Glossary:
- md: multiple devices
command | description |
---|---|
cat /proc/mdstat |
show status of all raids |
mdadm --detail /dev/md0 |
detailed status of raid md0 |
----- Esc ----- | |
Quick change directory: Esc + c | |
Quick change directory history: Esc + c and then Esc + h | |
Quick change directory previous entry: Esc + c and then Esc + p | |
Command line history: Esc + h | |
Command line previous command: Esc + p | |
View change: Esc + t (each time you do this shortcut a new directory view will appear) | |
Print current working directory in command line: Esc + a | |
Switch between background command line and MC: Ctrl + o | |
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name |
rsync (Everyone seems to like -z, but it is much slower for me)
<?php | |
# Fill our vars and run on cli | |
# $ php -f db-connect-test.php | |
$dbname = 'name'; | |
$dbuser = 'user'; | |
$dbpass = 'pass'; | |
$dbhost = 'host'; | |
$connect = mysql_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'"); |
#!/bin/bash | |
# portable way to ensure : | |
# | |
# * only one process at the time (prevents process-overlap, handy for cron workers) | |
# * reverse cron's email behaviour (only emails on error) | |
# * ultraportable: only reliest on flock, not on debians 'start-stop-daemon' or centos 'daemon' | |
# * readable process names in top | |
# | |
# usage: ./lazycron <my-unique-id> <application> [args] | |
# example: ./lazycron cron-my-process php foo.php |
# /dir/ means exclude the root folder /dir | |
# /dir/* means get the root folder /dir but not the contents | |
# dir/ means exclude any folder anywhere where the name contains dir/ | |
# Examples excluded: /dir/, /usr/share/mydir/, /var/spool/dir/ | |
# /dir means exclude any folder anywhere where the name contains /dir | |
# Examples excluded: /dir/, /usr/share/directory/, /var/spool/dir/ | |
# /var/spool/lpd//cf means skip files that start with cf within any folder within /var/spool/lpd | |
# | |
# include, + | |
# exclude, - |
sudo strace -f -tt -o /tmp/php.trace -s1024 -p `pgrep -f php-fpm | tr '\n' ','` |
Command | Shortcut |
---|---|
xfce4-screenshooter --fullscreen --clipboard |
Ctrl + PrtScrn |
xfce4-screenshooter --fullscreen --save /home/dianjuar/Pictures |
PrtScrn |
xfce4-screenshooter --region --clipboard |
Ctrl + Shift + PrtScrn |
xfce4-screenshooter --region --save /home/dianjuar/Pictures |
Shift + PrtScrn |
xfce4-screenshooter --window --clipboard |
Ctrl + Super + PrtScrn |
xfce4-screenshooter --window --save /home/dianjuar/Pictures |
Super + PrtScrn |
This gist is a compilation of two tutorials. You can find the original tutorials here and here. What should you know before using this? Everything can be executed from the home folder. For easier cleanup at the end you can make directory where you'll download everything, and then just use rm -rf .
. Although, you should be careful. If some strange bugs arise unexpectedly somewhere sometimes, just keep in mind that some user names have underscores in them (this is probably nothing to worry about).
sudo adduser --no-create-home --disabled-login --shell /bin/false --gecos "Prometheus Monitoring User" prometheus
sudo adduser --no-create-home --disabled-login --shell /bin/false --gecos "Node Exporter User" node_exporter
sudo adduser --no-create-home --disabled-login --shell /bin/false --gecos "Alertm