Skip to content

Instantly share code, notes, and snippets.

@ultimate010
ultimate010 / work.py
Last active September 13, 2017 08:19
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
[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
@ultimate010
ultimate010 / src2pdf.sh
Created December 25, 2015 11:05
Use xelatex to generate pdf from src
#!/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:
@ultimate010
ultimate010 / dawg.py
Created October 13, 2015 05:17 — forked from smhanov/dawg.py
Use a DAWG as a map
#!/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
@ultimate010
ultimate010 / skip_bom.sh
Created September 16, 2015 14:23
Use tail to skip bom(byte order mark)
tail --bytes=+4 text.txt
sudo chown root:wheel /usr/local/bin/htop
sudo chmod u+s /usr/local/bin/htop
#!/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"
# 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
```
@ultimate010
ultimate010 / vpnsetup.sh
Last active August 29, 2015 14:26 — forked from hwdsl2/.MOVED.md
IPsec L2TP VPN Auto Install Script for Ubuntu 14.04 & 12.04 and Debian 8 & 7
#!/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!
#
@ultimate010
ultimate010 / pptpd
Created August 4, 2015 10:11
pptpd
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