-
List all available keys.
1234$ ssh-add -l4096 ... training@silico_rsa (RSA)2048 ... alex@A010-PC10 (RSA)[..]
-
Remove a key.
1$ ssh-add -D training@silico_rsa
-
List all available keys.
123$ ssh-add -l2048 ... alex@A010-PC10 (RSA)[..]
Category: Unix
‘undo’ ssh-add
remove a user and all corresponding files
1 |
deluser --remove-home --remove-all-files <username> |
1 |
userdel <username> |
MySQL won’t start automatically during system startup
- P: The MySQL service does not automatically start during system startup.
-
A:
- Purge and redo startup scripts:
12sudo update-rc.d -f mysql removesudo update-rc.d mysql defaults
-
Change bind-address to 0.0.0.0:
1sudo nano /etc/mysql/my.cnf
bind-address = 127.0.0.1
and change it tobind-address = 0.0.0.0
-
Check
/etc/init/mysql.override
: This file might override your startup settings. In case it looks like this$ less /etc/init/mysql.override manual
Execute the following:1echo auto | sudo tee /etc/init/mysql.override - Done.
- Purge and redo startup scripts:
change file encoding recursively
Good:
Bad:
The second one will only work if
1 |
find . -name "*.java" -exec iconv -f windows-1252 -t utf-8 {} -o {}.utf8 \; |
1 |
find . -name "*.java" -exec iconv -f windows-1252 -t utf-8 {} -o converted/{} \; |
find
will not descend into sub directories, since the directory tree inside of converted
will not be created on demand, as it would be the case e.g. for mkdir -p
. The result will be a ‘file or directory not found’ error.
mv: do not override destination file that is newer than source file (update move)
mv
does not support the update option, unlike rsync
and cp
.
If your version of coreutils does support it, using cp
(followed by rm
) is the easiest way to perform an update move operation:
1 2 |
$ cp -avu * [destination] $ rm -rf * |
kill all processes by user
1 |
pkill -u username |
Install Oracle Java 8
1 2 3 4 5 6 7 8 9 |
$ sudo add-apt-repository ppa:webupd8team/java $ sudo apt-get update $ sudo apt-get install oracle-java8-installer $ java -version java version "1.8.0_72" Java(TM) SE Runtime Environment (build 1.8.0_72-b15) Java HotSpot(TM) 64-Bit Server VM (build 25.72-b15, mixed mode) $ javac -version javac 1.8.0_72 |
count words in a PDF file
-
1pdftotext mypdf.pdf - | tr -d '.' | wc -w
-
12pdftops mypdf.pdfps2ascii mypdf.ps | tr -d '.' | wc -w
1 2 3 4 5 |
pdftotext mypdf.pdf - | tr -d '.' | wc -w 40730 pdftops mypdf.pdf ps2ascii mypdf.ps | tr -d '.' | wc -w 33088 |
tr -d '.'
removes single dots (such as from the TOC).
phpMyAdmin Change default URL
1 |
sudo nano /etc/apache2/conf.d/apache.conf |
Alias /phpmyadmin /usr/share/phpmyadminTo
Alias /my-secret-url /usr/share/phpmyadminreload config
1 |
sudo service apache2 reload |
gzip all files in a directory
1 |
$ for f in $(ls -1); do gzip $f; done; |