Console history search by arrow up and arrow down

I find it very convenient using arrow up and arrow down buttons for searching in commands history in a shell. The mappings are in /etc/inputrc file:

# mappings for "arrow up" and "arrow down" to search the history
"\e[A": history-search-backward
"\e[B": history-search-forward

Copy package into chroot environment on Gentoo

I would like to share simple bash one line script for copying or updating a package installed on your main Gentoo system to an existent chroot environment. Basically this script takes full list of package files with help of “equery files” command and than copies all these files into chroot environment.

# for f in `equery files bzip2`; do if [ -d "$f" ]; then if [ ! -e "/your/chroot/directory$f" ]; then mkdir "/your/chroot/directory$f"; fi; else cp "$f" "/your/chroot/directory$f"; fi; done

Start playing embedded youtube video automatically

If you youtube video embedded on your blog, myspace or facebook you just need to append “&autoplay=1″ parameter to youtube urls in the code ebmedded html code taken from youtube.

So if you got following code from youtube site:
(more…)

Google Tech Talks are superb!

Did you know that google is sharing technical talks on youtube. Their videos are covering a wide spectrum of topics including science, medicine, engineering, business, humanities, law, entertainment, arts, etc. The page on youtube.

Here is a list of my favourite videos related to software engineering:
(more…)

Esearch has been masked in Gentoo

I used to esearch tool for searching packages in my portage tree, but this tool was not updated for a long time and eventually esearch functionality got broken and tool was maked in the portage tree. Related comment in /usr/portage/profiles/package.mask file says:

# Paul Varner <fuzzyray@gentoo.org> (31 Dec 2008)
# Masked due to being broken with portage 2.1 and 2.2.
# Users can use either the unstable versions or switch to app-portage/eix

I have installed eix, it works well and has more functionality than esearch.

qsearch from app-portage/portage-utils can be used for fast search in portage tree, or standard emerge -s|-S

New! Shared posts from my Google Reader in a sidebar

There is a new section in the sidebar titled “Latest shared posts”. It displays latest three posts marked by me as shared in my Google Reader account. List is created dynamically using WordPress core function wp_rss().
(more…)

WordPress 2.7 is finally available!

And finally WordPress 2.7 has been released! I can’t wait when I will have a chance to update devhands. I have quite many different plugins and suppose that update process might not be that slick :)

I will write more info about upgrading process when it will be done.

Update: Upgrade process finished without any problems, just the same as upgrading to minor version of 2.6.x. I had no problems with installed plugins, they working the same well as under 2.6.x. Impressions of redisigned administration area is very good, dashboard and navigation is now much more efficient and user friendly.

Werewolf. Sed and Cut fun.

One of my colleagues needed to “su” into another user on our development machine. He had permission to do it, but didn’t remember target user full username, only that “ivan” was a part of it. Here is a funny commands he could use:

# "sed" example
sudo su `getent passwd | grep ivan | sed 's/\([^:]*\):.*/\1/' | head -n 1`
 
# and a much simpler "cut" example
sudo su - `getent passwd | grep ivan | cut -d : -f 1 | head -n 1`

Colorful diff with subversion

Colorful diffs simplifies working with subversion repository on a console to a great extent. If you want to get colorful diffs, install ColorDiff on your system and add the following line to your ~/.subversion/config under [helpers] section:

diff-cmd = /usr/bin/colordiff

Don’t forget to change path to colordiff on your system.

ColorDiff

Apache HTTPS only vhosts

If you want to serve your domain only over HTTPS and redirect all requests made to standard HTTP port to HTTPS than this configuration might be helpful:

1
2
3
4
5
6
7
8
9
10
11
12
13
<VirtualHost *:80>
        ServerName www.example.com
        RewriteEngine On
        RewriteCond %{HTTP_HOST}        (.*)
        RewriteRule (.*) https://%1$1 [R=301,L]
</VirtualHost>
 
<VirtualHost *:443>
        ServerName www.example.com
 
        // other vhost configuration follows
        ...
</VirtualHost>