Audio

rip audio cdrom to mp3 with abcde

tnx 2 andrew.46

zypper install python-eyeD3 abcde lame imagemagick cdparanoia glyrc abcde -o mp3:-V2 -a default,getalbumart for i in *.mp3; do eyeD3 --add-image cover.jpg:FRONT_COVER "$i" done

Graphic

ImageMagick

quick dirty autoconvert raw images

ls *.CR2 | while read i;do dcraw -w -q 3 -c $i | convert -colorspace HSL -channel Saturation -negate -evaluate multiply 0.95 -negate -colorspace sRGB -gamma 1.1 -normalize -unsharp 0.5x0.5+0.5+0.008 -blur 1x1 - "`basename $i .CR2`b.jpg";done

Merge convert multiple jpg's files into one pdf

tnx 2 dlemstra

convert [-density 300] -define pdf:fit-page=A4 *.jpg out.pdf

Merge convert multiple PDF files into one PDF

tnx 2 alcohol

pdftk file1.pdf file2.pdf cat output target.pdf

Split PDF file

tnx 2

pdftk file.pdf cat [page(-page)] output target.pdf pdftk file.pdf cat [page( page ...)] output target.pdf

software development

development konsole

### the structure of each project folder is <project_directory> ├── correspondence ├── data │   ├── backups │   ├── data_sources │   ├── documentation │   ├── from_client │   ├── lists │   ├── logs │   └── results ├── literature ├── presentations ├── progs │   ├── bin │   ├── config │   └── lib └── reports ### create a konsole profile ~/.kde/share/apps/konsole/profiles/develop : [Profile] Name=develop [Desktop Entry] class=konsole-mainwindow#1 numSes=9 Title0=bin Title1=progs Title2=data1 Title3=data2 Title4=data3 Title5=data4 Title6=results Title7=logs Title8=bin Cwd0=./progs/bin Cwd1=./progs Cwd2=./data Cwd3=./data Cwd4=./data Cwd5=./data Cwd6=./data/results Cwd7=./data/logs Cwd8=./progs/bin SessionFont0=Droid Sans Mono,13,-1,5,50,0,0,0,0,0 #SessionFont0=Liberation Mono,13,-1,5,75,0,0,0,0,0 SessionFont1=Droid Sans Mono,13,-1,5,50,0,0,0,0,0 SessionFont2=Droid Sans Mono,13,-1,5,50,0,0,0,0,0 SessionFont3=Droid Sans Mono,13,-1,5,50,0,0,0,0,0 SessionFont4=Droid Sans Mono,13,-1,5,50,0,0,0,0,0 SessionFont5=Droid Sans Mono,13,-1,5,50,0,0,0,0,0 SessionFont6=Droid Sans Mono,13,-1,5,50,0,0,0,0,0 SessionFont7=Droid Sans Mono,13,-1,5,50,0,0,0,0,0 #SessionFont8=Liberation Mono,13,-1,5,75,0,0,0,0,0 SessionFont8=Droid Sans Mono,13,-1,5,50,0,0,0,0,0 DefaultSession=shell.desktop defaultfont=Droid Sans Mono,13,-1,5,50,0,0,0,0,0 [konsole-mainwindow#1 Toolbar style] ClassName=Konsole ObjectName=konsole-mainwindow#1 DefaultSession=shell.desktop defaultfont=Droid Sans Mono,13,-1,5,50,0,0,0,0,0 ### little shell script, creates a develop konsole desktop file #!/bin/bash echo "### creates develop konsole desktop file ###" if [ "$1" == "" ]; then echo echo WARN: dir not found, do: echo echo mdk path_of_project_directory echo or echo "readlink *|while read i;do mdk \$i;done" echo exit fi path=$1 name="`basename $1`" desktopfilename="${name}.desktop" echo "[Desktop Entry] Version=1.0 Type=Application Name=$name Comment=$name develop konsole start script Path=$path Exec=konsole -profile develop --geometry 1737x912-89-36 Icon=applications-development Terminal=false StartupNotify=false " > $desktopfilename chmod +x $desktopfilename echo "$desktopfilename created" ### run script on ~/Desktop mdk project_foo_directory ### creates file project_foo_directory.desktop [Desktop Entry] Version=1.0 Type=Application Name=project_foo_directory Comment=project_foo_directory develop konsole start script Path=project_foo_directory Exec=konsole -profile develop --geometry 1737x912-89-36 Icon=applications-development Terminal=false StartupNotify=false ### voilà! klick on file icon and work on all subdirs with your favored IDE vim ;)

mySQL

Totally reset auto increment primary key

tnx 2 codeblow.com

SET @count = 0; UPDATE table SET cd_id = @count:= @count + 1; SELECT max(cd_id) FROM table; # 8211539 ALTER TABLE table AUTO_INCREMENT = 8211540;

phpMyAdmin - custom settings in config.inc.php

/* * misc */ $cfg['PropertiesIconic'] = true; $cfg['ThemeDefault']= 'original'; $cfg['GridEditing'] = 'disabled'; $cfg['InitialSlidersState'] = 'open'; $cfg['ActionLinksMode'] = 'icons'; $cfg['PmaAbsoluteUri_DisableWarning'] = false; $cfg['PmaNoRelation_DisableWarning'] = true; /* * Extend phpMyAdmin Session Timeout Value (Expired Session) * see http://www.devcha.com/2008/01/extend-phpmyadmin-session-timeout-value.html * set session.gc_maxlifetime = 32400 in /etc/php5/apache2/php.ini too */ $cfg['LoginCookieValidity'] = 3600 * 9; // 9 hours

Case insensitive search on varbinary field

I

tnx 2 Rodrigo Gama

WHERE UPPER(COLUMNNAME) = UPPER('valuetocompare'). WHERE UPPER(COLUMNNAME) like UPPER('%valuetocompare%')

II

tnx 2 Mike

tnx 2 mysql.com

SELECT * FROM mytable WHERE CONVERT(page_title USING utf8) = 'foo'; select page_title from page_orig where CONVERT(page_title USING utf8) COLLATE utf8_unicode_ci = 'foo';

III

tnx 2 Abhay

CREATE TABLE `dictionary` ( `a` VARBINARY(128) NOT NULL, UNIQUE KEY `idx_uniq_a` (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

Find and Replace underscore in a mySQL database field

tnx 2 mydigitallife.info

mysql> UPDATE names SET name = REPLACE(name,'_',' ') WHERE name LIKE '%\_%';

load data from a tsv file with header and selected columns

<pre> LOAD DATA LOCAL INFILE <file> INTO TABLE <table> FIELDS TERMINATED BY '\t' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\n' IGNORE 1 LINES (<col1>, <col2>, ...) ; </pre>

Joomla

Akeeba Backup

https://www.akeebabackup.com/download/akeeba-backup/akeeba-backup-3-3-11/com_akeeba-3311-corezip.raw admin login -> erweiterungen -> installieren -> com_akeeba-3.3.11-core.zip Komponenten -> Akeeba Backup -> Starte den Konfigurationsassistenten Komponenten -> Akeeba Backup -> start backup

NX

set kb in nxclient

tnx 2 flcwiki

tnx 2 Michael Stuebiger

setxkbmap de -variant nodeadkeys setxkbmap -model evdev -layout de -variant nodeadkeys setxkbmap -model pc105 -layout de setxkbmap -model pc105 -layout de -variant nodeadkeys -rules evdev setxkbmap -query

nxclient 3.5 crashed on opensuse 13.1

tnx 2 Shishakov Vitaly

nxclient nxclient: /usr/NX/lib/libz.so.1: no version information available (required by /usr/lib/libpng16.so.16) nxclient: relocation error: /usr/lib/libpng16.so.16: symbol inflateReset2, version ZLIB_1.2.3.4 not defined in file libz.so.1 with link time reference solution: if [ -e '/usr/NX/lib/libz.so.1' ]; then mv /usr/NX/lib/libz.so.1 /usr/NX/lib/libz.so.1.orig fi

FreeNX with lxdm and xfce4 on opensuse

zypper ar -f http://download.opensuse.org/repositories/X11:/RemoteDesktop/openSUSE_13.2 X11RemoteDesktop zypper refresh zypper in FreeNX nxsetup --install --setup-nomachine-key --uid 99999 --gid 99999 nxserver --status Keine Prozesse gefunden. NX> 100 NXSERVER - Version 3.2.0-73 OS (GPL, using backend: 3.5.0) NX> 110 NX Server is running NX> 999 Bye /etc/nxserver/node.conf : NX_LOG_SECURE=2 # http://forums.opensuse.org/opensuseforums/english/get-technical-help-here/applications/479062-why-do-gnome-xfce-lxde-crash-freenx-under-12-2-a.html AGENT_EXTRA_OPTIONS_X="-norender -dpi 96" /etc/ssh/sshd_config : # needed by nxserver UseDNS no AllowUsers nx ... /etc/shadow : nx:*:15604:0:99999:7::: cd /var/lib/nxserver/home/.ssh/ ln -s authorized_keys2 authorized_keys rcsshd restart nxserver --restart - client settings : Desktop : Unix Custom Settings... Applications Run the default X client script on Server Options New Virtual Desktop