Skip to content

Instantly share code, notes, and snippets.

View integrii's full-sized avatar
🇺🇸
Remember that LED stop lights failed because they didn't melt snow.

Eric Greer integrii

🇺🇸
Remember that LED stop lights failed because they didn't melt snow.
View GitHub Profile
@integrii
integrii / config.hdf
Created July 4, 2014 03:13
Codeigniter running with on Centos 6.4 via HHVM and FastCGI
Server {
Type=fastcgi
Port=9000
PathDebug = true
FixPathInfo = true
}
VirtualHost {
* {
Pattern = .*
@integrii
integrii / irssi.sh
Last active August 29, 2015 14:05
Create or attach screen with irssi
#!/bin/bash
# Save script to ~/.irssi.sh
# Creates a screen and starts irssi in it.
# If the screen already exists, it simply attaches it.
# Create an alias in your ~/.bashrc to access it simply.
# alias irc='~/.irssi.sh'
if screen -list | grep -q "irssi"; then
screen -x irssi
else
@integrii
integrii / gist:9856eb7fe1db0e0bb417
Last active August 29, 2015 14:14
Get output of non-blocking bash commands with python
#!/usr/bin/python
# Be sure to run this as root!
import subprocess
def runcmd(command, timeout):
command = command + " & pid=$!;sleep " + str(timeout) + "; kill -9 $pid"
#print(command)
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
return process.stdout.read()
@integrii
integrii / webRequest.java
Created March 13, 2015 21:09
Simple web request with Java on Android
URL apiUrl = null;
int statusCode = 0;
String responseData = "";
try {
// setup new web request parameters
apiUrl = new URL("http://api.site.com");
HttpURLConnection connection = null;
connection = (HttpURLConnection) apiUrl.openConnection();
@integrii
integrii / squid.conf
Created July 17, 2015 04:45
authenticated squid.conf for centos 7
# setup password file
sudo htdigest -c /etc/squid/passwords local username
@integrii
integrii / .tmux.conf
Last active September 18, 2015 18:21 — forked from shinzui/tmux.conf
tmux.conf
# ~/.tmux.conf
#
# See the following files:
#
# /opt/local/share/doc/tmux/t-williams.conf
# /opt/local/share/doc/tmux/screen-keys.conf
# /opt/local/share/doc/tmux/vim-keys.conf
#
# URLs to read:
#
@integrii
integrii / gist:8f88e38180d84969b88d1bf07deab98f
Created May 19, 2016 05:34
the perfect ssh proxy command
ssh -D 8123 -f -C -q -N sammy@example.com
Explanation of arguments
-D: Tells SSH that we want a SOCKS tunnel on the specified port number (you can choose a number between 1025-65536)
-f: Forks the process to the background
-C: Compresses the data before sending it
-q: Uses quiet mode
-N: Tells SSH that no command will be sent once the tunnel is up

Keybase proof

I hereby claim:

  • I am integrii on github.
  • I am eg (https://keybase.io/eg) on keybase.
  • I have a public key whose fingerprint is CFE7 48DD D2EC AEEF 828A 98B6 353C 6078 36AA 0511

To claim this, I am signing this object:

@integrii
integrii / 2mtcp.sh
Created July 17, 2016 09:00
This systemctl chain can take the TCP stack up to 2M connections.
sysctl -w fs.file-max=12000500
sysctl -w fs.nr_open=20000500
ulimit -n 20000000
sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'
sysctl -w net.ipv4.tcp_rmem='1024 4096 16384'
sysctl -w net.ipv4.tcp_wmem='1024 4096 16384'
sysctl -w net.core.rmem_max=16384
sysctl -w net.core.wmem_max=16384
@integrii
integrii / teamspeak.service
Last active April 22, 2017 20:42
Service file for teamspeak on systemd (teamspeak.service)
[Unit]
Description=Teamspeak Server
After=network.target
[Service]
ExecStart=/root/teamspeak/ts3server_startscript.sh start
ExecStop=/root/teamspeak/ts3server_startscript.sh stop
Watchdog=1
Restart=on-watchdog
User=root