Skip to content

Instantly share code, notes, and snippets.

@partkyle
partkyle / .bash_prompt.bash
Last active November 8, 2019 00:52
minimal shell setup
# prompt examples:
# [3 jobs master virtualenv] ~/code/myproject/foo
# [1 job my-branch virtualenv] ~/code/bar/
# [virtualenv] ~/code/
# ~
# Very, very fast, only requiring a couple of fork()s (and no forking at all to determine the current git branch)
if [[ "$USER" == "root" ]]
then
export PS1="\e[1;31m\]\u \[\e[1;33m\]\w\[\e[0m\] ";
@partkyle
partkyle / sni.go
Created December 19, 2017 01:03
Send a request to an IP address but use a specific hostname
package main
import (
"crypto/tls"
"log"
"net/http"
)
func main() {
client := &http.Client{
@partkyle
partkyle / tacos.rb
Created May 17, 2017 22:05
Tacos please.
class Object
def tacos?
true
end
end
res = 1.tacos?
puts "1.tacos? => #{res}"
res = 2.tacos?
function doit(screenHeight, screenWidth) {
// override the random to make it always gold
Math.random = function() { return 1; }
// remnants of a time when I cared about where it started looping from
var startX = 0;
var startY = 0;
// there is a margin for the card. I can't be bothered to figure it out
alert()
@partkyle
partkyle / docker_networking.md
Last active January 26, 2016 19:49
Docker Networking Exploration

Docker networking tests

Tested on Docker 1.9+

~ > docker version
Client:
 Version:      1.9.0
 API version:  1.21
 Go version: go1.5.1
@partkyle
partkyle / README.md
Created December 23, 2015 23:21
Test Stackstorm Environment

Stackstorm Vagrant

Simple vagrantfile that uses the stackstorm one time installer.

The IP address is hardcoded to 192.168.33.10, so change that if you want it to be something else.

Run vagrant up in this directory. When it completes go to https://192.168.33.10/setup. There will be a security notifiction about the certificate, but it is safe to ignore as it is just a self-signed certificate. Follow the setup instructions and the site should be accesible.

You can skip chatops if it is not something you need.

+-------------+--------------------------------------------------------------+
| Property | Value |
+-------------+--------------------------------------------------------------+
| id | 567892f7b4bdf72e16426dea |
| uid | rule:chatops:notify |
| ref | chatops.notify |
| pack | chatops |
| name | notify |
| description | Notification rule to send results of action executions to |
| | stream for chatops |
FOO=bar
HELLO=world
@partkyle
partkyle / Dockerfile
Last active September 14, 2015 18:03
Run mailcatcher in docker
FROM ruby:2.1.5
RUN gem install mailcatcher
CMD ["mailcatcher", "-f", "--http-ip", "0.0.0.0", "--smtp-ip", "0.0.0.0"]