Skip to content

Instantly share code, notes, and snippets.

@esperlu
esperlu / mysql2sqlite.sh
Created April 27, 2011 05:46
MySQL to Sqlite converter
#!/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
@kost
kost / gist:1494305
Created December 18, 2011 20:05 — forked from avsej/gist:741722
build ruby for arm platform (e.g. for amazon kindle)
echo "deb http://emdebian.org/debian/ lenny main" >> /etc/apt/sources.list
apt-get update
apt-get install binutils-arm-linux-gnueabi gcc-4.3-arm-linux-gnueabi libc6-dev-armel-cross
cd /path/to/ruby/1.8.7/sources
autoconf
CFLAGS="--static" LDFLAGS="--static" CC="arm-linux-gnueabi-gcc" ac_cv_func_setpgrp_void=yes ac_cv_func_isinf=no ac_cv_func_isnan=no ac_cv_func_finite=no CROSS_COMPILING=1 ./configure --host="arm-linux-gnueabi" --prefix=/mnt/us/opt
make
make install