no Homebrew required
$ cd /usr/local/src
$ curl -OL http://nginx.org/download/nginx-1.12.2.tar.gz
$ tar -xvzf nginx-1.12.2.tar.gz && rm nginx-1.12.2.tar.gz
// e.g. console.save({hello: 'world'}) | |
(function(console){ | |
console.save = function(data, filename){ | |
if(!data) { | |
console.error('Console.save: No data') | |
return; | |
} | |
if(!filename) filename = 'console.json' | |
if(typeof data === "object"){ | |
data = JSON.stringify(data, undefined, 4) |
apt-get update | |
# 一些常用工具包 | |
apt-get install -y --no-install-recommends lsb-core net-tools dnsutils iputils-ping iftop htop telnet sudo openssh-server curl wget git vim locate | |
# 安装 ffmpeg 依赖 | |
apt-get install -y --no-install-recommends autoconf automake build-essential cmake git-core libass-dev libfreetype6-dev | |
apt-get install -y --no-install-recommends libsdl2-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev | |
apt-get install -y --no-install-recommends libxcb-xfixes0-dev pkg-config texinfo wget zlib1g-dev | |
apt-get install -y --no-install-recommends nasm yasm libx264-dev libx265-dev libnuma-dev libvpx-dev libfdk-aac-dev libmp3lame-dev libopus-dev | |
# 编译 ffmpeg 4.2.1 | |
wget https://download-public-imhuwq.oss-cn-shenzhen.aliyuncs.com/ffmpeg/ffmpeg.4.2.1.tar.gz |
template<int resolve_order_, int num_child_stack_> | |
struct StackFrame { | |
typedef shared_ptr<StackFrame> StackFramePtr; | |
typedef shared_ptr<const StackFrame> kStackFramePtr; | |
// arguments | |
long long min; | |
long long max; | |
TreeNode *node; |
#include <iostream> | |
#include <string> | |
#include <vector> | |
using namespace std; | |
// 给定一个排好序的数组,以及一个数字,求该数字在数组里面的任意一个可能位置。时间复杂度要求O(log(n)) | |
int find_pos(const vector<int>& input_vec, int target, int lo, int hi) { | |
if (lo > hi) return -1; | |
import os | |
import requests | |
def parse_authenticate(authenticate): | |
rv = dict() | |
pairs = authenticate.split(" ", 1)[-1] | |
pairs = pairs.split(",") | |
for pair in pairs: | |
name, value = pair.split("=") |
#include <malloc.h> | |
#include <iostream> | |
#include <vector> | |
#include <chrono> | |
using namespace std; | |
uint8_t *generate_bit_map(size_t length) { | |
size_t bytes_count = length / 8; | |
if (length % 8 != 0) bytes_count += 1; |
class Node: | |
def __init__(self): | |
self.next = None | |
self.val = None | |
@classmethod | |
def from_list(cls, l): | |
pre = Node() | |
head = pre | |
for i in l: |
#include <stdio.h> | |
#include <iostream> | |
using namespace std; | |
typedef unsigned char *byte_pointer; | |
void show_bytes(byte_pointer start, size_t len) { | |
for (size_t i = 0; i < len; i++) { | |
printf(" %.2x", start[i]); |
rm -rfd ~/.idm/uex | |
rm -rf ~/.idm/*.spl | |
rm -rf /tmp/*.spl |