apt-get install python-pip
pip install shadowsocks
sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Newtonsoft.Json.Serialization; | |
namespace ConsoleApplication3 | |
{ | |
public class SnakeCaseContractResolver : DefaultContractResolver | |
{ | |
protected override string ResolvePropertyName(string propertyName) | |
{ | |
return GetSnakeCase(propertyName); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ curl -L https://github.com/glfw/glfw/releases/download/3.3.2/glfw-3.3.2.zip > glfw-3.3.2.zip | |
$ unzip glfw-3.3.2.zip | |
$ cd glfw-3.3.2/ | |
$ mkdir build | |
$ cd build | |
$ export MACOSX_DEPLOYMENT_TARGET=10.14 | |
$ cmake -D CMAKE_BUILD_TYPE=Release -D GLFW_NATIVE_API=1 -D CMAKE_OSX_ARCHITECTURES="x86_64;arm64" -D BUILD_SHARED_LIBS=ON -D CMAKE_C_COMPILER=clang ../ | |
$ make | |
$ ls -l src/libglfw* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"net/http" | |
"github.com/bitly/go-simplejson" | |
"github.com/gorilla/mux" | |
) |
This is a quick guide to install PostgreSQL 10 - tested on Ubuntu 16.04 but likely can be used for Ubuntu 14.04 and 17.04 as well, with one minor modification detailed below.
To make life simple, remove all other versions of Postgres. Obviously not required, but again, makes life simple. If you have data in your previous version of postgres that you'd like to retain, then this is not recommended. Instead, you'll have to use pg_upgrade or pg_upgradecluster.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get update | |
apt-get install -y build-essential curl | |
apt-get -y install git g++ make binutils autoconf automake autotools-dev libtool pkg-config zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libev-dev libevent-dev libjansson-dev libjemalloc-dev cython python3-dev python-setuptools | |
git clone https://github.com/tatsuhiro-t/nghttp2.git | |
cd nghttp2 | |
autoreconf -i | |
automake | |
autoconf | |
./configure | |
make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// CoreDataController.swift | |
// | |
// Created by Keith Harrison http://useyourloaf.com | |
// Copyright (c) 2017 Keith Harrison. All rights reserved. | |
// | |
// Redistribution and use in source and binary forms, with or without | |
// modification, are permitted provided that the following conditions are met: | |
// | |
// 1. Redistributions of source code must retain the above copyright |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
package_name=$1 | |
./gradlew assembleDebug | |
adb -d install -r app/build/outputs/apk/app-debug.apk | |
adb shell monkey -p "$package_name" -c android.intent.category.LAUNCHER 1 | |
./logcat.sh "$package_name" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. extract audio from all videos (assuming .mp4 videos). | |
for FILE in *.mp4; do ffmpeg -i $FILE ${FILE%%.mp4}.wav; done | |
# 2. use the first second of the first audio file as the noise sample. | |
sox `ls *.wav | head -1` -n trim 0 1 noiseprof noise.prof | |
# Replace with a specific noise sample file if the first second doesn't work for you: | |
# sox noise.wav -n noiseprof noise.prof | |
# 3. clean the audio with noise reduction and normalise filters. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# DO NOT run the line 167 standalone. It will remove the necessary files besides the junk! | |
if echo $@|grep -q "\-\-help\|\-help\|\-h\|help\|\-\-h\|\-\-no\-deb\|\-\-no\-install\|\-\-no\-cleaning\|\-\-assume\-debian" | |
then : | |
else echo wrong entry\(ies\) ! | |
help=yes | |
fi | |
if echo $@|grep -q "\-\-help\|\-help\|\-h\|help\|\-\-h" || [ "$help" = yes ] |