Thursday, December 30, 2010

Increase / Decrease margins in PDF

Increasing or decreasing margins in PDF is what most of us need to do, specially when printing journals/letters etc on A4 sheets, or vice-versa . I tried few softwares myself, they are as follows :-

Free/Open Source :-

Pdfcrop is good for small files and works well. It takes long long time as well as CPU for large files and hence is almost useless for them. But i must complement the authors work and his will to release it for free. You can use it if you have upto 50-100 pages PDF.


Paid/Shareware :-

Adobe Acrobat Reader Professional  :- This is great software with inbuilt capability of croping pages, remove white margins (although some times with variable size pages get screwed up, but its good).

See http://www.itg.ias.edu/node/504 for cropping help, also try the remove margins, its just below the step to specify margins manually .

Unfortunately i couldn't find a way to increase margins in it, please comment if you know how.

Pdf annotator :- This is great software, and is good in trial version, specially if you want to edit just one or two documents :). Increasing margins also supported. Cropping is though is a bit clumsy but does job for most of the pdf's


Lastly :- If printing a book or something similar, don't forget to choose even/odd page option, according to binding and other details, else you ll end up messing the printed documents :P

Sunday, December 26, 2010

Mounting Remote folder over ssh as drive in windows

Most of the times we want to mount remote folder as a drive in windows. Although windows provide a good mount feature, its some not possible to do so due to firewall restrictions. Also mounting drives from different OS such as Ubuntu/Fedora in windows is not inbuilt.. Here NetDrive comes in help, its free for non-commercial use. It can mount drive over FTP/SFTP and is great to use. Although FTP is a much faster than SFTP (FTP over SSH), but is unsecure. Just install a FTP or SSH server, configure default  foder, and use netdrive to do the rest :).

Pdf printer for windows

Hi all, recently i was stuck with pdf printers, i looked on the net but none seem to be sufficient for all my needs.


I suggest two of free pdf writers for use , doPDf  and CutePdf writer.


doPdf is good for small files especially office or html files, but performs too slow with larger files. PDF files are some what more clumsy. (If u use lpr for printing, you know sometimes you need pre-formatted documents to avoid problems later). Size is comparatively smaller than those made by other pdf writers.
Its awesome, especially for resumes. Embedding fonts option add a little extra size and some minimal quality to produced pdf (I dint find any :P).

CutePDF is faster and good for large files. The output size is slightly larger than those produced by doPDf, but the speed is a factor when printing large files. Not good for small ones.


So i suggest you to use doPdf for small files (1-50 pages) and CutePdf (50+). Also doPdf starts consuming lot of memory and CPU for large files , so it wont be practical to use. Both are small in size and can be installed side by side.

Thursday, December 16, 2010

Adobe reader / Flash Player without DLM

Adobe !!! I dont want DLM but i am stuck with it .. it is forefully installed on all windows system now for reader download.. But who wants unwanted software on his comp ??

Solutions :-

1) Use thier FTP site for most of the products. This is explained in

http://www.techerator.com/2010/07/how-to-install-adobe-reader-without-installing-adobe-dlm-download-manager-browser-plugin/

Their FTP site is ftp.adobe.com

2) Solution one is awesome but i was stuck, my institute dont allow ftp access, but here good news, windows is not the only OS(although one of the best for PC, i know many would disagree). The adobe states that DLM is installed on all supported systems ( http://kb2.adobe.com/cps/520/cpsid_52001.html ). But good news is most linux distros are not supported for now, i tried on ubuntu and fedora. Just choose different OS option and download :) enjoy. You can also save the link for future reference :)


Adobe reader X for windows is available at :-
http://ardownload.adobe.com/pub/adobe/reader/win/10.x/10.0.0/en_US/AdbeRdr1000_en_US.exe

And the directory listing is forbidden :(

ardownload was initially just download.. but adobe keep changing it :( Just for forcing adobe DLM ... I thought only apple would do so .. :D


Flash player is at :-

http://fpdownload.adobe.com/get/flashplayer/current/install_flash_player.exe

Monday, November 22, 2010

High CPU usage, it may be Overheating

Recently i observed a very peculiar thing , my CPU usage became exceptionally high for almost all applications. I had installed Office 2010 Pro, and suspected it to be a culprit. I used to download at more than 5MBps from local lan (DC++) so i reinstalled its latest version, i used defragmenter, Disk check and what not.

Eventually almost everything stopped working and my laptop made strange noise (on running any audio for long). I opened my laptop and unfortunatly it was  very hot .. alas the cooling fan had stopped  :( .


After enough cooling i started my laptop and it worked seamlessly. I now use a cooling pad (till i get a replacement for cooling fan).


So i suggest all of you too look for any signs of overheating (usually only when cpu fan is not working) if CPU usage is very high and get a replacement for it as soon as possible,till then use the laptop in low frequency mode and don't run CPU intensive tasks (It needs more cpu cycles hence more heat generated).

Overheating might damage your CPU beyond repairs, so be careful.

Wednesday, October 13, 2010

How many servers do google have ??

Many people (including me) ask how many servers do google really have ???
According to me the number is more than 1 Million.
Here's how i calculated it, estimates are pretty old in some cases.

  • Size of google index  > 100 Million GB
  • Number of users on gmail >  176 Million http://www.youtube.com/t/fact_sheet
    Considering just 0.5 Gb per account on an average (Not all of 7.xxGB is used, hence its most likely to be shared among users)
    The size is > 88 Million GB (This is much less than actual, but for the time being let it be)
  • Size of youtube > 50 Million GB (>54 million registered users, which exclude the GB's of videos from educational institutions) (also see http://www.youtube.com/t/fact_sheet)
Without including Google earth (it ought be few million GB's) , picasa, and many other google products, we are aready at 200 Million GB mark .

Including all those will make us cross 300-400 million mark. And these figures are pretty old. So therefore considering a 250Gb harddisk(with around 200 Gb useable) with each server (see bigtable paper in google research labs) i feel that google has more than 1 Million servers :)

Monday, August 30, 2010

Pintos Project 2

Hi all ,


This is for my friends who are stuck with pintos project 2. I encountered few problems while creating a virtual disk for use with pintos. First of all the instructions given in pintos guide are outdated, and need few changes. Secondly the guide is different from installation manual, and don't talk much on virtual disk. I have enlisted the steps to followed :-


  1. First of all use make in directories pintos/src/examples pintos/src/userprog pintos/src/threads

  2. Now your working directory is pintos/src/userporg

  3. pintos-mkdisk fs.dsk 2
    This command will create a new disk named fs.dsk in current directory. Note that this command have variants, and change between versions. So better type pintos-mkdisk , to get the latest syntax.
  4. Now edit pintos perl script which resides in bin (most probably, bin have few more scripts such as pintos-gdb pintos-mkdisk etc). Change os.dsk to $HOME/pintos/src/userprog/os.dsk from $HOME/pintos/src/threads/os.dsk where $HOME is for making the path absolute. If we don't do this we might error like "option -f not found" and suffer from kernel panics. -f option is used in second step.
  5. Format the disk using pintos -f -q (better from pintos/src/userprog to avoid any confusions).

  6. Other instructions are same as given in pintos guide.
The pintos guide is awesome, but is a bit outdated at few places. :)

    Sunday, June 20, 2010

    Subversion Proxy settings

    Hi all ,

    This post is for my friends who are stuck behind proxy that needs authentication and wants to use subversion for fetching latest source codes , and use other tools dependent on subversion like msfupdate(Metasploit update).


    Do to the proxy settings go to /etc/subversion and edit servers file .


    You need to edit global section of this file . A snippet is given below.




    [global]
    # http-proxy-exceptions = *.exception.com, www.internal-site.org
    http-proxy-host = Myhost
    http-proxy-port = Myport
    http-proxy-username = Myusername
    http-proxy-password = Mypassword
    # http-compression = no
    # http-auth-types = basic;digest;negotiate
    # No http-timeout, so just use the builtin default.
    # No neon-debug-mask, so neon debugging is disabled.


     One can also add exceptions . The group settings can also be used to specify the proxy server , but these will be particular to a group.


    I needed sometime to figure it out as the Svn site don't explain this clearly.

    Thanx for reading:)

    Always have your stuff when you need it with @Dropbox. Sign up for free! http://db.tt/V9f0DFoI

    Wednesday, June 16, 2010

    Installation Guide For PF_RING


    Hi,
    This is my first guide so please bear with me for any disrespencies.

    These steps were tested on Intel Core 2 Duo machine with 4 GB Ram and  Intel(R) PRO/1000 Network Card , with Ubuntu 9.10 installed.This guide explains the installation procedure for Version 4.3.1

    PF_RING implementation by Luca Deri is a great method for efficient Packet Capture on Commodity Hardware.It can be found on http://www.ntop.org/PF_RING.html


    I made a clean install,no other packages were installed other than mentioned.


    1. Uninstall libpcap and other dependent applications/library using syanptic or apt-get
    2. Install subversion(For fetching latest source codes),flex and bison(Required to recompile pf_ring aware pcap),ethtool(if not preinstalled,required for some basic Nic info of your computer)
    3. Use Subversion to fetch source codes
      svn co https://svn.ntop.org/svn/ntop/trunk/PF_RING/  PF_RING
    4. Check your current network card/driver using ethtool

      ethtool -i eth0
      #change eth0 to your ethernet card

      Sample

      driver: e1000e
      version: 1.0.2-k2
      firmware-version: 0.4-3
      bus-info: 0000:00:19.0



      use
      man ethtool for more information on how to use ethtool

      As of version 4.3.1 PF_RING can be fully exploited only on the PF_RING aware device drivers.The modified device drivers for some of the popular network cards can be found in PF_RING/drivers .

      These are modified version of the drivers supplied from respective companies.(Might be a bit older sometimes but will work)
    5. Unload the ethernet card driver (this is shown in the first line of output of above command

      sudo rmmod e1000e
    6. Change current working directory to kernel

      cd PF_RING/kernel
    7. Make the source codes

      make


      Here i had observed that many a times people(even I on first attempt)use
      sudo make or sudo -s , make . The former is not a correct method and will give you errors such as bounds.c missing , etc.
      Latter is also wrong but will do the job . The reason for such a thing is better explained by the difference in the command "sudo" and "sudo -s" . This can be found at http://ubuntuforums.org/showthread.php?t=983645 , or searching for "difference between sudo and sudo -s" on our favorite google
    8. Now install the newly build source

      sudo make install
    9. Change the working directory to PF_RING/userland/lib

      cd ../userland/lib

    10. Again build the source codes

      make

    11. Install the library (This include pfring.h)

      sudo make install

    12. One bizarre thing that I observed is that the make install copies pfring.h to /usr/local/include but leaves the other dependent files these are :-

      • pfring_e1000e_dna.c
      • pfring_e1000e_dna.h
      Although the function in these files are not required in much of the program, they are include in pfring.h and i don't want to mess up with that.So we copy this to /usr/local/include . Please check this in later versions .

      cp pfring_e1000e_dna.c /usr/local/include
      cp pfring_e1000e_dna.h /usr/local/include
    13. Now we have to compile PF_RING aware pcap library . Change the working directory to userland/libpcap-1.0.0-ring

      cd ../libpcap-1.0.0-ring/

    14. Configure

      ./configure

    15. Build the sources

      make

    16. Install pf_ring aware libpcap

      sudo make install
    17. Now we need to install the device driver(pf_ring aware).Change the working directory to drivers///src
      In my case it is "drivers/intel/e1000e-1.0.15/src"

      cd ../../drivers/intel/e1000e-1.0.15/src
    18. Build the source

      make
    19. Install the driver

      sudo make install

    20. Now we need to activate PF_RING if its not already activated . You can use lsmod to check if pf_ring is started or not.Change the working diectory to /lib/modules//kernel/net/pf_ring .

      cd /lib/modules/2.6.31-14-generic/kernel/net/pf_ring
      Use uname -r to get the kernel version
    21. Enable PF_RING(if already enabled you can disable it using sudo rmmod pf_ring)

      sudo insmod pf_ring.ko transparent_mode=1


      More on transparent mode can be found at
      http://www.ntop.org/blog/?p=56
    22. Now enable to enable your driver go to /lib/modules//kernel/drivers/net/e100e

      cd /lib/modules/2.6.31-14-generic/kernel/drivers/net/e1000e
    23. Enable the driver

      sudo insmod e1000e.ko

    24. Now you can start working on your PF_RING application.You will have to recompile many applications such as tcpdump(modified included),network manager etc. Google for doing so :)
    Hoping for a positive reviews :) and comments .I l soon post the usage guide for PF_RING .