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
/* | |
* linux 2.6.37-3.x.x x86_64, ~100 LOC | |
* gcc-4.6 -O2 semtex.c && ./a.out | |
* 2010 sd@fucksheep.org, salut! | |
* | |
* update may 2013: | |
* seems like centos 2.6.32 backported the perf bug, lol. | |
* jewgold to 115T6jzGrVMgQ2Nt1Wnua7Ch1EuL9WXT2g if you insist. | |
*/ |
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
#install required packages | |
apt-get update | |
apt-get upgrade -y | |
apt-get install -y git curl build-essential libssl-dev libcurl4-openssl-dev nodejs | |
#optional | |
apt-get install libsqlite3-dev sqlite3 | |
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/perl | |
my $cmd = "dbus-monitor --session \"type='signal',interface='org.gnome.ScreenSaver',member='ActiveChanged'\""; | |
open (IN, "$cmd |"); | |
while (<IN>) { | |
if (m/^\s+boolean true/) { | |
print "*** Screensaver is active ***\n"; | |
system("killall -s SIGSTOP firefox plugin-container"); |
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 | |
# | |
# template script for generating CentOS container for LXC | |
# | |
# | |
# lxc: linux Container library | |
# Authors: |
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
Vagrant.configure("2") do |config| | |
config.vm.box = "debian-wheezy72-x64-vbox43" | |
config.vm.box_url = "http://box.puphpet.com/debian-wheezy72-x64-vbox43.box" | |
config.vm.network "private_network", ip: "192.168.56.101" | |
config.vm.synced_folder "./", "/var/www", id: "vagrant-root", :nfs => false | |
config.vm.usable_port_range = (2200..2250) |
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
echo "deb [trusted=yes] https://apt.fury.io/dictcp/ /" | sudo tee /etc/apt/sources.list.d/dictcp.list | |
sudo apt-get update && sudo apt-get install linux-image-3.16.0-28-pep |
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
<fontconfig> | |
<match target="pattern"> | |
<test name="lang"> | |
<string>zh-tw</string> | |
</test> | |
<test name="family"> | |
<string>sans-serif</string> | |
</test> | |
<edit name="family" mode="prepend" binding="strong"> | |
<string>Noto Sans CJK TC</string> |
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 | |
# assuming we are on Ubuntu 14.04 with docker proper installed | |
apt-get install -y build-essential dh-autoreconf git libssl-dev libtool | |
git clone https://github.com/Netflix/dynomite | |
cd dynomite | |
git checkout v0.4.0 | |
autoreconf -fvi | |
./configure |
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 | |
# The bandwidth to simulate, here about 56kilobit per second. This is layer 2 bandwidth, so TCP/UDP and IP overhead will apply | |
BW="56kbps" | |
# _Half_ the latency that we aim for. Since this applies to both the WAN port and Wi-Fi, the delay is applied twice, so this actually puts it at around 120+ms | |
LATENCY="60ms" | |
# Chance of packet loss. Also applied to both interfaces, so it is 1%. | |
LOSS="0.5%" | |
# The device name of your wifi device. | |
WIFI="wlan0" |
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 | |
# enable root login & password login | |
sed -i 's/^[# ]*PermitRootLogin$/PermitRootLogin yes/' /etc/ssh/sshd_config | |
sed -i 's/^[# ]*PasswordAuthentication$/PasswordAuthentication yes/' /etc/ssh/sshd_config | |
/etc/init.d/ssh restart > /dev/null | |
/etc/init.d/sshd restart > /dev/null | |
echo '-----------------------------------------' | |
if [ "`cat /etc/shadow | grep root | cut -d: -f2`" == '!*' ]; then |
OlderNewer