Skip to content

Instantly share code, notes, and snippets.

View yanggis's full-sized avatar

X.K. YANG yanggis

  • National University of Singapore
  • Singapore
View GitHub Profile
@yanggis
yanggis / tinc_install.sh
Created February 4, 2022 10:52 — forked from danielKugler/tinc_install.sh
Installing and configuring tinc vpn on a Debian based machine. (tried Ubuntu 16.04LTS and Raspbian Jessie)
#! /bin/sh
# -------------------------------------
# Installation of tinc vpn
# -------------------------------------
# -------------------------------------
# Installation of dependencies
# -------------------------------------
sudo apt-get update
sudo apt-get install -y make libssl-dev zlib1g-dev liblzo2-dev libreadline6-dev libncurses5-dev
@yanggis
yanggis / install-postgres-postgis-gdal.sh
Created April 17, 2018 01:16 — forked from mdiener21/install-postgres-postgis-gdal.sh
Setup Ubuntu 16.04 for GIS development postgresql 9.6, postgis 2.3, gdal 2.1.2, python 3.5, pgrouting
sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main"
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-9.6
sudo apt-get install postgresql-9.6-postgis-2.3
sudo apt-get install postgresql-9.6-pgrouting
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
@yanggis
yanggis / huawei_e8372_config.md
Created February 12, 2018 14:21 — forked from guseppiguliano/huawei_e8372_config.md
Huawei E8372 Linux Configuration and Setup

Dependencies

  1. usb_modeswitch, usb_modeswitch-data
  2. libusb1
  3. libusb-devel(Fedora), libusb-dev(Debian based)

Configuration

By default, your linux box would register your Huawei E8372 as a Mass Storage device and not (somehow) as a modem. First, make sure you have the exace same device we're talking about. This can be confirmed by looking at 2 values. Give the following command (while the dongle is plugged in):

    sudo su
    lsusb | grep Huawei
@yanggis
yanggis / LEDE-bwlimit.qos.patch
Last active November 6, 2017 06:25 — forked from 1player/simple-bwlimit.qos.patch
OpenWRT SQM script for bandwidth limited class
--- simple.qos
+++ simple-bwlimit.qos
@@ -77,6 +77,7 @@
BE_RATE=`expr $CEIL / 6` # Min for best effort
BK_RATE=`expr $CEIL / 6` # Min for background
BE_CEIL=`expr $CEIL - 16` # A little slop at the top
+BL_RATE=`expr $CEIL / 100`
LQ="quantum `get_mtu $IFACE $CEIL`"
@yanggis
yanggis / sniproxy.conf
Last active April 25, 2017 08:12 — forked from phoenixlzx/sniproxy.conf
SNIProxy配置文件
# sniproxy example configuration file
# lines that start with # are comments
# lines with only white space are ignored
user daemon
# PID file
pidfile /var/run/sniproxy.pid
resolver {
@yanggis
yanggis / hosts
Created January 8, 2016 10:49 — forked from renatofmachado/hosts
Hosts script to help edit the host names.
#!/bin/bash
# Lists all of the available host names.
function list(){
ips=$(cat "$file" | grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" | tr -s "\t " "\t")
numberOfFiles=$(echo -e "$ips" | wc -l | tr -d " ")
echo -e "\nThere are $numberOfFiles hosts registered:\n\n$ips"
}
# Adds an host to the list
@yanggis
yanggis / update-hosts
Created January 8, 2016 09:30 — forked from jarlef/update-hosts
Shell script to update hosts file
#! /bin/sh
# @author: Jarle Friestad
# Based on script by Claus Witt (http://clauswitt.com/319.html)
# Adding or Removing Items to hosts file
# Use -h flag for help
DEFAULT_IP=127.0.0.1
IP=${3:-$DEFAULT_IP}
@yanggis
yanggis / manage-etc-hosts.sh
Created January 8, 2016 09:29 — forked from irazasyed/manage-etc-hosts.sh
Bash Script to Manage /etc/hosts file for adding/removing hostnames.
#!/bin/sh
# PATH TO YOUR HOSTS FILE
ETC_HOSTS=/etc/hosts
# DEFAULT IP FOR HOSTNAME
IP="127.0.0.1"
# Hostname to add/remove.
HOSTNAME=$1
@yanggis
yanggis / update-hosts.sh
Created January 8, 2016 09:24 — forked from dfasolin/update-hosts.sh
Automatically update local hosts file with hosts-file.net
#!/usr/bin/env sh
# Filename: update-hosts.sh
# Authors: George Lesica <george@lesica.com>
# Danilo Fasolin Salmazio <dfasolin@gmail.com>
# Description: Replaces the HOSTS file with a customized version (hosts-file.net) that blocks
# domains that serve ads and malicious software, creating a backup of the old
# file.
# Improvements: Add the partial file, a /etc/hosts_dev with some development hosts and creates
# a logfile
@yanggis
yanggis / update_hosts
Created January 8, 2016 09:22 — forked from ilstar/update_hosts
Update your hosts
#!/usr/bin/ruby
# Usage
# sudo ruby update_hosts.rb
require 'rubygems'
require 'fileutils'
require 'net/http'