Archive for the ‘Scripting’ Category
Posted by jpluimers on 2017/06/28
Gosh, bash can be a pain. So here are some more links that proved to be useful in the past:
–jeroen
Posted in bash, Development, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2017/06/27
Since I always forget:
for /l %1 in (1,2,200) do echo %1 >> text-%1.txt
This creates files with incremental filenames like this:
text-1.txt
text-3.txt
...
text-199.txt
–jeroen
via: For – Loop through a range of numbers | Windows CMD | SS64.com [WayBack]
Posted in Batch-Files, Development, Scripting, Software Development | 4 Comments »
Posted by jpluimers on 2017/06/26
Edit 20260501: be careful, as this damaged the NAND memory of my router because of too many write cycles. Root cause: too high update frequency.
Interesting: middelink/mikrotik-fwban: Use your Mikrotik firewall to do fail2ban like blocking of unwanted IPs. Written in Go.
It might beat these (that just count SSH connections, not failed connection attempts)
Read the rest of this entry »
Posted in Development, Hardware, Internet, MikroTik, Network-and-equipment, Power User, RouterOS, routers, Scripting, Software Development, WinBox | Leave a Comment »
Posted by jpluimers on 2017/06/21
For one of my VMs I forgot to note which of the initial password I had changed, so I wanted to check them.
Since I didn’t have a keyboard attached to the console and ssh wasn’t allowing root, I needed an alternative than actual login to test the passwords.
Luckily /etc/shadow, with getent and openssl came to the rescue.
Since getent varies per distribution, here is how it works on OpenSuSE:
Read the rest of this entry »
Posted in *nix, *nix-tools, ash/dash, bash, bash, Development, Encoding, Hashing, Linux, md5, openSuSE, Power User, Scripting, Security, SHA, SHA-256, SHA-512, Software Development, SuSE Linux | Leave a Comment »
Posted by jpluimers on 2017/06/20
One day I need to research how to get the conversions right for this: How do I Check DHCP Lease info in terminal – Ars Technica OpenForum as I think that ipconfig getoption en0 lease_time gives me the value in a different format than date -r expects.
Also:
At T1 seconds (typically set to 0.5*lease_time) after the last successful renewal, the DHCP client attempts to renew it’s lease with the DHCP server that granted it’s current address via unicast. If unsuccessful, at T2 seconds (typically set to 0.875*lease_time) after the last renewal, the DHCP client attempts to rebind with any DHCP server via multicast.
–jeroen
Posted in Apple, bash, Development, Mac, Mac OS X / OS X / MacOS, OS X 10.10 Yosemite, OS X 10.11 El Capitan, OS X 10.9 Mavericks, Power User, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2017/06/16
PCC load balancing saved my ass; here are some link I used:
–jeroen
Posted in Development, Internet, MikroTik, Power User, RouterOS, routers, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2017/06/14
Some links that inspired me for various Mikrotik firewall rules:
–jeroen
Posted in Development, Internet, MikroTik, Power User, RouterOS, routers, Scripting, Software Development | Leave a Comment »