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
I write today to request a tweak in the federal tax code to make it possible to implement state-level universal and conditional benefits. In particular, to allow some more state tax credits to skip federal income tax. The reason to prefer universality is to avoid the high effective marginal taxation rates that correspond with phase-outs in the tax code: in the federal code, effective marginal rates can exceed 80% for people with children with about $20,000 annual household income. The chart of effective marginal taxation looks like a city skyline, with very high but also chaotic marginal rates for low earners.
Currently, the main way to do something like that is through TANF, which has a number of restrictions and wording around "need" based credits, i.e. means-testing within the program rather than in the tax system. This makes it unsuitable as a vehicle for conditional benefits. By opting to use flat-rate universal/conditional benefits, a state will emit extra tax to the federal government as compared to
@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 / designer.html
Created July 11, 2014 01:08
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icons/core-icons.html">
@fdr
fdr / designer.html
Created July 9, 2014 20:40
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icons/core-icons.html">
@fdr
fdr / compile
Created May 8, 2014 10:23
WAL-E vendoring compile
#!/bin/bash
set -ue
cache_key() {
# Generate an md5sum from one literal input and a series of files.
#
# This is to allow for nested content hash derivation, useful when
# the caller of a function may need to trigger a cache-bust in a
# subroutine.
cat <(echo "$1") "${@:2}" | md5sum | cut -f1 -d ' '
@fdr
fdr / index.php
Created July 30, 2013 06:52
A very simple PHP test It just makes sure linking maybe-works.
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo '<p>Hello World</p>'; ?>
<?php echo mysql_connect(); ?>
<?php echo apc_store('hello', 'world') ?>
<?php echo apc_fetch('hello') ?>
</body>
@fdr
fdr / build-apache-php
Last active December 20, 2015 09:49
Heroku Apache and PHP build
#!/bin/bash
set -uex
cd /tmp
# Heroku revision. Must match in 'compile' program.
#
# Affixed to all vendored binary output to represent changes to the
# compilation environment without a change to the upstream version,
# e.g. PHP 5.3.27 without, and then subsequently with, libmcrypt.
heroku_rev='-2'
@fdr
fdr / use-dollar-quoting-anywhere.md
Last active December 20, 2015 09:39
Use Postgres dollar quoting anywhere

= Postgres Dollar Quoting

Postgres supports two forms of entry of data literals into the system. One is the familiar single-quote:

=> SELECT 'hello';
 ?column?
----------
 hello

(1 row)

@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: