Miscellaneous 03 Sat Add preceding zero to perl IP string Add preceding zero to perl IP string ### Add preceding zero to IP address so that the address is 192.058, not 192.58 $IP=~s/(\d+)/substr”00$1″,-3/eg; Read more
Miscellaneous 03 Sat UNIX Perl – Get local IP with ifconfig UNIX Perl – Get local IP with ifconfig Replace ETH0 with the interface you need.. my $IP = `ifconfig eth0| awk ‘/dr:/{gsub(/.*:/,””,\$2);print\$2}’`; $IP =~ s/\s+$//; Read more
MYSQL, UNIX 03 Tue Extract Table from SQL Dump – MYSQL Extract Table from SQL Dump – MYSQL The script below creates individual table exports from a SQL dump. ./MyDumpSplitter.sh yourfile.sql your_table_name [code] #!/bin/sh # http://kedar.nitty-witty.com #SPLIT DUMP FILE INTO INDIVIDUAL TABLE DUMPS # Text color variables txtund=$(tput sgr 0 1) # Underline txtbld=$(tput bold) # Bold txtred=$(tput setaf 1) # Red txtgrn=$(tput setaf 2) # […] Read more