Skip to content

Instantly share code, notes, and snippets.

View fentas's full-sized avatar
🐷
Oink.

Jan Guth fentas

🐷
Oink.
View GitHub Profile
@fentas
fentas / curl-websocket.sh
Created June 28, 2017 14:10 — forked from htp/curl-websocket.sh
Test a WebSocket using curl.
curl --include \
--no-buffer \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Host: example.com:80" \
--header "Origin: http://example.com:80" \
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
--header "Sec-WebSocket-Version: 13" \
http://example.com:80/
Commit Type Emoji Code UTF-8
Initial Commit 🎉 :tada:
Version Tag 🔖 :bookmark:
New Feature :sparkles:
Bugfix 🐛 :bug:
Metadata 📇 :card_index:
Refactoring ♻️ :recycle:
Documentation 📚 :books:
Internationalization 🌐 `:globe_with_merid
@fentas
fentas / bash.generate.random.alphanumeric.string.sh
Created April 29, 2017 19:09 — forked from earthgecko/bash.generate.random.alphanumeric.string.sh
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@fentas
fentas / app.js
Created September 28, 2015 09:46 — forked from andrewdeandrade/app.js
Node.js ('child_process').spawn bug with SSH
var spawn = require('child_process').spawn
var instance = {
ipAddress: "0.0.0.0"
};
var awsPreSharedKeyPath = '~/.ssh/aws-preshared-key.pem'; // make sure key has permissions 600 with chmod
var spawnArgs = [ '-tt', // force teletype since ssh uses a psuedo-terminal
(function (window, document, $, undefined) {
var possibleCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
var defaults = {
selector: "#captcha",
text: null,
randomText: true,
randomColours: true,
@fentas
fentas / app.js
Last active August 29, 2015 13:58 — forked from ryanflorence/static_server.js
Simple nodejs server. Just serving files with mime types (-file ext).
#!/usr/bin/node
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 3000,
root = process.argv[3] || '/www',
mime = {".3dm":"x-world/x-3dmf",".3dmf":"x-world/x-3dmf",".a":"application/octet-stream",".aab":"application/x-authorware-bin",".aam":"application/x-authorware-map",".aas":"application/x-authorware-seg",".abc":"text/vnd.abc",".acgi":"text/html",".afl":"video/animaflex",".ai":"application/postscript",".aif":"audio/x-aiff",".aifc":"audio/x-aiff",".aiff":"audio/x-aiff",".aim":"application/x-aim",".aip":"text/x-audiosoft-intra",".ani":"application/x-navi-animation",".aos":"application/x-nokia-9000-communicator-add-on-software",".aps":"application/mime",".arc":"application/octet-stream",".arj":"application/octet-stream",".art":"image/x-jg",".asf":"video/x-ms-asf",".asm":"text/x-asm",".asp":"text/asp",".asx":"video/x-ms-asf-plugin",".au":"audio/x-au",".avi":"video/x-msvideo",".avs":"video/avs-video",".bcpio":"ap