Tuesday, February 16, 2016

ssh - common usage

Hi,

As I put the title of this post, I give simple examples to use it.

What is ssh:
 - ssh is the software utility to connect to remote host/machine(directly to the shell).
 - it supports when there is a 'sshd' service running in the remote machine only.
 - ssh is having so many methodologies to allow most of the clients based on some secure logging techniques.
 - Mostly we use ssh key pair(RSA)  to login to host.
 - SSH is used widely to secure the server from unknown logins even though a person knows the username/password to login.
 - with the help of keypair we use to secure the login.

Simple usage:
 - Generate key pair with below command using any ssh client.

 command: $ssh-keygen -t rsa -C "Some Name"

and while generating we can give password for shell login as an additional security if we want.

Process:
- Usually ssh-keygen generates a key pair (1-public key, 2-private key)
- We don't share the private key and we keep it with us in our machine.
- We will place the public key in the remote host (~/.ssh/authorized_keys).
- While logging to the host ssh client interacts with sshd server and verifies that this ssh client is valid or not based on these key pair match.
- If key pair is matched then only the sshd allows us to login to host.




nano - A simple text editor like vi

Hi,

For people who feel that 'vi' is hard to work then switch to 'nano'.

Like 'vi/vim' this 'nano' also there in almost all linux flavors.

I use it for simple text editing like correcting a word/line in a text file.

Below is the sample screen.

command: $nano


The above screen is having nothing in it, Its actually a fresh editor. We can type something you want and no need to remember any command like 'vi'(esc...i,..etc). Almost all commands it shows on the screen and there is no confusion also.


I usually two of them for regular usage
1) storing - ctrl+o --> Enter
2) closing - ctrl+x

That's all...

If you have interest to know more then take commands helps displaying on the screen.

Usage of 'ps' and 'kill' command in linux

Hi,

Here I have tip on processes.

suppose if I want to see list of currently running processes then we have a system command as 'ps'.

With this we can see list of processes as below if we use additional arguments.

command: $ps -ef




In the same way we have a scenario like, I want to see is there any java process running in my machine.

For this we have to filter above list of processes using additional pipe with grep,

command: $ps -ef | grep java



In this way we can easily find out whether any background service or any process running in the background.


Additional:
---------------

If we want to kill the above process then use 'kill' command with additional argument of 9.

command: $kill -9 7302

The above will invoke the system call kill on that process and the process will be killed in milliseconds.


Sunday, July 5, 2015

Fixing issue with Ubuntu default unity theme (no GUI - only wallpaper / desktop)

Hi,


Don't be panic if you are not able to see taskbar/panel/..etc after login.


Today I have tried to configure my machine's UI using compizConfigSettingsManager, sudden of GUI mode gone.

I googled it, after doing so many researches, I have found a fix as below,

(My machine was showing login window, but no GUI after login)

Step1) After successful login, right click on the desktop and select "open terminal" then go to your account's home directory.

Step2) List out all system/hidden files using "ls -la", then delete folder which ever starts with ".compiz or compiz*"

- Use sudo if it is not happened.

 * I have removed two folders in my home directory named as ".compiz" & ".config/compiz-1".

Step3) Restart Unity (default unity theme from ubuntu) after deleting above folders by using below commad or vice-versa.

 - setsid unity


Thats all, Immediately you will get GUI. Better you reboot the machine using "sudo reboot" from terminal.

:)

Tuesday, June 30, 2015

Fixing issue with Realtek Wifi on Ubuntu 14.X - Lenovo L440

Hi,


Today I have installed Ubuntu in my machine Lenovo L440, But there was no driver found for wifi since it has latest wifi driver which supports only for Windows.


After searching in the internet I have found a solution as below.



Steps:
-------

- Type the command 'lspci' in terminal. You will see the information of wifi hardware information as below.

02:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8192EE PCIe Wireless Network Adapter

- I have tried below links to install some unstable versions of driver software.

http://netbook-remix.archive.canonical.com/updates/pool/public/o/oem-wireless-rtl-92ce-92se-92de-8723ae-88ee-8723be-92ee-dkms/

http://netbook-remix.archive.canonical.com/updates/pool/public/o/oem-wireless-rtl8192ee-trusty-dkms/



Note: After installation, it may not work immediately. 



sources
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1239578
http://ubuntuforums.org/showthread.php?t=1457592&page=7





How to install Graphviz in Ubuntu 14.X

Hi,

Graphviz is a tool to generate diagrams using plantuml (one of the tools depending on it).


Below are steps to install Graphviz tool in Ubuntu.


Step1) In the terminal type below command with sudo permission

sudo apt-get install graphviz
This command will automatically downloads and installs it.



If you want to take a binary copy of this setup, then run below command in terminal

sudo apt-get download graphviz
This command will download a copy of the setup (*.deb) into current directory. You can keep it as backup ;)



Source: http://askubuntu.com/questions/196230/how-do-i-install-graphviz-2-29-in-12-04

Sunday, June 7, 2015

Cat command usage

Hi,

Here I will show you how to use cat command in some of the areas to utilize from command line (CLI).

1) If you want to display the content of a file in the terminal, then use as below.

Syntax : $>cat <filename>

$> cat samplefile.text
Hello how are you

2) If you want to create a new file with some text in it.

Syntax: $> cat > new-filename

$>cat > hellofile.text
Hi hello how are you

To save the file, use Ctrl+c

3) If you want to append some text to an already existing file.

$> cat >> oldfilename.text
Hi this is last line

To save the file/ append the text, use Ctrl+c

To be continued.....