Cheat Sheet

Melihat Konfigurasi tanpa Komentar

egrep -v ^'(#|$)'
contoh : egrep -v ^'(#|$)' /etc/magnum/magnum.conf

Python : locale.Error: unsupported locale setting

export LC_ALL=C

copy public key ke host lain

yum install sshpass
sshpass -p "password" ssh-copy-id -o StrictHostKeyChecking=no root@machine

install cheat to cheat the command

pip install cheat
cheat rsync

melihat mendukung virtualisasi

lscpu | grep Virtualization

mencari text tertentu di semua files

grep -Ril "text-to-find-here" /

menambahkan text tertentu ke belakang line dengan awalan tertentu

zufar@Zufar:~/Documents/Work/Btech$ cat test.txt 
zufar@Zufar:~/Documents/Work/Btech$ sed -i '/^enabled_filters/ s/$/,***/' test.txt
zufar@Zufar:~/Documents/Work/Btech$ cat test.txt 

mengedit text tertentu

sed -i "s/^IPADDR.*/IPADDR=" /etc/sysconfig/network-scripts/ifcfg-eth0

cek user mysql

select user, host from mysql.user;

cek privilege user db

show grants for nova@'%';

looping forever

while sleep 2; do echo thinking; done

sending email via telnet

telnet localhost 25


Subject: this is a test message
Date: Thu, 21 Jun 2007 11:11:40 -0400
Just testing SMTP functionality by telnetting in to port 25.  I'll end this message now
by entering in a line with nothing but a period in it and hitting return.

Create bootable

unformat devices
dd if=file.iso of=/dev/sdx

Check 5 file or folder with the largest size

du -hs * | sort -rh | head -5

Comments are closed.