echo ".dump" | sqlite3 old.db | sqlite3 new.db
Explanation: pipe “.dump” to sqlite and use that output (the dump itself) to fill the new.db database.
A blog on rails, php, computing, my bass guitar and stuff
September 17th, 2012 — development, Linux
echo ".dump" | sqlite3 old.db | sqlite3 new.db
Explanation: pipe “.dump” to sqlite and use that output (the dump itself) to fill the new.db database.
September 15th, 2012 — development, Linux
I had this huge git repository (1.9 gigabyte) and I couldn’t discover WHY is was SO big. After reading up on some git cleaning et cetera I did a `git gc`. I went from 1.9g to 12mb (megabytes yes). Unbelievable…
July 16th, 2012 — development, Linux
git filter-branch --commit-filter 'if [ "$GIT_AUTHOR_NAME" = "LeonB" ]; then export GIT_AUTHOR_NAME="Leon Bogaert"; export GIT_AUTHOR_EMAIL=leon@tim-online.nl;
After this is done you can do:
git push -f
It says some scary things like:
# Your branch and 'origin/v3' have diverged, # and have 75 and 75 different commits each, respectively.
But you can Ignore those.
March 16th, 2012 — development, python
Ik heb de eerste versie van motorrijweer.nl live gezet! ‘t Is nog vrij basis maar je kunt wel al voor een paar regio’s het motorweer/motorrijweer opvragen. Op naar de volgende versies!
February 22nd, 2012 — development, Linux
openssl rsa -in www_silverpower_nl.key -out www_silverpower_nl.key.unencrypted
February 13th, 2012 — development, PHP
$query = $adapter->getProfiler()->getLastQueryProfile()->getQuery(); //print last executed query foreach ($adapter->getProfiler()->getLastQueryProfile()->getQueryParams() as $k => $v) { $query = $query = str_replace($k, "'{$v}'", $query); } var_dump($query);
A more complete example:
$adapter = Mage::getSingleton('core/resource')->getConnection('core_write'); $adapter->getProfiler()->setEnabled(true); //enable profiler // Do database stuff $number = 10; $profiles = $adapter->getProfiler()->getQueryProfiles(); $profiles = array_slice($profiles, count($profiles)-$number, $number); foreach ($profiles as $profile) { $query = $profile->getQuery(); //print last executed query foreach ($profile->getQueryParams() as $k => $v) { $query = $query = str_replace($k, "'{$v}'", $query); $query = preg_replace('/\?/', $v, $query); } var_dump($query); }
January 21st, 2012 — development
This is a nice one:
git add -u
This only adds already commited files to a new commit. And leaves files not in the git repository alone.
October 26th, 2011 — development, Linux, PHP, python, Ruby
I installed sublime text on my Ubuntu 11.10 box but I had some troubled loading external python modules:
loaded 937 snippets >>> import distutils Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: No module named distutils
This is how I solved it:
Edited ~/.local/share/applications/sublime.desktop
Especially this line:
Exec="/home/leon/Software/bin/sublime" %U
/home/leon/Software/bin/sublime contains this:
#!/bin/bash cd /usr/lib/python2.7 /home/leon/Software/SublimeText2/sublime_text
Then I installed some excellent plugins:
February 8th, 2011 — development, Other
Generate your own Github resumé
October 18th, 2010 — development, Linux
I got an error when building the 2.32 version for ubuntu. Some packages once where installed but got removed. But they still had the status rc.
So I purged them with the help of this blog.
I compiled evolution with the help of a Makefile that I downloaded.
I had to add the “maverick” distro and install some additional packages such as:
I removed the evolution-exchange plugin.
The master branch of gweather required gtk3 so I changed that to: gnome-2.30 (or something)
I had to apply a patch to solve a build error.
Bottom of this post: http://www.mail-archive.com/evolution-hackers@gnome.org/msg03863.html