Category: Ubuntu

Variety: Wallpaper Changer

Variety Software

Variety is an open source wallpaper changer for linux.

Features

  1. It allows to set your own wallpapers.
  2. Provide  an option to change wallpaper automatically on hourly, daily basis.

Installation

sudo add-apt-repository ppa:peterlevi/ppa
sudo apt-get update
sudo apt-get install variety

Open it either from dashboard or from terminal by running command “variety”. Set it according to your needs.

Screenlets: Desktop Widgets

The next thing to make your Ubuntu more beautiful is to display desktop widgets like clock, infoPanelDesktop in Ubuntu system with the help of Screenlets software using this link.

Wireshark: Packet Analyzer

Install Wireshark from this link.

Advertisements

Vim Configuration

Are you bored of using standard vim editor?

Do you really want to style and customise your vim editor? Then what you are waiting for.

I have configured vim using this link . The complete source code and documentation of vimrc file is written in my Github repo

Just follow the instruction given in the README.md file and impress your friends with it.;-)

Struggles:

After adding and installing plugin “YouCompleteMe” for auto-complete I was getting message while opening any file with vim.

“The ycmd server SHUT DOWN (restart with :YcmRestartServer)”

Even after running command :YcmRestartServer the problem stucked. After searcing on internet, I ran the python script “install.py” under “$HOME/.vim/bundle/YouCompleteMe”

The following table contains some of vim basic commands and the commands run for my vimrc file.

Command Description
Type v, yank lines then press Ctrl-c It will copy lines in visual mode. It will work if you copy this .vimrc file.
Tap Esc, then Ctrl -p It will paste lines in normal mode. It will work if you copy this .vimrc file.
:Te filename It will open that file within the vim editor. You can also select file instead of typing filename. For that type :Te and then open NerdTree(Ctrl +n) and select the exact file.
gt Switch between the files opened with :Te command.
Ctrl + ww Switch between the files opened with :Te command.
Ctrl-P It enables the search within the vim. It uses plugin ctrlp.vim.
:sp filename Split the layout vertically. It means the vim window is divided in two parts upper and lower.
:vs filename Split the layout horizontally. It means the vim window is divided in two parts left and right.
:b buffer_number Switch to that particular buffer.
:ls List all buffers. Buffers are the files open in that vim session.
0 To reach the beginning of a line.
$ To reach end of a line.
* Move to the next occurrence of the word under cursor.
# Move to the previous occurrence of the word under cursor.
gg To reach beginning of a file.
G To reach end of a file.
o To insert text into a new line.
dw Deletes the first word on the right side of the cursor.
. To repeat the previous command.
x To delete a character.
d$ Delete from cursor to the end of current line.
5yy Copy 5 lines.
line_no>>G To go to particular line number.
Yank lines,then type :e filename. Copy-paste from one file to other. Filename is the destination file where you want to paste the lines.

 

Common Ubuntu Commands

The purpose of this blog is to inculcate the readers with some of the important network related commands and other command used on daily basis.

Rename multiple files in the same directory with extension phps to php.

$ rename ‘s/.phps$/.php/’ *.phps

History Command in Ubuntu

$history  //This command maintains history of the commands you applied

The output of this command displays serial number and command only. What if you want to know when that command is applied and at what time? What to do so that your history command always display date and time also?

Here is the answer of all questions.

HISTTIMEFORMAT="%d/%m/%y %T "

Or, to make the change permanent for the current user:

echo 'export HISTTIMEFORMAT="%d/%m/%y %T "' >> ~/.bashrc
source ~/.bashrc

Then

history

Command which tells which ports are open by firewall is.

$ nmap  127.0.0.1

Output

Starting Nmap 7.01 ( https://nmap.org ) at 2017-10-13 14:09 IST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000077s latency).
Not shown: 991 closed ports
PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
80/tcp open http
110/tcp open pop3
139/tcp open netbios-ssn
143/tcp open imap
445/tcp open microsoft-ds
3306/tcp open mysql
5432/tcp open postgresql

Nmap done: 1 IP address (1 host up) scanned in 0.12 seconds

Command to print network connections, routing tables.

$ sudo netstat -nutlap | grep 25

tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 14277/master
tcp 0 0 172.20.10.3:47056 198.252.206.25:443 ESTABLISHED 2956/firefox
tcp 0 0 172.20.10.3:47596 198.252.206.25:443 ESTABLISHED 2956/firefox
tcp 0 0 172.20.10.3:47424 198.252.206.25:443 ESTABLISHED 2956/firefox
tcp 0 0 172.20.10.3:47618 198.252.206.25:443 ESTABLISHED 2956/firefox
tcp 0 0 172.20.10.3:47576 198.252.206.25:443 ESTABLISHED 2956/firefox
tcp 0 0 172.20.10.3:59342 54.251.241.152:443 TIME_WAIT –
tcp 0 0 172.20.10.3:47530 198.252.206.25:443 ESTABLISHED 2956/firefox
tcp 0 0 172.20.10.3:38490 54.251.58.133:443 TIME_WAIT –
tcp 0 0 172.20.10.3:51642 198.252.206.25:443 ESTABLISHED 2956/firefox
tcp6 0 0 :::25 :::* LISTEN 14277/master

SMTP Secure listen to port 465 and TLS listen to port 587

Command to open port

sudo ufw allow <port number>

eg:- sudo ufw allow 8082

To know more about Ubuntu commands read blogs under the same category.

Stay tuned! 🙂

 

Connect to Wifi through Terminal

Today, I learned various new commands of ubuntu.

Command to connect to wifi through terminal.

nmcli d wifi connect <WiFiSSID> password <WiFiPassword>

If you have to login for wifi through browser. You can follow steps listed below.

$nmcli d wifi connect <WifiSSID>                              //WifiSSID means name of Wifi

Then install elink through

$sudo apt install elink

If already done then type

$elink

Enter URL of login page and password. Congratulation you are connected through Wifi from terminal. It may seem tedious task but if you know the real power of terminal than this long procedure is worth in.

Inspite of this I used to online tool to edit the properties  like aspect ratio, height and width of image through online tool http://resizeyourimage.com/ . I have used it to fill GATE examination form.

 

 

 

 

 

 

 

 

 

 

 

 

Mutt- Mail User Agent

Mutt is apowerful program for reading and sending electronic mails.

I followed two references to install mutt.

http://nickdesaulniers.github.io/blog/2016/06/18/mutt-gmail-ubuntu/

https://www.linuxquestions.org/questions/linux-newbie-8/unable-to-configure-mutt-email-client-4175513968/

Mutt Installation

$sudo apt install mutt

$ sudo touch $MAIL
$ sudo chmod 660 $MAIL
$ sudo chown `whoami`:mail $MAIL

Create the ~/.muttrc file

set imap_user = "userName@gmail.com"
set imap_pass = "password"

set smtp_url = "smtp://userName@smtp.gmail.com:587/"
set smtp_pass = "password"

set from = "userName@gmail.com"
set realname = "Sender Name"

set folder = "imaps://imap.gmail.com:993"
set spoolfile = "+INBOX"
set postponed="+[Gmail]/Drafts"

set header_cache=~/.mutt/cache/headers
set message_cachedir=~/.mutt/cache/bodies
set certificate_file=~/.mutt/certificates

set move = no

For furthur usage of Mutt keep in touch with me.

 

 

 

Track CPU and Memory Usage and Time Command

Today, I tried to explore and customize Ubuntu.

Track CPU and Memory Usage in Ubuntu Using Indicator-Sysmonitor

It’s clearly explained in the following link.

https://www.maketecheasier.com/track-cpu-memory-indicator-sysmonitor/

For Ubuntu 18.04, I followed this link

Done.

Then to note time of consumption by a particular command. You can use command

$time <your command>

Example:- $ time renderd -f -c /usr/local/etc/renderd.conf

Output

real 9m34.716s
user 0m16.796s
sys 0m0.960s

Done.

For the first time I used bitbucket. It’s versioning control system.

For it install mercurial.

$ sudo apt install mercurial
$ hg clone https://bitbucket.org/lawgon/osmindia

 

 

Interesting Ubuntu Commands

To find the file. Its alterantive is locate command.

find -iname <filename>

i means case-insensitive. It is an optional.

eog a.png

eog means eye of Gnome. It shows image.

pdftk in.pdf cat 1-endE output out.pd
sudo easy_install -U pip

To install pip.

libreoffice file.odt

To open odt file in libreoffice. We can also open docx file.

pandoc -f latex -t docx -o irc.docx irc.tex

It will convert tex file to docx. We can also convert tex file to odt. For it just replace docx with odt.

Increase the Memory of Ubuntu Partition

Free/Unallocated Space

If you have not free space to extend the memory then shrink space from other partition. Below are the steps to do so.

  1. Open Gparted either from terminal or from dashboard.
  2. Right click on the partition you want to shrink.
  3. Click on Resize/Move and write the free space(in Mib) you want to unallocate.
  4. Click on Apply all operations (Tick button with a green color).

After this Start GParted in live Ubuntu session.

Also unmount (if they’re mounted) all the partitions that will be involved in the resize/move operation (by right clicking and selecting unmount from the context menu)

The partition you want to extend should be adjacent to the unallocated space. If not so, then we have move the in between partitions as was in my case.

gpar1.png

Here, I want to extend /dev/sda8 partition with 49.61 Gib unallocated space. But they are not adjacent to each other. So, I have to move the partition  /dev/sda6 to the left.

Right click on the partition /dev/sda6 and select move/Resize option. Drag the bar to the complete left.

(WARNING: moving /boot partition may cause boot failure!)

snapWarn

Click OK. You will able to see the progress. It might take an hour or more depending upon the number of operations and partition memory.

mov1

After the completion of a move the partitions was in the order as shown.

movv

Now, it’s time to extend the partition /dev/sda8 which was our main objective. So again right click and select Resize/Move option.

mov2

Extend the size of the window by expand it to left (in this case) and select Resize/Move.

In this case the partition will move to left as well grow.

mov5

mov6

Here, you can see the partition /dev/sda8 is increased by 49.61 Gib. Hope this blog would help you out.

For any queries or suggestions you may comment on this blog.

USB Bootable In Ubuntu

In my first blog, I explained how to bootable USB in windows through UUI. Today, I will discuss it in Ubuntu. Sounds interesting.;)

Search Start Up Disk Creater on dashboard and select it. It will pop up the window.

start.png

As shown in the figure you will be able to see the source disk image(.iso) or CD in your system. Select any one of them.

Then select the removable disk to be used to make it bootable.

Forward to click the option Make startup disk and you are done with it.

Format USB in Ubuntu

Format USB In Ubuntu

Search Disk on dashboard and select it. It will pop up the window.

Select the option of the disk you want to format.

Choose atleast 1 volume represented by it.

Select the gear(settings button popping for more actions) icon and click the option Format Partition.

format

You are done with it. Now you may safely eject your pendrive.:)