Skip to content

Instantly share code, notes, and snippets.

View jonaharagon's full-sized avatar
✈️
I am out of town until June 19th

Jonah Aragon jonaharagon

✈️
I am out of town until June 19th
View GitHub Profile
@jonaharagon
jonaharagon / MobiRedirect
Created September 1, 2014 16:11
Redirect Mobile Websites
<script>
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) {
window.location = "CHANGE THIS TO MOBILE SITE";
}
</script>
<script>// <![CDATA[
if (screen.width <= 800) {
document.location = "CHANGE THIS TO MOBILE SITE";
}
@jonaharagon
jonaharagon / gist:da98971ee50a4212d5c8
Created September 13, 2014 23:10
mChat Problem D:
SQL ERROR [ mysql4 ]
Table 'jda_phpbb.MCHAT_CONFIG_TABLE' doesn't exist [1146]
SQL
SELECT * FROM MCHAT_CONFIG_TABLE
BACKTRACE
@jonaharagon
jonaharagon / restart_ucs.exe
Created April 26, 2015 22:33
Restart ucs.exe every 12 hours
@echo off
:loop
start ucs.exe ...
timeout /t 43200 >null
taskkill /f /im ucs.exe >nul
goto loop
@jonaharagon
jonaharagon / logcleaner.bat
Last active August 29, 2015 14:20
Simple batch file to clear the massive logs of UCS - Cleaner by lotus10190, modified by deysmacro.
@echo off
tasklist /FI "IMAGENAME eq ucs.exe" | findstr "ucs.exe" >nul
if %ERRORLEVEL% == 1 goto runcode1
goto runcode2
:runcode1
start /min ucs.exe ...
timeout /t 14400
taskkill /f /im ucs.exe
timeout /t 1
@jonaharagon
jonaharagon / server.conf
Last active March 27, 2017 04:50 — forked from laurenorsini/server.conf
OpenVPN configuration for /etc/openvpn/server.conf
local 192.168.2.0 # SWAP THIS NUMBER WITH YOUR RASPBERRY PI IP ADDRESS
dev tun
proto udp #Some people prefer to use tcp. Don't change it if you don't know.
port 1194
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/Pi.crt # SWAP WITH YOUR CRT NAME
key /etc/openvpn/easy-rsa/keys/Pi.key # SWAP WITH YOUR KEY NAME
dh /etc/openvpn/easy-rsa/keys/dh2048.pem
server 10.8.0.0 255.255.255.0
# server and remote endpoints
#!/bin/sh
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j SNAT --to-source 192.168.X.X
client
dev tun
proto udp
remote <YOUR PUBLIC IP ADDRESS HERE> 1194
resolv-retry infinite
nobind
persist-key
persist-tun
mute-replay-warnings
ns-cert-type server
@jonaharagon
jonaharagon / renew-certs
Last active February 16, 2017 04:41 — forked from thisismitch/le-renew-webroot
Auto Renewal Script for Let's Encrypt and Discourse (@ DigitalOcean)
#!/bin/bash
web_service='nginx'
config_file="/opt/letsencrypt/settings.ini"
le_path='/opt/letsencrypt'
exp_limit=30;
if [ ! -f $config_file ]; then
echo "[ERROR] config file does not exist: $config_file"
@jonaharagon
jonaharagon / keybase.md
Last active March 13, 2018 21:52
This is a Keybase verification file for https://keybase.io/jonaharagon

Keybase proof

I hereby claim:

  • I am jonaharagon on github.
  • I am jonaharagon (https://keybase.io/jonaharagon) on keybase.
  • I have a public key ASDird0rMUlWf6hEiuVPu5IiGTE0y6q8ZXFbXon5paxJFgo

To claim this, I am signing this object:

@jonaharagon
jonaharagon / srvzone-do
Last active December 30, 2022 14:33
Modified SRVZONE Script for DigitalOcean User Data Installation (see https://wiki.opennic.org/opennic:srvzone for original)
#!/bin/bash
cd `/etc/bind`
mkdir --mode=774 --parents /var/cache/bind/opennic
mkdir --mode=774 --parents /var/cache/bind/opennic/master
mkdir --mode=774 --parents /var/cache/bind/opennic/slave
chown -R bind:bind /var/cache/bind
file_root='/var/cache/bind/opennic/tld-root'
file_master='/var/cache/bind/opennic/master/$TLD'
file_slave='/var/cache/bind/opennic/slave/$TLD.zone'