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
#!/usr/bin/env bash | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
if ! crane version >/dev/null; then echo "Must install crane."; exit 1; fi | |
if ! cosign version >/dev/null; then echo "Must install cosign."; exit 1; fi | |
GHCR_ROOT_NAMESPACE="${GHCR_ROOT_NAMESPACE:-}" |
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
# Block Torrent algo string using Boyer-Moore (bm) | |
iptables -A FORWARD -m string --algo bm --string "BitTorrent" -j DROP | |
iptables -A FORWARD -m string --algo bm --string "BitTorrent protocol" -j DROP | |
iptables -A FORWARD -m string --algo bm --string "peer_id=" -j DROP | |
iptables -A FORWARD -m string --algo bm --string ".torrent" -j DROP | |
iptables -A FORWARD -m string --algo bm --string "announce.php?passkey=" -j DROP | |
iptables -A FORWARD -m string --algo bm --string "torrent" -j DROP | |
iptables -A FORWARD -m string --algo bm --string "announce" -j DROP | |
iptables -A FORWARD -m string --algo bm --string "info_hash" -j DROP | |
iptables -A FORWARD -m string --algo bm --string "/default.ida?" -j DROP |
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
FROM jwilder/nginx-proxy | |
COPY *.conf /etc/nginx/conf.d/ | |
COPY letsencrypt.diff /app/ | |
RUN apt-get update && apt-get install -y \ | |
patch \ | |
&& rm -rf /var/lib/apt/lists/* | |
RUN patch nginx.tmpl letsencrypt.diff |
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
local ret_status="%(?:%{$fg_bold[green]●$fg_bold[yellow]●$fg_bold[red]●%}:%{$fg_bold[red]●$fg_bold[red]●$fg_bold[red]●%} )" | |
PROMPT='${ret_status}%{$fg[cyan]%} %c%{$reset_color%} $(git_prompt_info)' | |
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " | |
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗" | |
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" |
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
const chunks = (arr, chunkSize) => { | |
let results = []; | |
while (arr.length) results.push(arr.splice(0, chunkSize)); | |
return results; | |
}; | |
module.exports = (xs, f, concurrency) => { | |
if (xs.length == 0) return Promise.resolve(); | |
return Promise.all(chunks(xs, concurrency).reduce( | |
(acc, chunk) => acc.then(() => Promise.all(chunk.map(f))), |
I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.
I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.
Chrome 51 has some pretty wild behaviour related to console.log
in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.
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
# Based on CentOS7 fork of @smartmadsoft: https://gist.github.com/moneytoo/ab3f34e4fddc2110675952f8280f49c5 | |
# "6" for CentOS6 or Amazon Linux, "7" for CentOS7 | |
CENTVER="6" | |
OPENSSL="openssl-1.1.0-pre5" | |
NGINX="nginx-1.11.0-1" | |
yum clean all | |
# Install epel packages (required for GeoIP-devel) |
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
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
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
// | |
// HideableUIView.swift | |
// Jarvis | |
// | |
// Created by Mathew Spolin on 9/22/15. | |
// Copyright © 2015 AppDirect. All rights reserved. | |
// | |
import Foundation | |
import UIKit |
NewerOlder