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 / RaZberry API Command Examples
Last active November 22, 2022 13:03
RaZberry API ZAutomation/ZAPI Examples
# I had a LOT of trouble finding working examples of the ZAutomation API for RaZberry API. I eventually figured out what exactly to use by combining information from multiple sources and sniffing requests from the 'Expert UI'. Some areas I found information:
- http://docs.zwayhomeautomation.apiary.io/
- http://wiki.micasaverde.com/index.php/ZWave_Command_Classes
- https://www.npmjs.org/package/mqtt-zway
- The included PDFs
- The expert API area on the device web UI
- https://chrome.google.com/webstore/detail/postman-interceptor/aicmkgpgakddgnaphhhpliifpcfhicfo?hl=en (Postman POST/GET sniffer)
# Some general RaZberry API commands:
@integrii
integrii / setup.sh
Last active April 28, 2023 06:12
uTorrent Server (utserver) on Centos 7 (x86_64)
#!/bin/bash
# Took me awhile to figure out how to install utserver on Centos 7 x86_64... Especially with the new systemd subsystem. None of the builds I saw support it - but it will work with a couple symlinks and compatibility packages.
yum install glibc libgcc openssl krb5-libs libcom_err zlib keyutils-libs libselinux glibc glibc.i[36]86 libgcc libgcc.i[36]86 openssl openssl.i[36]86 krb5-libs krb5-libs.i[36]86 libcom_err libcom_err.i[36]86 zlib zlib.i[36]86 keyutils-libs keyutils-libs.i[36]86 libselinux libselinux.i[36]86 openssl098e-0.9.8e-29.el7.centos.2.i686 -y
ln -s /usr/lib/libssl.so.0.9.8e /lib/libssl.so.0.9.8
ln -s /usr/lib/libcrypto.so.0.9.8e /lib/libcrypto.so.0.9.8
mkdir /var/utserver
wget -O /var/utserver/utorrent-server-3.0-25053.tar.gz http://download.utorrent.com/linux/utorrent-server-3.0-25053.tar.gz
cd /var/utserver/
tar zxf utorrent-server-3.0-25053.tar.gz
mv /var/utserver/utorrent-server-v3_0/* /var/utserver/
@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
@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