Skip to content

Instantly share code, notes, and snippets.

@jellyjellyrobot
jellyjellyrobot / CiscoKeyGen.py
Created February 28, 2018 08:50 — forked from paalfe/CiscoKeyGen.py
Cisco IOU License Generator. Originally found at http://www.routingloops.co.uk/cisco/gns3-v1-1-install-on-ubuntu-14-04-lts/, I have done a few changes to it. Make the file executable with " chmod +x CiscoKeyGen.py " and execute it " ./CiscoKeyGen.py ".
#! /usr/bin/python
print "\n*********************************************************************"
print "Cisco IOU License Generator - Kal 2011, python port of 2006 C version"
import os
import socket
import hashlib
import struct
# get the host id and host name to calculate the hostkey
hostid=os.popen("hostid").read().strip()
hostname = socket.gethostname()
@jellyjellyrobot
jellyjellyrobot / _lxc
Created January 5, 2018 05:30 — forked from sabottenda/_lxc
lxc zsh completion
#compdef lxc-start lxc-stop lxc-console lxc-restart lxc-create lxc-destroy lxc-monitor lxc-cgroup lxc-checkpoint lxc-execute lxc-freeze lxc-unfreeze lxc-info lxc-netstat lxc-ps lxc-wait
#=====================================================================================================
# original source is here: https://lists.linuxcontainers.org/pipermail/lxc-devel/2010-April/001172.html
#=====================================================================================================
_lxc_containers() {
local -a containers
containers=( $(/bin/ls /var/lib/lxc) )
compadd "$@" -a containers
@jellyjellyrobot
jellyjellyrobot / gist:cd58487fd186f81f75b90eeedc618def
Last active March 4, 2017 08:58
GNS3 console configuration for OSX, Iterm2v3, and a shell that does not quit terminal negotiating
osascript
-e 'tell application "iTerm"'
-e 'activate'
-e 'if (count of windows) = 0 then'
-e ' set t to (create window with profile "cisco")'
-e 'else'
-e ' set t to current window'
-e 'end if'
-e 'tell t'
-e ' set newTab to (create tab with profile "cisco" command "sh")'
@jellyjellyrobot
jellyjellyrobot / ._
Last active February 25, 2018 12:40
Me being a lazy guy
#!/bin/sh
# Change Mirrors
# sed --in-place 's/us.archive.ubuntu.com/mirror.0x.sg/' /etc/apt/sources.list
# sed --in-place 's/us.archive.ubuntu.com/download.nus.edu.sg\/mirror/' /etc/apt/sources.list
get_and_execute()
{
FILE=$1
echo "Getting $FILE"
@jellyjellyrobot
jellyjellyrobot / osx_mifare_install.sh
Last active February 12, 2018 16:50
libnfc + mfoc for fun, maybe profit?
# Prereq
brew tap jlhonora/lsusb
brew install autoconf doxygen automake libtool libusb libusb-compat --universal wget pkgconfig lsusb
# Libnfc
git clone git@github.com:nfc-tools/libnfc.git
cd libnfc
./make_release.sh
autoreconf -vis
./configure --enable-doc --with-drivers=all --sysconfdir=/etc --prefix=/usr
@jellyjellyrobot
jellyjellyrobot / keybase.md
Last active August 22, 2016 04:41
Keybase Auth - jellyjellyrobot

Keybase proof

I hereby claim:

  • I am jellyjellyrobot on github.
  • I am jellyjellyrobot (https://keybase.io/jellyjellyrobot) on keybase.
  • I have a public key whose fingerprint is CB25 3D12 B5AF F863 50DD 74CF 4D00 1E92 3F1D 6029

To claim this, I am signing this object:

@jellyjellyrobot
jellyjellyrobot / open_in_term.scpt
Last active February 26, 2016 17:31
new iterm has different api. updated the code to reflect that
-- Adapted from canuckistani/openItermHere.scpt
-- https://iterm2.com/applescript.html <- new api
-- cd to the current finder window folder in iTerm. Or drag a folder onto this script to cd to that folder in iTerm.
-- found this script in the comments of this article: http://www.macosxhints.com/article.php?story=20050924210643297
-- Instructions for use:
-- paste this script into Script Editor and save as an application to ~/Library/Scripts/Applications/Finder/cd to in iTerm
-- run via the AppleScript Menu item (http://www.apple.com/applescript/scriptmenu/)
-- Or better yet, Control-click and drag it to the top of a finder window so it appears in every finder window.
## For those times when you're too lazy to reboot and your Mac DNS client screws up.
sudo discoveryutil mdnsflushcache
sudo discoveryutil udnsflushcaches
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist
@jellyjellyrobot
jellyjellyrobot / CanonLide20Mac
Created March 5, 2015 09:26
Using Canon Lide 20 on Mac
#Download and run Relevant files from http://www.ellert.se/twain-sane/
#TWAIN SANE Interface
#SANE Preference Pane
#SANE backends
#libusb
# Scan images using command line
#scanimage --mode Gray --depth 16 --resolution 300 -x 215 -y 297 --format=tiff > blah.tiff