Skip to content

Instantly share code, notes, and snippets.

View glickbot's full-sized avatar

Jon Glick glickbot

View GitHub Profile
@glickbot
glickbot / install-gcloud.sh
Created June 4, 2019 20:49
Simple unattended gcloud installer
#!/bin/bash
set -e
pushd $HOME > /dev/null
if ! which gcloud > /dev/null; then
arch="x86"
os="linux"
if uname -a | grep -i 'x86_64' > /dev/null; then
arch="x86_64"
fi
if uname -a | grep -i 'darwin' > /dev/null; then
@glickbot
glickbot / colors
Created May 21, 2019 01:27
First 6502 ASM
reset:
LDY #$01
begin:
CLC
LDA #$00
loop:
TAX
TYA
STA $200,X
TXA

Keybase proof

I hereby claim:

  • I am glickbot on github.
  • I am glickbot (https://keybase.io/glickbot) on keybase.
  • I have a public key ASCQcKZrB5yfep9HqCIbgJhFOI4ZZMEFPP0KRZEYefmJlwo

To claim this, I am signing this object:

@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
choco install -y googlechrome 7zip.install steam visualstudiocode sysinternals vlc putty.install jre8 winscp discord malwarebytes geforce-experience spybot anti-beacon google-backup-and-sync vcredist2005 vcredist2010
@glickbot
glickbot / mac_string_util.erl
Created August 27, 2015 21:48
Erlang Integer to Mac String
-module(mac_string_util).
-export([rand_mac/0, rand_mac/1, int_to_mac/1]).
rand_mac() ->
rand_mac(10000).
rand_mac(Int) ->
int_to_mac(random:uniform(Int)).
int_to_mac(Int) ->
riak_core_util:rpc_every_member_ann(application, set_env, [riak_kv, anti_entropy_build_limit, {1, 86400000}], 5000).
riak_core_util:rpc_every_member_ann(application, set_env, [riak_kv, anti_entropy_concurrency, 1], 5000).
riak_core_util:rpc_every_member_ann(application, set_env, [riak_kv, anti_entropy_expire, 2419200000], 5000).
@glickbot
glickbot / riak-cs-adduser
Created March 16, 2015 14:27
Add user to Riak CS 1.x
#!/usr/sbin/riak escript
%% -*- coding: utf-8 -*-
%%! -pa /usr/lib64/riak-cs/lib/riakc-1.4.1/ebin /usr/lib64/riak-cs/lib/riak_pb-1.4.1.1/ebin /usr/lib64/riak-cs/lib/protobuffs-0.8.1/ebin /usr/lib/riak-cs/lib/riakc-1.4.1/ebin /usr/lib/riak-cs/lib/riak_pb-1.4.1.1/ebin /usr/lib/riak-cs/lib/protobuffs-0.8.1/ebin /usr/lib/riak-cs/ebinn
%%! -pa /usr/lib64/riak-cs/lib/riakc-1.3.1.1/ebin /usr/lib64/riak-cs/lib/riak_pb-1.3.0/ebin /usr/lib64/riak-cs/lib/protobuffs-0.8.0/ebin /usr/lib/riak-cs/lib/riakc-1.3.1.1/ebin /usr/lib/riak-cs/lib/riak_pb-1.3.0/ebin /usr/lib/riak-cs/lib/protobuffs-0.8.0/ebin /usr/lib/riak-cs/ebin
-define(USERS_BUCKET, <<"moss.users">>).
-define(DEFAULT_RIAK_IP, "127.0.0.1").
-define(DEFAULT_RIAK_PORT, 8087).
-record(rcs_user_v2, {
name :: string(),
#!/bin/bash
b=bash_counters
k=my_counter
h="localhost:8098"
#curl -XPUT "$h/buckets/$b/props" -H 'Content-Type: application/json' -d '{ "props":{ "allow_mult" : true } }'
curl -XPUT "$h/buckets/$b/props" -H 'Content-Type: application/json' -d '{ "props":{ "allow_mult" : true, "dvv_enabled" : true } }'
#curl -XPUT "$h/buckets/$b/props" -H 'Content-Type: application/json' -d '{ "props":{ "allow_mult" : true, "dvv_enabled" : false } }'
@glickbot
glickbot / Mac1010limits.sh
Last active August 1, 2021 12:40
Enables setting Mac OS 10.10 Yosemite open file limit to 65535 & max procs to 2048
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
cat <<MAXFILES > /Library/LaunchDaemons/limit.maxfiles.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">