Monday 29 October 2012

How to find and kill process

How to find and kill process in ubuntu


First step is to find a process which we want to kill.

To do this type command:

ps aux

This will give us the whole list of processes

If you know the name of the process that you want to kill type:

ps aux | grep NAMEofTHEprocess

for example

ps aux | grep firefox

The output will look like:

user  14585  8.8  1.9 544200 161520 ?       Sl   16:27   1:23 /usr/lib/firefox/firefox

I underlined number of the process which we need ...

...to kill the process

kill 14585

If the owner of the process is root then you have to become root first and then run the 'kill' command

sudo -s 

kill 14585

Good luck with killing!

This example shows how kill command looks like in ubuntu terminal.



Friday 26 October 2012

Vim find and replace command

How to search and replace entries in vim?

vim find and replace command looks as follows:

:%s/one/two/g
Looks for 'one' and changes it to 'two' in the whole file

:%s/one/two/gc
Searches strings 'one' and replaces with 'two'. 'c' option means that vim is asking for confirmation first.

:%s/one\/two/gc
This command is changing 'one' to 'two' only if word 'one' matches completely

:%s/one/two/gi
Substitutes 'one' with 'two' with case insensitive option

:%s/one/two/gI
Find and replaces 'one' with 'two' with case sensitive option

Example of find and replace command in vim text editor.



Tuesday 23 October 2012

How to set up ntp

Ubuntu how to set up ntp?


First of all update all your repositories:

apt-get update

Next run the following command

sudo dpkg-reconfigure tzdata

 Choose you location:

NTP server setting up the location - country

NTP server setting up your city

As a confirmation you should get the following information:

Current default time zone: 'Australia/Sydney'
Local time is now:      Fri Oct 19 11:30:48 EST 2012.
Universal Time is now:  Fri Oct 19 00:30:48 UTC 2012.


Next step is to update the address of ntp server. In this case we will use ubuntu ntp server. Open ntpdate file:

sudo vim /etc/cron.daily/ntpdate

and put this line into the file:

ntpdate ntp.ubuntu.com

The last step is to change permissions on the ntpdate file so that they can be read by the system to every user:

sudo chmod 755 /etc/cron.daily/ntpdate

Now you can check in the time is set properly on your ubuntu. Run this command:

date

And that is it!



Saturday 20 October 2012

How to install Network Connect on ubuntu

how to install Network Connect on ubuntu



NC installation on ubuntu is pretty straightforward if you have fresh system:

update all the repositories:

sudo apt-get update


Install the following packages required to make network connect work:

sudo apt-get install -y openjdk-7-jre; apt-get install -y openjdk-7-jdk; apt-get install -y icedtea-7-plugin


And then reboot

sudo reboot

Need IT penetration testing?

If your network connect does not work then execute the following command:

sudo update-alternatives --config java 


and pick opensource java version:

/usr/lib/jvm/java-6-openjdk-i386/jre/bin/java



Now starting network connect from your web browser should work.

Wednesday 17 October 2012

What is ubuntu


Ubuntu  is a standalone linux operating system.

It is designed to be used in the office as well as at home.

The whole project is sponsored by Canonical Ltd. and Ubuntu foundation.

Name 'Ubuntu' comes from language of two south africal tribals: Zulu and Xhosa.

Ubuntu means humanity towards others.

The main goal of this linux distribution is to provide users with complete, user-friendly, stable and open-source operating system.

Ubuntu is released every 6 months.


The main features of Ubuntu are:

- default settings and automatic hardware detection

- simplified administration with use of sudo, apt-get and GUI (graphical user interface)

- Ubuntu is based on the GNOME graphical environment

- Ubuntu Software Center - an easy way to install new applications

- disabled people support software

- multilingual distributions

- according to participate in Debian family Ubuntu has got huge variety of software available and tested

- LTS (Long Term Support) ubuntu version is distributed every two years in October. The support is
provided for another 5 years including security and software updates

- for Ubuntu 12.04 minimum hardware required is 1GHz Pentium4 512Mb RAM and 5Gb HDD


- server version available


Ubuntu is the most popular distribution of Linux operating system in the world and third most popular operating system right after Windows and MacOS.

You can  download ubuntu from here.


And this is probably the best ubuntu forum ever.