Some useful Google Chrome extensions that I use – Part 1

  1. AdThwart: Blocks ads based on Firefox Adblock plus filter engine. I prefer this one to the others as it works exactly the same as Adblock plus on Firefox, and other seem buggy, up till now.
  2. Google Mail Checker Plus: Checks your Gmail, adds a little icon to the upper right corner of the browser and provides nice visual and sound effects to indicate any new incoming mails
  3. PanicButton: Don’t get caught :)), a single click or a keyboard shortcut can hide all your tabs and can even password-protect them not to allow anyone to recover the ones you’ve hidden
Tagged , , , , | Leave a comment

$@ is not "$@"

when you want to pass multiple parameters through you shell script, you use $@
ex:

#! /bin/sh
echo $@

and then execute this file:

./script1 hello world

the script will prints “Hello world”

But be ware, $@ is not “$@” !!

The story is, I wrote some Java file that accepts 1 argument from the command line, such like this:

public class SayHello{
public static void main(String[] args){
if (args.length != 1){
System.out.println("Usage: SayHello ");
System.exit(-1);
}
// do other staff here
}
}

I have wrapped this program in a shell file “sayHello.sh”:

#! /bin/sh
java SayHello $@

But the result was unexpected, as when I run with this command:

./sayHello.sh "Mohammed Hewedy"

I got

Usage: SayHello

I found the problem in the shell file, that I should use “$@” instead of $@
So, the script should be:

#! /bin/sh
java SayHello "$@"
Tagged | Leave a comment

Restarting USB Storage Modules in Ubuntu

sudo modprobe -r usb_storage
sudo modprobe usb_storage


It’s only because I had a problem in mounting any USB storage, it happened with me once
and I had to restart my machine, and I hate having to do so 🙂


Source

Tagged , , | 1 Comment

Download Videos From YouTube using Ubuntu

A very nice command-line tool that allows you to download videos from Youtube:

“sudo apt-get install youtube-dl”

After the installation process, run:

youtube-dl video_url

Tagged , , | Leave a comment

Stop YouTube from autoplaying a video when opened

A very nice plugin for Google Chrome (or Chromium) that allows you to open as much videos as you want without them playing automatically where you must open each video and pause it yourself.

The surprise is: It’s pre-buffering 🙂

Stop Autoplay for YouTube

Tagged , , , | 1 Comment