Skip to main content

Posts

SOME ROUTING INFO AND NETWORKING

NETWORK LAYERS Application eg.ssh Transport  UDP,TCP Internet     Packets Link          Ethernet *)  To show up all interface and info execute ip addr show ---------------------------------- rahul@rahul-Inspiron-3542:~$ ip addr show 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00     inet 127.0.0.1/8 scope host lo        valid_lft forever preferred_lft forever     inet6 ::1/128 scope host        valid_lft forever preferred_lft forever 2: enp7s0: mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000     link/ether 74:e6:e2:00:24:53 brd ff:ff:ff:ff:ff:ff ---------------------------------- *) To show information about an interface execute ip -s link show l0 ---------------------------------- rahul@rahul-Inspiron-3542:~$ ip -s link show lo 1: lo: mtu 65536 ...

RAID

Check the Raid installed lspci | grep RAID     Software Raid ============== Linux Support For Software RAID Currently, Linux supports the following RAID levels (quoting from the man page): LINEAR RAID0 (striping) RAID1 (mirroring) RAID4 RAID5 RAID6 RAID10 MULTIPATH, and FAULTY. MULTIPATH is not a Software RAID mechanism, but does involve multiple devices: each device is a path to one common physical storage device. FAULTY is also not true RAID, and it only involves one device. It provides a layer over a true device that can be used to inject faults. Install mdadm Type the following command under RHEL / CentOS / Fedora Linux: # yum install mdadm Type the following command under Debian / Ubuntu Linux: # apt-get update && apt-get install mdadm How Do I Create RAID1 Using mdadm? Type the following command to create RAID1 using /dev/sdc1 and /dev/sdd1 (20GB size each). First run fdisk on /dev/sdc and /dev/sdd with " Softwa...

Fantastic netcat

Need a transfer speed which is 100+ better than scp or rsync, just follow this dd bs=16M if=/root/netcattest/file.txt |bzip2 -c| pv -b | nc 185.46.120.66 19000 nc -l 19000|bzip2 -d|dd bs=16M of=/home/mhtmi1ky1gpgg9py/netcattest/file.txt ------------------------------------- Server(sender) $tar -cvf - dir_name | nc -l 1567 Client (Receiver) $nc -n 172.31.100.7 1567 | tar -xvf -  ------------------------------- sender tar -cvf - netcattest | bzip2 -z | nc -l 1567 receiver nc -n 72.34.47.10 1567 | bzip2 -d | tar -xvf -

Flash cache implimentation

Flashcache implementation steps on Openvz  # cd /usr/src/  # git clone https://github.com/facebook/flashcache.git  # cd flashcache if you are facing some issues while installing git, you can use the below command # yum --disableexcludes=main install git -y Make sure the kernel-devel for current openVZ kernel is installed, otherwise you will get error while doing "make" # rpm -qa |grep vzkernel-devel-`uname -r` # make # make install Initializing the module # modprobe flashcache By checking out your kernel messages you can see that it has been initialized. # dmesg | tail ............................. [ 5806.891504] flashcache: flashcache-1.0 initialized # lsmod |grep flashcache flashcache             77223  0 dm_mod                 80860  1 flashcache  stop the VE and unmount the LVM umou...

SSH TUNNELING SOCKS5

You can access internet via linux server by below step Make sure your SSH have following settings tcp ip forward and tunneling is granted also rahul-Inspiron-3542 ~ # cat /proc/sys/net/ipv4/ip_forward 1 Once it is done you can access the server from your machine terminal rahul-Inspiron-3542 ~ # ssh -D 1080 root@ip Also make sure 1080 is allowed in firewall Navigate to firefox>preference>network>settings manual proxy sockshost localhost and port 1080 now checks whatsmyip :)

SMART tests with smartctl

SMART tests with smartctl    rahul-Inspiron-3542 ~ # smartctl --info /dev/sda | grep 'SMART support is:' SMART support is: Available - device has SMART capability. SMART support is: Enabled or  rahul-Inspiron-3542 ~ # smartctl -i /dev/sda | grep 'SMART support is:' SMART support is: Available - device has SMART capability. SMART support is: Enabled     rahul-Inspiron-3542 ~ # smartctl -H /dev/sda smartctl 6.2 2013-04-20 r3812 [x86_64-linux-3.11.0-12-generic] (local build) Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org === START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED To enable'   smartctl -s on -d ata /dev/sda     Run overall-health self-assessment test, enter:   smartctl -d ata -H /dev/sda     The following will provide even more information about failing hard disk: # smartctl --attributes --log=selftest /dev/sda   ...