Skip to content

Instantly share code, notes, and snippets.

View eagleon's full-sized avatar
🌴
On vacation

eagleon eagleon

🌴
On vacation
View GitHub Profile
@eagleon
eagleon / openresty-ubuntu-install.sh
Last active June 23, 2016 06:19 — forked from alex-roman/openresty-ubuntu-install.sh
Easy install openresty (used and tested on Ubuntu 14 and 15)
#!/bin/bash
apt-get update
wget http://luajit.org/download/LuaJIT-2.1.0-beta1.tar.gz
tar -xvf LuaJIT-2.1.0-beta1.tar.gz
cd LuaJIT-2.1.0-beta1
make
sudo make install
wget -c https://openresty.org/download/openresty-1.9.7.4.tar.gz
tar zxvf openresty-1.9.7.4.tar.gz
@eagleon
eagleon / gist:2639977bb42c3ad90697
Last active August 29, 2015 14:10 — forked from plucury/gist:3009512
git log / git lg
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
@eagleon
eagleon / jdk_download.sh
Last active January 22, 2021 07:03 — forked from P7h/jdk_download.sh
# Shell script to download Oracle JDK from command prompt / terminal.
# You can download all the binaries one-shot by just giving the BASE_URL.
## Features:
# Resumes a broken [previous] download, if any.
# Renames the file to a proper name with platform adding platform info.
# Downloads all the following from Oracle Website with one shell invocation.
# a. Windows 64 and 32 bit;
# b. Linux 64 and 32 bit; and
# c. API Docs.
resolver 8.8.8.8;
location /video/ {
if ($request_uri ~ "^/video/(.+?)/.+") {
set $upstream_host $1.googlevideo.com;
add_header Content-Disposition "attachment; filename=video.mp4;";
}
rewrite /video/.+?/(.+)$ /$1 break;
proxy_buffering off;
proxy_pass https://$upstream_host;
proxy_set_header Host $upstream_host;
@eagleon
eagleon / gist:4138796
Created November 24, 2012 07:34 — forked from saga/gist:4137880
appfog get youtube
#!/usr/bin/env python
import simplejson
import logging
import random
import re
import datetime
import string
import time
import sys
import urllib
@eagleon
eagleon / dns_resolve.py
Created October 3, 2012 12:41
dns_resolve
import os
import re
import socket
import struct
def dns_resolve(host, dnsserver):
assert isinstance(host, basestring) and isinstance(dnsserver, basestring)
index = os.urandom(2)
hoststr = ''.join(chr(len(x))+x for x in host.split('.'))
data = '%s\x01\x00\x00\x01\x00\x00\x00\x00\x00\x00%s\x00\x00\x01\x00\x01' % (index, hoststr)
@eagleon
eagleon / gist:3174006
Created July 25, 2012 02:25 — forked from lucifr/gist:1208100
Sublime Text 2 - 实用快捷键 (Mac OS X)