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 multiprocessing import Pool | |
import multiprocessing | |
from time import sleep | |
def f(x): | |
# Put any cpu (only) consuming operation here. I have given 1 below - | |
count = 0 | |
some_str = ' ' * 512000000 * 3 | |
while True: | |
count += 1 |
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
[General] | |
# warning, notify, info, verbose | |
external-controller-access = apw@0.0.0.0:6155 | |
interface = 0.0.0.0 | |
port = 8888 | |
socks-port = 8889 | |
ipv6 = 0 | |
bypass-system = 1 | |
dns-server = system, 223.5.5.5, 114.114.114.114, 119.29.29.29 | |
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12 |
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 | |
[[ debug -eq 1 ]] && set -x | |
PROGNAME=$(basename $0) | |
error_exit() | |
{ | |
# ---------------------------------------------------------------- | |
# Function for exit due to fatal program error | |
# Accepts 1 argument: |
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/python3 | |
# By Steve Hanov, 2011. Released to the public domain. | |
# Updated 2014 to use DAWG as a mapping. | |
import sys | |
import time | |
DICTIONARY = "/usr/share/dict/words" | |
QUERY = sys.argv[1:] | |
# This class represents a node in the directed acyclic word graph (DAWG). It |
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
tail --bytes=+4 text.txt |
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
sudo chown root:wheel /usr/local/bin/htop | |
sudo chmod u+s /usr/local/bin/htop |
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/expect -f | |
set timeout -1 | |
if { ${argc} < 2 } { | |
send_user "Usage:\n" | |
send_user "\t${argv0} PASSWORD \[USER@\]HOST \[COMMAND1 \[; COMMAND2\] ...\]\n" | |
send_user "\n" | |
send_user "Default USER is current login\n" | |
send_user "Without any COMMAND, will get an interactive shell on the remote.\n" | |
send_user "With COMMAND(s), it will be run on the remote, and return the last command's status.\n" |
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
# Basic Strongswan ikev2 server setup | |
* paltform: atlantic.net ubuntu 14.04 x64 | |
* the commands below are run with root account | |
## Strongswan | |
``` | |
apt-get install strongswan | |
apt-get install iptables iptables-persistent | |
``` |
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 | |
# | |
# Amazon EC2 user-data file for automatic configuration of IPsec/L2TP VPN server | |
# on a Ubuntu or Debian instance. Tested with Ubuntu 14.04 & 12.04 and Debian 8 & 7. | |
# With minor modifications, this script *can also be used* on dedicated servers | |
# or any KVM- or XEN-based Virtual Private Server (VPS) from other providers. | |
# | |
# DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC! THIS IS MEANT TO BE RUN WHEN | |
# YOUR AMAZON EC2 INSTANCE STARTS! | |
# |
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
rpm -Uvh http://download.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-1.noarch.rpm | |
yum -y install ppp pptpd | |
cp /etc/pptpd.conf /etc/pptpd.conf.bak | |
cat >/etc/pptpd.conf<<EOF | |
option /etc/ppp/options.pptpd | |
logwtmp | |
localip 10.0.10.1 | |
remoteip 10.0.10.2-254 | |
EOF |
NewerOlder