Skip to content

Instantly share code, notes, and snippets.

View johnjelinek's full-sized avatar
🤓

John Jelinek IV johnjelinek

🤓
  • Montgomery, TX
  • 10:44 (UTC -05:00)
View GitHub Profile
@dweekly
dweekly / gist:5873953
Last active December 19, 2015 01:09
Get Emscripten Running on OS X 10.8
# Based on https://github.com/kripken/emscripten/wiki/Tutorial
# prerequisites
cd ~/
brew install node
sudo ln -s /usr/bin/python2.7 /usr/bin/python2
curl http://llvm.org/releases/3.2/clang+llvm-3.2-x86_64-apple-darwin11.tar.gz > llvm.tgz
tar xzvf llvm.tgz
ln -s clang+llvm-3.2-x86_64-apple-darwin11 llvm
@ubergarm
ubergarm / docker-nsinit-howto.md
Last active January 11, 2016 16:17
How to compile nsinit for Docker to access a shell in a running container.

Docker nsinit

nsinit provides a handy way to access a shell inside a running container's namespace. This is useful for learning about how containers work, debugging your system without worrying about sshd daemons, and even hot fixes in production all you sad pandas!

:p

Running the docker daemon with the lxc driver allows you to use lxc-attach to do this. But now that docker deafults to the new native libcontainer driver, nsinit is probably the best way to go. jpetazzo's blog has a great high level summary.

The new issue is that the libcontainer .json format is under heavy development so you need to keep an nsinit binary built from the exact release tag from the the docker github repo. The tricky part for me was understanding that golang is designed with certain assumptions about dependencies vs versioning with regards to when you push to master, push to a topic branch, and fork a project.

@alucic
alucic / palindrome.js
Created August 27, 2015 21:01
Get the longest palindrome for a given string
// example: node palindrome.js bananas
var input = process.argv[2];
if (!input || !input.length) {
return '';
}
var longest = longestPalindrome(input);
@theronic
theronic / clj-nrepl.clj
Created March 1, 2018 10:01
How to start an nREPL using Clojure CLI tools using clj
$ clj -Sdeps '{:deps {org.clojure/tools.nrepl {:mvn/version "0.2.12"}}}'
Clojure 1.9.0
user=> (use '[clojure.tools.nrepl.server :only (start-server stop-server)])
nil
user=> (defonce server (start-server :port 7888))
#'user/server
;; now connect to port 7888. there's probably a way to do this in one line.
@benhagen
benhagen / is_ipv4.py
Last active March 19, 2020 19:23
Python function to determine if a string is like an IPv4 address. Its lame but works; to be improved at a later date.
def is_ipv4(ip):
match = re.match("^(\d{0,3})\.(\d{0,3})\.(\d{0,3})\.(\d{0,3})$", ip)
if not match:
return False
quad = []
for number in match.groups():
quad.append(int(number))
if quad[0] < 1:
return False
for number in quad:

The best:

@17twenty
17twenty / simple_git.md
Created September 27, 2013 18:32
A Simple Git branching model

a simple git branching model

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

The gist

@benders
benders / cisco-asa-config.txt
Last active November 23, 2021 05:01
Getting Amazon VPC up and running with Cisco ASAs can be a pain. This is the config that we used to make it work.
! --------------------------------------------------------------------------------
! This example configuration shows what WE did to get Amazon VPC working with our
! ASAs. We use version 8.3(1). This config has not been reviewed or otherwise
! blessed in any way by anyone at Amazon. YMMV.
!
! It differs from Amazon's supplied config by using two different sets of
! crypto maps and ACLs, so it brings both tunnels up simultaneously.
!
! For the purposes of the example, the physical datacenter network is 172.16.1.0/24
! and the VPC is 10.0.0.0/16.
@garethr
garethr / LICENSE
Last active January 21, 2022 21:33
A script for customers to use the Snyk API to get a list of projects impacted by the Log4Shell vulnerability
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit