Unix keystrokes

Adding this here just to memorize this good and very often unused keystrokes.Think that each person working with cli at least 1 hour a day should know this rather than moving the arrows 🙂

CTRL + B – Move the cursor left

CTRL + F – Move the cursor right

CTRL + A – Move the cursor to beginning of line

CTRL + E – Move the cursor to the end of the line

CTRL + W – Erase the preceding word

CTRL + U – Erase from cursor to beginning of the line

CTRL + K – Erase from cursor to end of the line

CTRL + Y – Paste erased text

CTRL + P – View the previous command (cursor up)

CTRL + N – Vie the next command (cursor down)

Would like to recommend a great book for Linux newbies who would like to learn a bit more :

How Linux Works: What Every Superuser Should Know

 

Mounting the iscsi target and checking performance.

Installing – Let’s use Debian based manager :

Apt-get install open-iscsi

Apt-get install iperf

Apt-get install nload

Scanning for targets :

Iscsiadmin -m discovery -t st -p target_ip

Iscsiadm -m node -u

Iscsiadm -m node –login

Check if you see the object :

Lsblk

New disk should appear in dev – like sdx \–sdx1

How to partition (if wasn’t partitioned yet)

Fdisk /dev/sdc

N

P

Enter

w

Mkfs.ext4 /dev/sdx1

Connecting the drive to system

Fsck /dev/sdc1

Mount /dev/sdc1 /mnt

Creating big file with random data :

Dd if=/dev/urandom of=rnd.20G count=1024 bs=20M

Also you can check the copy speed live via rsync (when copying from mount location to mount for example) –

rsync –progress source destination

Live interface monitoring can be done via

nload – same like top but for nics

And at the end if you’d like to check what is the performance of network(without storage) – connect second host to same switch and run iperf

Iperf -s  (on servers side)

Iperf -c x.x.x.x -d     (-D option for simultaneous bi-directional bandwidth measurement)

Apt-get/Yum through proxy

APT-GET 

In case if your access is going through proxy server you need to provide the credentials to APT.

Just create an apt.conf file in /etc/apt/ and add there the following entry :

Acquire::http::Proxy “http://proxyadd:port”;

In case if authentication is needed :

Acquire::http::Proxy “http://username:password@proxyadd:port”;

YUM 

/etc/yum.conf

proxy=http://proxyadd:port
proxy_username=user
proxy_password=passwd