Tag Archives: linux


Switch to self-hosted private git easily

Don’t like plans on github or had enough with downtimes on services like that, it’s not enough space provided by git hosting service? No problem! Switch to self-hosted git then, it’s quick and easy, you will still be able to track changes etc in console or via GUI of your git client, or you can even setup gitweb/instaweb to have web-interface. Personally, I don’t like any git hosting service because they’re not reliable and don’t provide enough space and private repos.

Search & Replace via command line in Linux

I needed to replace domain name in MySQL DB dump which was 700MB, so i’ve googled a bit to find a command line expression. If you need to search/replace in files via command line, you can simply use following command (if perl is installed):

perl -pi -w -e 's/search/replace/g;' *.php
-e means execute the following line of code.
-i means edit in-place
-w write warnings
-p loop

For example we can replace css link in all template files: