Skip to content

Instantly share code, notes, and snippets.

View luginbash's full-sized avatar

Luginbash luginbash

View GitHub Profile
@luginbash
luginbash / ocprofile.xml
Last active August 29, 2015 14:07
Client profile for OpenConnect Server
<?xml version="1.0" encoding="UTF-8"?>
<AnyConnectProfile xmlns="http://schemas.xmlsoap.org/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.xmlsoap.org/encoding/ AnyConnectProfile.xsd">
<ClientInitialization>
<AutoUpdate>true</AutoUpdate>
<BypassDownloader>true</BypassDownloader>
<UseStartBeforeLogon>false</UseStartBeforeLogon>
<StrictCertificateTrust>false</StrictCertificateTrust>
<RestrictPreferenceCaching>false</RestrictPreferenceCaching>
<RestrictTunnelProtocols>IPSec</RestrictTunnelProtocols>
@luginbash
luginbash / libSys.sh
Last active December 21, 2015 14:02
System Initialization Script, Personalized
#!/bin/bash
# libSystem - this script does nothing all by itself.
function addUfw {
aptitude -y install ufw
ufw logging on
ufw default deny
ufw allow ssh
ufw enable
rm /etc/rsyslog.d/20-ufw.conf
printf "%s\n" "Setting up vanilla enviroment"
# BSD
PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
# OSX Server Specific
PATH="$PATH:/Applications/Server.app/Contents/ServerRoot/usr/bin:/Applications/Server.app/Contents/ServerRoot/usr/sbin"
# sanity locale
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
daemon
pidfile /var/run/3proxy.pid
nscache 65536
nserver 208.67.222.222
nserver 208.67.220.220
config /etc/3proxy/3proxy.conf
monitor /etc/3proxy/3proxy.conf
monitor /etc/3proxy/counters
monitor /etc/3proxy/passwd
@luginbash
luginbash / proxy.js
Last active September 16, 2015 07:33
my auto proxy configuration script, address stripped.
function FindProxyForURL(url, host) {
// Apple Device compatibility, they will skip SOCKS5 for SOCKS.
var local_address = "192.168.88.0";
var local_subnet = "255.255.255.0";
var PROXY = "SOCKS5 __ADDRESS__:__PORT__; SOCKS __ADDRESS__:__PORT__";
var OLDMILL = "SOCKS5 __ADDRESS__:__PORT__; SOCKS __ADDRESS__:__PORT__";
var domain_list = [ ".ytimg.com"
,".youtube.com"
,".greatfire.org"
,"gist.github.com"
@luginbash
luginbash / default.yaml
Created March 24, 2015 08:12
Weasel Pinyin Config
ascii_composer:
good_old_caps_lock: true
switch_key:
Caps_Lock: clear
Control_L: noop
Control_R: noop
Eisu_toggle: clear
Shift_L: inline_ascii
Shift_R: commit_text
config_version: 0.36.custom.3025064750
@luginbash
luginbash / surge.conf
Created October 4, 2015 07:24 — forked from janlay/README.md
Yet another config for Surge.app
[General]
# warning, notify, info, verbose
loglevel = notify
[Proxy]
# http, https, socks5
Proxy = custom, 1.2.3.4, 443, rc4-md5, password, http://server/custom.module
[Rule]
# Block privacy trackers
@luginbash
luginbash / DNSoMatic.rsc
Last active May 2, 2022 03:48
DNS-O-Matic Dynamic IP Endpoint update script for Mikrotik RouterOS
# DNS-O-Matic Dynamic IP Endpoint update script for Mikrotik RouterOS.
#
# Author: Quan Zhou <[email protected]>
#
# Description:
# Update IP address of specified hostname through dnsomatic.com
# You need a dnsomatic.com account and whatsoever ddns service
# supported by them.
#
# Tested ands works with Mikrotik RouterOS 6.32
@luginbash
luginbash / hostIp.func.rsc
Created December 9, 2015 08:02
Add interface IPv4 address to a global var
# Change to the name of interface that gets the dynamic IP address
:local inetinterface "pppoe-out1";
# use search & replace all on myEndpoint for multiple hosts
:global myEndpoint;
:if ([/interface get $inetinterface value-name=running]) do={
# Get the current IP on the interface
:local currentIP [/ip address get [find interface="$inetinterface" disabled=no] address];
@luginbash
luginbash / functions.sh
Last active May 1, 2019 00:41
Dynamic DNS endpoint IP address update script with Mikrotik router
#!/bin/bash
function snmpGetIP
{
local SNMP_HOST=$1
local SNMP_COMM=$2
local SNMP_IFID=$3
snmpwalk -Os -c ${SNMP_COMM} -v 2c ${SNMP_HOST} ipAdEntIf | grep "INTEGER: ${SNMP_IFID}" | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'
}