Skip to content

Instantly share code, notes, and snippets.

View cromulus's full-sized avatar

Bill Cromie cromulus

View GitHub Profile
@cromulus
cromulus / raw email
Created April 5, 2021 14:18
Raw email that throws the error
Received: from mail-qt1-f169.google.com (unknown [209.85.160.169])\tby relay-3.us-west-2.relay-prod (Postfix) with ESMTPS id AD07B20983\tfor <[email protected]>; Sat, 03 Apr 2021 18:30:25 +0000\r\nReceived: by mail-qt1-f169.google.com with SMTP id i19so5801578qtv.7 for <[email protected]>; Sat, 03 Apr 2021 11:30:25 -0700\r\nReceived: from bills-macbookpro.localdomain (cpe-66-108-12-213.nyc.res.rr.com. [66.108.12.213]) by smtp.gmail.com with ESMTPSA id x14sm9745469qkx.112.2021.04.03.11.30.23 for <[email protected]> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Apr 2021 11:30:24 -0700\r\nDate: Sat, 03 Apr 2021 14:30:27 -0400\r\nFrom: Bill Cromie <[email protected]>\r\nTo: [email protected]\r\nMessage-ID: <[email protected]>\r\nMime-Version: 1.0\r\nContent-Type: multipart/alternative;\r\n boundary=\"Apple-Mail=_2E848F61-C9CF-4F12-86DF-43037582E1F8\"\r\nContent-Transfer-Encoding: 7bit\r\nDKIM-Sign
@cromulus
cromulus / ruby_dns_ttl.rb
Created February 12, 2018 15:59
Ruby DNS TTL
def get_ip(hostname)
dns = Resolv.new
redis = Redis.new # storing in redis
ip = redis.get("ip:#{hostname}")
return ip unless ip.nil?
begin
resource = dns.getresource(hostname, Resolv::DNS::Resource::IN::A)
rescue Resolv::ResolvError
return false
end
@cromulus
cromulus / gist:2b9226743fd2fb4acd5403b47ab3cf3d
Created December 6, 2016 16:16
sovereign development environment issues
# Note: I disabled xmpp in site.yml because of https://github.com/sovereign/sovereign/issues/624
$vagrant destroy -f && vagrant up
==> xenial: VM not created. Moving on...
==> jessie: Forcing shutdown of VM...
==> jessie: Destroying VM and associated drives...
Bringing machine 'jessie' up with 'virtualbox' provider...
==> jessie: Importing base box 'box-cutter/debian8'...
==> jessie: Matching MAC address for NAT networking...
==> jessie: Checking if box 'box-cutter/debian8' is up to date...
==> jessie: Setting the name of the VM: sovereign_jessie_1481038318155_73409
ubuntu@brlrh01:~$ sudo flynn-host fix --min-hosts 3 --peer-ips 192.168.200.11,192.168.200.12,192.168.200.13
INFO[08-15|20:12:44] found expected hosts n=3
INFO[08-15|20:12:44] ensuring discoverd is running on all hosts
INFO[08-15|20:12:44] checking flannel
INFO[08-15|20:12:44] flannel looks good
INFO[08-15|20:12:44] waiting for discoverd to be available
INFO[08-15|20:12:44] checking for running controller API
INFO[08-15|20:12:44] found running controller API instances n=2
INFO[08-15|20:12:44] found controller instance, checking critical formations
INFO[08-15|20:12:44] checking status of sirenia databases
@cromulus
cromulus / vagrant-bootstrapper.ps1
Last active January 5, 2016 15:37 — forked from mefellows/vagrant-bootstrapper.ps1
Windows Vagrant with Rsync powershell bootstrap script
Write-Host -ForegroundColor green "Bootstrapping machine"
Write-Host "Setting up package management and installing required packages for Dev."
#
# Install Choco (if not already installed) + required packages
#
if ( (Get-Command "choco" -errorAction SilentlyContinue) ) {
Write-Host "Chocolatey already installed. Skipping."
} else {
@cromulus
cromulus / Howto
Created December 28, 2015 19:31
How To Modify the heatseekos.img image
first off, you need a linux machine and must be uid 1000, usually this is the first user created on the system.
to find out your id, run this command: `id`
Then find a free loop device:
```
sudo losetup -f
```
usually that will return `loop0` but if not, use whatever it returns in the place of `loop0` in the commands below.
next, load the image into the loop device and mount it.
@cromulus
cromulus / Passwordless nfs for vagrant
Last active June 13, 2016 19:55
Passwordless nfs and hostmanager for vagrant
## add this to your /etc/sudoers file
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports
Cmnd_Alias VAGRANT_NFSD = /sbin/nfsd restart
Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /usr/bin/sed -E -e /*/ d -ibak /etc/exports
Cmnd_Alias VAGRANT_HOSTMANAGER_UPDATE = /bin/cp /Users/bill/.vagrant.d/tmp/hosts.local /etc/hosts
%admin ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD, VAGRANT_EXPORTS_REMOVE, VAGRANT_HOSTMANAGER_UPDATE
# for vagrant-hostmanager
Cmnd_Alias VAGRANT_HOSTMANAGER_UPDATE = /bin/cp <home-directory>/.vagrant.d/tmp/hosts.local /etc/hosts
%<admin-group> ALL=(root) NOPASSWD: VAGRANT_HOSTMANAGER_UPDATE
@cromulus
cromulus / Vagrantfile
Created December 17, 2015 15:13
Vagrantfile for super quick rails development
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@cromulus
cromulus / keybase.md
Last active September 22, 2015 17:48

Keybase proof

I hereby claim:

  • I am cromulus on github.
  • I am bcromie (https://keybase.io/bcromie) on keybase.
  • I have a public key whose fingerprint is 2E8D 69FA 9C61 3487 EB49 BE02 6BFC A720 006A B2DE

To claim this, I am signing this object:

@bp.route('lang',methods=['GET'])
def GET_lang():
"""
Returns the language requested by the browser
defaults to en-US
"""
try:
headers = self.request.headers
return headers['Accept-Language'] || "en-US,en;q=0.8"
except Exceptions as e: