How to search the contents of a list of jar/tar files

If you have a directory, for example /home/mhewedy/libs/jars/, this directory contains many jar/tar files, and you want to search the contents of these jar/tar files .

use this command :

cd /home/mhewedy/libs/jars/
for jar in *.jar; do echo “— $jar —” ; jar tf $jar | grep NullPointerException ; done;

Note, you may also use this command to search a list of tars for its contents:
for tar in *.tar; do echo “— $tar —” ; tar tf $tar | grep some_file_name ; done;

Posted in Uncategorized | Tagged | Leave a comment

How to revert to the old notification system in Ubuntu Jaunty

I really don’t like the new notification system in Ubuntu Jaunty, I googled around for a while and found this simple solution if you’d like to revert to the old one as in Intrepid and before. Only one step is needed:

“sudo apt-get remove notify-osd”

Simple, huh? 🙂

Tagged , | Leave a comment

Install Network Manager 0.7 in Ubuntu Hardy, Intrepid, Jaunty, Karmic …etc

A very nice site called Ubuntu PPA (Personal Package Archives) where many teams contribute their own deb packages to be used by anyone, it’s not an official repository and many of the PPAs are for testing purposes only, but anyway some of them are extremely useful and can keep your software packages up to date. One of the best PPAs is the one for Network Manager (https://launchpad.net/~network-manager/+archive/ppa). To add the repository to your Software Sources list:

  1. Go to System->Administration->Software Sources
  2. Go to the “Third-Party” Software Tab
  3. Click Add
  4. Copy and paste the following line there (change jaunty with hardy or Intrepid, depends on the version you’re using:
    deb http://ppa.launchpad.net/network-manager/ppa/ubuntu jaunty main
  5. copy the following (you can get it from this url: http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0x248DD1EEBC8EBFE8) and paste it in an empty file and save it:
    -----BEGIN PGP PUBLIC KEY BLOCK-----
    Version: SKS 1.0.10

    mI0ESXX0pgEEAMDSk9Vd+OWZNIa4dL2SpqFAjVq/hm4Nac2oc33g+BwP3jFajUC/quPnYXXl
    N7GER+tTHJ9d0PlXQDoRxXFRdSjZYUHDkiT8UV1I+sTxkjDaA7uMXD4dEcL0SG0nh6OyHHrd
    9PrWzIZ/jS6PsYtKrKwHYCvP/igPr5/bH1PQoyZzABEBAAG0IUxhdW5jaHBhZCBQUEEgZm9y
    IE5ldHdvcmstbWFuYWdlcoi2BBMBAgAgBQJJdfSmAhsDBgsJCAcDAgQVAggDBBYCAwECHgEC
    F4AACgkQJI3R7ryOv+h8JQP+Ib07jYEiNG3PZf22xkV2rU/ybI9s4fT1CCoPJq5V3uJmouUs
    jtSXMD/9V44kFamw+Xq1EVEWeExfeABjaX7Vc9SR50Kl/DJVvBAbGs8rM2JxldQsl4sGWnTn
    AMJx/fv4iQsdyaklS3TcK6xo1yL21C4j0wYsmNxS16F28L3hRQ4=
    =8t/V
    -----END PGP PUBLIC KEY BLOCK-----
  6. Go to the “Authentication” tab and click “Import Key File” and then select the file you’ve just created above
  7. click close
  8. open a terminal and type “sudo apt-get update && sudo apt-get upgrade”
  9. Now you have Network Manager 0.7.1 :), I think you might need to restart networking or restart the whole machine, don’t remember exactly
  10. Enjoy 🙂
Tagged , | Leave a comment

Network Manager 0.7 Multiple Simultaneous Connections!

Four network connections active at the same time:

  • 3G connection (etisalat USB modem)
  • 2 wireless networks with 2 different wireless cards (the internal card and another external one)
  • 1 wired connection

This is EXTREMELY useful and I gained a lot of benefits getting connected to multiple networks at the same time and being able to direct the network traffic to its destination using proxies, check the screenshots below:


Note that there must be one default connection (that can be changed manually since version 0.7.1) that all the traffic go to except if else specified.

Tagged , , | Leave a comment

How to run a script in startup

I needed this feature to run a “read-only” mount for windows file system on startup (because I always hibernate Windows, so Ubuntu can’t mount it “read-write” by default on startup)

1- Write the script in a file and save it in /etc/init.d
sudo gedit /etc/init.d/my_script

2- make the file executable
chmod +x /etc/init.d/my_script

3- add the script to rc.d files
sudo update-rc.d my_script defaults

And …. it’s done.

There is a GUI tool to edit the rc.d called Boot-Up Manager (bum) , but I haven’t try it. It can be found here

Note: Many thanks to Ahmad Amr for adding me as a contributer in this blog …..

Posted in Uncategorized | Tagged | Leave a comment