I hereby claim:
- I am jmacego on github.
- I am jmacego (https://keybase.io/jmacego) on keybase.
- I have a public key ASAlzNsoMHLfzKe1yOCpPuBcl2bjtgP1cDVnei7I69HJUwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env python | |
from __future__ import print_function | |
from sys import argv | |
import socket | |
import struct | |
""" | |
Decode the DHCP string given by AT^DHCP? on Huawei USB Modem and | |
print out appropriate commands to add it statically. | |
Tested under Python 2.7, 3.5, and 3.6 | |
No warranty of any kind. |
#!/bin/python | |
from __future__ import print_function # Python 2 compatibility fix | |
# Script to name ports for natural patching (1 to 1, 2 to 3..25 to 2). | |
i = 1 # Initialize to the starting number for your port . | |
# Set starting number, ending number, and increment setting an increment | |
# of 2 is most common. | |
for x in range(1, 48, 2): | |
i += 1 # this really could to at the end and not have the -1 in the |
#!/usr/bin/env python | |
from __future__ import print_function # Python 2 compatibility fix | |
from sys import argv, exit | |
from subprocess import check_output | |
# Takes AS MACRO as single argument | |
prefixes = check_output(['whois -h filtergen.level3.net \ | |
"ARIN::{} -searchpath=RIPE;ARIN;RADB \ | |
-recurseok -warnonly"'.format(argv[1])], shell=True) |
javascript:(function(){var inputs = document.getElementsByTagName("input");for(var i = 0; i < inputs.length; i++) {if(inputs[i].name.match(/comment/) || inputs[i].className.match(/comment/) ) {inputs[i].size = 100;}}})(); |
#!/bin/bash | |
# Profile function to add a convenient jekyllserve command and also a | |
# function to cd to the directory, do a git pull, open in sublime, | |
# serve the site and then open it in a web browser. | |
# | |
# Works on OSX with sublime CLI installed. YMMV for other platforms. | |
# You also probably want to rename things. Consider this a template. | |
# | |
# Also... I just have this in my ~/.profile so I type jmaclabs and it | |
# just works. Here's how that looks different: |
def bytes_to_str(size, mebi=False, precision=2): | |
"""Accept size in bytes, return size in string with KB, MB, GB | |
Will always return, increase the fields with TB, etc to prevent | |
103892GB or similar""" | |
mult = 1024 if mebi else 1000 | |
units = {1000: ['KB', 'MB', 'GB'], | |
1024: ['KiB', 'MiB', 'GiB']} | |
for unit in units[mult]: | |
size = size / mult | |
if size < mult: |
#!/bin/bash | |
# Take a folder with a structure like: | |
# File (Disc 1).bin | |
# File (Disc 1).cue | |
# File (Disc 2).bin | |
# File (Disc 2).cue | |
# ... | |
# and rename the .cue files to .CD# and then create a .m3u | |
# suitable to RetroPie | |
for i in *.cue; do |
#!/bin/env/python | |
from __future__ import print_function | |
import ipaddress | |
def do_vlsm(sorted_vlans): | |
supernet = input("Supernet: ") or "192.168.224.0/20" | |
current_subnet = ipaddress.ip_network(supernet) | |
available_subnets = [current_subnet] | |
print("\nSubnet Lengths:") | |
for vlan in sorted_vlans: |