Category Archives: Programming

SSH Tunnels

Bash script found here: https://gist.github.com/scy/6781836 -fRun in the background before command execution. -NDon’t execute any commands -TDisable pseudo-tty allocation. -S socketnameUse a control socket with name socketname -MPut control socket in master mode -O check, exitControl command

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 a test"

The following substring parameter expansion performs substring extraction:

 
var="${u:10:4}"
echo "${var}"
var="${u:10:4}"
echo "${var}"

Sample outputs:

 
test

Where numbers represents,
10 : The offset
4 : The length

Read More

Bad Behavior has blocked 56 access attempts in the last 7 days.