Skip to content

Instantly share code, notes, and snippets.

@qinabu
qinabu / pycon-2018.md
Created May 21, 2018
PyCon 2018 visiting
View pycon-2018.md
@lenage
lenage / fnv_example.go
Created Mar 31, 2017
golang fnv example
View fnv_example.go
package main
import (
"bufio"
"fmt"
"hash/fnv"
"io"
"os"
)
@dvdbng
dvdbng / zsh_to_fish.py
Created Dec 21, 2016
Migrate zsh history to fish
View zsh_to_fish.py
import os
import re
def zsh_to_fish(cmd):
return (cmd.replace('&&', '; and ')
.replace('||', '; or '))
def is_valid_fish(cmd):
@gleicon
gleicon / gist:cce798e141fb2bd42730
Created Jan 3, 2016 — forked from bcremer/gist:12167985b442d0d195de
NGINX as caching REST-API Proxy
View gist:cce798e141fb2bd42730
upstream backend {
server localhost:8080;
#server backup1.example.com:8080 backup;
#server backup2.example.com:8080 backup;
}
# Set cache dir
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:10m;
# Set cache key to include identifying components
View apt-rdepends-tree
#! /bin/bash
# Description: show dependency tree
# Author: damphat
if [ $# -lt 1 ]; then
echo 'Usage: apt-rdepends-tree [-r] <package>'
echo 'Required packages: apt-rdepends'
exit 1
fi
@rothgar
rothgar / install-tmux
Last active Jan 29, 2021 — forked from ekiara/how_to_install_tmux_on_centos
Install tmux 1.9 on rhel/centos 6
View install-tmux
# Install tmux on Centos release 6.5
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -xvzf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/usr/local
@ItsAdventureTime
ItsAdventureTime / .rtorrent.rc
Created Aug 8, 2014
This an optimized version of the rTorrent configuration file.
View .rtorrent.rc
#
#
# The Seedbox From Scratch Script
# By Notos ---> https://github.com/Notos/
#
#
######################################################################
#
# Copyright (c) 2013 Notos (https://github.com/Notos/)
#
@damphat
damphat / apt-rdepends-tree
Last active Jan 18, 2021
debian dependency tree
View apt-rdepends-tree
#! /bin/bash
# Description: show dependency tree
# Author: damphat
if [ $# != 1 ]; then
echo 'Usage: apt-rdepends-tree <package>'
echo 'Required packages: apt-rdepends'
exit 1
fi