Archives for Programming - Page 2
ntc – tempalates :cisco_ios_show_mac-address-table.template
#add this line in Type 3 - ^${VLAN}\s+${DESTINATION_ADDRESS}\s+${TYPE}\s+\S+\s+${DESTINATION_PORT} -> Record Value DESTINATION_ADDRESS (\w+.\w+.\w+) Value TYPE (\w+) Value VLAN (\w+) Value DESTINATION_PORT (\S+) Start ^Destination\s+Address\s+Address\s+Type\s+VLAN\s+Destination\s+Port -> TYPE1 ^\s+vlan\s+mac address\s+type\s+learn\s+age\s+ports ->...
Perl: Diamon operator: <> , $_, the default variable
The Diamond operator is almost exclusively used in a while-loop. It allows us to iterate over the rows in all the files given on the command line. Diamond –...
Route 53: Apex domain quick fix
apex, bare domain ( domain without www) and should point to the same IP. In amazon load balance or some of the cloud solution, they do not provide...
git: fatal: index-pack failed
I recently had to clone a very large repository through SSH, every time i did i got this error Cloning into 'large-repository'... remote: Counting objects: 20248, done. remote:...
How to tell git which private key to use?
Environment variable GIT_SSH_COMMAND: From Git version , you can use the environment variable GIT_SSH_COMMAND like this: GIT_SSH_COMMAND="ssh -i ~/.ssh/id_rsa_example" git clone example Note that -i can sometimes be overridden...
Python: Realtime web print out
There are some situation when we run a time-consuming process, we need to see the output of that command to see its progress. Normally, we would have to wait...
PHP7: Parse error: syntax error, unexpected ‘new’ (T_NEW)
You might see that error when upgrading from PHP5 to PHP7 your code might look like this: $this->smilies =& new smilies_package($this->current_smilies); Solution: just remove & , it will...
Relocation subversion
Command: svn sw --relocate oldpath newpath
How to check if your PHP support TLS V1.2?
Run this script to see your SSL Version <?php $ch = curl_init(''); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $data = curl_exec($ch); curl_close($ch); $json = json_decode($data); echo $json->tls_version; ?> If you want...