test : perl -e exit perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LC_ALL = (unset), LANG = “en_US.UTF-8” are supported and installed on your system. perl: warning: Falling back to the standard locale (“C”). Paste the following or add to server bash.rc : export LANGUAGE=en_US.UTF-8 export LC_ALL=en_US.UTF-8 export…
Category: Howtos
Clear Linux Cache
1.ย Clear PageCache only. # sync; echo 1 > /proc/sys/vm/drop_caches 2.ย Clear dentries and inodes. # sync; echo 2 > /proc/sys/vm/drop_caches 3.ย Clear PageCache, dentries and inodes. # sync; echo 3 > /proc/sys/vm/drop_caches nJoy ๐
Postres show replication peers
SELECT * FROM pg_replication_slots; nJoy ๐
Install latest influxdb on Ubuntu
curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add – source /etc/lsb-release echo “deb https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable” | sudo tee /etc/apt/sources.list.d/influxdb.list sudo apt-get update && sudo apt-get install influxdb sudo service influxdb start nJoy ๐
uninstall/remove influxdb from Ubuntu 16.04
sudo apt-get remove influxdb apt-get purge influxdb nJoy ๐
Cool chkconfig replacement for Ubuntu
Hi, Ubuntu does not carry chkconfig any more .. besides the standard update-rc.d apache2 defaults or update-rc.d apache2 remove There is a cool tool called : sysv-rc-conf. This tool can be installed using : sudo apt-get install sysv-rc-conf On its own the command opens a cool ncurses interface like this : …
Reboot required Ubuntu
To find out what triggered this use : more /var/run/reboot-required.pkgs nJoy ๐
converting webm to mp3s ffmpeg
for FILE in *.webm; do echo -e “Processing file ‘\e[32m$FILE\e[0m'”; ffmpeg -i “${FILE}” -vn -ab 128k -ar 44100 -y “${FILE%.webm}.mp3”; done; nJoy ๐
Snapshot backup using cp -al and rsync
This script requires genuine cp -al capable gnu and rsync commands together with a hardlink capable FS + OS. #!/bin/bash [ $# -ne 2 ] && echo “Incorrect usage : $0 <source path> <target path>” && exit 128 ; SOURCEFOLDER=$1 TARGETFOLDER=$2 SF_LEN=${#SOURCEFOLDER}-1 TF_LEN=${#TARGETFOLDER}-1 #echo “Last character in source folder is ${SOURCEFOLDER:SF_LEN}” if […
Wait for jobs in the background and measure time taken
SECONDS=0;sleep 5 & sleep 6 & sleep 3 & sleep 7 & wait ; elapsedseconds=$SECONDS ; echo $elapsedseconds nJoy ๐