Skip to content

Instantly share code, notes, and snippets.

View takizo's full-sized avatar

CJ Ooi takizo

  • Kuala Lumpur
View GitHub Profile
@taldanzig
taldanzig / osxvpnrouting.markdown
Created January 24, 2013 22:14
Routing tips for VPNs on OS X

Routing tips for VPNs on OS X

When VPNs Just Work™, they're a fantastic way of allowing access to a private network from remote locations. When they don't work it can be an experience in frustration. I've had situations where I can connect to a VPN from my Mac, but various networking situations cause routing conflicts. Here are a couple of cases and how I've been able to get around them.

Specific cases

Case 1: conflicting additional routes.

In this example the VPN we are connecting to has a subnet that does not conflict with our local IP, but has additional routes that conflict in some way with our local network's routing. In my example the remote subnet is 10.0.x.0/24, my local subnet is 10.0.y.0/24, and the conflicting route is 10.0.0.0/8. Without the later route, I can't access all hosts on the VPN without manually adding the route after connecting to the VPN:

@dhensby
dhensby / install-tarsnap.sh
Last active May 19, 2020 02:29
A script to install tarsnap automatically on Fedora/CentOS/RHEL
#!/bin/bash
# To do:
# - Force install (regardless of installed tarsnap version) via flag
# - Set version via flag
# - Set TMP_DIR via flag
# - Skip software insall via flag
# - Check signature automatically
VERSION=1.0.37
TMP_DIR=/tmp/tarsnap
REMOVE_DIR=false
@lucaspiller
lucaspiller / auto-save-remote-images.php
Created February 19, 2014 15:19
Auto Save Remote Images WP Plugin
<?php
/*
Plugin Name: Auto Save Remote Image
Plugin URI: http://www.devsaab.com/wordpress/
Description: This plugin automatically downloads the first remote image from a post and sets it as the featured image.
Version: 1.3
Author: Prebhdev Singh
Disclaimer: No warranty or guarantee of any kind! Use this in your own risk.
*/
add_action('publish_post', 'fetch_images');
@mattzuba
mattzuba / 01_httpd_phpfpm.config
Last active December 20, 2022 19:53
Apache 2.4 / PHP-FPM 5.5 on Amazon Elastic Beanstalk
packages:
yum:
php55-fpm: []
files:
"/opt/elasticbeanstalk/hooks/appdeploy/pre/26_phpfpm_config.sh":
mode: "000755"
owner: root
group: root
content: |
@kalinchernev
kalinchernev / countries
Created October 6, 2014 09:42
Plain text list of countries
Afghanistan
Albania
Algeria
Andorra
Angola
Antigua & Deps
Argentina
Armenia
Australia
Austria
@titipata
titipata / macports_installation.md
Last active March 29, 2022 03:08
Easy description to install python using Macports

##Installing Python using Macports (beginner guide)

I think package management system is good for long-term installation. Since lab members use a lot of Apple product, I wrote Macports documentation which is package management system for Mac OSX which hopefully will be useful for members who use Mac. Note that this is not an official document but probably an easy way to get start with Macports. Macports depends mostly by its community and ones who update the port. We may have to migrate our ports when Mac announce new operating system. From my experience, it is normal to have some port problem with macports when new Mac operating system, for example, when Maverick or Yosemite was announced or when new XCode version were updated. It will take some time (a day or a week) for them to update the new port that are compatible with new operating system. But yeah, most ports work very well even though OS changes since the community is very active.

Macports

@fevangelou
fevangelou / my.cnf
Last active May 23, 2024 15:15
Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers)
# === Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated December 2021 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
@pstray
pstray / ssh-multi.sh
Last active September 28, 2023 18:07
Start tmux and ssh to multiple hosts with synchronized input
#! /bin/bash
if [ -z "$1" ]; then
echo "please supply at least one server to connect to" >&2
exit 1
fi
target=multi-ssh-$$
if [ -z "$TMUX" ]; then
import signal
import sys
from google.cloud import language
from google.api_core.exceptions import InvalidArgument
# create a Google Cloud Natural Languague API Python client
client = language.LanguageServiceClient()
@allenday
allenday / make_TsvHttpData.pl
Last active September 3, 2018 10:07
Create URL list for Google Cloud Storage Transfer Service, see: https://cloud.google.com/storage/transfer/create-url-list
#!/usr/bin/perl
use strict;
my $http_base = shift;
my $path_base = shift;
my $prev_file = shift;
if ( ! $http_base || ! $path_base ) {
print STDERR <<"HERE";
USAGE: