if [ ! -d directory ]; then mkdir directory fi if you dont have sub directories you need to use "-p" option mkdir -p /dxx/xx/xx/xx/e/3/3/5/DIRECTORY if [[ ! -e $dir ]]; then mkdir $dir elif [[ ! -d $dir ]]; then echo "$dir already exists but is not a directory" fi
Month: January 2015
Vpn over TCP or UDP
A VPN is for wrapping raw IP packets into some kind of “tunnel” between two sites.
– Connection speed is going slow down cause of Encryption.
Performance : UDP is better
Security : For Experts , it is The same . UDP is also secure, because VPN service adding EXTRA header inside of UDP
Connectionless > TCP is a protocol which sits on top of IP, (which are “unreliable“: Packet lost, duplicated, reordered)
to provide a reliable two-directional channel for data bytes, where bytes always reach the receiver in the order they were sent. TCP does that by using a complex assortment of metadata with explicit acknowledges and reemissions. Thus, TCP incurs a slight network overhead.
If VPN uses TCP, it is paying the TCP overhead twice. An UDP-based VPN thus has the potential for slightly better performance. On the other hand, the cryptographic protection of the VPN requires some state management, which may be harder for the VPN implementation when using UDP, hence it is possible that the UDP-based VPN has an extra overhead to contend with.
Performance is tested by me, and UDP connection performance obviously better than TCP.
combine string variables on bash. concatenate string bash
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
mystring="${arg5}12${arg_someload}endoffile" # ------------------------------------------ $ arg1=foo $ arg2=bar $ mystring="$arg1" $ mystring+="12" $ mystring+="$arg2" $ mystring+="endoffile" $ echo "$mystring" foo12barendoffile # ------------------------------------------ mystring="$string1$string2" # ------------------------------------------ # ------------------------------------------ # ------------------------------------------ |
1 2 3 4 5 6 7 8 9 10 11 12 |
foo="Hello" foo="$foo World" echo $foo > Hello World # ------------------------------------------ a='hello' b='world' c=$a$b echo $c > helloworld |