How to extract substring in Bash – nixCraft

Extract substring in Bash The syntax is: ## syntax ## ${parameter:offset:length} The substring expansion is a bash feature. It expands to up to length characters of the value of parameter starting at the character specified by offset. For example, $u defined as follows: ## define var named u ## u="this is…

Wipe and Shutdown Remote Linux Server

Using ssh or some other remote access, fire up a terminal session. Using screen or something similar, type the below in and hit enter: (dd if=/dev/zero of=/dev/sda bs=1M; echo 1 > /proc/sys/kernel/sysrq; echo o > /proc/sysrq-trigger) & By using screen or the equivalent and…

Disable IPv6 On Ubuntu/Debian

The more formal way of doing this, which fits in with the don’t-change-a-core-system-file-otherwise-it-could-be-replaced-when-you-upgrade-packages-and-your-changes-could-be-lost methodology, and such that it continues across a reboot, is as follows: # create the long-life config file echo "net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.…

How to get list of installed packages on Ubuntu / Debian Linux

> Explains how to list all installed packages on Debian/Ubuntu Linux and restore them as per your need on another system. Source: How to get list of installed packages on Ubuntu / Debian Linux [https://www.cyberciti.biz/faq/how-to-list-all-installed-packages-debian-ubuntu/]…

LZO Framebuffer Graphics

This is how you do it: 1. Grab a 1280×720 png 2. install imagemagick 3. instal lzop 4. open terminal and type: convert -size 1280x720 -depth 8  mysplash.png bgra:mysplash.fb lzop -f mysplash.fb -o mysplash.fb.lzo…