HOME LINKS SAL PUBLIC SOFTWARE SEARCH MADE UP

QUICKHACKS by SAL :-)

RPM package sort by size:
rpm -qa --qf '%{SIZE} %{NAME}-%{VERSION}-%{RELEASE}\n' | sort -r -n | less
UNIX timestamp to date-time conversion:
awk '{ print strftime("%c", $1) }'
Fedora Xorg cleanup:
rpm -e `rpm -qa xorg-x11-drv\* | grep -v -e vmmouse -e dummy -e void \
  -e v4l -e ati -e drv-i -e vmware -e nv -e mouse -e vesa -e vga -e via \
  -e fbdev -e evdev -e mga -e mutouch -e keyboard` xorg-x11-drivers
Latex hyphenation:
joe /usr/share/texmf/tex/generic/config/language.dat
cd /usr/share/texmf/tex/latex/config
initex latex.ini
mv -f /usr/share/texmf/tex/latex/config/latex.fmt /usr/share/texmf/web2c/
Sk keyboard:
setxkbmap us,sk -variant ,qwerty -option "grp:switch,grp:alt_shift_toggle,grp_led:scroll"

setxkbmap us,sk,ru -variant ,qwerty,phonetic -option "grp:switch,grp:alt_shift_toggle,grp_led:scroll"

setxkbmap us,sk_qwerty -option "grp:switch,grp:alt_shift_toggle,grp_led:scroll"

Option "XkbLayout" "us,sk"
Option "XkbVariant" ",qwerty"
Option "XkbOptions" "grp:switch,grp:alt_shift_toggle,grp_led:scroll"
UTF-8 to ASCII conversion
iconv -f utf-8 -t ascii//translit
CD recording:
genisoimage -R -J . | wodim -v -eject blank=fast -
DVD data recording:
growisofs -Z /dev/cdrom -R -J .
DVD video recording:
genisoimage -dvd-video -o dvd.iso .
growisofs -dvd-compat -Z /dev/dvdrw .
Write ISO file to DVD:
growisofs -dvd-compat -Z /dev/dvdrw=image.iso
Sagator installation for Fedora:
wget -O /etc/yum.repos.d/sagator.repo \
     http://www.salstar.sk/pub/yum/yum.repos.d/sagator.repo
yum install sagator sagator-libclamav clamav-update \
            unrar unarj unace arc zoo \
            spamassassin perl-Razor-Agent pyzor razor dcc rrdtool-python
SSL CSR generation:
SERVER=`hostname`
umask 0077 # don't allow read on private key
openssl req -new -nodes -keyout $SERVER.key -out $SERVER.csr -newkey rsa:2048
#openssl genrsa -out $SERVER.key 2048
#openssl req -new -key $SERVER.key -out $SERVER.csr
Watch mdX reconstruction:
while grep -q = /proc/md*; do grep = /proc/md* | sed 's/  */ /g' | tr \\n \\r | tr -d recoveyinhpd; sleep 1; done
iSCSI mapping:
IP=10.0.0.2
iscsiadm -m discovery -p $IP -t sendtargets
iscsiadm -m node -p $IP --login
iscsiadm -m node -p $IP --rescan
iscsiadm -m node -p $IP --logout
Drop caches:
sync; echo 3 > /proc/sys/vm/drop_caches
Import S/MIME certificate:
|openssl smime -pk7out -in - -out /tmp/smime.pk7
openssl pkcs7 -print_certs -in /tmp/smime.pk7 -out /tmp/smime.pem
smime_keys add_cert /tmp/smime.pem
Linux mdadm speed:
sysctl dev.raid.speed_limit_min=100
sysctl dev.raid.speed_limit_max=10000
Linux mdadm check consistency:
MD=0
echo check > /sys/block/md$MD/md/sync_action
watch 'cat /prod/mdstat;cat /sys/block/md*/md/mismatch_cnt'
PostgreSQL database ID to name:
SELECT oid, * FROM pg_database;
SELECT 'TABLEID'::oid::regclass;
Joe's editor remove trailing spaces:
^kf \+ \$
r