Skip to content

Instantly share code, notes, and snippets.

View akatz's full-sized avatar

Avrohom Katz akatz

  • ShopKeep POS
  • Brooklyn, NY
View GitHub Profile
@akatz
akatz / masq.sh
Created July 5, 2018 20:59 — forked from mowings/masq.sh
script to get xet xhyve working with all vpn interfaces
#!/bin/bash
interfaces=( $(netstat -in | egrep 'utun\d .*\d+\.\d+\.\d+\.\d+' | cut -d ' ' -f 1) )
rulefile="rules.tmp"
echo "" > $rulefile
sudo pfctl -a com.apple/tun -F nat
for i in "${interfaces[@]}"
do
RULE="nat on ${i} proto {tcp, udp, icmp} from 192.168.64.0/24 to any -> ${i}"
echo $RULE >> $rulefile
done
declare interface ObjectConstructor {
entries<T>(o: { [s: string]: T } | ArrayLike<T>): [string, T][];
entries(o: {}): [string, any][];
}
@akatz
akatz / Dockerfile
Last active April 20, 2016 20:30
Docker cache issue reported here: https://github.com/docker/compose/issues/883
FROM alpine:3.3
COPY Gemfile /usr

Keybase proof

I hereby claim:

  • I am akatz on github.
  • I am akatz (https://keybase.io/akatz) on keybase.
  • I have a public key whose fingerprint is 38EC 9A73 2ADC 22B1 888D 3C8E DA08 F4AE 8CA1 68DB

To claim this, I am signing this object:

NSString * quantityValueWithoutX = [self.quantityLabel.text stringByReplacingOccurrencesOfString:@"x" withString:@""];
@akatz
akatz / gist:6518450
Last active December 22, 2015 19:19 — forked from byronwade/gist:6518000
<!--/*****************************************************************************/
/*** Blog 1.0 by Byron Wade */
/*** www.thorbis.com | bcw1995@gmail.com */
/*** Follow Me On Twitter At @Thorbis */
/*** NO modifications of this script can be done without consulting me first! */
/*******************************************************************************-->
<!DOCTYPE html>
<html>
<head>
production:
adapter: mysql2
encoding: utf8
database: shopkeepapp_production
pool: 5
username: user
password: pass
require 'set'
module Dependencies
class Dependencies
def initialize
@graph = Hash.new([])
end
def add_direct(dependent, dependencies)
@graph[dependent] += dependencies
<div class="control-group">
<label class="control-label" for="instanceId">Instance Id</label>
<div class="controls">
{{input value=instanceId id="instanceId" placeholder="Instance Id" required="true" disabled="true"}}
</div>
</div>
<div class="control-group">
<label class="control-label" for="name">Name</label>
<div class="controls">
{{input value=name id="name" placeholder="name" required="true"}}
#!/usr/bin/env ruby
require 'net/http'
require 'json'
require "highline/import"
trap("INT") do
system "stty echo"
exit