Skip to content

Instantly share code, notes, and snippets.

View bdmorin's full-sized avatar
👁️‍🗨️
the horrors persist, but so do l

Brian bdmorin

👁️‍🗨️
the horrors persist, but so do l
View GitHub Profile
@spoike
spoike / slack_post.js
Created March 2, 2015 08:14
Simple Slack Incoming Webhook script for hubot to post useful messages (in pretty format) on channels/rooms. Also works without having hubot invited on the channel.
/**
* # Post messages using Slack's Webhook
*
* Use this in combination with node-cron to Schedule messages.
* No need to have the hubot invited on the actual channel to post.
*
* ## Dependencies
*
* superagent
* lodash
@erichocean
erichocean / client.js
Created January 24, 2010 08:30 — forked from felixge/client.js
node.js load testing client
var
PARALLEL_CONNECTS = 10,
http = require('http'),
sys = require('sys'),
connectionCount = 0,
messageCount = 0;
lastMessages = 0;
function addClient() {
@clochix
clochix / casperCookies.js
Created July 10, 2013 16:48
Sample cookies management with CasperJS: functions to load cookies from a Netscape formatted file and save them
/**
* Load cookies from a file
*
* @param {String} file name of da file.
*
* @return {Array} of cookies.
*/
function loadCookies(file) {
"use strict";
var cookies = [];
@byllc
byllc / diy-ngrok.md
Last active April 20, 2017 22:42 — forked from tekacs/show
This does something essentially equivalent to showoff.io if you have a publicly facing server...

This is basically diy ngrok

Usage: show

function show() {
    DOMAIN=".example.com"
    REMOTE="$2$DOMAIN"
    ssh -tR 1080:127.0.0.1:$1 vps "sudo ssh -Nl \$USER -L $REMOTE:80:127.0.0.1:1080 localhost"
}
@onlyyoujack
onlyyoujack / makegifs.py
Last active September 7, 2017 22:53 — forked from Zulko/makegifs.py
#!/usr/bin/env python
# Taken from http://zulko.github.io/blog/2015/02/01/extracting-perfectly-looping-gifs-from-videos-with-python-and-moviepy/
import os
import sys
import moviepy.editor as mp
from moviepy.video.tools.cuts import FramesMatches
if len(sys.argv) != 2:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AbandonProcessGroup</key>
<true/>
<key>Label</key>
<string>local.automount.sshfs</string>
<key>ProgramArguments</key>
<array>
@samos123
samos123 / reverse-ssh-tunnel.service
Created June 27, 2016 06:41
/etc/systemd/system/reverse-ssh-tunnel.service to keep a reverse ssh tunnel restarted automatically
[Unit]
Description=Phone Home Reverse SSH Service
ConditionPathExists=|/usr/bin
After=network.target
[Service]
User=sshtunnel
ExecStart=/usr/bin/ssh -NTC -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -o StrictHostKeyChecking=no -i /home/sshtunnel/.ssh/id_rsa -R 22223:localhost:22 user@remote-ssh-server
# Restart every >2 seconds to avoid StartLimitInterval failure
RestartSec=3
@joelhans
joelhans / docker-compose.yml
Last active November 13, 2018 21:25
My self-hosting `docker-compose.yml` file. To use, 1) set up your DNS, 2) replace domain/email fields, 3) execute `docker-compose up -d`. Should work.
version: '2'
services:
portainer:
image: portainer/portainer
container_name: portainer
restart: always
environment:
- VIRTUAL_HOST=docker.DOMAIN.TLD
@skreuzer
skreuzer / prometheus.yml
Last active February 7, 2019 18:45
smokeping style metrics in prometheus
global:
evaluation_interval: 15s
rule_files:
- smokeping.rules
scrape_configs:
- job_name: 'blackbox_icmp'
metrics_path: /probe
params:
module: [icmp]
scrape_interval: 1s
@mustafaturan
mustafaturan / ruby.2.0.0-setup.sh
Last active May 21, 2019 23:00
ruby 2.0.0 centos 6
#!/usr/bin/env bash
# repository
cd /tmp
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm
# system update
yum -y update
yum -y groupinstall "Development Tools"
yum -y install libxslt-devel libyaml-devel libxml2-devel gdbm-devel libffi-devel zlib-devel openssl-devel libyaml-devel readline-devel curl-devel openssl-devel pcre-devel git memcached-devel valgrind-devel mysql-devel ImageMagick-devel ImageMagick