- Run a process detached to the current terminal:
nohup my_command &
- Get the exit code of the latest runned command:
echo $?
- If you have the following error:
-bash: ./myscript.sh: /bin/bash^M: bad interpreter: No such file or directory
Then the fix consist in removing the bad characters:
sed -i 's/\r//' ./myscript.sh
Tag Archive for 'CLI'
- Remove all binary logs:
mysql> RESET MASTER;
- Check, auto-repair and optimize all databases:
$ mysqlcheck --auto-repair --check --optimize --all-databases
- Get a clean local copy of my GitHub repository with read & write access:
git clone git@github.com:kdeldycke/kev-code.git
- Print a nice graph of your commits sorted by date:
git log --graph --all --pretty=oneline --abbrev-commit --date-order
- Destroy all your local changes and get back a sane repository:
git reset --hard
- Send local repository modifications to remote one:
git push origin
I provide hosting for free to some of my friends. One of them, QPX, had a side project called Lich’ti. But the latter is no longer active, so he decided to not renew the lich-ti.fr domain.
If Lich’ti’s domain name is dead, QPX’s personal blog is not. His website is powered by WordPress and was available at http://qpx.lich-ti.fr. My job is now to move it to http://qpx.coolcavemen.com. In this post, I’ll tell you how I’ve done it.
Before going further, backup everything, and be ready to revert back to your original situation at any moment ! What works for me will not necessary works for you…
To play nice with your visitors, you can setup a temporary maintenance page while we’re performing the migration.
Let’s start the migration by replacing, in the files served by Apache, all occurrences of the old domain name by the new one:
find /var/www/qpx-blog -mount -print -type f -exec sed -i 's/qpx.lich-ti.fr/qpx.coolcavemen.com/g' "{}" \;
If you have doubts about the efficiency of the command above, you can check the presence of the string we’re looking to replace via this command:
grep -RIi "qpx.lich-ti.fr" ./*
Then, we dump the database containing all WordPress content and config to a local file (the command will prompt for password):
mysqldump -p --host=localhost --port=3306 --user=root --opt --databases "qpx_blog" > qpx_dump.sql
And we replace all strings of the old domain by the new one:
sed 's/qpx.lich-ti.fr/qpx.coolcavemen.com/g' qpx_dump.sql > new_qpx.sql
Finally, we re-inject the modified database content after clearing the original:
mysql -p --host=localhost --port=3306 --user=root --execute='DROP DATABASE `qpx_blog`;' mysql -p --host=localhost --port=3306 --user=root < new_qpx.sql
Now you can disable the maintenance page and test the blog to check nothing’s broken.
Again, to play nice with your visitors (and search engines), you can redirect old URLs to the new domain, with apache directives similar to this one:
<VirtualHost *:80> ServerName qpx.lich-ti.fr RedirectMatch permanent (.*) http://qpx.coolcavemen.com$1 </VirtualHost>
I’ve just created a RPM of dmg2img for the x86_64 version of Mandriva 2009.1. The package is available in my RPM repository.
dmg2img is a command line utility to extract the content of an Apple Disk Image .dmg file. Here is how I use it to access content:
dmg2img ./my-package.dmg mount -t hfsplus -o loop ./my-package.img /media/my-mount-point

Latest blog activity
kev, djib
Hrr, bhanu, Amor, Miller, Teodoro, Darius [...]
Toma, kev, Toma
William Kulich, Roland Gesthuizen, bbr, Girish, Ozmumcu, gavjof [...]
kev, djib