Skip to content

Instantly share code, notes, and snippets.

@fdr
fdr / tunnel.sh
Created February 11, 2023 02:29 — forked from neca7/tunnel.sh
Script to set up an ipsec tunnel between two machinesFor Example: ./tunnel.sh 10.10.10.1 10.10.10.2 192.168.0.1 192.168.0.2 would set up an ipsec tunnel over 10.10.10.1 address using 192.168.0.1 as a virtual addresspasswordless sudo required for user on remote machine
#!/bin/bash
if [ "$4" == "" ]; then
echo "usage: $0 <local_ip> <remote_ip> <overlay_local_ip> <overlay_remote_ip>"
echo "creates an ipsec tunnel between two machines"
exit 1
fi
SRC="$1"; shift
DST="$1"; shift
@fdr
fdr / cert.rb
Created September 14, 2020 18:37 — forked from ricardochimal/cert.rb
generating ssl certs with subjectAltName domains
domain = "*.example.com"
subjectAltDomains = [ domain, "example.com" ]
require 'openssl'
puts "Generating public and private keys..."
key = OpenSSL::PKey::RSA.new(2048)
subject = "/C=US/ST=California/L=Los Angeles/O=Example Inc./CN=#{domain}"
cert = OpenSSL::X509::Certificate.new
@fdr
fdr / pr.md
Created May 13, 2013 00:17 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: