Skip to content

Instantly share code, notes, and snippets.

View atmosx's full-sized avatar

Panagiotis Atmatzidis atmosx

View GitHub Profile
@simme
simme / Install_tmux
Created October 19, 2011 07:55
Install and configure tmux on Mac OS X
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
@jessedearing
jessedearing / gist:2351836
Created April 10, 2012 14:44 — forked from twoism-dev/gist:1183437
Create self-signed SSL certificate for Nginx
#!/bin/bash
echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out myssl.key 1024
echo "Generating a Certificate Signing Request..."
openssl req -new -key myssl.key -out myssl.csr
echo "Removing passphrase from key (for nginx)..."
cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key
@inferno
inferno / Rakefile
Created June 25, 2012 12:47
Rake task for show defined routes in Sinatra
desc 'List defined routes'
task 'routes' do
App::routes.each_pair do |method, list|
puts ":: #{method} ::"
routes = []
list.each do |item|
source = item[0].source
item[1].each do |s|
source.sub!(/\(.+?\)/, ':'+s)
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@border
border / log.go
Created August 30, 2012 10:04
Log Example For Go
package utils
import (
"log"
"os"
)
var (
Log *log.Logger
)
@sgergely
sgergely / gist:3793166
Created September 27, 2012 09:43
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
@mattratleph
mattratleph / vimdiff.md
Last active April 24, 2024 11:28 — forked from roothybrid7/vimdiff_cheet.md
vimdiff cheat sheet

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)

@kymair
kymair / update-dns.py
Last active July 12, 2018 13:30
Python script to update Linode DNS
# Get Linode API python bindings from https://github.com/tjfontaine/linode-python
#!/usr/bin/python
from linode import api
instance = api.Api(key='abcdefg')
for domain in instance.domain_list():
if domain['TYPE'] == 'master':
print "Updating %s (%i)..." % (domain['DOMAIN'], domain['DOMAINID'])
@pvalkone
pvalkone / gist:6147878
Created August 3, 2013 20:34
How to Install Tarsnap on Raspbian "Wheezy"
$ sudo aptitude install libssl-dev zlib1g-dev e2fslibs-dev debhelper libbz2-dev libattr1-dev libacl1-dev
$ wget https://www.tarsnap.com/download/tarsnap-autoconf-1.0.35.tgz
$ wget https://www.tarsnap.com/download/tarsnap-sigs-1.0.35.asc
$ gpg --decrypt tarsnap-sigs-1.0.35.asc
$ sha256sum tarsnap-autoconf-1.0.35.tgz
$ tar xzf tarsnap-autoconf-1.0.35.tgz
$ cd tarsnap-autoconf-1.0.35
$ ln -s pkg/debian .
$ dpkg-buildpackage
$ cd ..
@mohit
mohit / logstash_mongodb.rb
Created August 11, 2013 22:42
Parse MongoDB logs in logstash
filters {
grok {
type => "mongodb"
pattern => [ "%{DATA:mongo_ts} \[%{DATA:mongo_conn}\]? %{DATA:mongo_type} %{GREEDYDATA:mongo_message}" ]
}
mutate {
type => "mongodb"
replace => [ "@message", "%{mongo_message}" ]
}
grok {