<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1628743762748449041</id><updated>2012-01-08T22:36:39.329Z</updated><category term='gpt'/><category term='udp'/><category term='tcpdump'/><category term='support'/><category term='grub'/><category term='javascript'/><category term='sysadmin'/><category term='umts'/><category term='debugging'/><category term='perl'/><category term='64bit'/><category term='gdisk'/><category term='storage'/><category term='hacking'/><category term='fedora'/><category term='lvm'/><category term='file_system'/><category term='command'/><category term='date'/><category term='snapshot'/><category term='troubleshooting'/><category term='scheduler'/><category term='udptx'/><category term='git'/><category term='python'/><category term='strace'/><category term='internet'/><category term='mbr'/><category term='tuning'/><category term='script'/><category term='debian'/><category term='uml'/><category term='windows'/><category term='performance'/><category term='programing'/><category term='devops'/><category term='xenserver'/><category term='raid'/><category term='xen'/><category term='sort'/><category term='database'/><category term='backup'/><category term='linux'/><category term='apache'/><category term='parted'/><category term='scripting'/><category term='screen'/><category term='research'/><category term='gdb'/><category term='ntfs'/><category term='netadmin'/><category term='usb'/><category term='instalation'/><category term='os'/><category term='tshark'/><category term='bridge'/><category term='highlight'/><category term='vmware'/><category term='htc'/><category term='humour'/><category term='ssh'/><category term='putty'/><category term='monitoring'/><category term='cloud'/><category term='wireshark'/><category term='bash'/><category term='configuration management'/><category term='bluetooth'/><category term='clone'/><category term='blogger'/><category term='filesystem'/><category term='citrix'/><category term='html'/><category term='kernel'/><category term='windows7'/><category term='partition'/><category term='network'/><category term='sata'/><category term='rescue'/><category term='workstation'/><category term='ubuntu'/><category term='automation'/><category term='virtualisation'/><category term='less'/><title type='text'>The Systems Engineer organized chaos</title><subtitle type='html'>Notes about various (technical) topics and encountered or solved puzzles from system, dev, devops and support field.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>46</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-3941578168816258804</id><published>2012-01-08T22:36:00.002Z</published><updated>2012-01-08T22:36:39.344Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='bridge'/><category scheme='http://www.blogger.com/atom/ns#' term='workstation'/><category scheme='http://www.blogger.com/atom/ns#' term='network'/><category scheme='http://www.blogger.com/atom/ns#' term='vmware'/><title type='text'>TCP Source port change for the outgoing traffic from VM</title><content type='html'>When it comes to virtual&amp;nbsp;machines&amp;nbsp;&amp;nbsp;(VM) management one of the big challenges to work with is the virtual network. When using VMware Workstation ( or Oracle VM VirtualBox) we can defined per VM how the added&amp;nbsp;virtual&amp;nbsp;network adapter should work.&lt;br /&gt;&lt;br /&gt;There are multiple setting to choice for a single virtual network interface within&amp;nbsp;VM:&lt;br /&gt;&amp;nbsp;- Bridged&lt;br /&gt;&amp;nbsp;- NAT&lt;br /&gt;&amp;nbsp;- Host-only private network&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;Problem&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;Server received TCP network traffic has changed source port when comparing it to the original traffic that the VM sent out.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;Impact&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;Applications that are port sensitive show wrong results (example:&amp;nbsp;&lt;a href="https://github.com/rtomaszewski/udptx" style="background-color: white; color: #336699; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16px; text-align: left;"&gt;udptx&amp;nbsp;&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;Solution&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;By default a network adapter added to a VM uses NAT feature. It means that the outgoing traffic from the VM may be changed before it is going to be sent the next hope router in our real network. To overcome this behaviour we ave to change the network operational setting from NAT to Bridged.&lt;br /&gt;&lt;br /&gt;If you lost the network connectivity after this change in your VM you have to additionally check and potentially change the default setting to what physical network device our default VMware bridge (VMnet0) is connected.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;- VMware workstation GUI -&amp;gt; Edit -&amp;gt;Virtual Network Editor : Vmnet0&lt;br /&gt;&amp;nbsp;- Select the correct virtual network device (default is VMnet0) &amp;nbsp;from the list&lt;br /&gt;&amp;nbsp;- Select a appropriate device from the device list under "Bridged to"&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-FNapjhl18lA/TwoXyJ_A9SI/AAAAAAAAFJE/iSxV-d_ROmM/s1600/virtual_net_editor.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-FNapjhl18lA/TwoXyJ_A9SI/AAAAAAAAFJE/iSxV-d_ROmM/s1600/virtual_net_editor.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;References&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;Workstation and Player Online Library&lt;br /&gt;&lt;a href="http://pubs.vmware.com/ws8/wwhelp/wwhimpl/js/html/wwhelp.htm#href=using_ws/GUID-BAFA66C3-81F0-4FCA-84C4-D9F7D258A60A.html"&gt;http://pubs.vmware.com/ws8/wwhelp/wwhimpl/js/html/wwhelp.htm#href=using_ws/GUID-BAFA66C3-81F0-4FCA-84C4-D9F7D258A60A.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Workstation 8 doesn't work properly with bridge networking&lt;br /&gt;&lt;a href="http://communities.vmware.com/message/1843247"&gt;http://communities.vmware.com/message/1843247&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-3941578168816258804?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/3941578168816258804/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2012/01/tcp-source-port-change-for-outgoing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/3941578168816258804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/3941578168816258804'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2012/01/tcp-source-port-change-for-outgoing.html' title='TCP Source port change for the outgoing traffic from VM'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-FNapjhl18lA/TwoXyJ_A9SI/AAAAAAAAFJE/iSxV-d_ROmM/s72-c/virtual_net_editor.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-1539799689952610069</id><published>2012-01-07T18:26:00.001Z</published><updated>2012-01-08T20:46:49.847Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='udp'/><category scheme='http://www.blogger.com/atom/ns#' term='udptx'/><category scheme='http://www.blogger.com/atom/ns#' term='network'/><category scheme='http://www.blogger.com/atom/ns#' term='research'/><category scheme='http://www.blogger.com/atom/ns#' term='git'/><category scheme='http://www.blogger.com/atom/ns#' term='tcpdump'/><category scheme='http://www.blogger.com/atom/ns#' term='hacking'/><title type='text'>Hacking the UDP protocol  - how to sent data using the UDP source port of UDP packets</title><content type='html'>Security has become one of the major concerns in current system architectures. The emerging new cloud technologies like Openstack (&amp;nbsp;IaaS cloud offering) try to address it in a better way in every new software release. When implementing and integrating bigger infrastructure solution we could say that the difficulty is proportional to the number of technologies that are involved to create a final solution.&lt;br /&gt;&lt;br /&gt;One of the most important technology that works as a glue between the components is of course a network&amp;nbsp;infrastructure and the supported protocol stack like TCP/IP that allows application to&amp;nbsp;communicate. As our history of Internet proves a network layer has been since ever a fascination of many hackers. And as we know when it comes to programming and deciding what your program should do the sky is the limit.&lt;br /&gt;&lt;br /&gt;As part of my network and security fascination i decided to conduct a small research project to confirm one of my ideas.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;Research project description&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;How to transmit data using the UDP as transport protocols but without relaying on the UDP payload functionality.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;Proposed solution description&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The ideas is to use the available UDP headers to encode and to encapsulate the the data payload. In my example I decided to use the UDP source port value to store there my payload [1]&lt;br /&gt;&lt;br /&gt;The UDP source port is a 16 bit length variable. That means that for a multi byte stream of data to transfer we have to implement effective way to divide it into chunks and sent them separately in many UDP datagrams. On the server site we have to de-encapsulate it and build up the original stream.&lt;br /&gt;&lt;br /&gt;Examples and prove of concept (POC)&lt;br /&gt;The client is a simple shell using the hping [2] to sent our specially designed UDP packets.&lt;br /&gt;&lt;br /&gt;The server has been written in C to allow it an access to all functions of a network socket. The server has to implement the necessary logic to assemble the original data as well.&lt;br /&gt;&lt;br /&gt;The example code can be found on github under the &lt;a href="https://github.com/rtomaszewski/udptx"&gt;udptx &lt;/a&gt; project link [4]&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;Results presentation&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;For the below DemoA and DemoB&amp;nbsp;illustrations we are going to use&lt;br /&gt;&amp;nbsp;a) &lt;a href="#demoA"&gt; One Debian base Rackspace Cloud Server (RCS) [3].&lt;/a&gt;&lt;br /&gt;&amp;nbsp;b) &lt;a href="#demoB"&gt; Locally hosted VM (in VMware Workstation) on my PC at home.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;On any of the below mentioned machines we work on I assume you have already the necessary programs installed like hping2 (you can use the hping3 as well) and the compiler to compile the&amp;nbsp;&lt;a href="https://github.com/rtomaszewski/udptx/blob/master/server.c"&gt; server.c&lt;/a&gt;&amp;nbsp;code.&lt;br /&gt;&lt;br /&gt;This is only an example what you may need to install if you use Debian or Ubuntu base RCS.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:bash;"&gt;debian-leny:~# aptitude install git-core #to check out our source code from github&lt;br /&gt;debian-leny:~# aptitude install gcc&lt;br /&gt;debian-leny:~# uname -a&lt;br /&gt;debian-leny:~# aptitude install linux-headers-2.6.26-2-xen-amd64&lt;br /&gt;debian-leny:~# aptitude install libc6-dev&lt;br /&gt;debian-leny:~# aptitude install hping2&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To check out the code and to compile the server code you can do:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:bash;"&gt;debian-leny:~# git clone git://github.com/rtomaszewski/udptx.git&lt;br /&gt;debian-leny:~# cd udptx&lt;br /&gt;debian-leny:~/udptx# gcc -o server server.c&lt;br /&gt;&lt;br /&gt;# after a successful compilation the code should look like this&lt;br /&gt;debian-leny:~/udptx# ls -la server&lt;br /&gt;-rwxr-xr-x 1 root root 11862 2012-01-05 22:15 server&lt;br /&gt;&lt;br /&gt;debian-leny:~/udptx# ldd server&lt;br /&gt;        linux-vdso.so.1 =&amp;gt;  (0x00007fff6bbff000)&lt;br /&gt;        libc.so.6 =&amp;gt; /lib/libc.so.6 (0x00007f95f19c3000)&lt;br /&gt;        /lib64/ld-linux-x86-64.so.2 (0x00007f95f1d16000)&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;a name="demoA"&gt; DemoA - using the loop back interface on the RCS&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;Open first SSH session to the RCS server and start the server.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text"&gt;ssh 31.222.171.250&lt;br /&gt;debian-leny:~/udptx#&amp;nbsp;cd udptx&lt;br /&gt;debian-leny:~/udptx#&amp;nbsp;./server&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If the server starts successfully the output will look like this.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text"&gt;debian-leny:~/udptx# ./server&lt;br /&gt;created a UPD socket on port 5555&lt;br /&gt;listening on our UPD socket&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;On the second SSH session on the RCS server let's run the&amp;nbsp;client. The client requires 2 options: the ip of a host where the data should be sent and a string parameter representing the data we want to sent. In our example we use the loopback address and we try to sent a 3 character string "az;".&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;pre class="brush:text"&gt;ssh&amp;nbsp;&amp;nbsp;31.222.171.xyz&lt;br /&gt;debian-leny:~/udptx#&amp;nbsp;cd udptx&lt;br /&gt;&lt;br /&gt;debian-leny:~/udptx# ./client.sh 127.0.0.1 'az;'&lt;br /&gt;DEBUG: Output interface address: 219.127.0.0&lt;br /&gt;DEBUG: if lo: OK&lt;br /&gt;using lo, addr: 127.0.0.1, MTU: 16436&lt;br /&gt;DEBUG: Trying to open PF_PACKET socket... DEBUG: PF_PACKET, SOCK_RAW open OK&lt;br /&gt;HPING 127.0.0.1 (lo 127.0.0.1): udp mode set, 28 headers + 0 data bytes&lt;br /&gt;45 00 00 1C BC A6 00 00 40 11 00 00 7F 00 00 01 7F 00 00 01 26 19 15 B3 00 08 C6 0F&lt;br /&gt;&lt;br /&gt;--- 127.0.0.1 hping statistic ---&lt;br /&gt;1 packets transmitted, 0 packets received, 100% packet loss&lt;br /&gt;round-trip min/avg/max = 0.0/0.0/0.0 ms&lt;br /&gt;DEBUG: Output interface address: 191.127.0.0&lt;br /&gt;DEBUG: if lo: OK&lt;br /&gt;using lo, addr: 127.0.0.1, MTU: 16436&lt;br /&gt;DEBUG: Trying to open PF_PACKET socket... DEBUG: PF_PACKET, SOCK_RAW open OK&lt;br /&gt;HPING 127.0.0.1 (lo 127.0.0.1): udp mode set, 28 headers + 0 data bytes&lt;br /&gt;45 00 00 1C 11 B3 00 00 40 11 00 00 7F 00 00 01 7F 00 00 01 2F DD 15 B3 00 08 BC 4B&lt;br /&gt;&lt;br /&gt;--- 127.0.0.1 hping statistic ---&lt;br /&gt;1 packets transmitted, 0 packets received, 100% packet loss&lt;br /&gt;round-trip min/avg/max = 0.0/0.0/0.0 ms&lt;br /&gt;DEBUG: Output interface address: 28.127.0.0&lt;br /&gt;DEBUG: if lo: OK&lt;br /&gt;using lo, addr: 127.0.0.1, MTU: 16436&lt;br /&gt;DEBUG: Trying to open PF_PACKET socket... DEBUG: PF_PACKET, SOCK_RAW open OK&lt;br /&gt;HPING 127.0.0.1 (lo 127.0.0.1): udp mode set, 28 headers + 0 data bytes&lt;br /&gt;45 00 00 1C A9 27 00 00 40 11 00 00 7F 00 00 01 7F 00 00 01 17 41 15 B3 00 08 D4 E7&lt;br /&gt;&lt;br /&gt;--- 127.0.0.1 hping statistic ---&lt;br /&gt;1 packets transmitted, 0 packets received, 100% packet loss&lt;br /&gt;round-trip min/avg/max = 0.0/0.0/0.0 ms&lt;br /&gt;DEBUG: Output interface address: 209.127.0.0&lt;br /&gt;DEBUG: if lo: OK&lt;br /&gt;using lo, addr: 127.0.0.1, MTU: 16436&lt;br /&gt;DEBUG: Trying to open PF_PACKET socket... DEBUG: PF_PACKET, SOCK_RAW open OK&lt;br /&gt;HPING 127.0.0.1 (lo 127.0.0.1): udp mode set, 28 headers + 0 data bytes&lt;br /&gt;45 00 00 1C 7F DE 00 00 40 11 00 00 7F 00 00 01 7F 00 00 01 00 35 15 B3 00 08 EB F3&lt;br /&gt;&lt;br /&gt;--- 127.0.0.1 hping statistic ---&lt;br /&gt;1 packets transmitted, 0 packets received, 100% packet loss&lt;br /&gt;round-trip min/avg/max = 0.0/0.0/0.0 ms&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If the data were sent successfully to the server we should see there the following output.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;pre class="brush:text"&gt;debian-leny:~/udptx# ./server&lt;br /&gt;created a UPD socket on port 5555&lt;br /&gt;listening on our UPD socket&lt;br /&gt;received from ip: 127.0.0.1 port: hex 0x2619 dec 9753&lt;br /&gt;received from ip: 127.0.0.1 port: hex 0x2fdd dec 12253&lt;br /&gt;received from ip: 127.0.0.1 port: hex 0x1741 dec 5953&lt;br /&gt;received from ip: 127.0.0.1 port: hex 0x35 dec 53&lt;br /&gt;Received 3 characters:&lt;br /&gt;msg[0]=char a hex 0x61 dec 97&lt;br /&gt;msg[1]=char z hex 0x7a dec 122&lt;br /&gt;msg[2]=char ; hex 0x3b dec 59&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;A tcpdump file with captured session&amp;nbsp;between&amp;nbsp;the client and sever can be found here &lt;a href="https://docs.google.com/open?id=0B7ftIvGKDqYMOWM4MzlkOWUtOWE4OS00ZTlkLTk2MGMtZDhjNTA5OGFjNTI1"&gt; udptx.lo.pcap&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:bash"&gt;debian-leny:~/udptx# tcpdump -s0 -nn -i lo -w /tmp/udptx.lo.pcap&lt;br /&gt;tcpdump: listening on lo, link-type EN10MB (Ethernet), capture size 65535 bytes&lt;br /&gt;4 packets captured&lt;br /&gt;8 packets received by filter&lt;br /&gt;0 packets dropped by kernel&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: large;"&gt;&lt;a name="demoB"&gt; DemoB - test over the Internet &lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;/div&gt;The assumptions here are the same as before with the exception that the client is run from a local VM and it connects over the Internet to our Rackspace Cloud Server.&lt;br /&gt;&lt;br /&gt;This time the output from the client is a little different than before.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:bash"&gt;root@ubuntuserver:~/udptx#&amp;nbsp;uname &amp;nbsp;-a&lt;br /&gt;Linux ubuntuserver 2.6.38-11-server #50-Ubuntu SMP Mon Sep 12 21:34:27 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;root@ubuntuserver:~/udptx# ip addr&lt;br /&gt;1: lo: &lt;loopback,up,lower_up&gt; mtu 16436 qdisc noqueue state UNKNOWN&amp;nbsp;&lt;/loopback,up,lower_up&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00&lt;br /&gt;&amp;nbsp; &amp;nbsp; inet 127.0.0.1/8 scope host lo&lt;br /&gt;&amp;nbsp; &amp;nbsp; inet6 ::1/128 scope host&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;valid_lft forever preferred_lft forever&lt;br /&gt;2: eth0: &lt;broadcast,multicast,up,lower_up&gt; mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000&lt;/broadcast,multicast,up,lower_up&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; link/ether 00:0c:29:93:ee:ff brd ff:ff:ff:ff:ff:ff&lt;br /&gt;&amp;nbsp; &amp;nbsp; inet 192.168.0.6/24 brd 192.168.0.255 scope global eth0&lt;br /&gt;&amp;nbsp; &amp;nbsp; inet6 fe80::20c:29ff:fe93:eeff/64 scope link&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;valid_lft forever preferred_lft forever&lt;br /&gt;&lt;br /&gt;root@ubuntuserver:~/udptx# ls -la /usr/sbin/hping2&lt;br /&gt;lrwxrwxrwx 1 root root 6 2012-01-05 23:28 /usr/sbin/hping2 -&amp;gt; hping3&lt;br /&gt;&lt;br /&gt;root@ubuntuserver:~/udptx#&amp;nbsp;tracepath &amp;nbsp;31.222.171.250&lt;br /&gt;&lt;br /&gt;&amp;nbsp;1 : &amp;nbsp;192.168.0.6 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.207ms pmtu 1500&lt;br /&gt;&amp;nbsp;1: &amp;nbsp;10.95.xyz.xyz &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10.674ms&lt;br /&gt;&amp;nbsp;1: &amp;nbsp;10.95.52.1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 13.559ms&lt;br /&gt;&amp;nbsp;2: &amp;nbsp;80.3.177.253 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 13.320ms&lt;br /&gt;&amp;nbsp;3: &amp;nbsp;195.182.179.85 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 14.875ms asymm &amp;nbsp;5&lt;br /&gt;&amp;nbsp;4: &amp;nbsp;212.43.163.117 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 13.964ms&lt;br /&gt;&amp;nbsp;5: &amp;nbsp;212.43.162.218 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 12.821ms&lt;br /&gt;&amp;nbsp;6: &amp;nbsp;213.105.159.34 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 18.455ms&lt;br /&gt;&amp;nbsp;7: &amp;nbsp;62.253.184.2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 26.880ms&lt;br /&gt;&amp;nbsp;8: &amp;nbsp;195.66.224.116 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 15.280ms asymm &amp;nbsp;7&lt;br /&gt;&amp;nbsp;9: &amp;nbsp;92.52.76.246 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 31.758ms asymm &amp;nbsp;8&lt;br /&gt;10: &amp;nbsp;92.52.77.107 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 50.107ms asymm &amp;nbsp;9&lt;br /&gt;11: &amp;nbsp;31.222.171.250 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 15.384ms reached&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Resume: pmtu 1500 hops 11 back 55&lt;br /&gt;&lt;br /&gt;root@ubuntuserver:~/udptx#&amp;nbsp;./client.sh 31.222.171.250 'az;'&lt;br /&gt;DEBUG: Output interface address: 0.0.0.0&lt;br /&gt;DEBUG: if lo: The address doesn't match&lt;br /&gt;DEBUG: if eth0: OK&lt;br /&gt;using eth0, addr: 192.168.0.6, MTU: 1500&lt;br /&gt;DEBUG: pcap_open_live(eth0, 99999, 0, 1, 0x628220)&lt;br /&gt;DEBUG: dltype is 1&lt;br /&gt;HPING 31.222.171.250 (eth0 31.222.171.250): udp mode set, 28 headers + 0 data bytes&lt;br /&gt;45 00 00 1C 81 DF 00 00 40 11 00 00 C0 A8 00 06 1F DE AB FA 26 19 15 B3 00 08 37 8B&lt;br /&gt;DEBUG: under pcap_recv()&lt;br /&gt;DEBUG: under pcap_recv()&lt;br /&gt;DEBUG: [pcap_recv] p = NULL&lt;br /&gt;&lt;br /&gt;--- 31.222.171.250 hping statistic ---&lt;br /&gt;1 packets transmitted, 0 packets received, 100% packet loss&lt;br /&gt;&lt;br /&gt;round-trip min/avg/max = 0.0/0.0/0.0 ms&lt;br /&gt;DEBUG: Output interface address: 0.0.0.0&lt;br /&gt;DEBUG: if lo: The address doesn't match&lt;br /&gt;DEBUG: if eth0: OK&lt;br /&gt;using eth0, addr: 192.168.0.6, MTU: 1500&lt;br /&gt;DEBUG: pcap_open_live(eth0, 99999, 0, 1, 0x628220)&lt;br /&gt;DEBUG: dltype is 1&lt;br /&gt;HPING 31.222.171.250 (eth0 31.222.171.250): udp mode set, 28 headers + 0 data bytes&lt;br /&gt;45 00 00 1C 1F E2 00 00 40 11 00 00 C0 A8 00 06 1F DE AB FA 2F DD 15 B3 00 08 2D C7&amp;nbsp;&lt;br /&gt;DEBUG: under pcap_recv()&lt;br /&gt;DEBUG: under pcap_recv()&lt;br /&gt;DEBUG: [pcap_recv] p = NULL&lt;br /&gt;&lt;br /&gt;--- 31.222.171.250 hping statistic ---&lt;br /&gt;1 packets transmitted, 0 packets received, 100% packet loss&lt;br /&gt;round-trip min/avg/max = 0.0/0.0/0.0 ms&lt;br /&gt;&lt;br /&gt;DEBUG: Output interface address: 0.0.0.0&lt;br /&gt;DEBUG: if lo: The address doesn't match&lt;br /&gt;DEBUG: if eth0: OK&lt;br /&gt;using eth0, addr: 192.168.0.6, MTU: 1500&lt;br /&gt;DEBUG: pcap_open_live(eth0, 99999, 0, 1, 0x628220)&lt;br /&gt;DEBUG: dltype is 1&lt;br /&gt;HPING 31.222.171.250 (eth0 31.222.171.250): udp mode set, 28 headers + 0 data bytes&lt;br /&gt;45 00 00 1C 9F 7F 00 00 40 11 00 00 C0 A8 00 06 1F DE AB FA 17 41 15 B3 00 08 46 63&amp;nbsp;&lt;br /&gt;DEBUG: under pcap_recv()&lt;br /&gt;DEBUG: under pcap_recv()&lt;br /&gt;DEBUG: [pcap_recv] p = NULL&lt;br /&gt;&lt;br /&gt;--- 31.222.171.250 hping statistic ---&lt;br /&gt;1 packets transmitted, 0 packets received, 100% packet loss&lt;br /&gt;&lt;br /&gt;round-trip min/avg/max = 0.0/0.0/0.0 ms&lt;br /&gt;DEBUG: Output interface address: 0.0.0.0&lt;br /&gt;&lt;br /&gt;DEBUG: if lo: The address doesn't match&lt;br /&gt;DEBUG: if eth0: OK&lt;br /&gt;using eth0, addr: 192.168.0.6, MTU: 1500&lt;br /&gt;DEBUG: pcap_open_live(eth0, 99999, 0, 1, 0x628220)&lt;br /&gt;DEBUG: dltype is 1&lt;br /&gt;HPING 31.222.171.250 (eth0 31.222.171.250): udp mode set, 28 headers + 0 data bytes&lt;br /&gt;45 00 00 1C 8C BC 00 00 40 11 00 00 C0 A8 00 06 1F DE AB FA 00 35 15 B3 00 08 5D 6F&amp;nbsp;&lt;br /&gt;DEBUG: under pcap_recv()&lt;br /&gt;DEBUG: under pcap_recv()&lt;br /&gt;DEBUG: [pcap_recv] p = NULL&lt;br /&gt;&lt;br /&gt;--- 31.222.171.250 hping statistic ---&lt;br /&gt;1 packets transmitted, 0 packets received, 100% packet loss&lt;br /&gt;round-trip min/avg/max = 0.0/0.0/0.0 ms&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The outputs from the server has changed as well.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:bash"&gt;debian-leny:~/udptx# ./server&lt;br /&gt;created a UPD socket on port 5555&lt;br /&gt;listening on our UPD socket&lt;br /&gt;received from ip: 80.194.5.191 port: hex 0x2619 dec 9753&lt;br /&gt;received from ip: 80.194.5.191 port: hex 0x2fdd dec 12253&lt;br /&gt;received from ip: 80.194.5.191 port: hex 0x1741 dec 5953&lt;br /&gt;received from ip: 80.194.5.191 port: hex 0x35 dec 53&lt;br /&gt;Received 3 characters:&lt;br /&gt;msg[0]=char a hex 0x61 dec 97&lt;br /&gt;msg[1]=char z hex 0x7a dec 122&lt;br /&gt;msg[2]=char ; hex 0x3b dec 59&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;A new tcpdump file with the captured session&amp;nbsp;between&amp;nbsp;the client and sever can be found here&amp;nbsp;&lt;a href="https://docs.google.com/open?id=0B7ftIvGKDqYMZGNjNjIxMTAtZDJlNS00OGU0LWExODUtNWZjNGRmYzk2MTg3"&gt;udptx.eth.pcap&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:bash"&gt;debian-leny:~/udptx# tcpdump -s0 -nn -i eth0 -w /tmp/udptx.eth.pcap&lt;br /&gt;tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes&lt;br /&gt;19 packets captured&lt;br /&gt;20 packets received by filter&lt;br /&gt;0 packets dropped by kernel&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;Summary and further work&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The presented code shows that it is possible to sent and receive data without relaying on the UDP payload mechanism. Of course the code is very simple and doesn't implement all the necessary protocol features to make it useful on a bigger scale. To name only a few missing key points that would have to be implemented:&lt;br /&gt;&amp;nbsp;- packet lost&lt;br /&gt;&amp;nbsp;- packet duplication&lt;br /&gt;&amp;nbsp;- packets reordering&lt;br /&gt;&lt;br /&gt;To better understand the limitation of our code and learn more about protocol implementation issues it is highly recommend to read at least the official RFC documents about for UDP and TCP protocols [5].&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;References&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;[1]&amp;nbsp;&lt;a href="http://www.networksorcery.com/enp/protocol/udp.htm"&gt;http://www.networksorcery.com/enp/protocol/udp.htm&lt;/a&gt;&lt;br /&gt;[2]&amp;nbsp;&lt;a href="http://www.hping.org/"&gt;http://www.hping.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;[3]&lt;br /&gt;&lt;a href="http://www.rackspace.com/cloud/cloud_hosting_products/servers/"&gt;http://www.rackspace.com/cloud/cloud_hosting_products/servers/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.rackspace.com/cloud/cloud_hosting_faq/"&gt;http://www.rackspace.com/cloud/cloud_hosting_faq/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.rackspace.com/knowledge_center/node/1875"&gt;http://www.rackspace.com/knowledge_center/node/1875&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;[4] &amp;nbsp;&lt;a href="https://github.com/rtomaszewski/udptx"&gt;https://github.com/rtomaszewski/udptx&lt;/a&gt;&lt;br /&gt;[5]&amp;nbsp;&lt;a href="http://www.diigo.com/user/rtomaszewski/rfc"&gt;http://www.diigo.com/user/rtomaszewski/rfc&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-1539799689952610069?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/1539799689952610069/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2012/01/hacking-udp-protocol-how-to-sent-data.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/1539799689952610069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/1539799689952610069'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2012/01/hacking-udp-protocol-how-to-sent-data.html' title='Hacking the UDP protocol  - how to sent data using the UDP source port of UDP packets'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-7498170741338595581</id><published>2012-01-01T22:42:00.002Z</published><updated>2012-01-01T22:42:46.046Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><title type='text'>One line Bash script debugging</title><content type='html'>Working on the Bash shell can be very&amp;nbsp;effective. You can combine various command line programs and chain (pipe) them together to&amp;nbsp;accomplish a&amp;nbsp;bigger task. Sometimes you have to debug your one line&amp;nbsp;scripts&amp;nbsp;although.&lt;br /&gt;&lt;br /&gt;When working on the CLI I wrote in a hurry a small command to find and check the value of the &lt;b&gt;sched_autogroup_enabled&lt;/b&gt; Linux&amp;nbsp;kernel&amp;nbsp;variable [1] under the proc file system.&lt;br /&gt;&lt;br /&gt;To my first surprise&amp;nbsp;it didn't work at all.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:bash; highlight: [1];"&gt;root@udesktop:/proc# find . -name \*sched\* 2&amp;gt;/dev/null  | grep -v [0-9]&lt;br /&gt;root@udesktop:/proc# &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It is easy to find this file manualy and I did it. Below is the prove that the file exist that I was looking for.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:bash; highlight: [1];"&gt;root@udesktop:/proc# ls -la ./sys/kernel/sched_autogroup_enabled&lt;br /&gt;-rw-r--r-- 1 root root 0 2012-01-01 21:38 ./sys/kernel/sched_autogroup_enabled&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Problem&lt;/b&gt;&lt;br /&gt;How to debug one line bash scripts. Or in general how to debug any bash script.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution&lt;/b&gt;&lt;br /&gt;The problem is easy to see once we enable more verbose debug output from the Bash&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:bash; highlight: [1,5];"&gt;root@udesktop:/proc# set -v -x&lt;br /&gt;root@udesktop:/proc# find . -name \*sched\* 2&amp;gt;/dev/null  | grep -v [0-9]&lt;br /&gt;find . -name \*sched\* 2&amp;gt;/dev/null  | grep -v [0-9]&lt;br /&gt;+ find . -name '*sched*'&lt;br /&gt;+ grep --color=auto -v 1 2 3 5 6 7 8 9&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;We see that the string '[0-9]' is&amp;nbsp;extended&amp;nbsp;by the bash before the command chain is actually executed.&lt;br /&gt;&lt;br /&gt;Once we know that the problem is how our regular&amp;nbsp;expression [2] is evaluated&amp;nbsp;the fix is simple:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:bash; highlight: [1,4,19];"&gt;root@udesktop:/proc# find . -name \*sched\* 2&amp;gt;/dev/null  | grep -v '[0-9]'&lt;br /&gt;find . -name \*sched\* 2&amp;gt;/dev/null  | grep -v '[0-9]'&lt;br /&gt;+ find . -name '*sched*'&lt;br /&gt;+ grep --color=auto -v '[0-9]'&lt;br /&gt;./schedstat&lt;br /&gt;./sched_debug&lt;br /&gt;./sys/kernel/sched_child_runs_first&lt;br /&gt;./sys/kernel/sched_min_granularity_ns&lt;br /&gt;./sys/kernel/sched_latency_ns&lt;br /&gt;./sys/kernel/sched_wakeup_granularity_ns&lt;br /&gt;./sys/kernel/sched_tunable_scaling&lt;br /&gt;./sys/kernel/sched_migration_cost&lt;br /&gt;./sys/kernel/sched_nr_migrate&lt;br /&gt;./sys/kernel/sched_time_avg&lt;br /&gt;./sys/kernel/sched_shares_window&lt;br /&gt;./sys/kernel/sched_rt_period_us&lt;br /&gt;./sys/kernel/sched_rt_runtime_us&lt;br /&gt;./sys/kernel/sched_compat_yield&lt;br /&gt;./sys/kernel/sched_autogroup_enabled&lt;br /&gt;./sys/kernel/sched_domain&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;References&lt;/b&gt;&lt;br /&gt;[1]&lt;br /&gt;Benefiting of sched_autogroup_enabled on the desktop&lt;br /&gt;&lt;a href="http://unix.stackexchange.com/questions/9069/benefiting-of-sched-autogroup-enabled-on-the-desktop"&gt;http://unix.stackexchange.com/questions/9069/benefiting-of-sched-autogroup-enabled-on-the-desktop&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The ~200 Line Linux Kernel Patch That Does Wonders&lt;br /&gt;&lt;a href="http://www.phoronix.com/scan.php?page=article&amp;amp;item=linux_2637_video&amp;amp;num=1"&gt;http://www.phoronix.com/scan.php?page=article&amp;amp;item=linux_2637_video&amp;amp;num=1&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;[2]&lt;br /&gt;Bash Reference Manual&lt;br /&gt;&lt;a href="http://www.gnu.org/software/bash/manual/bashref.html#Filename-Expansion"&gt;http://www.gnu.org/software/bash/manual/bashref.html#Filename-Expansion&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Debugging Bash scripts&lt;br /&gt;&lt;a href="http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_03.html"&gt;http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_03.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-7498170741338595581?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/7498170741338595581/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2012/01/one-line-bash-script-debugging.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/7498170741338595581'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/7498170741338595581'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2012/01/one-line-bash-script-debugging.html' title='One line Bash script debugging'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-8900657058154247359</id><published>2011-12-30T21:42:00.001Z</published><updated>2011-12-30T22:51:15.319Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='scheduler'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><category scheme='http://www.blogger.com/atom/ns#' term='kernel'/><category scheme='http://www.blogger.com/atom/ns#' term='scripting'/><title type='text'>How effectively use Linux system tools to find out the default  Linux kernel I/O scheduler</title><content type='html'>In many troubleshooting situation we overview and check large numbers of logs generated by one or another&amp;nbsp;application. Kernel is nothing special here. The kernel log files can &amp;nbsp;usually&amp;nbsp;be found under /var/log/kern.log.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Problem&lt;/b&gt;&lt;br /&gt;How to find out and confirm all names of the used io kernel scheduler&amp;nbsp;in the last several reboots.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution&lt;/b&gt;&lt;br /&gt;&lt;pre class="brush:bash; highlight: [1];"&gt;$ zcat kern.log.3.gz  | egrep 'io scheduler.*\(default\)' &lt;br /&gt;Oct  8 22:20:16 udesktop kernel: [    0.888090] io scheduler cfq registered (default)&lt;br /&gt;Oct 10 20:30:33 udesktop kernel: [    0.688367] io scheduler cfq registered (default)&lt;br /&gt;Nov  3 23:31:05 udesktop kernel: [    0.872053] io scheduler cfq registered (default)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre class="brush:bash; highlight: [1];"&gt;$ zcat kern.log.1.gz &amp;nbsp;| egrep 'io scheduler.*\(default\)' | sed -r 's/ +/ /g' | cut -d' ' -f10 | sort | uniq&lt;br /&gt;cfg&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Explanation&lt;/b&gt;&lt;br /&gt;We first grep for the names of the configured io scheduler.&amp;nbsp;Next we pars it trought sed to repalce all multi space string with a single space and at the end we cut of the scheduler name.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;b&gt;References&lt;/b&gt;&lt;br /&gt;Choosing an I/O Scheduler for Red Hat® Enterprise Linux® 4 and the 2.6 Kernel&lt;br /&gt;&lt;a href="http://www.redhat.com/magazine/008jun05/features/schedulers/"&gt;http://www.redhat.com/magazine/008jun05/features/schedulers/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-8900657058154247359?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/8900657058154247359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2011/12/how-effectively-use-linux-system-tools.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/8900657058154247359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/8900657058154247359'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2011/12/how-effectively-use-linux-system-tools.html' title='How effectively use Linux system tools to find out the default  Linux kernel I/O scheduler'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-1697548286041853513</id><published>2011-12-30T00:34:00.004Z</published><updated>2011-12-30T21:42:02.337Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='devops'/><category scheme='http://www.blogger.com/atom/ns#' term='cloud'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='automation'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='ssh'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='putty'/><title type='text'>How to connect over ssh to a server and automatically provide the user name and password using putty or ssh</title><content type='html'>With the benefit of easy of use of cloud services we can provision a new cloud base virtual server within a minute. Having the server ready we still have to login there to do our job or tests.&lt;br /&gt;&lt;br /&gt;As an example you can take a look at the Cloud Servers from Rackspace [1].&lt;br /&gt;&lt;br /&gt;By using the free windows ssh implementation like putty [2] or standard linux openssh ssh client we can easily login over a secure connection into our server by using the SSH protocol.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Problem&lt;/b&gt;&lt;br /&gt;When you want to quickly and temporarily provision a cloud server it is time wasting when you have to provide the user name and password each time to login to do the work.&lt;br /&gt;As the cloud server will be used for a limited (short) time we would like to be able to login with one 'click' or one command only.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution&lt;/b&gt;&lt;br /&gt;The Multi-Tabbed PuTTY tool allow us to use a wrapper around the putty tool and provide an easy to use solution to open a new ssh session on demand without having to wory about he user name or password.&lt;br /&gt;&lt;br /&gt;Multi-Tabbed PuTTY&lt;br /&gt;&lt;a href="http://www.ttyplus.com/"&gt;http://www.ttyplus.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;For the Linux system we can use an simple script using the 'expect' tool to start the ssh client.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;SSH - Passing Unix login passwords through shell scripts &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://nixcraft.com/shell-scripting/4489-ssh-passing-unix-login-passwords-through-shell-scripts.html"&gt;http://nixcraft.com/shell-scripting/4489-ssh-passing-unix-login-passwords-through-shell-scripts.html&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Security&lt;/b&gt;&lt;br /&gt;From the security point of view storing the passwords is always a bad idea. There are always some alternative methods. Some examples listed below:&lt;br /&gt;&lt;br /&gt;Password-less logins with OpenSSH&lt;br /&gt;&lt;a href="http://www.debian-administration.org/articles/152"&gt;http://www.debian-administration.org/articles/152&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-password-using-ssh-keygen-ssh-copy-id/"&gt;http://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-password-using-ssh-keygen-ssh-copy-id/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;References&lt;/b&gt;&lt;br /&gt;[1]&lt;br /&gt;&lt;a href="http://www.rackspace.com/cloud/cloud_hosting_products/servers/"&gt;http://www.rackspace.com/cloud/cloud_hosting_products/servers/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;[2]&lt;br /&gt;&lt;a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/"&gt;http://www.chiark.greenend.org.uk/~sgtatham/putty/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-1697548286041853513?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/1697548286041853513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2011/12/how-to-connect-over-ssh-to-server-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/1697548286041853513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/1697548286041853513'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2011/12/how-to-connect-over-ssh-to-server-and.html' title='How to connect over ssh to a server and automatically provide the user name and password using putty or ssh'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-5191939380667950780</id><published>2011-12-29T00:13:00.002Z</published><updated>2011-12-29T23:58:49.078Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='partition'/><category scheme='http://www.blogger.com/atom/ns#' term='ntfs'/><category scheme='http://www.blogger.com/atom/ns#' term='virtualisation'/><category scheme='http://www.blogger.com/atom/ns#' term='vmware'/><title type='text'>How to resize (increase) main NTFS system partition of your Windows base virtual mashine in VMware Workstation</title><content type='html'>&lt;br /&gt;&lt;b&gt;Problem summary&lt;/b&gt;&lt;br /&gt;When we create a VM we specify the various hardware component we want to virtualize. One of them is the HDD.&amp;nbsp; After some time you may find out that the hard drive your VM has is too small.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-dVG4CddLRF0/Tvuudu4scNI/AAAAAAAAFI0/bxauoGKahfA/s1600/vmware-resize.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="170" src="http://3.bp.blogspot.com/-dVG4CddLRF0/Tvuudu4scNI/AAAAAAAAFI0/bxauoGKahfA/s200/vmware-resize.jpg" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;The VMware Workstation allows you to resize the disk (as long there are not snapshots).&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Impact&lt;/b&gt;&lt;br /&gt;You can't install any additional software because there is not enough free space.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Problem&lt;/b&gt;&lt;br /&gt;Although there are many tools you can use to resize the NTFS file system many of them have some limitation (demo version doesn't write data to the disk) or require a comercial license to bought or can be use on the main partition (diskpart.exe) [2]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution&lt;/b&gt;&lt;br /&gt;The task can be done with the help of [1]. We don't need license. It can resize the main NTFS partition.&lt;br /&gt;&lt;br /&gt;Free EaseUS® Partition Master 9.1 Home Edition&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;References&lt;/b&gt;&lt;br /&gt;[1]&lt;br /&gt;Free EaseUS® Partition Master 9.1 Home Edition&lt;br /&gt;&lt;a href="http://www.partition-tool.com/personal.htm"&gt;http://www.partition-tool.com/personal.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;[2]&lt;br /&gt;&lt;br /&gt;How to extend a data volume in Windows Server 2003, in Windows XP, in Windows 2000, and in Windows Server 2008 &lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/325590"&gt;http://support.microsoft.com/kb/325590&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-5191939380667950780?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/5191939380667950780/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2011/12/how-to-resize-increase-ntfs-main-system.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/5191939380667950780'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/5191939380667950780'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2011/12/how-to-resize-increase-ntfs-main-system.html' title='How to resize (increase) main NTFS system partition of your Windows base virtual mashine in VMware Workstation'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-dVG4CddLRF0/Tvuudu4scNI/AAAAAAAAFI0/bxauoGKahfA/s72-c/vmware-resize.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-5010425748815045802</id><published>2011-10-10T19:46:00.000+01:00</published><updated>2011-10-10T19:46:17.167+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='virtualisation'/><category scheme='http://www.blogger.com/atom/ns#' term='citrix'/><category scheme='http://www.blogger.com/atom/ns#' term='xen'/><category scheme='http://www.blogger.com/atom/ns#' term='xenserver'/><title type='text'>XenServer v6 installation problem: UNSUPPORTED_INSTALL_METHOD - other-config:install-repository was not set to an appropriate value, and this is required for the selected distribution type</title><content type='html'>It has been a long time since I played with the XenServer for the last time.&lt;br /&gt;&lt;br /&gt;I managed to install the XenServer without any problems. The XenConsole installation went flawlessly as well. But when I tried to create a new VS using the provided templates i run into the desribing problem:&lt;br /&gt;&lt;br /&gt;What I did in XenCentre: &lt;br /&gt;&lt;ol&gt;&lt;li&gt;XenCentre&lt;/li&gt;&lt;li&gt;New VM&lt;/li&gt;&lt;li&gt;Ubuntu Lucid Lynx 10.04(32 bit)&amp;nbsp;&lt;/li&gt;&lt;li&gt;Then use the default settings and once you see the screen with the:&lt;/li&gt;&lt;/ol&gt;"Select the installation method for the operating system software you want to install on the new VM"&lt;br /&gt;&lt;br /&gt;You seen on the screen a page where you should select the desired installation source. In my example the option for "Install from ISO library or DVD drive" was grey but you can still select one of the ISO images from your storage pool (if you defined it previously).&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Problem:&lt;/b&gt;&lt;br /&gt;If you attempt to run the VS to start the installation you will get an error like this:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text;"&gt;UNSUPPORTED_INSTALL_METHOD - other-config:install-repository was not set to an appropriate value, and this is required for the selected distribution type&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;There is not much on the Citrix support/technical knowledge page for this. The solution is here although.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution:&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;To create VM and start the installation from a ISO file saved on the attached storage (NFS or CIFS) you have to use the correct profile: &lt;b&gt;&lt;span style="font-size: small;"&gt;Other install media&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;To use the &lt;b&gt;Ubuntu Lucid Lynx 10.04(32 bit)&lt;/b&gt; profile you have to specify an URL for the data to be retrived (for example like&lt;a href="http://mirror.clarkson.edu/ubuntu/"&gt; http://mirror.clarkson.edu/ubuntu/ )&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;References:&lt;br /&gt;&lt;a href="http://lists.xensource.com/archives/html/xen-users/2011-06/msg00394.html"&gt; http://lists.xensource.com/archives/html/xen-users/2011-06/msg00394.html &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-5010425748815045802?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/5010425748815045802/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2011/10/xenserver-v6-installation-problem.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/5010425748815045802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/5010425748815045802'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2011/10/xenserver-v6-installation-problem.html' title='XenServer v6 installation problem: UNSUPPORTED_INSTALL_METHOD - other-config:install-repository was not set to an appropriate value, and this is required for the selected distribution type'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-6038313001519275946</id><published>2011-05-19T23:15:00.001+01:00</published><updated>2011-05-20T20:13:26.278+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='screen'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='monitoring'/><title type='text'>Screen trick how to simultaneously monitor network traffic and disk activity and processes in Linux</title><content type='html'>As a system administrator sooner than later you will discover the 'screen' command. It is very powerful tool that allows you practically do anything with your (black) terminal screen or run commands in background for you.&lt;br /&gt;&lt;br /&gt;The tools we will use for monitoring:&lt;br /&gt;- htop is a top like process monitoring tool for text consoles&lt;br /&gt;- nethogs is a network monitoring tool (needs root privileges!)&lt;br /&gt;- iotop is a disk I/O monitoring tool&lt;br /&gt;&lt;br /&gt;To start a single screen session, divided in 3 vertical smaller screens, each running its own monitoring program try this recipe:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:html; highlight: [1,11];"&gt;# cat &amp;lt;&amp;lt;END &gt;/tmp/myscreen.cfg&lt;br /&gt;startup_message off&lt;br /&gt;screen -t top htop&lt;br /&gt;split&lt;br /&gt;focus&lt;br /&gt;screen -t nethogs  nethogs wlan0&lt;br /&gt;split&lt;br /&gt;focus&lt;br /&gt;screen -t iotop iotop&lt;br /&gt;END&lt;br /&gt;&lt;br /&gt;# screen -c /tmp/myscreen.cfg&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;References:&lt;br /&gt;&lt;a href="http://blog.urfix.com/top-10-awesome-linux-screen-tricks/"&gt; Top 10 Awesome Linux Screen Tricks &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-6038313001519275946?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/6038313001519275946/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2011/05/screen-trick-how-to-simultaneously.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/6038313001519275946'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/6038313001519275946'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2011/05/screen-trick-how-to-simultaneously.html' title='Screen trick how to simultaneously monitor network traffic and disk activity and processes in Linux'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-7326047791471408607</id><published>2011-05-04T23:33:00.000+01:00</published><updated>2011-05-04T23:33:45.487+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fedora'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='usb'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><category scheme='http://www.blogger.com/atom/ns#' term='instalation'/><title type='text'>By using Ubuntu how to create a bootable USB thumb drive with Fedora distro</title><content type='html'>Although this it has already been possible to use USB thumb drive and boot from it for a longer time, there is still no one unified method to create this USB thumb drive.&lt;br /&gt;&lt;br /&gt;Ubuntu has its own method:&lt;br /&gt;&lt;br /&gt;"2) Burn your CD or create a USB drive"&lt;br /&gt;http://www.ubuntu.com/download/server/download&lt;br /&gt;&lt;br /&gt;Fedora has its own as well:&lt;br /&gt;&lt;br /&gt;"3.2.1. Making Fedora USB Media on a Windows Operating System"&lt;br /&gt;http://docs.fedoraproject.org/en-US/Fedora/14/html/Installation_Guide/Making_USB_Media.html&lt;br /&gt;&lt;br /&gt;Fortunately for us a separate project unetbootin [1] comes in handy to do this job regardless what OS you are currently using.&lt;br /&gt;&lt;br /&gt;To simply install and run follow this instructions bellow.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text; highlight: [1,3];"&gt;# aptitude install unetbootin # dpkg -L  unetbootin | grep bin/usr/bin/unetbootin# unetbootin&lt;/pre &gt;&lt;br /&gt;&lt;br /&gt;References:&lt;br /&gt;&lt;br /&gt;[1] &lt;br /&gt;&lt;a href="http://unetbootin.sourceforge.net"&gt; UNetbootin - Homepage and Downloads &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://coffeecode.net/archives/223-Using-Fedoras-liveusb-creator-on-Ubuntu-Lucid-Lynx.html"&gt; Using Fedora's liveusb-creator on Ubuntu Lucid Lynx &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-7326047791471408607?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/7326047791471408607/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2011/05/by-using-ubuntu-how-to-create-bootable.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/7326047791471408607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/7326047791471408607'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2011/05/by-using-ubuntu-how-to-create-bootable.html' title='By using Ubuntu how to create a bootable USB thumb drive with Fedora distro'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-3105571794200774573</id><published>2011-05-01T23:06:00.000+01:00</published><updated>2011-05-01T23:06:34.024+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='partition'/><category scheme='http://www.blogger.com/atom/ns#' term='parted'/><category scheme='http://www.blogger.com/atom/ns#' term='gdisk'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><category scheme='http://www.blogger.com/atom/ns#' term='instalation'/><category scheme='http://www.blogger.com/atom/ns#' term='gpt'/><title type='text'>Gdisk error message: Caution: invalid main GPT header, but valid backup; regenerating main header from backup!</title><content type='html'>At some point when experimenting with partitions on your disk you may get the following error message.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:html; highlight: [1];"&gt;% gdisk /dev/sda&lt;br /&gt;GPT fdisk (gdisk) version 0.7.1&lt;br /&gt;&lt;br /&gt;Caution: invalid main GPT header, but valid backup; regenerating main header&lt;br /&gt;from backup!&lt;br /&gt;&lt;br /&gt;Caution! After loading partitions, the CRC doesn't check out!&lt;br /&gt;Warning! Main partition table CRC mismatch! Loaded backup partition table&lt;br /&gt;instead of main partition table!&lt;br /&gt;&lt;br /&gt;Warning! One or more CRCs don't match. You should repair the disk!&lt;br /&gt;&lt;br /&gt;Partition table scan:&lt;br /&gt;  MBR: MBR only&lt;br /&gt;  BSD: not present&lt;br /&gt;  APM: not present&lt;br /&gt;  GPT: damaged&lt;br /&gt;&lt;br /&gt;Found valid MBR and corrupt GPT. Which do you want to use? (Using the&lt;br /&gt;GPT MAY permit recovery of GPT data.)&lt;br /&gt; 1 - MBR&lt;br /&gt; 2 - GPT&lt;br /&gt; 3 - Create blank GPT&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;As always you have to be very careful depending what you did and what do you want to do as next.&lt;br /&gt;&lt;br /&gt;The three options for gdisk gives you the choice what partition tables you will examine. Fortunately for us gpart is not going to write on disk anything until we say so by executing the w (write) command (example bellow). The three options only influences how the data on the disk are going to be interpreted and presented for our review.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:html; highlight: [1,16];"&gt;# gdisk /dev/sda&lt;br /&gt;Command (? for help): h&lt;br /&gt;b    back up GPT data to a file&lt;br /&gt;c    change a partition's name&lt;br /&gt;d    delete a partition&lt;br /&gt;i    show detailed information on a partition&lt;br /&gt;l    list known partition types&lt;br /&gt;n    add a new partition&lt;br /&gt;o    create a new empty GUID partition table (GPT)&lt;br /&gt;p    print the partition table&lt;br /&gt;q    quit without saving changes&lt;br /&gt;r    recovery and transformation options (experts only)&lt;br /&gt;s    sort partitions&lt;br /&gt;t    change a partition's type code&lt;br /&gt;v    verify disk&lt;br /&gt;w    write table to disk and exit&lt;br /&gt;x    extra functionality (experts only)&lt;br /&gt;?    print this menu&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;At this stage it is save to experiment and have a look how the partition tables look like. Depending on your choise different partitions may be printed ('p') .&lt;br /&gt;&lt;br /&gt;REMEMBER to always quit the session with the 'q' (quit) and never with 'w' otherwise your experiments will be permanently saved on the disk.&lt;br /&gt;&lt;br /&gt;In my case this error was misleading and confusing only. I could verify that my current partition schema was not GPT at all but the good old MSDOS one [1]. At this stage I knew that 'gdisk' is not the tool I wanted to use and I finished creating new partitions with 'parted'. I didn't have to use gdisk at all.&lt;br /&gt;&lt;br /&gt;The reason why I had some parts of GPT data on my disk is unknown. I can only suspect that it was created when I played with the Windows tool 'EasyBCD'.&lt;br /&gt;&lt;br /&gt;I could try to delete the GPT data but base on [2] never had to do it.&lt;br /&gt;&lt;br /&gt;References&lt;br /&gt;[1] &lt;a href="http://rtomaszewski.blogspot.com/2011/05/how-to-find-what-type-of-disk-partition.html"&gt; How to find what type of disk partition schema do I use (msdos, gpt) &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;[2] &lt;a href="http://www.rodsbooks.com/gdisk/wipegpt.html"&gt;Wiping Out Old GPT Data &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-3105571794200774573?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/3105571794200774573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2011/05/gdisk-error-message-caution-invalid.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/3105571794200774573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/3105571794200774573'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2011/05/gdisk-error-message-caution-invalid.html' title='Gdisk error message: Caution: invalid main GPT header, but valid backup; regenerating main header from backup!'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-4753784115264485365</id><published>2011-05-01T21:50:00.000+01:00</published><updated>2011-05-01T21:50:58.710+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='partition'/><category scheme='http://www.blogger.com/atom/ns#' term='grub'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='mbr'/><category scheme='http://www.blogger.com/atom/ns#' term='gpt'/><title type='text'>How to find what type of disk partition schema do I use (msdos, gpt)</title><content type='html'>There are many disk partition schemes that can be used. Very likely on most x86 base computer the choice is often limited by the operating system we use although.&lt;br /&gt;&lt;br /&gt;The list of supported labels (partition schemes) in GNU parted tool can be found here [1]:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;label-type must be one of these supported disk labels:&lt;br /&gt;&lt;br /&gt;* bsd&lt;br /&gt;* loop (raw disk access)&lt;br /&gt;* gpt&lt;br /&gt;* mac&lt;br /&gt;* msdos&lt;br /&gt;* pc98&lt;br /&gt;* sun&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;To find out what type of partition schema we currently have on your system please run the bellow command and check the value for the 'Partition Table'.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:html; highlight: [1,12];"&gt;% parted /dev/sda unit mb print&lt;br /&gt;Model: ATA ST2000DL003-9VT1 (scsi)&lt;br /&gt;Disk /dev/sda: 2000399MB&lt;br /&gt;Sector size (logical/physical): 512B/512B&lt;br /&gt;Partition Table: msdos&lt;br /&gt;&lt;br /&gt;Number  Start     End       Size      Type     File system  Flags&lt;br /&gt; 1      0.03MB    104856MB  104856MB  primary  ntfs         boot&lt;br /&gt; 2      104857MB  209714MB  104858MB  primary  ntfs&lt;br /&gt; 3      209714MB  312115MB  102401MB  primary&lt;br /&gt;                                      &lt;br /&gt;root@sysresccd /tmp % parted /dev/sda unit s print&lt;br /&gt;Model: ATA ST2000DL003-9VT1 (scsi)&lt;br /&gt;Disk /dev/sda: 3907029168s&lt;br /&gt;Sector size (logical/physical): 512B/512B&lt;br /&gt;Partition Table: msdos&lt;br /&gt;&lt;br /&gt;Number  Start       End         Size        Type     File system  Flags&lt;br /&gt; 1      63s         204796619s  204796557s  primary  ntfs         boot&lt;br /&gt; 2      204797952s  409597951s  204800000s  primary  ntfs&lt;br /&gt; 3      409597952s  609599487s  200001536s  primary&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;References:&lt;br /&gt;&lt;br /&gt;[1]&lt;br /&gt;&lt;a href="http://www.gnu.org/software/parted/manual/parted.html#mklabel"&gt; (parted) mklabel msdos &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Others:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.gnu.org/software/parted/manual/parted.html"&gt; Parted User's Manual &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/GUID_Partition_Table"&gt; GUID Partition Table &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ibm.com/developerworks/linux/library/l-gpt/index.html"&gt; Make the most of large drives with GPT and Linux &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.justlinux.com/forum/showthread.php?threadid=153121"&gt; Fun with GPT partitioning &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html"&gt; Linux Creating a Partition Size Larger than 2TB &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-4753784115264485365?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/4753784115264485365/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2011/05/how-to-find-what-type-of-disk-partition.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/4753784115264485365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/4753784115264485365'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2011/05/how-to-find-what-type-of-disk-partition.html' title='How to find what type of disk partition schema do I use (msdos, gpt)'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-1402858653789827519</id><published>2011-05-01T21:17:00.000+01:00</published><updated>2011-05-01T21:17:51.551+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='partition'/><category scheme='http://www.blogger.com/atom/ns#' term='grub'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='mbr'/><title type='text'>How to export/backup partition schema for a disk using old style disk partitions format like 'msdos'  written into MBR sector</title><content type='html'>To backup the partition schema of the disk you can execute:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:html; highlight: [1];"&gt;# sfdisk -d /dev/sda &amp;gt; part.txt&lt;br /&gt;&lt;br /&gt;# example output can look like&lt;br /&gt;# cat part.txt&lt;br /&gt;# partition table of /dev/sda&lt;br /&gt;unit: sectors&lt;br /&gt;&lt;br /&gt;/dev/sda1 : start=       63, size=204796557, Id= 7, bootable&lt;br /&gt;/dev/sda2 : start=204797952, size=204800000, Id= 7&lt;br /&gt;/dev/sda3 : start=409597952, size=200001536, Id=83&lt;br /&gt;/dev/sda4 : start=        0, size=        0, Id= 0&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To restore the part.txt you can use:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:html; highlight: [1];"&gt;# sfdisk /dev/hda &amp;lt; part.txt&amp;nbsp;&lt;/pre&gt;&lt;pre class="brush:html; highlight: [1];"&gt;&amp;nbsp;&lt;/pre&gt;References:  &lt;br /&gt;&lt;a href="http://manpages.ubuntu.com/manpages/lucid/man8/sfdisk.8.html"&gt; man sfdisk&amp;nbsp;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.rodsbooks.com/gdisk/wipegpt.html"&gt;Wiping Out Old GPT Data&amp;nbsp;&lt;/a&gt;&lt;br /&gt;&amp;nbsp;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-1402858653789827519?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/1402858653789827519/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2011/05/how-to-exportbackup-partition-schema.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/1402858653789827519'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/1402858653789827519'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2011/05/how-to-exportbackup-partition-schema.html' title='How to export/backup partition schema for a disk using old style disk partitions format like &apos;msdos&apos;  written into MBR sector'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-1840963533469245263</id><published>2011-05-01T18:38:00.000+01:00</published><updated>2011-05-01T18:38:29.568+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='screen'/><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><title type='text'>Howto capture and record the console screen output to a file on disk</title><content type='html'>The basic of capturing a data to a file require simple redirection or using of 'tee' program for example.&lt;br /&gt;&lt;br /&gt;Examples:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text"&gt;$ ls -la &gt; /var/tmp/output.ls.txt&lt;br /&gt;$ ls -la | tee /var/tmp/output.ls.txt&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;But sometimes programs can be interactive or we simply want to capture all our session without to worry to redirect the stdout to a file. &lt;br /&gt;&lt;br /&gt;The solution is to use the 'screen' tool. &lt;br /&gt;&lt;br /&gt;Example #1: Screen basic usage&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text"&gt;# to start the session with a name 'example' run&lt;br /&gt;$screen -h&lt;br /&gt;$screen -S example&lt;br /&gt;&lt;br /&gt;# to leave the screen session type: CONTROL-a d&lt;br /&gt;# you are placed back in the original shell&lt;br /&gt;&lt;br /&gt;# to reattach to the created session&lt;br /&gt;$ screen -ls&lt;br /&gt;$ screen -r example&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Example #1: Enable screen logging&lt;br /&gt;&lt;br /&gt;The options '-L' instruct screen to create a log file that will capture all the commands output in the screen session.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text"&gt;$ screen -S logexample -L&lt;br /&gt;&lt;br /&gt;# inside the screen session&lt;br /&gt;$ echo 'some output'&lt;br /&gt;&lt;br /&gt;# to leave the screen session type: CONTROL-a d&lt;br /&gt;&lt;br /&gt;# this is the default log file for screen&lt;br /&gt;$ ls -la screenlog.0&lt;br /&gt;&lt;br /&gt;$ cat screenlog.0&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-1840963533469245263?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/1840963533469245263/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2011/05/howto-capture-and-record-console-screen.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/1840963533469245263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/1840963533469245263'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2011/05/howto-capture-and-record-console-screen.html' title='Howto capture and record the console screen output to a file on disk'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-5758654196735192195</id><published>2011-05-01T14:04:00.003+01:00</published><updated>2011-05-01T14:07:00.660+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='programing'/><category scheme='http://www.blogger.com/atom/ns#' term='troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='gdb'/><category scheme='http://www.blogger.com/atom/ns#' term='debugging'/><title type='text'>Automatic debugging session of a programs in C and the gdb analyse of its core dumps</title><content type='html'>In our example we are going to concentrate on this little program &lt;a href="#program"&gt; bad_program &lt;/a&gt; to demonstrate our semi automated debug approach.&lt;br /&gt;&lt;br /&gt;For debugging purposes we should first compile the program with debugging symbols. The possible ways are listed bellow and should be taken only as simple examples how to do this. More about this in [1].&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text; highlight: [1,4];"&gt;# no debugging at all&lt;br /&gt; (0) $ gcc bad_program.c -o bad_program&lt;br /&gt;&lt;br /&gt;# with debugging symbols  &lt;br /&gt; (1) $ gcc -g3     bad_program.c -o bad_program1&lt;br /&gt; (2) $ gcc -g      bad_program.c -rdynamic -o bad_program2&lt;br /&gt; (3) $ gcc -g  -O0 bad_program.c -rdynamic -o bad_program3&lt;br /&gt; (4) $ gcc -g3 -Os bad_program.c -o bad_program4&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The test has been run on a following system.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text; highlight: [1,8];"&gt;$ gcc -v&lt;br /&gt;Using built-in specs.&lt;br /&gt;Target: i486-linux-gnu&lt;br /&gt;Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu&lt;br /&gt;Thread model: posix&lt;br /&gt;gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) &lt;br /&gt;&lt;br /&gt;$ gdb -v&lt;br /&gt;GNU gdb (GDB) 7.1-ubuntu&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The example program itself is written in such a way that it crushes and generates core dump each time when started.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Example 1&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text ; highlight: [1];"&gt;$ ./bad_program 1&lt;br /&gt;Segmentation fault&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To get the core dump file written on a disk that can be later analysed in gnu debugger (gdb) we need to first allow core dumps. &lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text; highlight: [2];"&gt;$ ulimit -a&lt;br /&gt;core file size          (blocks, -c) 0&lt;br /&gt;data seg size           (kbytes, -d) unlimited&lt;br /&gt;scheduling priority             (-e) 20&lt;br /&gt;file size               (blocks, -f) unlimited&lt;br /&gt;pending signals                 (-i) 16382&lt;br /&gt;max locked memory       (kbytes, -l) 64&lt;br /&gt;max memory size         (kbytes, -m) unlimited&lt;br /&gt;open files                      (-n) 1024&lt;br /&gt;pipe size            (512 bytes, -p) 8&lt;br /&gt;POSIX message queues     (bytes, -q) 819200&lt;br /&gt;real-time priority              (-r) 0&lt;br /&gt;stack size              (kbytes, -s) 8192&lt;br /&gt;cpu time               (seconds, -t) unlimited&lt;br /&gt;max user processes              (-u) unlimited&lt;br /&gt;virtual memory          (kbytes, -v) unlimited&lt;br /&gt;file locks                      (-x) unlimited&lt;br /&gt;&lt;br /&gt;$ ulimit -c unlimited &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;When we run the program again it will create the core file for later analyse.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Example 2&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text"&gt;$ ./bad_program 1&lt;br /&gt;Segmentation fault (core dumped)&lt;br /&gt;&lt;br /&gt;$ ls -la core &lt;br /&gt;-rw------- 1 radoslaw radoslaw 151552 2011-04-24 19:50 core&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In our example we only want to run the gdb 'where' command, but if needed the file my_session.gdb.cmds bellow can be extended for any number of commands we may be interested in. More about the useful gdb debugging commands can be found in [2].&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text"&gt;$ cat my_session.gdb.cmds &lt;br /&gt;where&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Our test session can look like: &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Debugging session #1&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text; highlight: [1,2];"&gt;$ export BAD_PROGRAM=bad_program&lt;br /&gt;$ for i in $(seq 1 4); do rm -f core; echo;  echo " ---- ---- ---- [$i] starting the program ---- ---- ----"; ./$BAD_PROGRAM $i ; echo " ---- ---- ---- [$i] starting gdb ---- ---- ----"; gdb -batch -x my_session.gdb.cmds -n $BAD_PROGRAM core ; done | tee ${BAD_PROGRAM}.log&lt;br /&gt;&lt;br /&gt; ---- ---- ---- [1] starting the program ---- ---- ----&lt;br /&gt; ---- ---- ---- [1] starting gdb ---- ---- ----&lt;br /&gt;&lt;br /&gt;warning: Can't read pathname for load map: Input/output error.[New Thread 16934]&lt;br /&gt;&lt;br /&gt;1051 ../sysdeps/i386/i686/multiarch/memcpy-ssse3.S: No such file or directory.&lt;br /&gt;Core was generated by `./bad_program 1'.&lt;br /&gt;Program terminated with signal 11, Segmentation fault.&lt;br /&gt;#0  __memcpy_ssse3 () at ../sysdeps/i386/i686/multiarch/memcpy-ssse3.S:1051&lt;br /&gt; in ../sysdeps/i386/i686/multiarch/memcpy-ssse3.S&lt;br /&gt;#0  __memcpy_ssse3 () at ../sysdeps/i386/i686/multiarch/memcpy-ssse3.S:1051&lt;br /&gt;#1  0x00e9073c in ?? () from /lib/ld-linux.so.2&lt;br /&gt;#2  0x0804844d in generate_core ()&lt;br /&gt;#3  0x08048566 in main ()&lt;br /&gt;&lt;br /&gt; ---- ---- ---- [2] starting the program ---- ---- ----&lt;br /&gt; ---- ---- ---- [2] starting gdb ---- ---- ----&lt;br /&gt;[New Thread 16938]&lt;br /&gt;&lt;br /&gt;warning: Can't read pathname for load map: Input/output error.&lt;br /&gt;Core was generated by `./bad_program 2'.&lt;br /&gt;Program terminated with signal 11, Segmentation fault.&lt;br /&gt;#0  0x0804852b in try_core2 ()&lt;br /&gt;#0  0x0804852b in try_core2 ()&lt;br /&gt;#1  0x0804848e in generate_core ()&lt;br /&gt;#2  0x08048566 in main ()&lt;br /&gt;&lt;br /&gt; ---- ---- ---- [3] starting the program ---- ---- ----&lt;br /&gt; ---- ---- ---- [3] starting gdb ---- ---- ----&lt;br /&gt;&lt;br /&gt;warning: [New Thread 16942]&lt;br /&gt;Can't read pathname for load map: Input/output error.&lt;br /&gt;Core was generated by `./bad_program 3'.&lt;br /&gt;Program terminated with signal 11, Segmentation fault.&lt;br /&gt;#0  0x08048541 in try_core3 ()&lt;br /&gt;#0  0x08048541 in try_core3 ()&lt;br /&gt;#1  0x080484cf in generate_core ()&lt;br /&gt;#2  0x08048566 in main ()&lt;br /&gt;&lt;br /&gt; ---- ---- ---- [4] starting the program ---- ---- ----&lt;br /&gt; ---- ---- ---- [4] starting gdb ---- ---- ----&lt;br /&gt;[New Thread 16946]&lt;br /&gt;&lt;br /&gt;warning: Can't read pathname for load map: Input/output error.&lt;br /&gt;Core was generated by `./bad_program 4'.&lt;br /&gt;Program terminated with signal 11, Segmentation fault.&lt;br /&gt;#0  0x08048541 in try_core3 ()&lt;br /&gt;#0  0x08048541 in try_core3 ()&lt;br /&gt;#1  0x080484cf in generate_core ()&lt;br /&gt;#2  0x080484eb in generate_core ()&lt;br /&gt;#3  0x08048566 in main ()&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;We can still see enough to say where the problem happened more or less but we get much better results when a program is run with debugging symbols. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Debugging session #2&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text; highlight: [1,2, 16,27,40,53];"&gt;$ export BAD_PROGRAM=bad_program1&lt;br /&gt;$ for i in $(seq 1 4); do rm -f core; echo;  echo " ---- ---- ---- [$i] starting the program ---- ---- ----"; ./$BAD_PROGRAM $i ; echo " ---- ---- ---- [$i] starting gdb ---- ---- ----"; gdb -batch -x my_session.gdb.cmds -n $BAD_PROGRAM core ; done | tee ${BAD_PROGRAM}.log&lt;br /&gt;&lt;br /&gt; ---- ---- ---- [1] starting the program ---- ---- ----&lt;br /&gt; ---- ---- ---- [1] starting gdb ---- ---- ----&lt;br /&gt;&lt;br /&gt;warning: [New Thread 17974]&lt;br /&gt;Can't read pathname for load map: Input/output error.&lt;br /&gt;1051 ../sysdeps/i386/i686/multiarch/memcpy-ssse3.S: No such file or directory.&lt;br /&gt;Core was generated by `./bad_program1 1'.&lt;br /&gt;Program terminated with signal 11, Segmentation fault.&lt;br /&gt;#0  __memcpy_ssse3 () at ../sysdeps/i386/i686/multiarch/memcpy-ssse3.S:1051&lt;br /&gt; in ../sysdeps/i386/i686/multiarch/memcpy-ssse3.S&lt;br /&gt;#0  __memcpy_ssse3 () at ../sysdeps/i386/i686/multiarch/memcpy-ssse3.S:1051&lt;br /&gt;#1  0x00f6973c in ?? () from /lib/ld-linux.so.2&lt;br /&gt;#2  0x0804844d in generate_core (n=1) at bad_program.c:15&lt;br /&gt;#3  0x08048566 in main (argc=2, argv=0xbfb572a4) at bad_program.c:52&lt;br /&gt;&lt;br /&gt; ---- ---- ---- [2] starting the program ---- ---- ----&lt;br /&gt; ---- ---- ---- [2] starting gdb ---- ---- ----&lt;br /&gt;&lt;br /&gt;warning: [New Thread 17978]&lt;br /&gt;Can't read pathname for load map: Input/output error.&lt;br /&gt;Core was generated by `./bad_program1 2'.&lt;br /&gt;Program terminated with signal 11, Segmentation fault.&lt;br /&gt;#0  0x0804852b in try_core2 (n=2) at bad_program.c:41&lt;br /&gt;41   *ptr=n;&lt;br /&gt;#0  0x0804852b in try_core2 (n=2) at bad_program.c:41&lt;br /&gt;#1  0x0804848e in generate_core (n=2) at bad_program.c:20&lt;br /&gt;#2  0x08048566 in main (argc=2, argv=0xbff99024) at bad_program.c:52&lt;br /&gt;&lt;br /&gt; ---- ---- ---- [3] starting the program ---- ---- ----&lt;br /&gt; ---- ---- ---- [3] starting gdb ---- ---- ----&lt;br /&gt;[New Thread 17982]&lt;br /&gt;&lt;br /&gt;warning: Can't read pathname for load map: Input/output error.&lt;br /&gt;Core was generated by `./bad_program1 3'.&lt;br /&gt;Program terminated with signal 11, Segmentation fault.&lt;br /&gt;#0  0x08048541 in try_core3 (n=3) at bad_program.c:47&lt;br /&gt;47   *(ptr+n)=n; &lt;br /&gt;#0  0x08048541 in try_core3 (n=3) at bad_program.c:47&lt;br /&gt;#1  0x080484cf in generate_core (n=3) at bad_program.c:25&lt;br /&gt;#2  0x08048566 in main (argc=2, argv=0xbf92fdd4) at bad_program.c:52&lt;br /&gt;&lt;br /&gt; ---- ---- ---- [4] starting the program ---- ---- ----&lt;br /&gt; ---- ---- ---- [4] starting gdb ---- ---- ----&lt;br /&gt;[New Thread 17986]&lt;br /&gt;&lt;br /&gt;warning: Can't read pathname for load map: Input/output error.&lt;br /&gt;Core was generated by `./bad_program1 4'.&lt;br /&gt;Program terminated with signal 11, Segmentation fault.&lt;br /&gt;#0  0x08048541 in try_core3 (n=3) at bad_program.c:47&lt;br /&gt;47   *(ptr+n)=n; &lt;br /&gt;#0  0x08048541 in try_core3 (n=3) at bad_program.c:47&lt;br /&gt;#1  0x080484cf in generate_core (n=3) at bad_program.c:25&lt;br /&gt;#2  0x080484eb in generate_core (n=4) at bad_program.c:29&lt;br /&gt;#3  0x08048566 in main (argc=2, argv=0xbfdd2994) at bad_program.c:52&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;We can see in lines # 16, 27, 40, 53 the instructions that caused the core dump. We see as well the full arguments in functions what helps to better understand the program logic flow. One thing more as well to notice is the difference in debugging output when analysing the core from: &lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text;"&gt;./bad_program  1   # no debugging symbols; versus&lt;br /&gt;./bad_program1 1   # with debugging symbols&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;From the debugging session #1 we can hardly guess where the problem was, where in debugging session #2 we clearly see that the problem started with line 'bad_program.c:15'.&lt;br /&gt;&lt;br /&gt;Example program&lt;br /&gt;&lt;br /&gt;The "bad" example program that cores every time when run is bellow. More info about this in [3].&lt;br /&gt;&lt;br /&gt;&lt;a name="program"&gt; Source code of the bad_program.c&amp;nbsp;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:c"&gt;#include &lt;stdio.h&gt;&lt;br /&gt;#include &lt;stdlib.h&gt;&lt;br /&gt;#include &lt;execinfo.h&gt;&lt;br /&gt;#include &lt;signal.h&gt;&lt;br /&gt;#include &lt;string.h&gt;&lt;br /&gt;&lt;br /&gt;void try_core1(int n);&lt;br /&gt;void try_core2(int n);&lt;br /&gt;void try_core3(int n);&lt;br /&gt;void generate_core(int n);&lt;br /&gt;&lt;br /&gt;void generate_core( int n ) {&lt;br /&gt;  if ( 1 == (n%10) ) { &lt;br /&gt;    try_core1(n);&lt;br /&gt;    generate_core(n-1);&lt;br /&gt;  } &lt;br /&gt;  &lt;br /&gt;  if ( 2 == (n%10) ) { &lt;br /&gt;    try_core2(n);&lt;br /&gt;    generate_core(n-1);&lt;br /&gt;  } &lt;br /&gt;  &lt;br /&gt;  if ( 3 == (n%10) ) { &lt;br /&gt;    try_core3(n);&lt;br /&gt;    generate_core(n-1);&lt;br /&gt;  } &lt;br /&gt;  &lt;br /&gt;  generate_core(n-1);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void try_core1( int n ) {&lt;br /&gt;  char *ptr=NULL;&lt;br /&gt;  &lt;br /&gt;  strcpy(ptr, "this is going to hurt ;)...");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void try_core2( int n ) {&lt;br /&gt;  int *ptr=NULL;&lt;br /&gt;  &lt;br /&gt;  *ptr=n;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void try_core3( int n ) {&lt;br /&gt;  int *ptr;&lt;br /&gt;  &lt;br /&gt;  *(ptr+n)=n; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int main(int argc, char **argv) {&lt;br /&gt;  generate_core( atoi( argv[1] ) );&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/string.h&gt;&lt;/signal.h&gt;&lt;/execinfo.h&gt;&lt;/stdlib.h&gt;&lt;/stdio.h&gt;&lt;/pre&gt;&lt;b&gt;References: &lt;/b&gt;&lt;br /&gt;[1]&lt;br /&gt;&lt;a href="http://www.cyberciti.biz/tips/linux-core-dumps.html"&gt;  HowTo: Debug Crashed Linux Application Core Files Like A Pro &lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.delorie.com/gnu/docs/gdb/gdb_17.html"&gt; Debugging with GDB &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;[2] &lt;br /&gt;&lt;a href="http://www.ibm.com/developerworks/linux/library/l-debug/"&gt; Mastering Linux debugging techniques &lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ibm.com/developerworks/library/l-gdb/"&gt; Linux software debugging with GDB &lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.gnu.org/software/gdb/"&gt; GDB: The GNU Project Debugger &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;[3]&lt;br /&gt;&lt;a href="http://stackoverflow.com/questions/979141/how-to-programatically-cause-a-core-dump-in-c-c"&gt; How to programatically cause a core dump in C/C++ &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-5758654196735192195?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/5758654196735192195/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2011/05/automatic-debugging-session-of-programs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/5758654196735192195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/5758654196735192195'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2011/05/automatic-debugging-session-of-programs.html' title='Automatic debugging session of a programs in C and the gdb analyse of its core dumps'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-8174254202652971000</id><published>2011-04-24T18:02:00.000+01:00</published><updated>2011-04-24T18:02:17.445+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows7'/><category scheme='http://www.blogger.com/atom/ns#' term='64bit'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='instalation'/><title type='text'>How to create a bootable USB thumb drive for Windows 7 64bit using Windows XP 32bit machine.</title><content type='html'>Problem:&lt;br /&gt;We have the ISO of the Windows 7 64bit and want to install it using the USB Thumb drive installation method.&lt;br /&gt;We have access only to our old Windows XP 32bit OS.&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt;Use the standard MS tool to format the USB Thumb drive [1].&lt;br /&gt;It will failed at the 100% with an error message saying:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;Status: Files copied successfully. However, we were unable to run bootsect to make the USB device&lt;br /&gt;bootable. If you need assistance with bootsect ....#truncated#&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Download and install the EasyBCD for your WinXP 32bit [2].&lt;br /&gt;The installation will copy the bootsect.exe tool that can be used on winXP.&lt;br /&gt;&lt;br /&gt;Run the bootsect.exe to make the USB Thumb drive bootable. The 'E:' is the driver letter assign by your XP!&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text; highlight: [1];"&gt;C:\Program Files\NeoSmart Technologies\EasyBCD\bin&gt;bootsect.exe /nt60 E:&lt;br /&gt;Target volumes will be updated with BOOTMGR compatible bootcode.&lt;br /&gt;&lt;br /&gt;E: (\\?\Volume{ba063d8e-7111-11e0-b640-aafb6b9edf9e})&lt;br /&gt;&lt;br /&gt;    Successfully updated NTFS filesystem bootcode.&lt;br /&gt;&lt;br /&gt;Bootcode was successfully updated on all targeted volumes.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;As last, unmount the USB, reboot the system, change the BIOS and start the installation.&lt;br /&gt;&lt;br /&gt;&lt;a name="ref"&gt; References: &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.intowindows.com/how-to-create-bootable-windows-7-usb-to-install-windows-7-from-usb-flash-drive-using-windows-7-dvdusb-tool/"&gt; [1] Windows 7 USB/DVD Download Tool &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://neosmart.net/dl.php?id=1"&gt; [2] EasyBCD &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;For troubleshooting purposes:&lt;br /&gt;&lt;a href="http://maketecheasier.com/boot-and-install-windows-7-from-usb-flash-drive/2009/01/23"&gt; How To Boot And Install Windows 7 From USB Flash Drive &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-8174254202652971000?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/8174254202652971000/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2011/04/how-to-create-bootable-usb-thumb-drive.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/8174254202652971000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/8174254202652971000'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2011/04/how-to-create-bootable-usb-thumb-drive.html' title='How to create a bootable USB thumb drive for Windows 7 64bit using Windows XP 32bit machine.'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-9029776649986191467</id><published>2011-04-24T16:24:00.048+01:00</published><updated>2011-05-02T13:28:15.966+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='partition'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='backup'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='clone'/><category scheme='http://www.blogger.com/atom/ns#' term='rescue'/><title type='text'>How to clone a partition to a remote NFS server</title><content type='html'>&lt;b&gt;Problem description.&lt;/b&gt;&lt;br /&gt;You formatted and re-partitioned your hard drive.&lt;br /&gt;You have a partition of the size about 100GB that you dedicated to your OS.&lt;br /&gt;The installation of your OS went fine as well as the installation of all your necessary drivers.&lt;br /&gt;&lt;br /&gt;After all you would like to have a copy of your partition data that can quickly restore in a case something wrong happens.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution:&lt;/b&gt;&lt;br /&gt;Download the SystemRescueCd ISO img file &lt;a href="http://www.blogger.com/post-edit.g?blogID=1628743762748449041&amp;amp;postID=9029776649986191467#ref"&gt; [1] &lt;/a&gt;&lt;br /&gt;Create bootable USB thumb drive [2]&lt;br /&gt;Boot the system using your USB thumb drive. Once it is fully loaded you will get bash command line access. &lt;br /&gt;&lt;br /&gt;Mount your remote NFS site image repository:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text"&gt;# mkdir /tmp/nfs&lt;br /&gt;# mount -t nfs -o nolock 192.168.0.X:/your/path /tmp/nfs&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Copy and compress the partition while coping it out for backup purposes [3]. Copy the partition schema as well.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text"&gt;# For test purposes you can shortly run the partclone.dd with '-d' option&lt;br /&gt;# it will create a log file in /var/log directory.&lt;br /&gt;# But don't run it like that otherwise it will quickly fill your log partition&lt;br /&gt;&lt;br /&gt;# partclone.dd -c -d -s /dev/sda1 -o - | bzip2 -1 -c &amp;gt; /tmp/nfs/sda1.winXP.32bit.img&lt;br /&gt;&lt;br /&gt;# Once tested run without -d option&lt;br /&gt;#&lt;br /&gt;# partclone.dd -c -s /dev/sda1 -o - | bzip2 -1 -c &amp;gt; /tmp/nfs/sda1.winXP.32bit.img&lt;br /&gt;# parted -l &amp;gt; /tmp/nfs/log.parted.l.txt&lt;br /&gt;# parted -l -m &amp;gt; /tmp/nfs/log.parted.lm.txt&lt;br /&gt;#&lt;br /&gt;# to backup the partition table from the MBR sector (don't use it on GPT partitioned system)&lt;br /&gt;# sfdisk -d &amp;gt; /tmp/nfs/log.sfdisk.d.txt&lt;br /&gt;#&lt;br /&gt;# umount /tmp/nfs&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;At the end unmount the NFS partition and we are ready to reboot the system.&lt;br /&gt;&lt;br /&gt;Later on, as a security precaution create md5sums and some level of par2 recovery files if the image should have ever get corrupted.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text"&gt;# md5sum -b sda1.winXP.32bit.img &amp;gt; sda1.winXP.32bit.img.md5&lt;br /&gt;# par2create -r3 sda1.winXP.32bit.img&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=1628743762748449041&amp;amp;postID=9029776649986191467" name="ref"&gt; References: &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.sysresccd.org/Main_Page" name="1"&gt; [1] SystemRescueCd &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.sysresccd.org/Sysresccd-manual-en_How_to_install_SystemRescueCd_on_an_USB-stick"&gt; [2] Sysresccd-manual-en How to install SystemRescueCd on an USB-stick &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;[3] &lt;a href="http://partclone.org/usage.php?usage=dd"&gt; partclone.dd &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://manpages.ubuntu.com/manpages/lucid/man5/nfs.5.html"&gt; man 5 nfs &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://parchive.sourceforge.net/"&gt; par2 home page &lt;/a&gt;&lt;br /&gt;&lt;a href="http://manpages.ubuntu.com/manpages/lucid/man1/par2.1.html"&gt; man par2 &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-9029776649986191467?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/9029776649986191467/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2011/04/how-to-clone-partitoin-to-remote-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/9029776649986191467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/9029776649986191467'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2011/04/how-to-clone-partitoin-to-remote-server.html' title='How to clone a partition to a remote NFS server'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-6686530387714607856</id><published>2011-04-24T13:46:00.002+01:00</published><updated>2011-04-24T16:23:32.395+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='programing'/><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='scripting'/><category scheme='http://www.blogger.com/atom/ns#' term='less'/><title type='text'>Less tricks in linux on the bash command line</title><content type='html'>Some tricks that is worth to know when working on the linux bash cli that can save you a lot of time.&lt;br /&gt;&lt;br /&gt;1. To tell less to normal print the raw control character of your stream you can use the '-r' or '-R' options.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:html; highlight: [1,8];"&gt;$ ls -la --color | less -X &lt;br /&gt;total 3284&lt;br /&gt;drwxr-xr-x 90 radoslaw radoslaw   4096 2011-04-24 10:22 ESC[0mESC[01;34m.ESC[0m&lt;br /&gt;drwxr-xr-x  4 root     root       4096 2010-08-02 20:37 ESC[01;34m..ESC[0m&lt;br /&gt;drwx------  5 radoslaw radoslaw   4096 2011-01-31 12:18 ESC[01;34m.adobeESC[0m&lt;br /&gt;drwxr-xr-x  4 radoslaw radoslaw   4096 2009-11-07 20:53 ESC[01;34m.ankiESC[0m&lt;br /&gt;&lt;br /&gt;$ ls -la --color | less -X -r&lt;br /&gt;total 3284&lt;br /&gt;drwxr-xr-x 90 radoslaw radoslaw   4096 2011-04-24 10:22 .&lt;br /&gt;drwxr-xr-x  4 root     root       4096 2010-08-02 20:37 ..&lt;br /&gt;drwx------  5 radoslaw radoslaw   4096 2011-01-31 12:18 .adobe&lt;br /&gt;drwxr-xr-x  4 radoslaw radoslaw   4096 2009-11-07 20:53 .anki&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;2. To list only #n lines from the input with or without the raw characters being interpreted.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:html; highlight: [1,8];"&gt;$ ls -la --color | cat -t | head -10&lt;br /&gt;total 3284&lt;br /&gt;drwxr-xr-x 90 radoslaw radoslaw   4096 2011-04-24 10:22 ^[[0m^[[01;34m.^[[0m&lt;br /&gt;drwxr-xr-x  4 root     root       4096 2010-08-02 20:37 ^[[01;34m..^[[0m&lt;br /&gt;drwx------  5 radoslaw radoslaw   4096 2011-01-31 12:18 ^[[01;34m.adobe^[[0m&lt;br /&gt;drwxr-xr-x  4 radoslaw radoslaw   4096 2009-11-07 20:53 ^[[01;34m.anki^[[0m&lt;br /&gt;&lt;br /&gt;$ ls -la --color | head -10&lt;br /&gt;total 3284&lt;br /&gt;drwxr-xr-x 90 radoslaw radoslaw   4096 2011-04-24 10:22 .&lt;br /&gt;drwxr-xr-x  4 root     root       4096 2010-08-02 20:37 ..&lt;br /&gt;drwx------  5 radoslaw radoslaw   4096 2011-01-31 12:18 .adobe&lt;br /&gt;drwxr-xr-x  4 radoslaw radoslaw   4096 2009-11-07 20:53 .anki&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;3. To list files with line numbers.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:html; highlight: [1,7,14];"&gt;$ less -N -X /etc/init.d/networking &lt;br /&gt;      1 #!/bin/sh -e&lt;br /&gt;      2 ### BEGIN INIT INFO&lt;br /&gt;      3 # Provides:          networking&lt;br /&gt;      4 # Required-Start:    &lt;br /&gt;&lt;br /&gt;$ ls -la --color | cat -n -t | head -5&lt;br /&gt;     1 total 3284&lt;br /&gt;     2 drwxr-xr-x 90 radoslaw radoslaw   4096 2011-04-24 10:22 ^[[0m^[[01;34m.^[[0m&lt;br /&gt;     3 drwxr-xr-x  4 root     root       4096 2010-08-02 20:37 ^[[01;34m..^[[0m&lt;br /&gt;     4 drwx------  5 radoslaw radoslaw   4096 2011-01-31 12:18 ^[[01;34m.adobe^[[0m&lt;br /&gt;     5 drwxr-xr-x  4 radoslaw radoslaw   4096 2009-11-07 20:53 ^[[01;34m.anki^[[0m&lt;br /&gt;&lt;br /&gt;$ ls -la --color | cat -n | head -5&lt;br /&gt;     1 total 3284&lt;br /&gt;     2 drwxr-xr-x 90 radoslaw radoslaw   4096 2011-04-24 10:22 .&lt;br /&gt;     3 drwxr-xr-x  4 root     root       4096 2010-08-02 20:37 ..&lt;br /&gt;     4 drwx------  5 radoslaw radoslaw   4096 2011-01-31 12:18 .adobe&lt;br /&gt;     5 drwxr-xr-x  4 radoslaw radoslaw   4096 2009-11-07 20:53 .anki&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Reference:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://superuser.com/questions/171095/linux-console-output-pause-after-each-screen"&gt; less -R &lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.cyberciti.biz/faq/linux-unix-command-to-number-lines-of-files/"&gt;Shell Script To Number Lines Of Files &lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-6686530387714607856?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/6686530387714607856/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2011/04/less-tricks-in-linux-on-bash-command.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/6686530387714607856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/6686530387714607856'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2011/04/less-tricks-in-linux-on-bash-command.html' title='Less tricks in linux on the bash command line'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-5209202345215277907</id><published>2011-04-11T23:38:00.000+01:00</published><updated>2011-04-11T23:38:23.622+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='strace'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><title type='text'>What does my bash ulimit function use to set/report the limitation of resources</title><content type='html'>Everyone knows the output from the 'ulimit' bash, builtin function. But what functionality actually this function uses to mange all of this. &lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text; highlight: [1];"&gt;$ ulimit -a&lt;br /&gt;core file size          (blocks, -c) 0&lt;br /&gt;data seg size           (kbytes, -d) unlimited&lt;br /&gt;scheduling priority             (-e) 20&lt;br /&gt;file size               (blocks, -f) unlimited&lt;br /&gt;pending signals                 (-i) 16382&lt;br /&gt;max locked memory       (kbytes, -l) 64&lt;br /&gt;max memory size         (kbytes, -m) unlimited&lt;br /&gt;open files                      (-n) 1024&lt;br /&gt;pipe size            (512 bytes, -p) 8&lt;br /&gt;POSIX message queues     (bytes, -q) 819200&lt;br /&gt;real-time priority              (-r) 0&lt;br /&gt;stack size              (kbytes, -s) 8192&lt;br /&gt;cpu time               (seconds, -t) unlimited&lt;br /&gt;max user processes              (-u) unlimited&lt;br /&gt;virtual memory          (kbytes, -v) unlimited&lt;br /&gt;file locks                      (-x) unlimited&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Let's find out if the 'strace' program come in handy for this job.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text; highlight: [2,5,6];"&gt;# let's create auxilary file we will use later&lt;br /&gt;$ cat mylimits.sh&lt;br /&gt;ulimit -a&lt;br /&gt;&lt;br /&gt;$ strace bash mylimits.sh 1&amp;gt;/dev/null 2&amp;gt;/tmp/strace.out&lt;br /&gt;$ tail -20 /tmp/strace.out &lt;br /&gt;getrlimit(RLIMIT_NOFILE, {rlim_cur=1024, rlim_max=1024}) = 0&lt;br /&gt;write(1, "open files                      "..., 42) = 42&lt;br /&gt;write(1, "pipe size            (512 bytes,"..., 39) = 39&lt;br /&gt;getrlimit(RLIMIT_MSGQUEUE, {rlim_cur=800*1024, rlim_max=800*1024}) = 0&lt;br /&gt;write(1, "POSIX message queues     (bytes,"..., 44) = 44&lt;br /&gt;getrlimit(RLIMIT_RTPRIO, {rlim_cur=0, rlim_max=0}) = 0&lt;br /&gt;write(1, "real-time priority              "..., 39) = 39&lt;br /&gt;getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0&lt;br /&gt;write(1, "stack size              (kbytes,"..., 42) = 42&lt;br /&gt;getrlimit(RLIMIT_CPU, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0&lt;br /&gt;write(1, "cpu time               (seconds,"..., 47) = 47&lt;br /&gt;getrlimit(RLIMIT_NPROC, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0&lt;br /&gt;write(1, "max user processes              "..., 47) = 47&lt;br /&gt;getrlimit(RLIMIT_AS, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0&lt;br /&gt;write(1, "virtual memory          (kbytes,"..., 47) = 47&lt;br /&gt;getrlimit(RLIMIT_LOCKS, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0&lt;br /&gt;write(1, "file locks                      "..., 47) = 47&lt;br /&gt;rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0&lt;br /&gt;read(255, "", 10)                       = 0&lt;br /&gt;exit_group(0)                           = ?&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So as we can see the limitations are managed by the 'getrlimit' function and enforced on the kernel level.&lt;br /&gt;&lt;br /&gt;For more info about this take a look at &lt;a href="http://manpages.ubuntu.com/manpages/lucid/man2/setrlimit.2.html"&gt;man 2 setrlimit &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;For these who are not afraid of glibc library a quick look at they wrappers may help as well: &lt;a href="http://www.gnu.org/s/hello/manual/libc/Resource-Usage-And-Limitation.html#Resource-Usage-And-Limitation"&gt;glibc  "Resource Usage And Limitation" &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;An obsolete kernel function &lt;a href="http://manpages.ubuntu.com/manpages/lucid/man3/ulimit.3.html"&gt; man 3 ulimit &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-5209202345215277907?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/5209202345215277907/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2011/04/what-does-my-bash-ulimit-function-use.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/5209202345215277907'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/5209202345215277907'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2011/04/what-does-my-bash-ulimit-function-use.html' title='What does my bash ulimit function use to set/report the limitation of resources'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-2365979259443689972</id><published>2011-04-10T22:13:00.000+01:00</published><updated>2011-04-10T22:13:18.640+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='programing'/><category scheme='http://www.blogger.com/atom/ns#' term='troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='netadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='network'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='tshark'/><title type='text'>How to filter and dump in clear text http requests and responses from the network dump using the cli program tshark</title><content type='html'>There are many programs that allow us to save network traffic into a file for later analyze. Once you have the file(s) we could like to quickly investigate the data inside and verify what we sent and what we revived.   &lt;br /&gt;&lt;br /&gt;If we are interested, let's say only in the HTTP traffic than the command line 'tshark' has only limited capabilities in a way to present us the data for review and investigation.&lt;br /&gt;&lt;br /&gt;We can still play with the various options: '-Tfields' and multiple '-e' but still don't get the complete headers output.&lt;br /&gt;&lt;br /&gt;The complete list that can be used with '-e' can be found &lt;a href="http://www.wireshark.org/docs/dfref/h/http.html"&gt; here &lt;/a&gt;.&lt;br /&gt;Alternatively we can experiment with the '-Tpdml' that will create alike XML file. But even with all this flexibility we still can't print a custom name header like in this curl request bellow:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:bash;"&gt;curl -H "Rado: my_value" -v -o /tmp/page.html http://rtomaszewski.blogspot.com/2011/04/tshark-in-network-troubleshooting.html&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To solve this little problem we have created a small program written in python. It takes the output from 'tshark -S -V' and parses it to present the data in a way we want.&lt;br /&gt;&lt;br /&gt;Example how to use it:&lt;br /&gt;&lt;pre class="brush:bash;"&gt;# tshark -r /tmp/net.pcap -R http -V | parse.py -d&lt;br /&gt;# tshark -r /tmp/net.pcap -R http -V | parse.py &lt;br /&gt;# tshark -nn -s0 -i any -w /tmp/net.pcap  -f tcp -R http -l -S -V | parse.py&lt;br /&gt;# tshark -nn -s0 -i any -w /tmp/net.pcap  -f tcp -R http -l -S -V | parse.py -d&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;An example output from the 'parse.py' when running on the command line:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text; highlight: [1,9];"&gt;$ curl -H "Rado: my_value" -v -o /tmp/page.html http://rtomaszewski.blogspot.com/2011/04/tshark-in-network-troubleshooting.html &lt;br /&gt;* About to connect() to rtomaszewski.blogspot.com port 80 (#0)&lt;br /&gt;*   Trying 209.85.229.132... connected&lt;br /&gt;* Connected to rtomaszewski.blogspot.com (209.85.229.132) port 80 (#0)&lt;br /&gt;&amp;gt; GET /2011/04/tshark-in-network-troubleshooting.html HTTP/1.1&lt;br /&gt;&amp;gt; User-Agent: curl/7.19.7 (i486-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15&lt;br /&gt;&amp;gt; Host: rtomaszewski.blogspot.com&lt;br /&gt;&amp;gt; Accept: */*&lt;br /&gt;&amp;gt; Rado: my_value&lt;br /&gt;&amp;gt; &lt;br /&gt;  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current&lt;br /&gt;                                 Dload  Upload   Total   Spent    Left  Speed&lt;br /&gt;  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0&amp;lt; HTTP/1.1 200 OK&lt;br /&gt;&amp;lt; Content-Type: text/html; charset=UTF-8&lt;br /&gt;&amp;lt; ETag: "b6d5837e-31bb-4473-95af-da3c1d466295"&lt;br /&gt;&amp;lt; X-Content-Type-Options: nosniff&lt;br /&gt;&amp;lt; X-XSS-Protection: 1; mode=block&lt;br /&gt;&amp;lt; Server: GSE&lt;br /&gt;&amp;lt; Age: 1202&lt;br /&gt;&amp;lt; Date: Sun, 10 Apr 2011 19:14:00 GMT&lt;br /&gt;&amp;lt; Expires: Sun, 10 Apr 2011 19:14:00 GMT&lt;br /&gt;&amp;lt; Last-Modified: Sun, 10 Apr 2011 19:03:05 GMT&lt;br /&gt;&amp;lt; Cache-Control: public, must-revalidate, proxy-revalidate, max-age=0&lt;br /&gt;&amp;lt; Transfer-Encoding: chunked&lt;br /&gt;&amp;lt; &lt;br /&gt;{ [data not shown]&lt;br /&gt;100 49993    0 49993    0     0  28925      0 --:--:--  0:00:01 --:--:-- 57529* Connection #0 to host rtomaszewski.blogspot.com left intact&lt;br /&gt;&lt;br /&gt;* Closing connection #0&lt;br /&gt;&lt;/pre&gt;&lt;pre class="brush:text; highlight: [1,11];"&gt;# tshark -nn -s0 -i wlan0 -w /tmp/net.pcap -R http -f tcp -S -V | ./parse.py  &lt;br /&gt;Running as user "root" and group "root". This could be dangerous.&lt;br /&gt;Capturing on wlan0&lt;br /&gt;Internet Protocol, Src: 192.168.43.111 (192.168.43.111), Dst: 209.85.229.132 (209.85.229.132)&lt;br /&gt;Transmission Control Protocol, Src Port: 38391 (38391), Dst Port: 80 (80), Seq: 1, Ack: 1, Len: 226&lt;br /&gt;    [Stream index: 1]&lt;br /&gt;    GET /2011/04/tshark-in-network-troubleshooting.html HTTP/1.1\r\n&lt;br /&gt;    User-Agent: curl/7.19.7 (i486-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15\r\n&lt;br /&gt;    Host: rtomaszewski.blogspot.com\r\n&lt;br /&gt;    Accept: */*\r\n&lt;br /&gt;    Rado: my_value\r\n&lt;br /&gt;&lt;br /&gt;Internet Protocol, Src: 209.85.229.132 (209.85.229.132), Dst: 192.168.43.111 (192.168.43.111)&lt;br /&gt;Transmission Control Protocol, Src Port: 80 (80), Dst Port: 38391 (38391), Seq: 49070, Ack: 227, Len: 1375&lt;br /&gt;    [Stream index: 1]&lt;br /&gt;    HTTP/1.1 200 OK\r\n&lt;br /&gt;    Content-Type: text/html; charset=UTF-8\r\n&lt;br /&gt;    ETag: "b6d5837e-31bb-4473-95af-da3c1d466295"\r\n&lt;br /&gt;    X-Content-Type-Options: nosniff\r\n&lt;br /&gt;    X-XSS-Protection: 1; mode=block\r\n&lt;br /&gt;    Server: GSE\r\n&lt;br /&gt;    Age: 1202\r\n&lt;br /&gt;    Date: Sun, 10 Apr 2011 19:14:00 GMT\r\n&lt;br /&gt;    Expires: Sun, 10 Apr 2011 19:14:00 GMT\r\n&lt;br /&gt;    Last-Modified: Sun, 10 Apr 2011 19:03:05 GMT\r\n&lt;br /&gt;    Cache-Control: public, must-revalidate, proxy-revalidate, max-age=0\r\n&lt;br /&gt;    Transfer-Encoding: chunked\r\n&lt;br /&gt;&lt;br /&gt;2 packets captured&lt;br /&gt;&lt;/pre&gt;The program can be downloaded form here:  &lt;a href="https://docs.google.com/leaf?id=0B7ftIvGKDqYMZTRiZGZhOWUtNWVhYS00YTA5LTlmYzItM2IwYzA4ZmQ5YWEx&amp;amp;sort=name&amp;amp;layout=list&amp;amp;num=50"&gt; parse.py &lt;/a&gt;  Additionally the source code of this short tool can be seen here:  &lt;br /&gt;&lt;pre class="brush:python; highlight: [1];"&gt;#!/usr/bin/python &lt;br /&gt;#&lt;br /&gt;## tested on python 2.6.5&lt;br /&gt;#&lt;br /&gt;# author : radoslaw tomaszewski&lt;br /&gt;&lt;br /&gt;import sys&lt;br /&gt;import re&lt;br /&gt;import inspect&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;class ParseTsharkOut:&lt;br /&gt;  no=0&lt;br /&gt;  debugYes=0 &lt;br /&gt;    &lt;br /&gt;  ipRe=None&lt;br /&gt;  tcpRe=None&lt;br /&gt;  protRe=None&lt;br /&gt;  &lt;br /&gt;  ipInfo=[]&lt;br /&gt;  tcpInfo=[]&lt;br /&gt;  protInfo=[]&lt;br /&gt;  &lt;br /&gt;  auxStart=0&lt;br /&gt;  tcpAuxStart=0&lt;br /&gt;&lt;br /&gt;  protAux=1&lt;br /&gt;  &lt;br /&gt;  def __init__(self):&lt;br /&gt;    self.ipRe="Internet Protocol,(.*)$"&lt;br /&gt;    self.tcpRe=["Transmission Control Protocol,(.*)$", "    (\[Stream index:.*)$"]&lt;br /&gt;    self.protRe=["Hypertext Transfer Protocol", "    ([^\[ ].*)$", "^$| *(\\\\r|\\\\n)"]&lt;br /&gt;    &lt;br /&gt;  def debug(self, s):&lt;br /&gt;    if self.debugYes : &lt;br /&gt;      parent=inspect.stack()[1][3]&lt;br /&gt;      #parent=inspect.stack()&lt;br /&gt;      print("debug:[" + str(parent) + "] " +  s.rstrip())&lt;br /&gt;  &lt;br /&gt;  def usage(self):&lt;br /&gt;    print("todo")   &lt;br /&gt;  &lt;br /&gt;  def ipParse(self,s):&lt;br /&gt;    self.debug(s)&lt;br /&gt;&lt;br /&gt;    tmp=re.match(self.ipRe, s)&lt;br /&gt;#    tmp=re.match("..", s)&lt;br /&gt;    if tmp is None :&lt;br /&gt;       return 0&lt;br /&gt;    else:&lt;br /&gt;       self.ipInfo.append(tmp.group(0))&lt;br /&gt;       return 1&lt;br /&gt;       &lt;br /&gt;  def tcpParse(self,s):&lt;br /&gt;    self.debug(s)&lt;br /&gt;    ret=0&lt;br /&gt;&lt;br /&gt;    tmp=re.match(self.tcpRe[self.tcpAuxStart], s)&lt;br /&gt;    if tmp is None :&lt;br /&gt;       return 0&lt;br /&gt;    else:&lt;br /&gt;       self.tcpInfo.append(tmp.group(0))&lt;br /&gt;       &lt;br /&gt;       ret=self.tcpAuxStart&lt;br /&gt;       self.tcpAuxStart=(self.tcpAuxStart + 1 ) % 2&lt;br /&gt;       &lt;br /&gt;       return ret&lt;br /&gt;  &lt;br /&gt;  def protParse(self,s):&lt;br /&gt;    self.debug(s)&lt;br /&gt;&lt;br /&gt;    if ( self.protAux ) :&lt;br /&gt;       if re.match(self.protRe[0], s):&lt;br /&gt;         self.protAux=0&lt;br /&gt;         return 0&lt;br /&gt;         &lt;br /&gt;    else :&lt;br /&gt;       if re.match(self.protRe[2], s):&lt;br /&gt;         self.protAux=1&lt;br /&gt;         self.show()&lt;br /&gt;         return 1&lt;br /&gt;&lt;br /&gt;       tmp=re.match(self.protRe[1], s)&lt;br /&gt;       if tmp is None :&lt;br /&gt;         return 0&lt;br /&gt;       else:&lt;br /&gt;         self.protInfo.append(tmp.group(0))&lt;br /&gt;         return 0&lt;br /&gt;    &lt;br /&gt;  def parse(self, s):&lt;br /&gt;    funcs=[self.ipParse, self.tcpParse, self.protParse]&lt;br /&gt;    &lt;br /&gt;    if funcs[self.auxStart](s):&lt;br /&gt;      self.auxStart= ( self.auxStart + 1 ) % 3 &lt;br /&gt;  &lt;br /&gt;  def show(self):&lt;br /&gt;    self.debug("start")&lt;br /&gt;    &lt;br /&gt;    for i in self.ipInfo:&lt;br /&gt;      print(i)&lt;br /&gt;      &lt;br /&gt;    for i in self.tcpInfo:&lt;br /&gt;      print(i)&lt;br /&gt;&lt;br /&gt;    for i in self.protInfo:&lt;br /&gt;      print(i)  &lt;br /&gt;      &lt;br /&gt;    print("")&lt;br /&gt;      &lt;br /&gt;    self.ipInfo=[]&lt;br /&gt;    self.tcpInfo=[]&lt;br /&gt;    self.protInfo=[]      &lt;br /&gt;  &lt;br /&gt;  def main(self):&lt;br /&gt;    try:&lt;br /&gt;      if sys.argv[1] == '-d':&lt;br /&gt;        self.debugYes=1&lt;br /&gt;        self.debug("debuging is turn on")&lt;br /&gt;    except (IndexError):&lt;br /&gt;      None &lt;br /&gt;      &lt;br /&gt;    self.debug("main start")&lt;br /&gt;&lt;br /&gt;    for l in sys.stdin:&lt;br /&gt;      self.parse(l)  &lt;br /&gt;      &lt;br /&gt;    return 0  &lt;br /&gt;      &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;if __name__ == "__main__":&lt;br /&gt;        sys.exit(ParseTsharkOut().main())&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;aaa&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-2365979259443689972?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/2365979259443689972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2011/04/how-to-filter-and-dump-in-clear-text.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/2365979259443689972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/2365979259443689972'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2011/04/how-to-filter-and-dump-in-clear-text.html' title='How to filter and dump in clear text http requests and responses from the network dump using the cli program tshark'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-7305421930940215235</id><published>2011-04-10T20:00:00.000+01:00</published><updated>2011-04-10T20:00:05.908+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='network'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='tcpdump'/><category scheme='http://www.blogger.com/atom/ns#' term='wireshark'/><category scheme='http://www.blogger.com/atom/ns#' term='tshark'/><title type='text'>tshark in network troubleshooting</title><content type='html'>As described in another of my posts, there is not good and elegant way of printing on stdout and to a file the data captured on the wire when using 'tcpdump'. &lt;br /&gt;&lt;br /&gt;In help the 'tshark' that comes with the 'wireshark' packet sniffer comes handy to do the job in a simple and elegant way.&lt;br /&gt;&lt;br /&gt;To capture all network packets and to write them to a file you would use a syntax similar to this one:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text; highlight: [1];"&gt;# tshark -nn -i any -w /tmp/net.pcap&lt;br /&gt;Running as user "root" and group "root". This could be dangerous.&lt;br /&gt;Capturing on Pseudo-device that captures on all interfaces&lt;br /&gt;24&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If you don't like the packet counter constantly being updated when tshark runs use the '-q' options like that:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text; highlight: [1];"&gt;# tshark -nn -i any -w /tmp/net.pcap.pcap -q&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And finally when you want to observe the packet in live and in the same time have a raw copy of the network dump on your disk use the '-S' option like that:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text; highlight: [1];"&gt;# tshark -nn -i any -w /tmp/net.pcap.pcap -S&lt;br /&gt;Running as user "root" and group "root". This could be dangerous.&lt;br /&gt;Capturing on Pseudo-device that captures on all interfaces&lt;br /&gt;  0.000000    127.0.0.1 -&gt; 127.0.0.1    ICMP Echo (ping) request&lt;br /&gt;  0.028908    127.0.0.1 -&gt; 127.0.0.1    ICMP Echo (ping) request&lt;br /&gt;  0.297138 192.168.122.1 -&gt; 192.168.122.255 UDP Source port: 17500  Destination port: 17500&lt;br /&gt;  1.036921    127.0.0.1 -&gt; 127.0.0.1    ICMP Echo (ping) request&lt;br /&gt;  2.045086    127.0.0.1 -&gt; 127.0.0.1    ICMP Echo (ping) request&lt;br /&gt;5 packets captured&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;After all, when you  are done with the troubleshooting and need to convenience someone you can sent him the saved file /tmp/net.pcap for review.&lt;br /&gt;&lt;br /&gt;More info&lt;br /&gt;&lt;a href="http://manpages.ubuntu.com/manpages/lucid/man1/tshark.1.html#contenttoc4"&gt; man tshark &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-7305421930940215235?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/7305421930940215235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2011/04/tshark-in-network-troubleshooting.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/7305421930940215235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/7305421930940215235'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2011/04/tshark-in-network-troubleshooting.html' title='tshark in network troubleshooting'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-7389908341890335527</id><published>2011-04-05T00:46:00.000+01:00</published><updated>2011-04-05T00:46:10.367+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='os'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='apache'/><title type='text'>How to understand Apache MPM  processes during the starting phase</title><content type='html'>One of the great flexibility that comes with Apache HTTP server is its incredible modularity. But sometimes it take a little time and experimenting before you understand how your favourite MPM model works.&lt;br /&gt;&lt;br /&gt;So let's take a look how many processes there are going to be created when we start Apache after not customized installation? &lt;br /&gt;&lt;br /&gt;All descriptions and examples are based on the default configuration in the Ubuntu:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:bash"&gt;# cat /etc/lsb-release&lt;br /&gt;&lt;br /&gt;DISTRIB_ID=Ubuntu&lt;br /&gt;&lt;br /&gt;DISTRIB_RELEASE=10.04&lt;br /&gt;&lt;br /&gt;DISTRIB_CODENAME=lucid&lt;br /&gt;&lt;br /&gt;DISTRIB_DESCRIPTION="Ubuntu 10.04.1 LTS"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The installation itself is as simple as:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:bash"&gt;# aptitude install apache2&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;By default when you start Apache with its default config it will look like this:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:bash; highlight: [1];"&gt;# ps -AHl | egrep 'apach|httpd'&lt;br /&gt;1 S     0 25528     1  0  80   0 -  1348 poll_s ?        00:00:00   apache2&lt;br /&gt;5 S    33 25530 25528  0  80   0 -  1291 skb_re ?        00:00:00     apache2&lt;br /&gt;5 S    33 25532 25528  0  80   0 - 56702 pipe_w ?        00:00:00     apache2&lt;br /&gt;5 S    33 25533 25528  0  80   0 - 56702 pipe_w ?        00:00:00     apache2&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;A closer look at the configuration in /etc/apache2/apache2.conf reveals more then one section that could be in control of your http server. So which one is our? &lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text; highlight: [1,11];"&gt;# grep -B7 'IfModule mpm_prefork_module'  apache2.conf &lt;br /&gt;&lt;br /&gt;# prefork MPM&lt;br /&gt;# StartServers: number of server processes to start&lt;br /&gt;# MinSpareServers: minimum number of server processes which are kept spare&lt;br /&gt;# MaxSpareServers: maximum number of server processes which are kept spare&lt;br /&gt;# MaxClients: maximum number of server processes allowed to start&lt;br /&gt;# MaxRequestsPerChild: maximum number of requests a server process serves&lt;br /&gt;&lt;IfModule mpm_prefork_module&gt;&lt;br /&gt;&lt;br /&gt;# grep -A8 'IfModule mpm_'  apache2.conf &lt;br /&gt;&lt;IfModule mpm_prefork_module&gt;&lt;br /&gt;    StartServers          5&lt;br /&gt;    MinSpareServers       5&lt;br /&gt;    MaxSpareServers      10&lt;br /&gt;    MaxClients          150&lt;br /&gt;    MaxRequestsPerChild   0&lt;br /&gt;&lt;/IfModule&gt;&lt;br /&gt;&lt;br /&gt;# worker MPM&lt;br /&gt;--&lt;br /&gt;&lt;IfModule mpm_worker_module&gt;&lt;br /&gt;    StartServers          2&lt;br /&gt;    MinSpareThreads      25&lt;br /&gt;    MaxSpareThreads      75 &lt;br /&gt;    ThreadLimit          64&lt;br /&gt;    ThreadsPerChild      25&lt;br /&gt;    MaxClients          150&lt;br /&gt;    MaxRequestsPerChild   0&lt;br /&gt;&lt;/IfModule&gt;&lt;br /&gt;--&lt;br /&gt;&lt;IfModule mpm_event_module&gt;&lt;br /&gt;    StartServers          2&lt;br /&gt;    MaxClients          150&lt;br /&gt;    MinSpareThreads      25&lt;br /&gt;    MaxSpareThreads      75 &lt;br /&gt;    ThreadLimit          64&lt;br /&gt;    ThreadsPerChild      25&lt;br /&gt;    MaxRequestsPerChild   0&lt;br /&gt;&lt;/IfModule&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Well, if you paid attention when installing the server then you know what &lt;a href="http://httpd.apache.org/docs/2.2/mod/worker.html"&gt; MPM &lt;/a&gt;  you installed. If you don't remember than we can find this by running:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:bash; highlight: [1];"&gt;# apache2ctl -l&lt;br /&gt;Compiled in modules:&lt;br /&gt;  core.c&lt;br /&gt;  mod_log_config.c&lt;br /&gt;  mod_logio.c&lt;br /&gt;  worker.c  &lt; - - - this is the one we can customize&lt;br /&gt;  http_core.c&lt;br /&gt;  mod_so.c&lt;br /&gt;&lt;/pre&gt;From the doc &lt;a href="http://httpd.apache.org/docs/2.2/mod/worker.html"&gt; Apache MPM worker &lt;/a&gt; we know what the above options should mean as well. &lt;pre class="brush:text"&gt;&lt;IfModule mpm_worker_module&gt;&lt;br /&gt;    StartServers          2&lt;br /&gt;    MinSpareThreads      25&lt;br /&gt;    MaxSpareThreads      75 &lt;br /&gt;    ThreadLimit          64&lt;br /&gt;    ThreadsPerChild      25&lt;br /&gt;    MaxClients          150&lt;br /&gt;    MaxRequestsPerChild   0&lt;br /&gt;&lt;/IfModule&gt;&lt;br /&gt;&lt;/pre&gt;Base on line # 2 (StartServers) we should see 2 processes. But when you scroll up we can see 4! So what is going on there? To understand the situation we need to look at the processes and threads statistics together.&lt;pre class="brush:bash; highlight: [1];"&gt;# ps -lFmC apache2&lt;br /&gt;F S UID        PID  PPID  C PRI  NI ADDR SZ WCHAN    RSS PSR STIME TTY          TIME CMD&lt;br /&gt;1 - root     25528     1  0   -   - -  1348 -       2580   - Apr04 ?        00:00:00 /usr/sbin/apache2 -k start&lt;br /&gt;1 S root         -     -  0  80   0 -     - poll_s     -   0 Apr04 -        00:00:00 -&lt;br /&gt;5 - www-data 25530 25528  0   -   - -  1291 -       1784   - Apr04 ?        00:00:00 /usr/sbin/apache2 -k start&lt;br /&gt;5 S www-data     -     -  0  80   0 -     - skb_re     -   0 Apr04 -        00:00:00 -&lt;br /&gt;5 - www-data 25532 25528  0   -   - - 56736 -       2776   - Apr04 ?        00:00:00 /usr/sbin/apache2 -k start&lt;br /&gt;5 S www-data     -     -  0  80   0 -     - pipe_w     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   0 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   0 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   0 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   0 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   0 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   0 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   0 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   0 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   0 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   0 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   0 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - inet_c     -   1 Apr04 -        00:00:00 -&lt;br /&gt;5 - www-data 25533 25528  0   -   - - 56736 -       2768   - Apr04 ?        00:00:00 /usr/sbin/apache2 -k start&lt;br /&gt;5 S www-data     -     -  0  80   0 -     - pipe_w     -   0 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - futex_     -   1 Apr04 -        00:00:00 -&lt;br /&gt;1 S www-data     -     -  0  80   0 -     - inet_c     -   1 Apr04 -        00:00:00 -&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;At the end everything is as it suppose to be. From all the 4 Apache processes the first 2 are for management and communication and then the last 2 are actually the one we defined in our config file to process the client's requests. All lines with the 'futex' show as well that there is 25 worker threads in the last to processes so this is controlled by the parameter  ThreadsPerChild and is correct as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-7389908341890335527?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/7389908341890335527/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2011/04/how-to-understand-apache-mpm-processes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/7389908341890335527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/7389908341890335527'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2011/04/how-to-understand-apache-mpm-processes.html' title='How to understand Apache MPM  processes during the starting phase'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-7692267515312852477</id><published>2011-03-26T20:00:00.001Z</published><updated>2011-04-10T20:03:05.450+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='netadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='network'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='tcpdump'/><title type='text'>tcpdump wrapper for all network and systems troubleshooter</title><content type='html'>&lt;b&gt;UPDATE&lt;/b&gt;:&lt;br /&gt;This other post describe a more elegant way how to do the job &lt;a href="http://rtomaszewski.blogspot.com/2011/04/tshark-in-network-troubleshooting.html"&gt; tshark in network troubleshooting&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Origin post:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;One of the tool that a network engineers relay every day is a network sniffer. One of the most famous I believe is the 'tcpdump'. &lt;br /&gt;&lt;br /&gt;Very often when you troubleshoot a problem you run it many time to verify the traffic on the wire. Let say that at some point you see where the problem may be and you need to sent an email with your analyze to another person. &lt;br /&gt;&lt;br /&gt;Documenting your results can be very time consuming. To minimize our time and increase the quality of the results we would like to attach the dump files we review ourself of course. Unfortunately it can be a little annoying if we need to repeat our troubleshooting again only to save the dumps on the disk this time. Often sending the analyzed text output form tcpdumps is not enough as well.&lt;br /&gt;&lt;br /&gt;This small tcpdump wrapper bellow can save you a lot of time by saving the tcpdump data to file and still letting you to follow the data on the screen in a live troubleshooting.&lt;br /&gt;&lt;br /&gt;For couple of examples how to run in please scroll down. &lt;br /&gt;&lt;br /&gt;The file with source code can be found here &lt;a href="https://docs.google.com/leaf?id=0B7ftIvGKDqYMMmIwYTgxMTAtZjBhYS00MWVkLTg3YWYtZDU3ZTJiOTRhNDc2&amp;amp;hl=en"&gt; mytcpdump.sh &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:bash; highlight: [10];"&gt;# you can define the filter and options in your bash variables&lt;br /&gt;# example: &lt;br /&gt;# T_FILTER='arp or icmp or not ip ( net 10.0.0.0/8 )&lt;br /&gt;# T_OPTIONS='-s0 -nn'&lt;br /&gt;&lt;br /&gt;# ------------------------------------------&lt;br /&gt;&lt;br /&gt;# arg1 - filter to the wireshark&lt;br /&gt;# arg2 - options to wireshark&lt;br /&gt;mytcpdump () {&lt;br /&gt; # parse args&lt;br /&gt; &lt;br /&gt; DEFAULT_OPT='-s0 -l -nn -w - -i any'&lt;br /&gt; &lt;br /&gt; if [ 'x-h' = x"$1" ] ; then &lt;br /&gt;  echo &lt;br /&gt;  echo "usage: mytcpdump [arg1] [arg2]"&lt;br /&gt;  echo " arg1 - wireshark network filter, by example: 'arp and (net 10/8)'"&lt;br /&gt;  echo " arg2 - wireshark options, default: '$DEFAULT_OPT'"&lt;br /&gt;  echo ""&lt;br /&gt;  echo " example:"&lt;br /&gt;  echo "   mytcpdump"&lt;br /&gt;  echo "   mytcpdump '(net 10.0.0.0/8 and not net 11.0.0.0/8) and port 22'"&lt;br /&gt;  echo "   mytcpdump '(net 10.0.0.0/8 and not net 11.0.0.0/8) and port 22' '-s0 -l -nn -i eth0 -w -' "&lt;br /&gt;  echo&lt;br /&gt;  &lt;br /&gt;  return &lt;br /&gt; fi&lt;br /&gt; &lt;br /&gt; # filters&lt;br /&gt; if [ '1' != 1"$1" ] ; then &lt;br /&gt;  filter="$1"&lt;br /&gt; elif [ '2' != 2"$T_FILTER" ]; then&lt;br /&gt;  filter=$T_FILTER&lt;br /&gt; else&lt;br /&gt;  filter=""&lt;br /&gt; fi&lt;br /&gt;&lt;br /&gt; # options&lt;br /&gt; if [ '1' != 1"$2" ] ; then &lt;br /&gt;  opts="$2"&lt;br /&gt; elif [ '2' != 2"$T_OPTIONS" ]; then&lt;br /&gt;  opts=$T_OPTIONS&lt;br /&gt; else&lt;br /&gt;  opts="$DEFAULT_OPT"&lt;br /&gt; fi &lt;br /&gt; &lt;br /&gt; t=`date +%s`;&lt;br /&gt; echo "[$t]: timestamp is $t" &lt;br /&gt; echo "[$t]: wireshark optoins are &amp;lt;$opts&amp;gt;"&lt;br /&gt; echo "[$t]: wireshark filter is &amp;lt;$filter&amp;gt;"&lt;br /&gt;&lt;br /&gt; cmd="tcpdump $opts $filter"&lt;br /&gt; echo "[$t]: tcpdump cmd is &amp;lt;$cmd&amp;gt;"&lt;br /&gt; &lt;br /&gt; f="/var/tmp/tcpdump.$t.pcap"&lt;br /&gt; echo "[$t]: tcpdump pcap file &amp;lt;$f&amp;gt;"&lt;br /&gt; &lt;br /&gt; chain="$cmd | tee $f | tcpdump -r- -nn"&lt;br /&gt; echo "[$t]: running the bash command chains &amp;lt;$chain&amp;gt;" &lt;br /&gt; &lt;br /&gt; $cmd | tee $f | tcpdump -r- -nn&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;alias myt='mytcpdump'&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Usage help&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:bash; highlight: [1];"&gt;# myt -h&lt;br /&gt;&lt;br /&gt;usage: mytcpdump [arg1] [arg2]&lt;br /&gt; arg1 - wireshark network filter, by example: 'arp and (net 10/8)'&lt;br /&gt; arg2 - wireshark options, default: '-s0 -l -nn -w - -i any'&lt;br /&gt;&lt;br /&gt; example:&lt;br /&gt;   mytcpdump&lt;br /&gt;   mytcpdump '(net 10.0.0.0/8 and not net 11.0.0.0/8) and port 22'&lt;br /&gt;   mytcpdump '(net 10.0.0.0/8 and not net 11.0.0.0/8) and port 22' '-s0 -l -nn -i eth0 -w -'&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Examples:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;These 2 examples bellow show how to use this small wrapper. Each time we can monitor live traffic on the console output from tcpdump and in the same time be sure that a copy of the raw tcpdump data is written to the disk.&lt;br /&gt;&lt;br /&gt;The file you may want to copy then later is shown at the beginning after the header '[timestmap]'. In our examples the file names are:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text; "&gt;/var/tmp/tcpdump.1301166859.pcap&lt;br /&gt;/var/tmp/tcpdump.1301166869.pcap&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre class="brush:text; highlight: [1,6,16,21];"&gt;# myt &lt;br /&gt;[1301166859]: timestamp is 1301166859&lt;br /&gt;[1301166859]: wireshark optoins are &amp;lt;-s0 -l -nn -w - -i any&amp;gt;&lt;br /&gt;[1301166859]: wireshark filter is &amp;lt;&amp;gt;&lt;br /&gt;[1301166859]: tcpdump cmd is &amp;lt;tcpdump -s0 -l -nn -w - -i any &amp;gt;&lt;br /&gt;[1301166859]: tcpdump pcap file &amp;lt;/var/tmp/tcpdump.1301166859.pcap&amp;gt;&lt;br /&gt;[1301166859]: running the bash command chains &amp;lt;tcpdump -s0 -l -nn -w - -i any  | tee /var/tmp/tcpdump.1301166859.pcap | tcpdump -r- -nn&amp;gt;&lt;br /&gt;tcpdump: listening on any, link-type LINUX_SLL (Linux cooked), capture size 65535 bytes&lt;br /&gt;reading from file -, link-type LINUX_SLL (Linux cooked)&lt;br /&gt;19:14:19.837101 IP 192.168.43.111 &amp;gt; 212.77.100.101: ICMP echo request, id 42106, seq 5396, length 64&lt;br /&gt;^Ctcpdump: pcap_loop: error reading dump file: Interrupted system call&lt;br /&gt;4 packets captured&lt;br /&gt;6 packets received by filter&lt;br /&gt;0 packets dropped by kernel&lt;br /&gt;&lt;br /&gt;# myt 'icmp or arp'&lt;br /&gt;[1301166869]: timestamp is 1301166869&lt;br /&gt;[1301166869]: wireshark optoins are &amp;lt;-s0 -l -nn -w - -i any&amp;gt;&lt;br /&gt;[1301166869]: wireshark filter is &amp;lt;icmp or arp&amp;gt;&lt;br /&gt;[1301166869]: tcpdump cmd is &amp;lt;tcpdump -s0 -l -nn -w - -i any icmp or arp&amp;gt;&lt;br /&gt;[1301166869]: tcpdump pcap file &amp;lt;/var/tmp/tcpdump.1301166869.pcap&amp;gt;&lt;br /&gt;[1301166869]: running the bash command chains &amp;lt;tcpdump -s0 -l -nn -w - -i any icmp or arp | tee /var/tmp/tcpdump.1301166869.pcap | tcpdump -r- -nn&amp;gt;&lt;br /&gt;tcpdump: listening on any, link-type LINUX_SLL (Linux cooked), capture size 65535 bytes&lt;br /&gt;reading from file -, link-type LINUX_SLL (Linux cooked)&lt;br /&gt;19:14:29.847649 IP 192.168.43.111 &amp;gt; 212.77.100.101: ICMP echo request, id 42106, seq 5406, length 64&lt;br /&gt;^C2 packets captured&lt;br /&gt;2 packets received by filter&lt;br /&gt;0 packets dropped by kernel&lt;br /&gt;tcpdump: pcap_loop: error reading dump file: Interrupted system call&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-7692267515312852477?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/7692267515312852477/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2011/03/tcpdump-wrapper-for-all-network-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/7692267515312852477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/7692267515312852477'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2011/03/tcpdump-wrapper-for-all-network-and.html' title='tcpdump wrapper for all network and systems troubleshooter'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-8086645424538276612</id><published>2011-03-12T15:48:00.000Z</published><updated>2011-03-12T15:48:04.550Z</updated><title type='text'>Funny way to print lines in reverse order</title><content type='html'>This is completely something you need see at least once in your live to know what you never should do ;). &lt;br /&gt;&lt;br /&gt;The complete code examples bellow are taken from the original post at &lt;a href="http://backreference.org/2010/12/19/print-lines-in-reverse-order/"&gt; Print lines in reverse order &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The recommended way:&lt;/b&gt;&lt;br /&gt;&lt;pre class="brush:bash"&gt;$ tac file&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;The more funny way to achieve the same result ;) &lt;/b&gt;&lt;br /&gt;&lt;pre class="brush:bash"&gt;#example1&lt;br /&gt;$ cat -n file | sort -k1,1rn | cut -f 2-&lt;br /&gt;&lt;br /&gt;#example2&lt;br /&gt;$ perl -e 'print reverse &amp;lt;&amp;gt;' file&lt;br /&gt;&lt;br /&gt;#example3; sorry, this one is not a one line command&lt;br /&gt;$ i=0&lt;br /&gt;$ while IFS= read -r arr[i]; do ((i++)); done &amp;lt; file&lt;br /&gt;$ for((j=i-1;j&amp;gt;=0;j--)); do printf "%s\n" "${arr[$j]}"; done&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-8086645424538276612?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/8086645424538276612/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2011/03/funny-way-to-print-lines-in-reverse.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/8086645424538276612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/8086645424538276612'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2011/03/funny-way-to-print-lines-in-reverse.html' title='Funny way to print lines in reverse order'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-3930108620028822462</id><published>2011-03-11T21:45:00.000Z</published><updated>2011-03-11T21:45:12.972Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='lvm'/><category scheme='http://www.blogger.com/atom/ns#' term='snapshot'/><title type='text'>LVM is reporting I/O errors after creating a snapshots and modifying it</title><content type='html'>Once you create a snapshot for one of your logical volumes you can mount it in rw mode and use it as a normal available file system/block device. After some time you may get errors like the one bellow unfortunately.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:bash; highlight: [7];"&gt;# lvs&lt;br /&gt;  /dev/group1/snap: read failed after 0 of 4096 at 0: Input/output error&lt;br /&gt;  Volume group group2 is exported&lt;br /&gt;  LV         VG     Attr   LSize  Origin Snap%  Move Log             Copy%  Convert&lt;br /&gt;  l1         group1 owi-ao 12.00m                                                  &lt;br /&gt;  mirror.new group1 mwi-a- 12.00m                    mirror.new_mlog 100.00        &lt;br /&gt;  snap       group1 Swi-I-  4.00m l1     100.00                                    &lt;br /&gt;  snap2      group1 swi-a- 20.00m l1       0.23                                    &lt;br /&gt;  snap3      group1 swi-ao  4.00m l1       1.17                                    &lt;br /&gt;  snap4      group1 swi-a-  4.00m l1       1.17        &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The key part to understand this is to look at the attribute descriptions of the lvs command.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:bash; highlight: [3];"&gt;$ man lvs | less -R  +2/lv_attr -X&lt;br /&gt;1  Volume  type:  (m)irrored,  (M)irrored  without  initial  sync,  (o)rigin,  (p)vmove,  (s)napshot, invalid (S)napshot,&lt;br /&gt;                 (v)irtual, mirror (i)mage, mirror (I)mage out-of-sync, under (c)onversion&lt;br /&gt;&lt;br /&gt;              2  Permissions: (w)riteable, (r)ead-only&lt;br /&gt;&lt;br /&gt;              3  Allocation policy: (c)ontiguous, c(l)ing, (n)ormal, (a)nywhere, (i)nherited This is capitalised if the volume is  cur‐&lt;br /&gt;                 rently locked against allocation changes, for example during pvmove (8).&lt;br /&gt;&lt;br /&gt;              4  fixed (m)inor&lt;br /&gt;&lt;br /&gt;              5  State:  (a)ctive,  (s)uspended,  (I)nvalid  snapshot,  invalid  (S)uspended  snapshot, mapped (d)evice present without&lt;br /&gt;                 tables, mapped device present with (i)nactive table&lt;br /&gt;&lt;br /&gt;              6  device (o)pen&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It means that our snapshot device /dev/group1/snap has run out of free space. The only way to fix it is to remove the snapshot device because we can't trust unfortunately its content any longer. Next time make sure that the additional free space for the snapshot logical volume is big enough when you plan changing a lot of data on it.&lt;br /&gt;&lt;br /&gt;# lvremove /dev/group1/snap4&lt;br /&gt;# lvcreate  -n snap -s -L&lt;your size=""&gt;  group1/l1&lt;br /&gt;&lt;br /&gt;Reference:&lt;br /&gt;&lt;a href="http://tldp.org/HOWTO/LVM-HOWTO/snapshotintro.html"&gt; 3.8. Snapshots&lt;/a&gt;&lt;br /&gt;&lt;a href="http://serverfault.com/questions/189803/lvm-is-reporting-i-o-errors-but-the-disk-reports-no-problems-argh"&gt;LVM is reporting I/O errors, but the disk reports no problems&lt;/a&gt;&lt;br /&gt;&lt;/your&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-3930108620028822462?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/3930108620028822462/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2011/03/lvm-is-reporting-io-errors-after.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/3930108620028822462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/3930108620028822462'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2011/03/lvm-is-reporting-io-errors-after.html' title='LVM is reporting I/O errors after creating a snapshots and modifying it'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-7314392921382037526</id><published>2011-03-11T19:42:00.002Z</published><updated>2011-03-11T19:49:21.206Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='raid'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='lvm'/><category scheme='http://www.blogger.com/atom/ns#' term='storage'/><title type='text'>What storage solution is better – quick comparison between LVM mirroring and software RAID1 in Linux</title><content type='html'>With the introduction of LVM2 we have now the ability to create mirrors in LVM. It is relatively easy to set up configuration and works similar to RAID1. &lt;br /&gt;&lt;br /&gt;At some point when playing with it you start asking yourself what is actually the technical difference between them two in Linux:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;LVM mirroring&lt;/li&gt;&lt;li&gt;RAID1&lt;/li&gt;&lt;/ul&gt;For the end user it looks that both provide the same functionality of creating and maintaining a redundant block device. But are they very different from each other? Before I will give you couple of ideas to think about let me refresh just briefly how these 2 technologies are defined. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;1. What is RAID &lt;/b&gt;(taken from the Red Hat docs)&lt;br /&gt;&lt;a href="http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html-single/Storage_Administration_Guide/index.html#s1-raid-what-is"&gt; 13.1. What is RAID &lt;/a&gt;&lt;br /&gt;&lt;blockquote&gt;...&lt;br /&gt;RAID allows information to be spread across several disks. RAID uses techniques such as disk striping (RAID Level 0), disk mirroring (RAID Level 1), and disk striping with parity (RAID Level 5) to achieve redundancy, lower latency, increased bandwidth, and maximized ability to recover from hard disk crashes.&lt;br /&gt;&lt;br /&gt;RAID distributes data across each drive in the array by breaking it down into consistently-sized chunks (commonly 256K or 512k, although other values are acceptable). Each chunk is then written to a hard drive in the RAID array according to the RAID level employed. When the data is read, the process is reversed, giving the illusion that the multiple drives in the array are actually one large drive.&lt;br /&gt;....&lt;/blockquote&gt;&lt;br /&gt;&lt;b&gt;2. Logical Volumes &lt;/b&gt;(taken from the Red Hat docs)&lt;br /&gt;&lt;a href="http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html-single/Logical_Volume_Manager_Administration/index.html#logical_volumes"&gt; 1.2. Logical Volumes &lt;/a&gt;&lt;br /&gt;&lt;blockquote&gt;...&lt;br /&gt;Volume management creates a layer of abstraction over physical storage, allowing you to create logical storage volumes. This provides much greater flexibility in a number of ways than using physical storage directly. With a logical volume, you are not restricted to physical disk sizes. In addition, the hardware storage configuration is hidden from the software so it can be resized and moved without stopping applications or unmounting file systems.&lt;br /&gt;...&lt;/blockquote&gt;&lt;br /&gt;As we see the descriptions are quite different. So where the differences are going to be visible? Well, I was trying to find a good technical summary how this 2 techniques work but found only many small articles around on Google and in various docs.  &lt;br /&gt;&lt;br /&gt;Bellow is only a quick summary what could be good to know when trying to answer my question. For your information as well, the list is not meant to be complete and reflects only my personal state of knowledge. &lt;br /&gt;&lt;ul&gt;&lt;li&gt;How will the cache size in modern hard drives impacts the write and read operation of my block device? (&lt;a href="http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html-single/Storage_Administration_Guide/index.html#writebarr"&gt; Storage Admin guide&lt;/a&gt; ) &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Is the read/write performance the same for LVM and RAID block devices? Looks, like it is not equal and RAID can manage a faster read throughput when accessing the data ( &lt;a href="http://serverfault.com/questions/80134/linux-md-vs-lvm-performance"&gt;Linux md vs. LVM performance&lt;/a&gt; )&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;In RAID1 by default both disks are going to be used for read operations. This is the opposite for LVM, where by default only the ‘primary’ disk is used. &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;With LVM mirroring you can create more then only one mirror. A command like below will create for you 2 separate mirror block devices. In RAID1 you can have only one mirror and other devices will be consider as spare disk only.&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# lvcreate -m 2 ...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;You can detach the mirror from the ‘primary’ logical volume and start using it for whatever you want (backup, testing, ...). Doing this gives you immediately a copy of your primary logical volume but of course will remove the redundancy, at least temporarily. If you want to have the redundancy back you have to enable it again with a command like:&lt;/li&gt;&lt;/ul&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# lvchange -m ...&lt;/div&gt;&lt;ul&gt;&lt;li&gt;LVM supports snapshotting feature on logical volumes. At the time of writing this blog it can’t be used on the mirroring volume but you can always detach the mirror and start using it as a normal logical volume. As soon as it becomes a normal logical volume you can start creating snapshots.&lt;/li&gt;&lt;/ul&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# lvconvert --splitmirrors ...&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# lvconvert -m1 ...&lt;/div&gt;&lt;ul&gt;&lt;li&gt;As long you have free space in your volume group you can have more then one snapshot.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;For LVM mirroring you need by default more devices (+1 for the mirror device and +1 for the logs what together when you want to have only 1 mirror on a logical device you need 3 devices for it). This allocation policy, especially for logs can be changed and is controlled with the following options:  &lt;/li&gt;&lt;/ul&gt;&lt;ul style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;ul&gt;&lt;li&gt;--mirrorlog (lvcreate)&lt;/li&gt;&lt;li&gt;--alloc anywhere (vgcreate) &lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Having a mirror in place don't limit you in use of other LVM features. It means you should be able to extend you logical volume by extending the physical volume it is base on. Once the local volume grows your file system on this block device can grow as well. All this can be done online without having to take the server off line or down.&lt;/li&gt;Can you extend the file system so easily on the RAID1 device?  &lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Depending on what mounting point are you trying to add to your system you may have some trouble during the boot phase with the default initrd (often it comes when you play with the /boot and / file systems as described here &lt;a href="http://www.listware.net/201003/redhat-rhelv5-list/60809-rhelv5-list-lvm-mirroring.html"&gt;rhelv5-list - LVM mirroring&lt;/a&gt; ) &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;Reference:&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://docs.redhat.com"&gt;Red Hat documentation &lt;/a&gt; and especially the books of &lt;span style="font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;“Logical Volume Manager Administration"&lt;/span&gt;, &lt;span style="font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;“Storage Administratoin Guide”&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://www.redhat.com/magazine/009jul05/departments/red_hat_speaks/"&gt;Heinz Mauelshagen, Consulting Development Engineer, Cluster and Storage Development&lt;/a&gt;&lt;/li&gt;&lt;li&gt;The discussion about the technical design between RAID1 and LVM mirroring&lt;a href="http://osdir.com/ml/linux-lvm/2009-07/threads.html"&gt; [linux-lvm] Mirroring implementation&amp;nbsp;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&lt;a href="http://serverfault.com/questions/97845/lvm-mirroring-vs-raid1"&gt;LVM mirroring VS RAID1&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&amp;nbsp;&lt;a href="http://serverfault.com/questions/80134/linux-md-vs-lvm-performance"&gt;Linux md vs. LVM performance&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://codeanswer18.blogspot.com/2011/01/lvm-mirroring-vs-raid1.html"&gt;LVM mirroring VS RAID1&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://lwn.net/Articles/283161/"&gt;Barriers and journaling filesystems&lt;/a&gt;&amp;nbsp; &lt;/li&gt;&lt;li&gt; &lt;a href="http://www.debian-administration.org/articles/410"&gt;A simple introduction to working with LVM &lt;/a&gt;on Debian Administration (especialy the commends are very interesting :) )&lt;/li&gt;&lt;li&gt;&lt;a href="http://stackoverflow.com/questions/237434/raid-verses-lvm"&gt;RAID verses LVM&amp;nbsp;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-7314392921382037526?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/7314392921382037526/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2011/03/what-storage-solution-is-better-quick.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/7314392921382037526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/7314392921382037526'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2011/03/what-storage-solution-is-better-quick.html' title='What storage solution is better – quick comparison between LVM mirroring and software RAID1 in Linux'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-674154869056490302</id><published>2011-03-07T23:50:00.000Z</published><updated>2011-03-07T23:50:45.142Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='support'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='less'/><title type='text'>Searching trick for the Linux less tool</title><content type='html'>Event after so many year of working on the command line I constantly find some trick ;). This is one of them for the less tool. &lt;br /&gt;&lt;br /&gt;With the syntax bellow the less will do a normal search like using the '/' char, but will look for the 2th occurrence of our regex expression and once found will jump to it immediately to display. &lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:bash; highlight: [1];"&gt;$ man tune2fs | less -R  +2/-U -X&lt;br /&gt;      -U UUID&lt;br /&gt;              Set   the   universally   unique   identifier   (UUID)   of   the  filesystem  to  UUID.   The  format  of  the  UUID  is  a  series  of  hex  digits  separated  by  hyphens,  like  this:&lt;br /&gt;              "c1b9d5a2-f162-11cf-9ece-0020afc76f16".  The UUID parameter may also be one of the following:&lt;br /&gt;&lt;br /&gt;                   clear  clear the filesystem UUID&lt;br /&gt;&lt;br /&gt;                   random generate a new randomly-generated UUID&lt;br /&gt;&lt;br /&gt;                   time   generate a new time-based UUID&lt;br /&gt;&lt;br /&gt;              The UUID may be used by mount(8), fsck(8), and /etc/fstab(5) (and possibly others) by specifying UUID=uuid instead of a block special device name like /dev/hda1.&lt;br /&gt;&lt;br /&gt;              See uuidgen(8) for more information.  If the system does not have a good random number generator such as /dev/random or /dev/urandom, tune2fs will  automatically  use  a  time-based  UUID&lt;br /&gt;              instead of a randomly-generated UUID.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The source of it can be found on the FAQ page of the less itself: &lt;a href="http://www.greenwoodsoftware.com/less/faq.html#tricks"&gt;Less FAQ&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-674154869056490302?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/674154869056490302/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2011/03/searching-trick-for-linux-less-tool.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/674154869056490302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/674154869056490302'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2011/03/searching-trick-for-linux-less-tool.html' title='Searching trick for the Linux less tool'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-3237973400581571003</id><published>2011-03-07T22:14:00.001Z</published><updated>2011-03-07T22:16:50.341Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='programing'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><category scheme='http://www.blogger.com/atom/ns#' term='sort'/><category scheme='http://www.blogger.com/atom/ns#' term='script'/><title type='text'>How to sort data on more then one column with Linux sort command</title><content type='html'>You caught always yourself looking for old recipes you did years ago. It is time to document this once and for all.&lt;br /&gt;&lt;br /&gt;This will produce a list of services maintained by the upstart init daemon on the Linux system that:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;1st is sorted alphabetically base on the status description&lt;/li&gt;&lt;li&gt;2th is sorted numerically base on the pid value&lt;/li&gt;&lt;li&gt;3th is sorted alphabetically base on the service name&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;pre class="brush:php; highlight: [1]; html-script: true"&gt;$ initctl  list | sed 's/ (/(/g'  | sort -k2,2d -k4,4n -k1,1d | column -t  &lt;br /&gt;bridge-network-interface(eth0)    start/running&lt;br /&gt;bridge-network-interface(lo)      start/running&lt;br /&gt;bridge-network-interface(pan0)    start/running&lt;br /&gt;bridge-network-interface(virbr0)  start/running&lt;br /&gt;bridge-network-interface(wlan0)   start/running&lt;br /&gt;network-interface(eth0)           start/running&lt;br /&gt;network-interface(lo)             start/running&lt;br /&gt;network-interface(pan0)           start/running&lt;br /&gt;network-interface-security        start/running&lt;br /&gt;network-interface(virbr0)         start/running&lt;br /&gt;network-interface(wlan0)          start/running&lt;br /&gt;ufw                               start/running&lt;br /&gt;upstart-udev-bridge               start/running,  process  358&lt;br /&gt;udev                              start/running,  process  366&lt;br /&gt;smbd                              start/running,  process  870&lt;br /&gt;rsyslog                           start/running,  process  889&lt;br /&gt;dbus                              start/running,  process  891&lt;br /&gt;ssh                               start/running,  process  897&lt;br /&gt;gdm                               start/running,  process  904&lt;br /&gt;network-manager                   start/running,  process  905&lt;br /&gt;avahi-daemon                      start/running,  process  912&lt;br /&gt;tty4                              start/running,  process  1046&lt;br /&gt;tty5                              start/running,  process  1051&lt;br /&gt;tty2                              start/running,  process  1060&lt;br /&gt;tty3                              start/running,  process  1062&lt;br /&gt;tty6                              start/running,  process  1065&lt;br /&gt;acpid                             start/running,  process  1070&lt;br /&gt;cron                              start/running,  process  1084&lt;br /&gt;atd                               start/running,  process  1085&lt;br /&gt;libvirt-bin                       start/running,  process  1096&lt;br /&gt;tty1                              start/running,  process  1627&lt;br /&gt;nmbd                              start/running,  process  2156&lt;br /&gt;alsa-mixer-save                   stop/waiting&lt;br /&gt;anacron                           stop/waiting&lt;br /&gt;apport                            stop/waiting&lt;br /&gt;console-setup                     stop/waiting&lt;br /&gt;control-alt-delete                stop/waiting&lt;br /&gt;dmesg                             stop/waiting&lt;br /&gt;failsafe-x                        stop/waiting&lt;br /&gt;hostname                          stop/waiting&lt;br /&gt;hwclock                           stop/waiting&lt;br /&gt;hwclock-save                      stop/waiting&lt;br /&gt;irqbalance                        stop/waiting&lt;br /&gt;module-init-tools                 stop/waiting&lt;br /&gt;mountall                          stop/waiting&lt;br /&gt;mountall-net                      stop/waiting&lt;br /&gt;mountall-reboot                   stop/waiting&lt;br /&gt;mountall-shell                    stop/waiting&lt;br /&gt;mounted-dev                       stop/waiting&lt;br /&gt;mounted-tmp                       stop/waiting&lt;br /&gt;mounted-varrun                    stop/waiting&lt;br /&gt;networking                        stop/waiting&lt;br /&gt;plymouth                          stop/waiting&lt;br /&gt;plymouth-log                      stop/waiting&lt;br /&gt;plymouth-splash                   stop/waiting&lt;br /&gt;plymouth-stop                     stop/waiting&lt;br /&gt;procps                            stop/waiting&lt;br /&gt;rc                                stop/waiting&lt;br /&gt;rcS                               stop/waiting&lt;br /&gt;rc-sysinit                        stop/waiting&lt;br /&gt;screen-cleanup                    stop/waiting&lt;br /&gt;udev-finish                       stop/waiting&lt;br /&gt;udevmonitor                       stop/waiting&lt;br /&gt;udevtrigger                       stop/waiting&lt;br /&gt;ureadahead                        stop/waiting&lt;br /&gt;ureadahead-other                  stop/waiting&lt;br /&gt;usplash                           stop/waiting&lt;/pre&gt;&lt;br /&gt;Google and system documentation is your friend.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$ man sort&lt;br /&gt;$ info coreutils 'sort invocation'&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;a href="http://www.unix.com/shell-programming-scripting/12338-sorting-based-multiple-columns.html"&gt;Sorting based on Multiple columns &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.skorks.com/2010/05/sort-files-like-a-master-with-the-linux-sort-command-bash/"&gt;Sort Files Like A Master With The Linux Sort Command&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-3237973400581571003?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/3237973400581571003/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2011/03/how-to-sort-data-on-more-then-one.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/3237973400581571003'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/3237973400581571003'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2011/03/how-to-sort-data-on-more-then-one.html' title='How to sort data on more then one column with Linux sort command'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-3094820779686247476</id><published>2011-03-07T18:45:00.003Z</published><updated>2011-03-07T22:21:22.592Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='blogger'/><category scheme='http://www.blogger.com/atom/ns#' term='highlight'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><title type='text'>How to highlight source text on your blog</title><content type='html'>There are many time situation when you would like to publish a piece of code that should have a special formatting for the viewer.&lt;br /&gt;&lt;br /&gt;This blog describe one of the possible solution base on the javascript library: &lt;a href="http://alexgorbatchev.com/SyntaxHighlighter"&gt;SyntaxHighlighter&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;To integrate it with your blog follow the description there:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.cyberack.com/2007/07/adding-syntax-highlighter-to-blogger.html"&gt;Adding a Syntax Highlighter to your Blogger blog&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The list of brushes (javascript scripts) that you have to copy to your blog design template depends on your needs.  If you want to use these 2 like 'plain' and 'bash' brushes you have to extend the list.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:html; highlight: [3, 4];" &gt;&amp;lt;script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js' type='text/javascript'/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPlain.js' type='text/javascript'/&amp;gt;&lt;br /&gt;&amp;lt;script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js' type='text/javascript'/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;script language='javascript'&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The list of all brushes can be found at &lt;a href="http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/"&gt;Bundled Brushes&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;To convert the 'raw html' into the 'escaped' html code you can use this &lt;a href="http://accessify.com/tools-and-wizards/developer-tools/quick-escape/"&gt; convert tool &lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;A basic example use in your blog post can look like this:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:html; highlight: [2]"&gt;&amp;lt;pre class=&amp;quot;brush:html; highlight: [1];&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;h2&amp;gt;This is an example.&amp;lt;/h2&amp;gt;&lt;br /&gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-3094820779686247476?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/3094820779686247476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2011/03/how-to-highlight-text-on-your-blog.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/3094820779686247476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/3094820779686247476'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2011/03/how-to-highlight-text-on-your-blog.html' title='How to highlight source text on your blog'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-3504955189993625358</id><published>2011-03-07T17:05:00.007Z</published><updated>2011-03-07T22:22:22.314Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><title type='text'>pretty printing for bash command outputs</title><content type='html'>Some commands like to print the output in a way that is hard to read. Try this '&lt;span style="font-weight: bold;"&gt;column&lt;/span&gt;' tool that turns the unstructured output into a pretty printed output.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:plain"&gt;$ mount | column -t&lt;br /&gt;/dev/sda2         on  /                         type  ext3                   (rw,relatime,errors=remount-ro)&lt;br /&gt;proc              on  /proc                     type  proc                   (rw)&lt;br /&gt;none              on  /sys                      type  sysfs                  (rw,noexec,nosuid,nodev)&lt;br /&gt;none              on  /sys/fs/fuse/connections  type  fusectl                (rw)&lt;br /&gt;none              on  /sys/kernel/debug         type  debugfs                (rw)&lt;br /&gt;none              on  /sys/kernel/security      type  securityfs             (rw)&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-3504955189993625358?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/3504955189993625358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2011/03/pretty-printing-for-bash-command.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/3504955189993625358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/3504955189993625358'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2011/03/pretty-printing-for-bash-command.html' title='pretty printing for bash command outputs'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-7786277179114430056</id><published>2009-11-08T01:20:00.004Z</published><updated>2011-03-07T22:23:17.395Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>How to upgrade ubuntu distro</title><content type='html'>I had to update and upgrade the Ubuntu on my laptop. There are 2 well know options how you can do this.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Using the graphical GUI&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# update-manager&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Using the text command GUI&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# type -a do-release-upgrade&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;do-release-upgrade is /usr/bin/do-release-upgrade&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# dpkg -S /usr/bin/do-release-upgrade&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;update-manager-core: /usr/bin/do-release-upgrade&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;root@radexlaptop:/home/radoslaw# do-release-upgrade --help&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Usage: do-release-upgrade [options]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Options:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  -h, --help            show this help message and exit&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  -d, --devel-release   Check if upgrading to the latest devel release is&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                        possible&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  -p, --proposed        Try upgrading to the latest release using the upgrader&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                        from $distro-proposed&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  -m MODE, --mode=MODE  Run in a special upgrade mode. Currently 'desktop' for&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                        regular upgrades of a desktop system and 'server' for&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                        server systems are supported.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  -f FRONTEND, --frontend=FRONTEND&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                        Run the specified frontend&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  -s, --sandbox         Test upgrade with a sandbox aufs overlay&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;root@radexlaptop:/home/radoslaw# do-release-upgrade -d&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Checking for a new ubuntu release&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;No new release found&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-7786277179114430056?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/7786277179114430056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/how-to-upgrade-ubuntu-distro.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/7786277179114430056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/7786277179114430056'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/how-to-upgrade-ubuntu-distro.html' title='How to upgrade ubuntu distro'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-4225219512811346114</id><published>2009-11-07T22:30:00.002Z</published><updated>2009-11-07T22:36:44.742Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><category scheme='http://www.blogger.com/atom/ns#' term='command'/><category scheme='http://www.blogger.com/atom/ns#' term='scripting'/><title type='text'>Linux trick with grep tool</title><content type='html'>Command line tools are like grep are very useful when working a lot with text files.&lt;br /&gt;&lt;br /&gt;One unknown feature is the &lt;span style="font-family: courier new;"&gt;--color &lt;span style="font-family: arial;"&gt;options &lt;/span&gt;&lt;/span&gt;which shows you in different colour the matching string grep found.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;user@host:~$ egrep '(vmx|svm)' --color=always /proc/cpuinfo&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl &lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(255, 0, 0); font-family: courier new; font-weight: bold;"&gt;vmx&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; est tm2 ssse3 cx16 xtpr pdcm lahf_lm ida tpr_shadow vnmi flexpriority&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-4225219512811346114?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/4225219512811346114/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/linux-trick-with-grep-tool.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/4225219512811346114'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/4225219512811346114'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/linux-trick-with-grep-tool.html' title='Linux trick with grep tool'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-5507499160442824887</id><published>2009-11-04T16:33:00.005Z</published><updated>2009-11-07T22:58:52.645Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='virtualisation'/><category scheme='http://www.blogger.com/atom/ns#' term='xen'/><title type='text'>Which CPU for XenServer do I need</title><content type='html'>Citrix XenServer to be able to virtualise Windows OS need some support on the hardware site. You have to have a CPU which bring the "virtualisation feature". It's mean: Intel-VT or Amd-V.&lt;br /&gt;&lt;br /&gt;To see if your processor is 64 bit, you can run the following command:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# egrep --color ' lm ' /proc/cpuinfo&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;How you can check if your CPU has one of these necessary features:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# egrep &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;--color&lt;/span&gt;&lt;span style="font-family:courier new;"&gt; '^flags.*(vmx|svm)' /proc/cpuinfo&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://vmetc.com/2008/07/14/how-to-check-if-your-cpu-supports-hardware-virtualization/"&gt;How to check if your CPU supports hardware virtualization&lt;/a&gt;&lt;br /&gt;&lt;a href="http://blogs.msdn.com/taylorb/archive/2008/06/19/hyper-v-will-my-computer-run-hyper-v-detecting-intel-vt-and-amd-v.aspx"&gt;Hyper-V: Will My Computer Run Hyper-V? Detecting Intel VT and AMD-V&lt;/a&gt;&lt;br /&gt;&lt;a href="http://nicolask.wordpress.com/2008/03/25/does-your-cpu-run-intel-vt-or-amd-v/"&gt;Does your CPU run Intel-VT or AMD-V?&lt;/a&gt;&lt;br /&gt;&lt;a href="http://support.citrix.com/article/CTX116106"&gt;XenServer 3.2 Hardware Support FAQ&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-5507499160442824887?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/5507499160442824887/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/which-cpu-for-xenserver-do-i-need.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/5507499160442824887'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/5507499160442824887'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/which-cpu-for-xenserver-do-i-need.html' title='Which CPU for XenServer do I need'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-847526057390591666</id><published>2009-11-04T16:33:00.003Z</published><updated>2009-11-04T16:46:10.846Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='filesystem'/><category scheme='http://www.blogger.com/atom/ns#' term='command'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><title type='text'>Small trick with a 'stat' tool in Linux</title><content type='html'>I used many times &lt;span style="font-weight: bold;"&gt;'stat'&lt;/span&gt; tool to find out information about a physical file. Normally the output looks like that:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;user@host:/tmp$ stat myfile.txt&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  File: `myfile.txt'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  Size: 0          Blocks: 0          IO Block: 4096   regular empty file&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Device: 802h/2050d Inode: 325124      Links: 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Access: (0644/-rw-r--r--)  Uid: ( 1000/radoslaw)   Gid: ( 1000/radoslaw)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Access: 2009-11-04 16:15:07.000000000 +0100&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Modify: 2009-11-04 16:15:07.000000000 +0100&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Change: 2009-11-04 16:15:07.000000000 +0100&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There is another very useful options,&lt;span style="font-weight: bold;"&gt; -f&lt;/span&gt;, that shows different information.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;user@host:/tmp$ stat -f myfile.txt&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  File: "myfile.txt"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    ID: a0fb1614334b9c81 Namelen: 255     Type: ext2/ext3&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Block size: 4096       Fundamental block size: 4096&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Blocks: Total: 2460827    Free: 647809     Available: 522804&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Inodes: Total: 625856     Free: 407715&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In the output you can find a lot of file system related information, like the block size or file system name.&lt;br /&gt;&lt;br /&gt;And When you want to find only the file system name you can run:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;user@host:/tmp$ stat -f -c "%T" myfile.txt&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;ext2/ext3&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-847526057390591666?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/847526057390591666/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/small-trick-with-stat-tool-in-linux.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/847526057390591666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/847526057390591666'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/small-trick-with-stat-tool-in-linux.html' title='Small trick with a &apos;stat&apos; tool in Linux'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-8602753697118773796</id><published>2009-11-04T16:32:00.001Z</published><updated>2009-11-04T16:32:48.608Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='htc'/><category scheme='http://www.blogger.com/atom/ns#' term='bluetooth'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='internet'/><category scheme='http://www.blogger.com/atom/ns#' term='umts'/><title type='text'>How to configure a Linux (Ubuntu) notebook to use a mobile phone with UMTS card as a access modem to Internet</title><content type='html'>You have a mobile phone, like this  &lt;a href="http://www.htc.com/www/product/advantage/overview.html"&gt;htc advantag 7510&lt;/a&gt; and  you want to use it as a Internet modem.&lt;br /&gt;&lt;br /&gt;Everything what you have to do is:&lt;br /&gt;&lt;br /&gt;&lt;ul style="font-weight: bold;"&gt;&lt;li&gt;Configure bluetooth in &lt;span original="phome" style="" class="goog-spellcheck-word"&gt;phone&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;ul&gt;&lt;li&gt;enable the bluetooth&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;turn on the "Internet  sharing" application&lt;/li&gt;&lt;li&gt;estabilish the connection&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Configure a  Linux host&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family:courier new;"&gt;pand --connect 00:17:E6:E7:E3:D2&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;dhclient -1 -d  bnep0&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;More info about the configuration for Ubuntu can you find here:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.geekzone.co.nz/content.asp?contentid=1524" target="_blank"&gt;http://www.geekzone.co.nz/&lt;wbr&gt;content.asp?contentid=1524&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://ubuntuforums.org/showthread.php?p=4145133#post4145133" target="_blank"&gt;http://ubuntuforums.org/&lt;wbr&gt;showthread.php?p=4145133#&lt;wbr&gt;post4145133&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://forum.eeeuser.com/viewtopic.php?pid=23948#p23948" target="_blank"&gt;http://forum.eeeuser.com/&lt;wbr&gt;viewtopic.php?pid=23948#p23948&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://ubuntu-utah.ubuntuforums.org/showthread.php?t=896244" target="_blank"&gt;http://ubuntu-utah.&lt;wbr&gt;ubuntuforums.org/showthread.&lt;wbr&gt;php?t=896244&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-8602753697118773796?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/8602753697118773796/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/how-to-configure-linux-ubuntu-notebook.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/8602753697118773796'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/8602753697118773796'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/how-to-configure-linux-ubuntu-notebook.html' title='How to configure a Linux (Ubuntu) notebook to use a mobile phone with UMTS card as a access modem to Internet'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-8942555519184312475</id><published>2009-11-04T16:31:00.001Z</published><updated>2009-11-04T16:31:55.188Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><category scheme='http://www.blogger.com/atom/ns#' term='command'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='date'/><title type='text'>Linux, date tool trick</title><content type='html'>How many times did you have to get same date and do something with it. To calculate this dates is very annoying, unless you know a few tricks with &lt;span style="font-weight: bold;"&gt;date&lt;/span&gt; command :).&lt;br /&gt;&lt;br /&gt;How to find quickly some dates:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;$ date -d yesterday &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;$ date -d '2 days ago' &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;$ date -d '1 week ago' &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;$ date -d tomorrow &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;$ date -d '2 days' &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;$ date -d '1 week' &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For example,  when did you born:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;$ date&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Di 12 Aug 11:44:57 CEST 2008&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;$  date -d "11 days ago 7 month ago 28 years ago"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Di  1 Jan 10:43:49 CET 1980&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-8942555519184312475?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/8942555519184312475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/linux-date-tool-trick.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/8942555519184312475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/8942555519184312475'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/linux-date-tool-trick.html' title='Linux, date tool trick'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-4095896427578479954</id><published>2009-11-04T16:30:00.000Z</published><updated>2009-11-04T16:31:23.449Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='filesystem'/><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><title type='text'>Linux Admin bash command diary</title><content type='html'>&lt;ol style="font-weight: bold;"&gt;&lt;li&gt;External hard disk drive "CnMemory HDD 2,5 " and NTFS file system problem&lt;/li&gt;&lt;/ol&gt;The external HDD drivers can bring some problem when mounting if they have been formatted and use the NTFS file system.  To workaround some annoying warning when the device has not been "clean" removed from the windows or linux system use the mount command with following options:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;root@radex:/# cat /etc/issue&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Ubuntu 7.10 \n \l&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:courier new;"&gt;root@host:/# mount -t ntfs-3g /dev/sdb1 /mnt/tmp -o force&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$LogFile indicates unclean shutdown (0, 0)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;WARNING: Forced mount, reset $LogFile.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-4095896427578479954?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/4095896427578479954/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/linux-admin-bash-command-diary.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/4095896427578479954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/4095896427578479954'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/linux-admin-bash-command-diary.html' title='Linux Admin bash command diary'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-3361776244948752856</id><published>2009-11-04T16:29:00.001Z</published><updated>2009-11-04T16:29:57.779Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='programing'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><category scheme='http://www.blogger.com/atom/ns#' term='configuration management'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><title type='text'>Configuration Management and DB2 parameters</title><content type='html'>&lt;span style="font-family:arial;"&gt;Configuration Management is one of the most important thing in problem and incident management. Even in a simple situation when our db server with important db's will totally demanded we will need some "secured", high tuned parameters for db, application or for the operating system.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;To be able to collect this db parameters we can write some simple script which will do this for us. The most important thing in this script that we need to thing about are: looking and deadlock situation in the db.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;For IBM db2 we can use following peace of code in Perl, which will use "uncommitted lock" during the connection with db to get the db parameters:&lt;/span&gt;&lt;pre  style="font-family:courier new;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;446:&lt;/span&gt;&lt;span style="color: rgb(0, 153, 0);"&gt; $id&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;=&lt;/span&gt; &lt;b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;getpwnam&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"$user_name"&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;447:&lt;/span&gt; &lt;span style="color: rgb(0, 153, 0);"&gt;@tmp&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;=&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;getpwuid&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;$id&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;448:&lt;/span&gt; &lt;span style="color: rgb(0, 153, 0);"&gt;$home_dir&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;$tmp&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(153, 51, 153);"&gt;7&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;];&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;449:&lt;/span&gt; &lt;span style="color: rgb(0, 153, 0);"&gt;$cmd&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"&lt;/span&gt;&lt;span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;db2 change isolation to ur ; " .&lt;br /&gt;       "&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;db2 connect to $db_name ; " .&lt;br /&gt;       "db2 list tables for all show detail; db2 connect reset"&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;450:&lt;/span&gt;    &lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;451:&lt;/span&gt; &lt;span style="color: rgb(0, 153, 0);"&gt;@tmp&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;=&lt;/span&gt;`sudo su &lt;span style="color: rgb(153, 0, 0);"&gt;-&lt;/span&gt; &lt;span style="color: rgb(0, 153, 0);"&gt;$user_name&lt;/span&gt; &lt;span style="color: rgb(153, 0, 0);"&gt;-&lt;/span&gt;c &lt;span style="color: rgb(255, 0, 0);"&gt;"$cmd"&lt;/span&gt; &lt;span style="color: rgb(153, 51, 153);"&gt;2&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;&gt;&amp;amp;&lt;/span&gt;&lt;span style="color: rgb(153, 51, 153);"&gt;1&lt;/span&gt;`&lt;span style="color: rgb(153, 0, 0);"&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;span style="font-family:arial;"&gt;The complete script can be found there &lt;a href="http://docs.google.com/Doc?id=ddvjwb6v_91dct35fhn"&gt;db2-cfg-info.pl&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-3361776244948752856?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/3361776244948752856/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/configuration-management-and-db2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/3361776244948752856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/3361776244948752856'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/configuration-management-and-db2.html' title='Configuration Management and DB2 parameters'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-6047486840061916672</id><published>2009-11-04T16:28:00.002Z</published><updated>2009-11-04T16:29:20.061Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='filesystem'/><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><category scheme='http://www.blogger.com/atom/ns#' term='command'/><title type='text'>Linux, find  tool trick</title><content type='html'>Many times when you are working with some application which create some lock/log/shared/record files you want to know what is happening for a sort time ago for example. The quick trick with the &lt;span style="font-weight: bold;"&gt;find&lt;/span&gt; tool allow you to find for example all files which ware created/changed for _xyz_ minutes ago.&lt;br /&gt;&lt;br /&gt;How to find quickly new created files in some directory:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;$ find /tmp/ -cmin -1 -maxdepth 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;$ find /tmp/ -cmin -10 -maxdepth 1&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-6047486840061916672?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/6047486840061916672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/linux-find-tool-trick.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/6047486840061916672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/6047486840061916672'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/linux-find-tool-trick.html' title='Linux, find  tool trick'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-3441772070302659710</id><published>2009-11-04T16:28:00.001Z</published><updated>2009-11-04T16:28:42.066Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='performance'/><category scheme='http://www.blogger.com/atom/ns#' term='tuning'/><category scheme='http://www.blogger.com/atom/ns#' term='raid'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='filesystem'/><category scheme='http://www.blogger.com/atom/ns#' term='sata'/><category scheme='http://www.blogger.com/atom/ns#' term='command'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><title type='text'>Potential problems with "Write Back Caching"</title><content type='html'>For the modern hd drives there is something what can make some problems when the operating system crushed.  It is also got to know for troubleshooting and tuning of os and application like data base for example.&lt;br /&gt;&lt;br /&gt;Try it for your self:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-size:100%;" &gt;# man hdparm&lt;br /&gt;# man sdparm&lt;br /&gt;&lt;br /&gt;To disable write cache execute:&lt;br /&gt;#hdparm -W0 /dev/hdX | device&lt;br /&gt;#sdparm --set WCE=0&lt;br /&gt;&lt;br /&gt;To  enable write cache execute:&lt;br /&gt;#hdparm -W1 device&lt;br /&gt;#sdparm --set WCE=1&lt;br /&gt;&lt;br /&gt;# sdparm -a -e /dev/sda&lt;br /&gt;# sdparm --page=ca --long /dev/sda&lt;br /&gt;   /dev/sda: ATA       Hitachi HTS72201  DCDO&lt;br /&gt;   Direct access device specific parameters: WP=0  DPOFUA=0&lt;br /&gt;Caching (SBC) [ca] mode page:&lt;br /&gt; IC          0  Initiator control&lt;br /&gt; ABPF        0  Abort pre-fetch&lt;br /&gt; CAP         0  Caching analysis permitted&lt;br /&gt; DISC        0  Discontinuity&lt;br /&gt; SIZE        0  Size enable&lt;br /&gt; WCE         1  Write cache enable&lt;br /&gt; MF          0  Multiplication factor&lt;br /&gt; RCD         0  Read cache disable&lt;br /&gt; DRRP        0  Demand read retention priority&lt;br /&gt; WRP         0  Write retention priority&lt;br /&gt; DPTL        0  Disable pre-fetch transfer length&lt;br /&gt; MIPF        0  Minimum pre-fetch&lt;br /&gt; MAPF        0  Maximum pre-fetch&lt;br /&gt; MAPFC       0  Maximum pre-fetch ceiling&lt;br /&gt; FSW         0  Force sequential write&lt;br /&gt; LBCSS       0  Logical block cache segment size&lt;br /&gt; DRA         0  Disable read ahead&lt;br /&gt; NV_DIS      0  Non-volatile cache disable&lt;br /&gt; NCS         0  Number of cache segments&lt;br /&gt; CSS         0  Cache segment size&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;a few links in net:&lt;br /&gt;&lt;a style="color: rgb(51, 102, 255);" href="http://sg.torque.net/sg/sdparm.html"&gt;The sdparm utility&lt;/a&gt;&lt;br /&gt;&lt;a style="color: rgb(51, 102, 255);" href="http://www.tecchannel.de/storage/san/432631/index3.html"&gt;Praxis-Know-how: RAID-Controller optimal konfigurieren&lt;/a&gt;&lt;br /&gt;&lt;a style="color: rgb(51, 102, 255);" href="http://dev.mysql.com/doc/refman/4.1/en/innodb-configuration.html"&gt;MySql InnoDB Configuration&lt;/a&gt;&lt;br /&gt;&lt;a style="color: rgb(51, 102, 255);" href="http://www.sr5tech.com/write_back_cache_experiments.htm"&gt;Experiments on Disk Write Back Caches in Linux&lt;/a&gt;&lt;br /&gt;&lt;a style="color: rgb(51, 102, 255);" href="http://www.westnet.com/%7Egsmith/content/linux-pdflush.htm"&gt;The Linux Page Cache and pdflush: Theory of Operation and Tuning for Write-Heavy Loads&lt;/a&gt;&lt;br /&gt;&lt;a style="color: rgb(51, 102, 255);" href="http://www.symlink.ch/articles/03/02/21/0844254.shtml"&gt;Linux IDE Problem beim Write Back Caching&lt;/a&gt;&lt;br /&gt;&lt;a style="color: rgb(51, 102, 255);" href="http://www.linuxquestions.org/questions/linux-hardware-18/turning-on-dma-and-write-back-cache-on-sata-385371/"&gt;turning on dma and write back cache on SATA&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-3441772070302659710?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/3441772070302659710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/potential-problems-with-write-back.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/3441772070302659710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/3441772070302659710'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/potential-problems-with-write-back.html' title='Potential problems with &quot;Write Back Caching&quot;'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-7555474045688230773</id><published>2009-11-04T16:26:00.002Z</published><updated>2009-11-04T16:28:06.827Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='programing'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='debian'/><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Convert source code to syntax highlighted document</title><content type='html'>How to conver some source code to nice looking [x]html code :)?&lt;br /&gt;&lt;br /&gt;The debian &lt;span style="font-weight: bold;"&gt;apt-cache&lt;/span&gt; tool is your friend. Try the following commands:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;apt-cache search syntax highlighted&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;apt-cache search source converter&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;apt-cache search source color html&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Some of packages, which I found:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;code2html - Syntax highlighter&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;src2tex - A converter from source program files to TeX format files&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;highlight - An universal source code to formatted text converter&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;txt2html - Text to HTML converter&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;src2tex - A converter from source program files to TeX format files&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;c2html - Highlight C sources for WWW presentation&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;source-highlight - convert source code to syntax highlighted document&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;webcpp - configurable utility to convert source code to HTML&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;$ source-highlight -n -d -o sample.html -s python -i sample.py&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;tt&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;01:&lt;/span&gt; &lt;i&gt;&lt;span style="color: rgb(154, 25, 0);"&gt;#!/usr/bin/python &lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;02:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;03:&lt;/span&gt; &lt;b&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;import&lt;/span&gt;&lt;/b&gt; sys&lt;span style="color: rgb(153, 0, 0);"&gt;,&lt;/span&gt; re&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;04:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;05:&lt;/span&gt; &lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;class&lt;/span&gt;&lt;/b&gt; &lt;span style="color: rgb(0, 153, 0);"&gt;HelloWorld&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;06:&lt;/span&gt;     &lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;def&lt;/span&gt;&lt;/b&gt; &lt;b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;helloWorld&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;(&lt;/span&gt;self&lt;span style="color: rgb(153, 0, 0);"&gt;):&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;07:&lt;/span&gt;         &lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;print&lt;/span&gt;&lt;/b&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;"hallo world :)"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;08:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;09:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;10:&lt;/span&gt; &lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;&lt;/b&gt; &lt;span style="color: rgb(0, 153, 0);"&gt;__&lt;/span&gt;name&lt;span style="color: rgb(0, 153, 0);"&gt;__&lt;/span&gt; &lt;span style="color: rgb(153, 0, 0);"&gt;==&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;"__main__"&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;11:&lt;/span&gt;     hello&lt;span style="color: rgb(0, 153, 0);"&gt;World&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;=&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;HelloWorld&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;()&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;12:&lt;/span&gt;     hello&lt;span style="color: rgb(0, 153, 0);"&gt;World&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;.&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;helloWorld&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;()&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-7555474045688230773?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/7555474045688230773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/convert-source-code-to-syntax.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/7555474045688230773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/7555474045688230773'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/convert-source-code-to-syntax.html' title='Convert source code to syntax highlighted document'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-4983965635371601096</id><published>2009-11-04T16:26:00.001Z</published><updated>2009-11-04T16:26:50.729Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='programing'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><category scheme='http://www.blogger.com/atom/ns#' term='scripting'/><title type='text'>Bash commands statistics</title><content type='html'>Looking for some MySQL &amp;amp; performance stuff is found on the page from &lt;a href="http://blog.kovyrin.net/"&gt;Alexey N. Kovyrin&lt;/a&gt;  &lt;a href="http://blog.kovyrin.net/"&gt;&lt;/a&gt; something interested :).&lt;br /&gt;&lt;br /&gt;To see, what are you doing on our Linux box, type the following code on bash console:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$ &lt;span style="font-weight: bold;"&gt;history 1000 | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;150 ls&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;30 for&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;26 du&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;20 tar&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;19 java&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;19 strace&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;...&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-4983965635371601096?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/4983965635371601096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/bash-commands-statistics.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/4983965635371601096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/4983965635371601096'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/bash-commands-statistics.html' title='Bash commands statistics'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-7398517431221273576</id><published>2009-11-04T16:24:00.000Z</published><updated>2009-11-04T16:26:08.493Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='uml'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>autodiag too: how to generate uml diagram for perl code</title><content type='html'>Howto generate xml "class" diagram for perl code.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;$ &lt;span style="font-weight: bold;"&gt;autodia.pl -z -r -d printshop/&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;getting pattern for perl&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;using directory : printshop/&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;recursively searching files..&lt;/span&gt;   &lt;span style="font-family:courier new;"&gt;AutoDia - version 2.00(c) Copyright 2003 A Trevena&lt;/span&gt;  &lt;span style="font-family:courier new;"&gt;getting handlers..&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;using language : perl&lt;/span&gt;  &lt;span style="font-family:courier new;"&gt;..using Autodia::Handler::Perl&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/monitor.pl&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/checkdata.pl&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/modules/knownfi&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;le.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/modules/common.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/modules/logs.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/modules/processfiles.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/modules/processfiles_phase2.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/modules/processprotocols.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/modules/mylock.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/modules/monitordb.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/modules/filetypes/standardbriefe.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/modules/filetypes/csv.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/modules/f&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;iletypes/hermespayrem.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/modules/filetypes/brandmobile_invoice.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/modules/filetypes/asnstandardbriefe.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/modules/filetypes/otherspayrem.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/modules/filetypes/xml.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/modules/filetypes/hermes.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/modules/filetypes/brandmobile_pr.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/modules/fil&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;etypes/invoices.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/modules/filetypes/acnpayrem.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/modules/protocoltypes/hermesmanung.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/modules/protocoltypes/hermesrechnung.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/modules/protocoltypes/brandmobile_telefactory.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/modules/protocoltypes/acoreuspayrem.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/modul&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;es/protocoltypes/skeleton.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/modules/protocoltypes/acnmahnung.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/modules/protocoltypes/invoices.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;Diagram.pm : add_class : ignoring duplicate classprotocoltypes::acoreuspayrem&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/modules/protocoltypes/itelaobit.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;opening printshop/&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;modules/protocoltypes/acnrechnung.pm&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;Diagram.pm : Inheritances : no Inheritances to be printed - ignoring..&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;written outfile : autodia.out.xml successfully&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;complete. (processed 30 files)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The diagram can looks like:&lt;br /&gt;&lt;br /&gt;Modules with out function:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_IM1YCLqYW_o/R_Icm_lib-I/AAAAAAAAA_c/HSQJ8hi0d5E/s1600-h/printshop-monitor-20080401-nofunc.gif"&gt;&lt;img style="cursor: pointer;" src="http://bp1.blogger.com/_IM1YCLqYW_o/R_Icm_lib-I/AAAAAAAAA_c/HSQJ8hi0d5E/s320/printshop-monitor-20080401-nofunc.gif" alt="" id="BLOGGER_PHOTO_ID_5184237577286348770" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Modules with function:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_IM1YCLqYW_o/R_IeSvlicAI/AAAAAAAAA_s/WzNId1ScadI/s1600-h/printshop-monitor-20080401-withfunc.gif"&gt;&lt;img style="cursor: pointer;" src="http://bp0.blogger.com/_IM1YCLqYW_o/R_IeSvlicAI/AAAAAAAAA_s/WzNId1ScadI/s400/printshop-monitor-20080401-withfunc.gif" alt="" id="BLOGGER_PHOTO_ID_5184239428417253378" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-7398517431221273576?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/7398517431221273576/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/autodiag-too-how-to-generate-uml.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/7398517431221273576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/7398517431221273576'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/autodiag-too-how-to-generate-uml.html' title='autodiag too: how to generate uml diagram for perl code'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_IM1YCLqYW_o/R_Icm_lib-I/AAAAAAAAA_c/HSQJ8hi0d5E/s72-c/printshop-monitor-20080401-nofunc.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-2289319627725660274</id><published>2009-11-04T16:23:00.000Z</published><updated>2009-11-04T16:24:12.176Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><title type='text'>Festplatte auf Fehler überprüfen</title><content type='html'>&lt;p&gt; &lt;strong&gt;Problem: Festplatte auf Fehler überprüfen&lt;/strong&gt; &lt;/p&gt;  &lt;p&gt; &lt;strong&gt;Problemlösung:&lt;/strong&gt;  &lt;/p&gt; &lt;pre class="code"&gt;Linuxdistribution mithilfe einer Live CD booten.&lt;br /&gt;Root werden&lt;br /&gt;apt-get install smartmontools&lt;br /&gt;smartctl -s on&lt;br /&gt;smartctl -a -d ATA /dev/PLATTE&lt;br /&gt;die Anzahl der Relocatet Sectors notieren&lt;br /&gt;badblocks -w /dev/PLATTE&lt;br /&gt;smartctl -a -d ATA /dev/PLATTE&lt;br /&gt;Anzahl der Relocatet Sectors vergleichen&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-2289319627725660274?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/2289319627725660274/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/festplatte-auf-fehler-uberprufen.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/2289319627725660274'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/2289319627725660274'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/festplatte-auf-fehler-uberprufen.html' title='Festplatte auf Fehler überprüfen'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-5858219419108770036</id><published>2009-11-04T16:22:00.000Z</published><updated>2009-11-04T16:23:37.464Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='file_system'/><title type='text'>any good solution for undelete for ext3 :(</title><content type='html'>http://jblevins.org/computing/linux/ext3-undelete&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;So, to recover plain text data one can simply do a brute force grep of the&lt;br /&gt;filesystem to find a unique string in the deleted file.  My Fortran files all&lt;br /&gt;contained a unique string, the name of a module I wrote called&lt;br /&gt;“auxpf_filter.”  Thus, using the following command I was able to eventually&lt;br /&gt;find the files I needed.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;grep --binary-files=text -300 "auxpf_filter" /dev/hda4 &gt; output.txt&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-5858219419108770036?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/5858219419108770036/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/any-good-solution-for-undelete-for-ext3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/5858219419108770036'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/5858219419108770036'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/any-good-solution-for-undelete-for-ext3.html' title='any good solution for undelete for ext3 :('/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-5847856067541254091</id><published>2009-11-04T16:20:00.000Z</published><updated>2009-11-04T16:22:14.995Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='humour'/><title type='text'>dieM4tr1x-Trilogie von bitchhacker</title><content type='html'>&lt;h1&gt;&lt;span style="font-size:85%;"&gt;Eine echte wahre Geschichte aus dem Imternet :&lt;/span&gt; dieM4tr1x-Trilogie&lt;/h1&gt;&lt;br /&gt;&lt;b&gt;Zitat:&lt;/b&gt;&lt;br /&gt;&lt;&lt;span style="color: rgb(204, 0, 0);"&gt;Elch&lt;/span&gt;&gt; Du kennst dich ja voll mit Rechner aus.&lt;br /&gt;&lt;&lt;span style="color: rgb(0, 102, 153);"&gt;bitchchecker&lt;/span&gt;&gt; halts maul ich hack dich&lt;br /&gt;&lt;&lt;span style="color: rgb(204, 0, 0);"&gt;Elch&lt;/span&gt;&gt; ok, ich bin ja schon ruhig, nicht dass du uns zeigst was für ein toller Hacker du bist ^^&lt;br /&gt;&lt;&lt;span style="color: rgb(0, 102, 153);"&gt;bitchchecker&lt;/span&gt;&gt; sag mir deine &lt;b&gt;netzwerk nummer&lt;/b&gt; man dann bist du tot&lt;br /&gt;&lt;&lt;span style="color: rgb(204, 0, 0);"&gt;Elch&lt;/span&gt;&gt; öhm die ist 129.0.0.1&lt;br /&gt;&lt;&lt;span style="color: rgb(204, 0, 0);"&gt;Elch&lt;/span&gt;&gt; oder war es 127.0.0.1&lt;br /&gt;&lt;&lt;span style="color: rgb(204, 0, 0);"&gt;Elch&lt;/span&gt;&gt; ja genau die war es: 127.0.0.1 Ich warte dann mal auf einen dollen Hackerangriff&lt;br /&gt;&lt;&lt;span style="color: rgb(0, 102, 153);"&gt;bitchchecker&lt;/span&gt;&gt; in fünf minuten ist deine fest platte gelöscht&lt;br /&gt;&lt;&lt;span style="color: rgb(204, 0, 0);"&gt;Elch&lt;/span&gt;&gt; Da habe ich jetzt aber Angst&lt;br /&gt;&lt;&lt;span style="color: rgb(0, 102, 153);"&gt;bitchchecker&lt;/span&gt;&gt; halts maul du bist gleich weg&lt;br /&gt;&lt;&lt;span style="color: rgb(0, 102, 153);"&gt;bitchchecker&lt;/span&gt;&gt; ich hab hier &lt;b&gt;ein program da gebe ich deine ip ein und du bist tot&lt;/b&gt;&lt;br /&gt;&lt;&lt;span style="color: rgb(0, 102, 153);"&gt;bitchchecker&lt;/span&gt;&gt; sag schon mal auf wieder sehen&lt;br /&gt;&lt;&lt;span style="color: rgb(204, 0, 0);"&gt;Elch&lt;/span&gt;&gt; zu wem?&lt;br /&gt;&lt;&lt;span style="color: rgb(0, 102, 153);"&gt;bitchchecker&lt;/span&gt;&gt; zu dir mann&lt;br /&gt;&lt;&lt;span style="color: rgb(0, 102, 153);"&gt;bitchchecker&lt;/span&gt;&gt; &lt;b&gt;buy buy&lt;/b&gt;&lt;br /&gt;&lt;&lt;span style="color: rgb(204, 0, 0);"&gt;Elch&lt;/span&gt;&gt; Ich zitter schon förmlich vor einem so krassen Hack0r wie du einer bist&lt;br /&gt;&lt;b&gt;&lt;span style="color: rgb(0, 102, 51);"&gt; * bitchchecker (~java@euirc-61a2169c.dip.t-dialin.net) Quit (Ping timeout#)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Die komplete Geschichte ist unten zu finden:&lt;br /&gt;http://www.stophiphop.com/modules/news/article.php?storyid=184&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-5847856067541254091?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/5847856067541254091/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/diem4tr1x-trilogie-von-bitchhacker.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/5847856067541254091'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/5847856067541254091'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/diem4tr1x-trilogie-von-bitchhacker.html' title='dieM4tr1x-Trilogie von bitchhacker'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1628743762748449041.post-1275515707933808008</id><published>2009-11-04T16:19:00.000Z</published><updated>2009-11-04T16:20:53.438Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='database'/><title type='text'>db2daig log</title><content type='html'>The internet is great, some very interested post (all info is at &lt;a href="http://www.mydatabasesupport.com/forums/ibm-db2/116241-just-laughs.html"&gt;post&lt;/a&gt; ):&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Hi,&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;some developers seem to have a good sense of humor. The following&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;was found after (stupid enough) restoring a DB created with FP9a on a&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;FP8 test-system (DIAGLEVEL=4):&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;2006-03-17-13.13.47.909513+060 I54072G437         LEVEL: Info&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;PID     : 22929                TID  : 1024        PROC : db2agent (TEST)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;INSTANCE: db2inst1             NODE : 000         DB   : TEST&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;APPHDL  : 0-300                APPID: XXXXXXXX.XXXX.XXXXXXXXXXXX&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;FUNCTION: DB2 UDB, access plan manager, sqlra_compile_var, probe:20&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;RETCODE : ZRC=0x80310004=-2144272380=SQLNN_E_NFOUND&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;"did not find specified thing in whatever"&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;Not too bad. It finally led me to the initial mistake AND gave me a&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;refreshing laugh. Thank you guys! ;-)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;tcb,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Norbert&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1628743762748449041-1275515707933808008?l=rtomaszewski.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rtomaszewski.blogspot.com/feeds/1275515707933808008/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/db2daig-log.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/1275515707933808008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1628743762748449041/posts/default/1275515707933808008'/><link rel='alternate' type='text/html' href='http://rtomaszewski.blogspot.com/2009/11/db2daig-log.html' title='db2daig log'/><author><name>Rado</name><uri>http://www.blogger.com/profile/07819763839528988809</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://bp0.blogger.com/_IM1YCLqYW_o/R-y53Plib7I/AAAAAAAAA-s/EcE1QInk6nI/S220/0004.jpg'/></author><thr:total>0</thr:total></entry></feed>
