Skip to content

Instantly share code, notes, and snippets.

@kice
kice / Ubuntu-core-install-guide.md
Last active February 19, 2020 10:25
Ubuntu core install guide(CN)

准备

使用下载Ubuntu Desktop ISO镜像(32位64位都可以)。 用光驱启动,选择试用Ubuntu。

下载ubuntu-core

访问:http://cdimage.ubuntu.com/ubuntu-core/releases/找到所需要的镜像文件。

使用Ubuntu LiveCD,下载所需镜像到home目录

anonymous
anonymous / IPWry.py
Created August 5, 2014 07:34
import os
import re
import zlib
import functools
import urllib.request
from mmap import mmap
from struct import unpack
from ipaddress import IPv4Address
from collections import namedtuple
@markselby
markselby / nginx-openresty-ubuntu-build-dependencies.sh
Last active July 26, 2018 08:35
Build Nginx OpenResty version on Ubuntu.This is part of the high performance caching blog on writebox.co.uk
# Build dependencies for OpenResty.
sudo apt-get install build-essential libpcre3-dev libssl-dev libgeoip-dev
# Install standard Nginx first so that you get the relevant service scripts installed too
sudo apt-get install nginx
# If you want to access Postgres via Nginx
sudo apt-get install libpq-dev
@siddontang
siddontang / hmac.lua
Created May 18, 2013 09:24
openresty string hmac implementation
local ffi = require "ffi"
local sha512 = require "resty.sha512"
local aes = require "resty.aes"
local ffi_new = ffi.new
local ffi_str = ffi.string
local C = ffi.C
local setmetatable = setmetatable
local error = error
@Deco
Deco / deepcopy.lua
Created October 31, 2012 05:38
Lua Non-recursive Deep-copy
--[[ deepcopy.lua
Deep-copy function for Lua - v0.2
==============================
- Does not overflow the stack.
- Maintains cyclic-references
- Copies metatables
- Maintains common upvalues between copied functions (for Lua 5.2 only)
TODO
@koblas
koblas / smtp.py
Created November 11, 2011 15:23
SMTP Client for Tornado
from tornado import ioloop
from tornado import iostream
import socket
class Envelope(object):
def __init__(self, sender, rcpt, body, callback):
self.sender = sender
self.rcpt = rcpt[:]
self.body = body
self.callback = callback
@ameerkat
ameerkat / BoyerMooreStringSearch.py
Created October 14, 2010 17:46
Boyer Moore string search implementation in Python
# Boyer Moore String Search implementation in Python
# Ameer Ayoub <[email protected]>
# Generate the Bad Character Skip List
def generateBadCharShift(term):
skipList = {}
for i in range(0, len(term)-1):
skipList[term[i]] = len(term)-i-1
return skipList