you are in: codestackercodes [RSS] → tag: text [RSS]

restart springboard Delicious Email

show/hide lines
   1  killall -HUP SpringBoard
created by leozera — 20 January 2012 — get a short url — tags: iPhone embed

dumping mysql store procedures, functions and triggers Delicious Email

show/hide lines
   1  mysqldump -u user -p -h localhost your_database --routines --no-create-info --no-data --no-create-db --skip-opt > routines.sql
created by leozera — 08 November 2011 — get a short url — tags: mysql embed

list all apache loaded modules Delicious Email

show/hide lines
   1  apache2ctl -t -D DUMP_MODULES
created by leozera — 04 November 2011 — get a short url — tags: apache embed

convert mysql dump to sqlite database Delicious Email

via http://goo.gl/p7Sxj

show/hide lines
   1  #!/bin/bash
   2  
   3  if [ "x$1" == "x" ]; then
   4    echo "First: mysqldump -u root -p --compatible=ansi --skip-opt database > dumpfile"
   5    echo "Usage: $0 <dumpfile>"
   6    exit
   7  fi
   8  
   9  cat $1 |
  10  grep -v ' KEY "' |
  11  grep -v ' UNIQUE KEY "' |
  12  grep -v ' PRIMARY KEY ' |
  13  sed '/^SET/d' |
  14  sed 's/ unsigned / /g' |
  15  sed 's/ auto_increment/ primary key autoincrement/g' |
  16  sed 's/ smallint([0-9]*) / integer /g' |
  17  sed 's/ tinyint([0-9]*) / integer /g' |
  18  sed 's/ int([0-9]*) / integer /g' |
  19  sed 's/ character set [^ ]* / /g' |
  20  sed 's/ enum([^)]*) / varchar(255) /g' |
  21  sed 's/ on update [^,]*//g' |
  22  sed 's/\\r\\n/\\n/g' |
  23  sed 's/\\"/"/g' |
  24  perl -e 'local $/;$_=<>;s/,\n\)/\n\)/gs;print "begin;\n";print;print "commit;\n"' |
  25  perl -pe '
  26  if (/^(INSERT.+?)\(/) {
  27    $a=$1;
  28    s/\\'\''/'\'\''/g;
  29    s/\\n/\n/g;
  30    s/\),\(/\);\n$a\(/g;
  31  }
  32  ' > $1.sql
  33  cat $1.sql | sqlite3 $1.db > $1.err
  34  ERRORS=`cat $1.err | wc -l`
  35  if [ $ERRORS == 0 ]; then
  36    echo "Conversion completed without error. Output file: $1.db"
  37    rm $1.sql
  38    rm $1.err
  39  else
  40    echo "There were errors during conversion.  Please review $1.err and $1.sql for details."
  41  fi
created by leozera — 25 September 2011 — get a short url — tags: mysql sqlite embed

get you public ip Delicious Email

show/hide lines
   1  curl ifconfig.me
created by leozera — 17 July 2011 — get a short url embed

convert an ISO file to DMG format in terminal Delicious Email

show/hide lines
   1  hdiutil convert /path/imagefile.iso -format UDRW -o /path/convertedimage.dmg
created by leozera — 16 January 2011 — get a short url — tags: convert dmg iso mac embed

convert a DMG file to ISO in terminal Delicious Email

show/hide lines
   1  hdiutil convert /path/imagefile.dmg -format UDTO -o /path/convertedimage.iso
created by leozera — 16 January 2011 — get a short url — tags: convert dmg iso mac embed

find php.ini path Delicious Email

show/hide lines
   1  php -i | grep php.ini
created by leozera — 16 January 2011 — get a short url — tags: php shell embed

.htaccess examples Delicious Email

show/hide lines
   1  RewriteEngine On 
   2  RewriteCond %{REQUEST_FILENAME} !-f 
   3  RewriteCond %{REQUEST_FILENAME} !-d 
   4  RewriteRule ^(.*)$ $1.php [L,QSA] 
   5  # http://domain/about -> http://domain/about.php 
   6  
   7  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] 
   8  # http://domain/about -> http://domain/index.php?q=about 
created by leozera — 07 November 2010 — get a short url — tags: .htaccess apache embed

finding large files Delicious Email

show/hide lines
   1  find . -size +20000k -exec du -h {} \;
created by leozera — 11 September 2010 — get a short url — tags: shell embed
Displaying records 1 - 10 of 56