Skip to content

Instantly share code, notes, and snippets.

View julianpistorius's full-sized avatar

Julian Pistorius julianpistorius

View GitHub Profile
anonymous
anonymous / setup_osx_vm_config.sh
Created February 11, 2015 18:34
echo Setting OSX values for Virtual Box ${1}
VBoxManage modifyvm "${1}" --cpuidset 00000001 000306a9 04100800 7fbae3ff bfebfbff
VBoxManage setextradata "${1}" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "MacBookPro11,3"
VBoxManage setextradata "${1}" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "${1}" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata "${1}" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "${1}" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1
@younata
younata / AssembleMapFromMapquest.py
Created November 30, 2013 06:24
Script to generate large satellite image maps by querying mapquest. note that the inputs is the zoom, far north, far west, [far south, far west]. If far_south and far_west are not given, they are the next lowest integers. everything is in degrees. for non-US areas, max zoom level is 11, for US-areas, max zoom level 18. Todo is pretty much parall…
#!/usr/bin/env python
from PIL import Image
import math
import requests
import StringIO
def deg2num(lat_deg, lon_deg, zoom):
lat_rad = math.radians(lat_deg)
n = 2.0 ** zoom
@ostholz
ostholz / Get public ip
Created September 4, 2013 20:50
curl get public ip address
curl ifconfig.me
curl -i -N -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Host: localhost:3001/ws" -H "Sec-Websocket-Key: hey" -H "Sec-Websocket-Version: 13" http://localhost:3001/ws
@mwvaughn
mwvaughn / DockerInProduction.md
Created April 11, 2017 00:00
Docker In Production

Docker In Production

There was once an oral surgeon named Lytle S. Adams. He lived a long time ago, when America was fighting a war against Japan. Japan had attacked a military base in Hawaii, and—the day that happened—Adams was on vacation at Carlsbad Caverns. That’s a system of caves in New Mexico, where thousands and thousands of bats live. Adams was very impressed with the bats, and he came up with an idea: a swarm of weaponized bats, with miniature incendiary bombs strapped to their bodies—bats that would be dropped over Japanese cities to streak through the air, scatter far and wide, and then explode, sparking thousands of little fires all over the place, burning down buildings and frightening everyone.

Adams was friendly with Eleanor Roosevelt, the president’s wife, and he used his connections to send a brief to the president; the president gave it to a military commander with a note that said, ‘This man is not a nut.’ And so, by 1943, there was a top secret bat-bomb project up a

@max-mapper
max-mapper / Containerfile
Last active May 4, 2018 23:22
CALeDNA container (build with npm i mkcontainer -g)
ENV NSPAWN_BOOTSTRAP_IMAGE_SIZE=10GB
FROM ubuntu:xenial
# set unlimited bash history
# nspawn needs resolv.conf to be set up for internet to work
# password gets changed so we can login later
RUN mkdir /usr/local/anacapa && \
cd /usr/local/anacapa && \
echo "export HISTFILESIZE=" >> .bashrc && \
echo "export HISTSIZE=" >> .bashrc && \
@simon-weber
simon-weber / externalcall.py
Last active November 24, 2018 21:52
Custom tooling to ease VCR.py management.
import vcrutils
VCR_CASSETTE_PATH = APPROOT + '/venmo_tests/cassettes/' # eg
MAKE_EXTERNAL_REQUESTS = os.environ.get('MAKE_EXTERNAL_REQUESTS') == 'TRUE'
@dual_decorator # convert a paramaterized decorator for no-arg use (https://gist.github.com/simon-weber/9956622).
def external_call(*args, **kwargs):
"""Enable vcrpy to store/mock http requests.
@bahamas10
bahamas10 / 0-README.md
Last active January 4, 2019 18:02
Joyent Manta Functions

So, as I mentioned last time, I have two fundamental goals with dat that are not addressed by simply running dat share.

  • Uptime: making sure that the site is seeded even if my local laptop is closed, eaten by a bear, or disconnected from the internet
  • Resilience: ensuring that there's a way to restart my website if the original seeding computer is lost. I try to make everything on my primary work/personal computer work in such a way that I can recover it all, easily, onto a new machine if I need to

To break these down a bit more, uptime is a combination of two things:

  • Ensuring that there are seeders
  • Ensuring that those seeders are seeding, and they're up-to-date
@ashiklom
ashiklom / docker.org
Created August 21, 2019 15:11
PNNL PEcAn setup

PIC setup notes

VM instance setup

Start at cloud management console (https://dashboard.cloud.pnnl.gov).

Go to “Instances”, then “Launch Instance”.

Details: Give it a name (e.g. “pecan1”) Availability zone “nova” (only option).