Search Ali's Blog

Loading...

Tuesday, October 25, 2011

Search Linux Kernel code from Google Chrome

If you're a kernel developer, you must be familiar with Linux Cross Reference (LXR) sites.. there are a few of them out there, but I find http://lxr.linux.no the most convinent and the the fastest, it also uses a newer version of LXR than others.

If you're a Google Chrome user, you can easily add a new custom search type for LXR:
1. Open chrome and go to: chrome://settings/searchEngines
2. Add the following entry: Search engine: lxr.linux.no, keyword: lxr, Query: http://lxr.linux.no/linux/+search=%s

3. Now you can search for any Linux kernel symbol directly from chrome, for example: go to the toolbar and type "lxr skb_dst"

4. Chrome will build the URL query for you, and results are shown directly in the browser tab.. happy kernel browsing :)

Thursday, October 06, 2011

Steve Jobs 1955-2011

Apple website snapshot Oct 5th 2011, 5:10 pm

Saturday, October 01, 2011

Major Linux Hackers

These people had major influence on the Linux Kernel (code talks and bullshit walks).
Mostly known by their code, patches, comments.. it turns out that they are human beings with real photos :)


Linus Torvalds: Software is like sex: it's better when it's free.
I found the following two quotations very funny (fame oh fame):
1991: "I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu) for 386/486 AT clones"
1998: "My name is Linus Torvalds and I am your god"



David Miller (a must read thread)

Thursday, June 23, 2011

Sony HX100v - GPS location

The new Sony HX100 is GPS-enabled, this feature is very cool, especially when paired with Google Picasa.
For Example, when you upload a photo to picasa web album, the location on the map is viewed automatically (make sure that location permission is granted).



And, also through Picasa application on your computer, if you have Google Earth installed, you will be able to see a small icon of Google maps on the photo, then you can click on Geo-Tag button, and Google Earth will be launched and will show your picture location.. neat ha?



Sony HX100v - 10fps Collage

Finally got my new Sony HX100v, a lot of features I'd like to try.
My favorite feature is the 10 frames per second (each is full resolution of 16.2MP).. this feature existed in the previous HX1 as well.. first day trying me new camera I got this collage.. click on the picture for better resolution, or check zoom-in option under this link.



To make collage (especialy for such a nice feature) you can use Google Picasa and follow these simple steps.

Select the photos and click on Collage:

Edit the Collage settings, and generate the collage photo!



Sunday, June 19, 2011

Bird's kick vs. Spartan's kick

I found it hard to ignore the analogy between these two..
This is Spartaaaaa
I mean: This is.. my bird-girl-frieeeend
[kick]

Thursday, December 09, 2010

Xen Installation on CenOS-5.5

As part of my work, I had to bring up Xen Servers setup, and install some virtual machines.
I've been working on VMware ESX Servers for a while, and I must admit that VMware products are way more mature than Xen products. Below step by step installation of Xen over CentOS-5.5 and how to bring up and configure DomU Virtual Machines.



Dom0 Installation:
-----------------
1. Install CentOS-5.5 OS
   ISO is downloadable from here

2. Install Xen kernel and Tools:
# yum install kernel-xen kernel-xen-devel xen

# yum install virt-manager
# yum install virt-viewer
3. Edit /etc/grub.conf and select xen kernel

default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-194.26.1.el5xen)
        root (hd0,0)
        kernel /xen.gz-2.6.18-194.26.1.el5
        module /vmlinuz-2.6.18-194.26.1.el5xen ro root=LABEL=/ rhgb quiet
        module /initrd-2.6.18-194.26.1.el5xen.img
title CentOS (2.6.18-194.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-194.el5 ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.18-194.el5.img
4. Reboot the machine
5. Check kernel name, it will have xen substring:

# uname -a
Linux eng-023.mti.mtl.lab.com 2.6.18-194.26.1.el5xen ...
6. On my machine, yum installed Xen version 3.0.3:

# rpm -qa|grep -i ^xen-[0-9]
xen-3.0.3-105.el5_5.5

DomU Installation:
------------------
1. run virt-manager from dom0
2. select server name in the table, and select "new"

3. configure the virtual machine, when you get to the installation media, you better have the installation dir (extracted iso) available through on your network (check this link if you want to bring up your own apache) note that for full Linux installation (e.g., for RHEL-5.5) you need more than 4GB virtual disk space (I use 8GB).
4. when installation is done, machine will reboot and come up with bridged network connection
5. If you configured your VM to use DHCP, then you're ready, go ahead and ping the WAN.
- For more info on how to use virt-manager to install DomU instance (with snapshots) check this link.


DomU Network Configuration:
---------------------------
Xen supports three modes for network virtualization:
Bridging, Routing w/o NAT, Routing with NAT, each one of them need to be configured differently.


By default, the network is set up in bridging mode.
To change the network configuration, there are two main configuration files:
# /etc/xen/xend-config.sxp (hypervisor conf)

# /etc/xen/VM-NAME (virtual machine conf)


DomU in Bridging mode:
----------------------
1. Make sure that xend-config.sxp has the following lines:
   (network-script network-bridge)

   (vif-script vif-bridge)
   To use different netdev (rather than eth0) use the line:
   (network-script 'network-bridge netdev=eth1')

   To create multiple bridges, you must create your own script.
   For example, in 
xend-config.sxp add:
   (network-script network-bridge-multi)
   The cerate the file (with +x permissions):   # cat /etc/xen/scripts/network-bridge-multi
   #!/bin/sh
   dir=$(dirname "$0")
   "$dir/network-bridge" "$@" vifnum=0 netdev=eth0 bridge=xenbr0
   "$dir/network-bridge" "$@" vifnum=1 netdev=eth1 bridge=xenbr1
   "$dir/network-bridge" "$@" vifnum=2 netdev=eth2 bridge=xenbr2
   check this link for more details.
2. Configure DomU virtual interfaces,
   Edit /etc/xen/VM-NAME and examine the following line:

   vif = [ "mac=00:16:36:69:0d:0b,script=vif-bridge,bridge=xenbr2" ]
   where xenbr2 is an example of the bridge name
3. Note that if the netdev of the bridge your going to use was created after machine reboot, then you need to restart the xen network script, for example:
# /etc/xen/scripts/network-bridge stop 
# /etc/xen/scripts/network-bridge start
If the pethX interface you expect does not come up, try to reboot the machine (I noticed that in Xen 3.0, the network-bridge may fail to create the pethX interface if you restart the script few times, reboot solved the issue)
4. Make sure that the bridge as appear in brctl is output, is configured as expected:
#brctl show xenbr2
bridge name     bridge id  STP enabled  interfaces
xenbr2          8000.00..  no           vif2.0
                                        peth2
If you configured your system in the past to work in routing mode, you may see virbr0 instead of xenbr0, to revert these changes, run:
# service libvirtd stop; chkconfig libvirtd off
If for some reason the peth2 that coresponds to your netdev is not attached to the bridge, then find your peth:
# ethtool -i peth2
and then add the interface to the bridge:
#  brctl addif xenbr2 peth2
If for some reason, peth2 link is down, run:
# ip link set peth2 up

At this point you can run the VM, configure the IP, and heck ping-pong, you can tcpdump the bridge (xenbr2) and its slaves to check the packets flow.



DomU in Routed mode:
--------------------
Note that most of the tips of this section are based on this link.
1. Update your grub entry to include the following parameters:

title Kernel-XXX-xen
    root (hd0,5)
    kernel /boot/xen.gz 
    module /boot/vmlinuz-XXX-xen root=/dev/sda6 vga=0x31a resume=/dev/sda5 splash=silent showopts
    module /boot/initrd-XXX-xen
2. Set netloop driver module parameter, edit /etc/modprobe.conf and include the line (to top netloop from creating 8 useless vifs):
options netloop nloopbacks=0
3. Reboot Dom0
4. Configure Dom0 networking, edit /etc/xen/xend-config.sxp and include the line:

(network-script network-route)
(vif-script     vif-route)
5. Configure DomU networking, edit /etc/xen/VM-NAME and include the line:
vif = [ 'mac=00:16:3e:33:22:11, ip=192.168.23.1, vifname=eth0' ]
Where the IP address, is the IP address you plan to give to vifname interface within the VM.
6. Power on the VM, and conifgure (for example) the eth0 interface to use the IP=102.168.23.1
7. Ping the IP address of Dom0 (run ifconfig from Dom0 and check your netdev IP, must start with 192.x.x.x [depends on your mask]).
8. To ping other machines outside the GW, need to configure the default GW in the VM, this can be done in many different ways, for example:
route add default gw 192.168.23.254 eth0

Notes:
------
- To install KVM on CentOS, check this link


Troubleshooting:
----------------
- If you get the error message:
ERROR    unable to connect to 'localhost:8000': Connection refused
You probably don't have xen-http-server enabled, edit:
/etc/xen/xend-config.sxp
and include the line:
(xend-http-server yes)
then restart xend:
/etc/init.d/xend restart

Thursday, December 02, 2010

Google Currency converter

Nice and simple Google Currency converter:
Example, from USD to ILS: