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 | |
set -ex | |
PATH=/bin:/sbin:/usr/bin:/usr/sbin | |
KEYMAP="us us" | |
HOST=alpine | |
USER=anon | |
ROOT_FS=ext4 | |
BOOT_FS=ext4 |
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 | |
# set -eux | |
# This a simple script that builds static versions of Python and LibPython using musl-libc | |
# Find the associated article at: http://general-purpose.io/2015/12/06/compiling-python-and-libpython-statically-using-musl-libc/ | |
WORKING_DIR="/code/static-python" | |
MUSL_PREFIX="/code/static-python/musl" | |
PY_PREFIX="/code/static-python/python" |
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
Function | |
Convert-WindowsImage | |
{ | |
<# | |
.NOTES | |
Copyright (c) Microsoft Corporation. All rights reserved. | |
Use of this sample source code is subject to the terms of the Microsoft | |
license agreement under which you licensed this sample source code. If |
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
import sys, socket | |
''' | |
tcp fast open server sample code | |
execute it before enable tfo flag | |
$ echo 3 | sudo tee /proc/sys/net/ipv4/tcp_fastopen | |
''' | |
PORT = 80 | |
MSG_FASTOPEN = 0x20000000 |
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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
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
# zonecfg -z <uuid> | |
# add attr | |
# set name=qemu-extra-opts | |
# set type=string | |
# set value="LXNtcCBjcHVzPTEsY29yZXM9NCx0aHJlYWRzPTI=" | |
# end | |
# commit | |
# exit | |
Then reboot the machine. The value is the base64 encoded string that will be added to the qemu-kvm options. The above is "-smp cpus=1,cores=4,threads=2", which plays nice with Windows which for some stupid reason only supports 2 cpus. |
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
import jsonrpc | |
from jsonrpc import ServiceProxy | |
from os.path import expanduser | |
conf = {p[0]: p[1].strip() for p in | |
(l.split("=", 1) for l in open(expanduser("~/.bitcoin/bitcoin.conf"))) | |
if len(p) == 2} | |
proxy = ServiceProxy("http://%(rpcuser)s:%(rpcpassword)[email protected]:8332"%conf) | |
info = proxy.getinfo() |
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 -e | |
if [ -z "$iso" ] ; then | |
printf -- ">>> You must invoke with iso=/path/to/winxp.iso $(basename $0)\n" | |
exit 1 | |
fi | |
if [ -z "$url" ] ; then |
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
#include <algorithm> | |
#include <cmath> | |
#include <functional> | |
#include <numeric> | |
#include <unordered_map> | |
#include <vector> | |
#include <stdint.h> | |
#include <stdio.h> | |
using namespace std; |
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 python | |
# -*- encoding: utf-8 -*- | |
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: | |
# Author: Binux<[email protected]> | |
# http://binux.me | |
# Created on 2012-09-06 22:22:21 | |
import urlparse | |
import re |
NewerOlder