Map Hex Array to Ascii Where @values are an array of hex values my @ascii_vals = map (chr, map(hex,@values));
Convert IP to HEX in Perl – one liner Strip out the IP.. $IP=”192168016012″; $IP = sprintf “%*vX”, “:”, $IP; Vector hex conversion of IP
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;
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+$//;
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) # […]
MYSQL Event Scheduler – Auto Enable If you are finding the MYSQL event scheduler is disabled everytime you start MYSQL, use the following my.cnf or mysql.ini settings; event_scheduler=on That Simple!!
Comparison of the network types Type Bridged NAT (Network Address Translation) Host-only Description The VM appears as if it was a physical host on the network. The VMware hides behind the IP address of the VMware host. Other VMs in the same NAT network can access it directly. The VM can only access the VMware […]
Ubuntu – IPtables – redirect port to different IP Read IP tables; iptables -t nat -L -n -v For redirecting port to different IP and port echo “1” > /proc/sys/net/ipv4/ip_forward Then, we will add a rule telling to forward the traffic on port 1111 to ip 2.2.2.2 on port 1111: # iptables -t […]
Outlook Crash – IMAP 0xc0000005 – ISPCONFIG Outlook was crashing on startup every time it synced IMAP folders, not a problem in Thunderbird. This is my fix; Removing the empty first empty line from the files subscriptions and courierimapsubscribed fixes it in /var/vmail/MAILBOX/Maildir/
A number of JQUERY plugins can throw up syntax errors after setting setlocale(“LC_ALL”,XXX.utf8) Make sure you change back the LC_NUMERIC variable; setlocale (LC_ALL, $language); setlocale(LC_NUMERIC, ‘C’);