If you get questionmarks instead of phone name when trying to run your app, you can fix it with the following code:
#! /usr/bin/env bash path="/opt/android-studio" # Path where Android Studio is installed set -e "$path/sdk/platform-tools/adb" kill-server sudo "$path/sdk/platform-tools/adb" start-server "$path/sdk/platform-tools/adb" devices If it doesn’t work the first time, try a few more times
Updated my school ubuntu ws from raring to trust and X11 stopped working.
Solution (2014) sudo apt-get remove --purge xserver-xorg sudo apt-get remove --purge nvidia* sudo apt-get autoremove --purge sudo reboot #..rebooting.. sudo apt-get install xserver-xorg sudo dpkg-reconfigure xserver-xorg # NB; nothing will seem to happen sudo reboot #..rebooting.. Now reinstall your favourite graphical environmnet
Solution (2021) sudo apt purge nvidia* ubuntu-drivers devices # Manual option (install the one you want, start with "recommended") sudo apt install nvidia-driver-xxx # Automatic option sudo ubuntu-drivers autoinstall sudo reboot
Great links for bash greycat’s wiki Useless Use of Cat Award Rename multiple files I have multiple directories with the following format:
directory.name [word123]
directory.name1 [word123]
directory.name2 [word123]
directory.name3 [word123]
etc.
I would like to remove the [word123] from each directory name. It is unreasonable to perform a mv for each as there are simply too many!
for r in ./*\ \[word123\]; do mv "$r" "${r%\ \[word123\]}"; done Switch to a fake bash login-shell exec -l bash # If you're in bash: bash -c 'exec -l bash' # If you're in another shell Fake running program name (exec -a 'vim thesis....
How many colors do I have? These can usually be seen by typing
tput colors or you can download and run 256colors to see them
Tip: Columnize output Pipe it through ‘column -t’
ss -tunap | column -t
To make it easier to ssh (and enable autocomplete), create a ~/.ssh/config like this:
Host * SendEnv LANG LC_* HashKnownHosts yes GSSAPIAuthentication yes PreferredAuthentications publickey,password IdentityFile ~/.ssh/id_rsa ServerAliveInterval 60 Compression yes CompressionLevel 4 Host github Hostname github.com User git and you will always use user git when you ssh to github
If you has a rsa-key and don’t want to write in your credentials every time you ssh, you can use ssh-agent instead. Add this to your .bash_profile (or make it a standalone script you execute once at startup)
SSHAGENT=$(command -v ssh-agent) SSHAGENTARGS="-s" if ! pgrep -xu $USER ssh-agent &>/dev/null; then if [[ -z "$SSH_AUTH_SOCK" && -x "$SSHAGENT" ]]; then eval "$($SSHAGENT $SSHAGENTARGS)" trap "kill $SSH_AGENT_PID" 0 fi fi Then you add you credentials once by typing ssh-add (which will add ~/....
If you found this page through Google, it would be stupid to follow these instructions to the letter
This kernel requires the following features not present on the CPU: pae Unable to boot - please use a kernel appropriate for your CPU. Step 1: Chroot mount /dev/sda2 /mnt for i in dev proc sys; do mount --bind /$i /mnt/$i; done chroot /mnt Step 2: Make initrd cd /boot mkinitrd -c -k 3....
These instructions are old and probably don’t work anymore
Add spotify-sources to apt-repo
echo "deb http://repository.spotify.com stable non-free" >> /etc/apt/sources.list Add key
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 94558F59 Fetch updates
apt-get update Add this stupid old dependency This might not be needed anymore / on other distros. Just do it if the next step doesn’t work
wget snapshot.debian.org/archive/debian/20110406T213352Z/pool/main/o/openssl098/libssl0.9.8_0.9.8o-6_amd64.deb dpkg -i libssl0.9.8_0.9.8o-6_amd64.deb Install spotify
apt-get install spotify-client Run spotify!
spotify