Skip to content

Instantly share code, notes, and snippets.

@zennro
zennro / irssi-cheat-sheet.md
Created May 27, 2016 11:17
Irssi Cheat Sheet

Cheat Irssi

Short cheatsheet handy while learning to use Irssi. Adapted from IRC-client.md by Nishant Modak.

  1. To switch between open channels / windows

    Alt + N where N is the number corresponding to the open window

  2. To ignore joins / quits / nicks changes on a specific channel.

package main
import (
"bufio"
"encoding/csv"
"encoding/json"
"fmt"
"io"
"os"
"path/filepath"
@zennro
zennro / known_hosts_autocomplete.sh
Created December 9, 2015 15:25 — forked from peelman/known_hosts_autocomplete.sh
Bash AutoComplete from known_hosts
# add to ~/.bash_profile, and close/reopen a shell. Will autocomplete any hosts found in known_hosts.
complete -W "$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e s/,.*//g | uniq | grep -v "\["`;)" ssh
@zennro
zennro / 1_ubuntu_terminal_command
Created December 2, 2015 12:43 — forked from lucasdavila/1_ubuntu_terminal_command
Installing Source Code Pro fonts in ubuntu
# to execute this gist, run the line bellow in terminal
\curl -L https://raw.github.com/gist/3875946/install_source_code_pro.sh | sh
@zennro
zennro / gist:819bfeca795440c0a1ad
Created November 30, 2015 20:47 — forked from tmm1/gist:329682
EM Chat Server Demo
require 'rubygems'
require 'eventmachine'
require 'em-http' # gem install em-http-request
require 'yajl' # gem install yajl-ruby
class String
def bold
"\033[1m#{self}\033[0m"
end
end
@zennro
zennro / _etc_init.d_autosshd
Created October 29, 2015 07:48 — forked from suma/_etc_init.d_autosshd
Autossh init script(Ubuntu) for reverse ssh tunneling
#! /bin/sh
### BEGIN INIT INFO
# Provides: autosshd
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: autosshd initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
@zennro
zennro / ngrok-selfhosting-setup.md
Created October 28, 2015 08:12 — forked from lyoshenka/ngrok-selfhosting-setup.md
How to setup Ngrok with a self-signed SSL cert

Intro

The plan is to create a pair of executables (ngrok and ngrokd) that are connected with a self-signed SSL cert. Since the client and server executables are paired, you won't be able to use any other ngrok to connect to this ngrokd, and vice versa.

DNS

Add two DNS records: one for the base domain and one for the wildcard domain. For example, if your base domain is domain.com, you'll need a record for that and for *.domain.com.

Different Operating Systems

@zennro
zennro / bash-cheatsheet.sh
Created October 15, 2015 19:29 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@zennro
zennro / app.rb
Last active August 31, 2015 13:35 — forked from hendrikswan/app.rb
sample sinatra mongodb service
require 'sinatra'
require 'mongoid'
require 'json'
require "sinatra/reloader" if development?
Mongoid.load!("mongoid.yml")
class Price
include Mongoid::Document
@zennro
zennro / sshmany
Last active August 29, 2015 14:27 — forked from progrium/sshmany
bash script for executing a command via ssh in parallel on multiple servers with colored output
#!/bin/bash
#
# Usage:
# $ echo "host1 host2 host3" | ./sshmany uname -a
# $ cat myservers | ./sshmany echo Hello world
#
cmd="$@"
servers="$(cat)"
i=37
for server in $servers; do