Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@nk23x
nk23x / .Xresources
Last active December 27, 2015 15:49
my .dotfiles
XLock.mode: blank
XLock.erasedelay: 500
XLock.fpsfont: -misc-fixed-medium-r-*-*-13-*-*-*-*-*-*
XLock.timeelapsed: on
XLock.timeout: 20
XLock.font: -misc-fixed-medium-r-*-*-13-*-*-*-*-*-*
XLock.username:
XLock.password:
XLock.info:
XLock.validate: validating ...
## make users, directory structure, etc.
useradd ftpsecure -g users
mkdir /srv/ftp/data
mkdir /srv/ftp/data/alle
mkdir /srv/ftp/data/sta
chown -R :users /srv/ftp/data/alle
chmod g+w /srv/ftp/data/alle
@nk23x
nk23x / rsyslog.conf
Last active December 27, 2015 15:59
rsyslog.conf - local rsyslogd
## /etc/rsyslog.conf Configuration file for rsyslog.
## /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html
$ModLoad imuxsock # provides support for local system logging
$ModLoad imklog # provides kernel logging support
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
$FileOwner root
$FileGroup adm
@nk23x
nk23x / LPIC_ADM2.txt
Created November 13, 2013 10:25
Notes on LPIC ADM2 Training (11/2013)
= LPIC ADM2 =
<toc>
== # rsyslogd ==
=== # links ===
* http://blog.gerhards.net/2012/10/rate-limiting-in-rsyslog-732.html
* http://www.rsyslog.com/doc/manual.html
* http://www.rsyslog.com/using-the-syslog-receiver-module/
@nk23x
nk23x / acpi_handler.sh
Created November 22, 2013 14:33
press power button = suspend to disk
#!/bin/sh
## /etc/acpi/acpi_handler.sh
IFS=${IFS}/
set $@
case "$1" in
button)
case "$2" in
power ) echo -n disk > /sys/power/state
@nk23x
nk23x / xmute.sh
Created November 22, 2013 14:39
xmute.sh: old xmute.sh using xmessage (the new version uses xosd)
### gbfsc.~:cat scripts/xmute.sh
#!/bin/sh
TOGGLE=$(amixer sset Master playback toggle | grep -c -E 'Front(.*)Playback(.*)on')
if [ $TOGGLE -eq 0 ]
then
xmessage -timeout 2 -center -buttons '' " - off "
else
@nk23x
nk23x / github-cli.txt
Last active December 29, 2015 02:29
github gist using curl, App::Nopaste
== # curl ==
get raw url for all your gists and dump content to STDOUT
<pre>
curl -s --user "USER:PASSWD" https://api.github.com/gists | \
grep raw_url | \
perl -pi -e 's/(.*)\"https:(.*)\",/https:$2/g;' | \
xargs curl
</pre>
@nk23x
nk23x / ffmpeg-examples.txt
Last active May 4, 2018 18:52
ffmpeg examples
## mp4 to ogv
ffmpeg -i VIDEO.mp4 -acodec vorbis -aq 3 -strict -2 -qscale:v 18 VIDEO.ogv
## PAL VIDEO CD (VCD)
ffmpeg -i /path/file.avi -target pal-vcd -s 352x192 -padtop 32 -padbottom 32 -ab 128 /path/output.mpg
vcdimager -t vcd2 -l "LABEL" -c videocd.cue -b videocd.bin output.mpg
@nk23x
nk23x / .Xresources.xlock
Last active July 10, 2018 11:26
~/.fluxbox/..
XLock.mode: blank
XLock.erasedelay: 500
XLock.fpsfont: -misc-fixed-medium-r-*-*-13-*-*-*-*-*-*
XLock.timeelapsed: on
XLock.timeout: 20
XLock.font: -misc-fixed-medium-r-*-*-13-*-*-*-*-*-*
XLock.username:
XLock.password:
XLock.info:
XLock.validate: validating ...