Recent Updates Page 2 Toggle Comment Threads | Keyboard Shortcuts

  • Tushar Neupaney 4:52 pm on December 3, 2009 Permalink | Reply  

    Politics Explained 

    FEUDALISM: You have two cows. Your lord takes some of the milk.

    PURE SOCIALISM: You have two cows. The government takes them and puts them in a barn with everyone else’s cows. You have to take care of all of the cows. The government gives you as much milk as you need.

    BUREAUCRATIC SOCIALISM: You have two cows. The government takes them and put them in a barn with everyone else’s cows. They are cared for by ex-chicken farmers. You have to take care of the chickens the government took from the chicken farmers. The government gives you as much milk and eggs as the regulations say you need.

    FASCISM: You have two cows. The government takes both, hires you to take care of them and sells you the milk.

    PURE COMMUNISM: You have two cows. Your neighbors help you take care of them, and you all share the milk.

    RUSSIAN COMMUNISM: You have two cows. You have to take care of them, but the government takes all the milk.

    CAMBODIAN COMMUNISM: You have two cows. The government takes both of them and shoots you.

    DICTATORSHIP: You have two cows. The government takes both and drafts you.

    PURE DEMOCRACY: You have two cows. Your neighbors decide who gets the milk.

    REPRESENTATIVE DEMOCRACY: You have two cows. Your neighbors pick someone to tell you who gets the milk.

    BUREAUCRACY: You have two cows. At first the government regulates what you can feed them and when you can milk them. Then it pays you not to milk them. Then it takes both, shoots one, milks the other and pours the milk down the drain. Then it requires you to fill out forms accounting for the missing cows.

    PURE ANARCHY: You have two cows. Either you sell the milk at a fair price or your neighbors try to take the cows and kill you.

    LIBERTARIAN/ANARCHO-CAPITALISM: You have two cows. You sell one and buy a bull.

    SURREALISM: You have two giraffes. The government requires you to take harmonica lessons.



    Posted via web from Linux fanatic

  • Tushar Neupaney 4:56 pm on December 1, 2009 Permalink | Reply  

    Hewlett Packard (HP 530) due to snd-hda-intel making a click sound fixed 

    I had installed ubuntu in my uncle’s laptop hp 530. I had installed ubuntu 9.04 (jaunty jackalope) in the laptop. When I upgraded the distro into Karmic Koala, the audio started to make a clicking sound. So irritating and confusing. I tried to unload all the modules for sound first so tried:

    rmmod snd*

    then, tried to load each module independently, later to my notice only when the snd-hda-intel module was installed, the computer was going wooo.

    So  I thought that there is a problem in the module. Strangely the sound was not coming when I was running rhythmbox or vlc or some sort of video or audio player. Thus I had to search the internet for remedy.

    The solution is quite easy : you need to comment out the following line in /etc/modprobe.d/alsa-base.conf.

    #options snd-hda-intel power_save=10 power_save_controller=N

    I too found out that there were bug reporting of the same and a youtube video to demonstrate the problem. But I tried to search something else, I was looking for what is snd-hda-intel and why the hell is it needed when everyone is commenting it out. Actually, it is a module to control the HD Audio Controller, produced by intel. You will come across this, when you type the command lspci. This module is used to control the Intel audio bus, but is quite less thought about project. Thus, creation of some audio disturbances are of no interest to the community.



    Youtube video explaining the problem:
    A Bug in Launchpad:

    Posted via web from Linux fanatic

  • Tushar Neupaney 7:36 am on December 1, 2009 Permalink | Reply  

    Could not determine the server’s fully qualified domain name : apache2 

    I just installed the new karmic koala, in my laptop. After I configured everything i installed apache2. While i started the apache2 service daemon I bumped into the following error:

    apache2: Could not determine the server's fully qualified domain name, using for ServerName

    While this error is not new to people who have configured apache previously, but the remedy was wonderfully easy. So i wanted to share this with you folks. To do so, you need to edit the httpd.conf file located in /etc/apache2 folder. You need to have sudo access (Obviously). So choose your favourite editor and write the following lines in it.


    This majical line will solve your problem. Try restarting the service by the following command and watch the error fly away.

    sudo /etc/init.d/apache2 restart

    Posted via web from Linux fanatic

  • Tushar Neupaney 2:12 am on September 11, 2009 Permalink | Reply
    Tags: assumptions, explanations, future, nanotechnology, science, singularity, technology,   

    Next Top Trends in Science and Technology 

    As we all know, trends are things that matters the society the most. Actually, it is not who matters but society shapes the trends and to understand the flow of society, analysis and importance of trends grow by folds. I came across the future trends things in the internet. Sort of ran into it.


    Technology with it’s frogleap, is being quite unsually complex to predict, at what end will it come out. But some ideas are already created. Some have florished from the 80’s, some are younger when they belong to 90’s and this millenium. Some forcastable conditions are:

    1. The smaller reveiled
    As suggested by the name, nano technology is the science of small things. In the future almost everything including food, drugs, clothes,
    machines … will have nanotech built-in. They will not only be a household item but also be integrated to ourselves as unseperable.

    2. Singularity
    The rise of machines, where machines will not only be intelligent than humans but also achieve rapid growth, conciousness and the power to replicate itself.

    3. Discipline convergence
    We have seen subjects converging with each other already. For example engineering has converged with computing and in future we will see nanotech which
    will be a convergence of biology-physics-engineering-chemistry and lot others.

    4. Universe answered
    We already know universe and it’s unpredictabiligy. This won’t be so, the queries about the universe and the smaller fractions like quarks will end forever but we still
    can’t predict what will happen next.

    5. Geo Tagging
    You will no more be in congnito, world will find out exactly where you are through RFID. This won’t make life hard coz you can choose what to make public. This will
    help you open doors at office, home and banks.

    6. Device Convergence
    Ya, we know it’s happening. For e.g. your iphone can call someone, play music, play games and browse the internet. This seriously is a convergence.

    7. Time traveling
    Though it might seem fantasy, but physics is damn sure it happens. Theoritical physicist have claimed and devoted their lives for this.

    8. Human Genetics
    Humans will be able to regenerate their body parts and clone themselves too. We will have genetically engineered childs. Looks weird but true

    There are limitations here, coz future can be predicted from all sort of angles, disciplines, perspectives and majors.
    Please put your view in the comment.


    Posted via email from Linux fanatic

    • Claire 5:56 pm on September 11, 2009 Permalink | Reply

      Experiments in much of what you are describing above are well underway. Only they are not going too well, with over 15,000 families all over the world are suffering from something called “Morgellons Disease” – nanotechnology and gene transfer gone bad.

    • Tushar Neupaney 6:12 pm on September 11, 2009 Permalink | Reply

      I am not a medical personnel but according to wikipedia “Morgellons Disease” is considered some sort of psychosis by cdc, still a form of unconfirmed disease and disease condition.

      Well in that case you may be true. Maybe technological advancement has not achieved much in these diseases. But theoritically speaking, if we understand the working of all genes can we not find out the cure? Yes we can. Here in the blog, I have supposed a more positivistic approach of the future. Thus considering only things similar.

      There are other aspects and theories of future. Other schools of thought remains. Read this entry at wikipedia:,_humans_and_planet_Earth

    • Richard Watson 12:19 am on September 15, 2009 Permalink | Reply

      Here’s a possible new trend. The idea that we will start asking whether we should do something rather than whether we can do something.


  • Tushar Neupaney 5:30 am on September 9, 2009 Permalink | Reply  

    Nitche bash commands to use 

    I use a lot of scripting for my daily stuffs. I had listed a collection of commands that are useful to me and guess is useful to everyone else reading this blog.
    The stuffs below are collected from different sources but i have tested them for working conditions.
    If there are any other ways of doing the same thing, please comment.

    1. Connect via ssh using mac address
    ssh root@’for ((i=100; i<=110; i++));do arp -a 192.168.1.$i; done | grep 00:35:cf:56:b2:2g |
    awk ‘{print $2}’ | sed -e ‘s/(//’ -e ‘s/)//

    2. Show directories in the PATH, one each line
    echo $PATH | tr \: \\n

    3. Check your unred yahoo mail with wget
    wget -q -O – –load-cookies=cookies.txt “
    fid=Inbox&order=down&pSize=25″ | sed ‘s/<[^>]*>/\n/g’ | grep ‘.’ | awk ‘/^Unread$/,/KB$/’ |
    grep -v ‘&nbsp’ | sed ‘s/^Unread$/===============/’

    4. Rip VCD
    cdrdao read-cd –device ATA:1,1,0 –driver generic-mmc-raw –read-raw image.toc

    5. Check your gmail from the command line
    curl -u username –silent “” |
    perl -ne ‘print “\t” if /<name>/; print “$2\n” if /<(title|name)>(.*)<\/\1>/;’

    6. Remove html tags from a file
    sed ‘s/<[^>]*>//g’ index.html

    7. Make ISO file using the dd command
    dd if=/dev/cdrom of=output.iso

    8. Watch the load average of your computer
    watch ‘cat /proc/loadavg’

    9. List all harddisk partitions
    fdisk -l |grep -e ‘^/’ |awk ‘{print $1}’|sed -e “s|/dev/||g”

    10. Reinstall Grub
    sudo grub-install –recheck /dev/sda1

    11. Flash emergency signals from your computer
    while true; do xset dpms force off; sleep 0.3; xset dpms force on; xset s reset; sleep 0.3; done

    12. Scan all active ip addresses in your network
    arp-scan -l

    Posted via email from Linux fanatic

  • Tushar Neupaney 10:15 am on September 7, 2009 Permalink | Reply  

    Get twitter user information and details with perl 

    If you are wondering how to pull information of a certain user from twitter, wondering what he is saying and the number of people following him.
    These can be done with the following code. This code runs even under proxy. So you don't have to worry if some filthy animals have set proxy upon your freedom to use internet.

    Here I have used  the twitter::badge, html::linkextor, lwp::useragent modules of perl to do all the coding. You don't have to authenticate yourself before accessing the information.

    When i designed the code, i first run into a problem. I could not derive the user id of the specific user.
    I had to query his site and then find his id from the site. So if anyone, you know how to pull the user id from any sort of module or so, please write down.

    The code is in perl programming language:

    ——————— In twitter follow me @tneupaney —————————————–

    use Twitter::Badge;
    use HTML::LinkExtor;
    require LWP::UserAgent;
    my $user = shift;

    my $extor = HTML::LinkExtor->new(undef, $URL);
    my $ua = LWP::UserAgent->new;


    my $response = $ua->get("$user");

    if ($response->is_success) {
            $result = $response->decoded_content;

        my @rs = $extor->links;
        foreach $lnk (@rs)
            if ($$lnk[2] =~ m/.rss$/) {
                @rmslash = split(/\//, $$lnk[2]);
                @lnk_rss = split(/\./, @rmslash[5]);
                $i =@lnk_rss[0];
                $j = badge($i);
    else {
        die $response->status_line;

            my $id = shift;                          
            my $twitter = Twitter::Badge->new(id => $id);

            print $twitter->name.' says – '.$twitter->text."\n";
            print $twitter->name.' has '.$twitter->followers_count." followers\n";

    Posted via email from Linux fanatic

  • Tushar Neupaney 8:06 am on August 27, 2009 Permalink | Reply
    Tags: Administration, Monitoring, Programming, , System, ,   

    Examples of WMIC a hidden secret 

    WMIC stands for windows management instrumentation command-line, a well kept secret which has been silently being featured in Windows based Operating system actively after windows 2000. The tool is not only robust, powerful and flexible, it can also be used over the network seamlessly.

    To access this tool, you have to enter wmic in the command line of windows, which will end up in it’s own shell. Mostly, you should have wmic installed as it is the default in windows, you may also see a message saying wmic installing which happens for the first time only. It basically works after the WMI service starts to run. WMIC also has an easy API structure. To use the api you will have to use the WQL or Windows Query Language which is quite similar to SQL or Structed Query Language.

    The format of WMIC is:

    WMIC [Credentials] [area] [QueryString]

    Some Examples and usage of WMIC:

    1.  To get the process list – wmic process list
    2.  To get the group list – wmic group list
    3.  To get the NIC Card Configuration – wmic nicconfig list
    4.  To get user account list – wmic useraccount list
    5.  To get the built in System account list – wmic sysaccount list
    6.  To get the Environment list – wmic environment list
    7.  To get the information of all shares (including hidden) – wmic share list
    8.  To get the list of services – wmic services list
    9.  To get the computer system details – wmic computersystem list
    10. To get the volume information – wmic volume list
    11. To get full startup list – wmic startup list full
    12. To get Information of logical disks – wmic logicaldisk get description, filesystem, name, size
    13. To get screensaver information – wmic desktop get screensaversecure, screensavertimeout
    14. To get logon information – wmic logon get authenticationpackage
    15. To get information about the OS – wmic os get name, servicepackmajorversion
    16. To get information about QFE (Quick Fix Engineering) – wmic qfe get description,installedOn
    17. To get information about the computer – wmic csproduct get name,vendor,identifyingNumber
    18. To get the toal ram – wmic computersystem get TOTALPhysicalMemory,caption
    19. To get the macaddress of nic card – wmic nic get macaddress,description

    Note: In all the above you can use “brief” command to get a brief list of information and “full” to get the full list of information, for example use wmic process list brief, wmic process list full.

    Doing some niche tasks from wmic:

    1. Updage static ip address
    wmic nicconfig where index=9 call enablestatic(“”),(“”)

    2. To Change the network gateway
    wmic nicconfig where index=9 call setgateways(“″,””),(1,2)

    3. To start an application
    wmic process call create “paint.exe”

    4. To enable dhcp
    wmic nicconfig where index=9 call enabledhcp

    5. To kill an application
    wmic process where name=”paint.exe” call terminate

    6. To change the process priority
    wmic process where name=”iexplorer.exe” call setpriority 64

    7. To get name and process id of a process
    wmic process where (Name=’svchost.exe’) get name,processid

    • Tawattetres 5:47 pm on December 9, 2009 Permalink | Reply

      Good article, amazing looking website, added it to my favorites.

    • Roshan 6:45 am on July 26, 2012 Permalink | Reply

      Can we use wmic command to fetch logs from devices with IPv6 addresses ??

    • Bart 2:54 pm on May 29, 2013 Permalink | Reply

      using WMIC …. /format:htable > file.html – output to file.htm as html table layout
      using WMIC …. /format:hform > file.html – output to file.htm as html form layout

      get information of multiple system thru 1 command

      create text file server.txt:

      using WMIC /node:@server.txt ….. – enumerates for servers A B C

  • Tushar Neupaney 7:16 am on August 26, 2009 Permalink | Reply
    Tags: Remote Administration, , SNMP, ,   

    Remote Administration of Windows System 

    Windows based system can be penetrated from outside by using different tools. Some are tools from microsoft themselves and others are from around the globe. I would like to shed light on some tools that I think are very important. Microsoft uses IPC share, remote desktop, remote registry, WMIC and RPC for controlling itself remotely. In which  the most important is RPC or remote procedure call. RPC is not only powerful but also must vulnerable service that windows has. WMIC stands for windows management instrumentation command-line. The scope of this article limits going any further on wmic and rpc, have to write another blog for them.

    Tools other than microsoft's own, uses protocols like wmic, rpc, snmp or self opened ports to communicate between server and client software. These tools are very efficient but also a threat if the system admin could not identify the real motive of the software. For security reason automated remote system administration is very risky. Manual administration puts the system admin in total control of the network thus, keeping the risks at bay.

    The reason behind doing remote administration of windows system is to minimize the loss of time, cost and increase efficiency. Computers are being very advanced everyday and normal users cannot catch up the pace. With this advancement comes severe threat of viruses and malwares. To control, monitor and repair compromized systems, remote administration is a must.

    Remote administration also includes remote installation of operating system. For remotely installing windows in computers in the network, disk clonning and disk imaging are being widely popular. Free and Open Source tools like FOG, commercial product like Norton Ghost are growing favourite of admins. This tools use PXE network boot to pull disk images from client computers to servers. After pulling all information, it can also write back to the client disk all the information from the previously pulled disk image. This means installing windows and all necessary software in one computer and distributing it to many computers around the network. Later on you must have to authorize the licence of windows on each computer. This can also be done remotely. You have to consult microsoft for multiple licence.

    Installing software remotely is very crucial. To make things work better and with ease, system admin must be able to do so. But remote software installation is not like eating cheese pie. You can use remote execute (reexec.exe) for doing so. There are windows terminal services and remote desktop which can help you do that with ease. If you want to do it in your own, remote installation can be done with RPC.

    Tweaking and configuring remote computers can be done by creating inf files. These files are registry editing system built by microsoft. With INF files you can delete, add and edit registry values. You can remotely install inf files and edit registry for performance tweaks.

    Creating scheduled tasks in client systems will also make your work lot easier. Tasks like disk cleaning, defragmentation and scanning can be scheduled to minimize multiple initialization of routine tasks.

  • Tushar Neupaney 12:43 pm on August 23, 2009 Permalink | Reply
    Tags: Curl, , , Longurl, Perl, Short url, , , url, XML   

    Using perl to convert short urls (shortened urls) into long urls 

    Perl is a powerful and useful programming language. It has been largely popular for it’s string manipulation, speed and ease of using. Perl is one of my favourite languages of choice. It suits best for small programs which needs to one thing but do it best.

    When I was writing a software to analyse twitter statuses, i had to see what people were actually trying to say. In twitter culture people include urls to present their view. For example, to say you don’t like Obama’s new agenda, you can give a link to a url where the view is strongly presented. Thus, to abstract the sentiment of tweet by a tweeter user, I had to look for url present in their tweets and rank their sentiments. Also, due to the limitation of tweet being 140 character, people include shortened urls in order to save spaces. These short urls use services like, tinyurl, etc.

    Thus to lengthened the shortened urls, i built my own perl code. I made a sub function where I will pass a short url and it will return a long url for me. This will mean that when I come across a long url in a tweet I can immediately get a long url of it and get the rank of the site after seeing it (manually).

    The libraries and modules that I used is WWW::Curl::Easy and XML::QL. This script basically uses the api of The result which is returned from the site is what we need after we do some small formatting. WWW::Curl::Easy is the backend to pull the page. By using the XML::QL module we can actually find the location from the xml data which comes by when the curl function returns the result.

    The Code:

    use WWW::Curl::Easy;
    use XML::QL;


    sub long_url
    my $url = shift;

    $url =~ s/:/%3A/gi;
    $url =~ s/\//%2F/gi;
    $url = ‘‘ . $url;

    my $curl = new Www::Curl::Easy;
    $curl->setopt(CURLOPT_URL, $url);
    my $response_body;

    open(my $fileb, “>” , \$response_body);

    my $retcode = $curl->perform;
    my $result;

    if ($retcode == 0) {
    my $response_code = $curl->getinfo(CURLINFO_HTTP_CODE);
    open (FL, “>tmp_curl”);
    print FL $response_body;
    close FL;

    my ($qry,$long_url);
    $qry = ‘WHERE <long-url>$long_url</long-url> ORDER-BY $long_url IN “file:tmp_curl” CONSTRUCT $long_url’;
    $result = XML::QL->query($qry);
    return $result;
    } else {
    $result = print(“An error happened: ” . $curl->strerror($retcode).” ($retcode)\n”);

    And According to Mr. Laryy Wall the following can be a small alternative to the above:
    perl -MLWP::UserAgent -e ‘print LWP::UserAgent->new->get(””)->base’

    • Larry Wall 1:40 pm on August 26, 2009 Permalink | Reply

      The answer would be much simpler using Perl’s LWP library. Here’s a simple command line:

      perl -MLWP::UserAgent -e ‘print LWP::UserAgent->new->get(“”)->base’

    • Tushar Neupaney 5:56 am on August 27, 2009 Permalink | Reply

      Thanks larry, that was a nice one.

Compose new post
Next post/Next comment
Previous post/Previous comment
Show/Hide comments
Go to top
Go to login
Show/Hide help
shift + esc