Skip to content

Instantly share code, notes, and snippets.

View musha68k's full-sized avatar

Oskar Maria Grande musha68k

View GitHub Profile
@musha68k
musha68k / apply_google_bigquery_data_transfer_config.log.pgp
Last active December 12, 2022 15:48
terraform-provider-google-bigquery-data-transfer-config-issue
@musha68k
musha68k / set_current_date_on_all_vagrant_instances.md
Last active September 27, 2018 16:56
Set system dates for all running vagrant instances like a savage (🔨👈)

How to fix skewed system times on multiple vagrant instances 🍻

Set current date of darwin/osx on all local vagrant instances:

date | pbcopy && vagrant status | grep running | awk '{print $1}' | xargs -I {} vagrant ssh {} -c "sudo date --s \"$(pbpaste)\""

Set current date of darwin/osx on all vagrant instances:

date | pbcopy && vagrant global-status | grep running | awk '{print $1}' | xargs -I {} vagrant ssh {} -c "sudo date --s \"$(pbpaste)\""
@musha68k
musha68k / list_ops.ml
Last active April 2, 2017 20:33
List operations
let rec fold ~init ~f = function
[] -> init
| x :: xs -> fold ~init:(f init x) ~f xs
let length xs =
xs
|> fold ~init:0 ~f:(fun acc _ -> acc + 1)
let reverse xs =
xs
@musha68k
musha68k / vcard_converter.rb
Created February 12, 2016 00:22
Converts multiple single person 2.1 vcard files from a Nokia dumb-phone export (".vcf") into one iCloud web contacts importable vcards collection file
#!/usr/bin/env ruby
require 'vpim'
require 'vcardio'
files = Dir.glob "*.vcf"
vcards = files.map do |f|
vc_old = Vpim::Vcard.decode(File.read(f))[0]
# proper vcard 4.0 wasn't accepted by the iCLoud web-interface

Keybase proof

I hereby claim:

  • I am musha68k on github.
  • I am musha68k (https://keybase.io/musha68k) on keybase.
  • I have a public key whose fingerprint is 3AC3 9645 FDE9 3C57 6A42 451A 56DA C4A3 1372 6D99

To claim this, I am signing this object:

@musha68k
musha68k / docker_based_development_on_osx.md
Last active January 13, 2016 17:15
Docker based development on OSX

Premise

  1. our base operating system is Mac OSX which we will simply call osx

  2. on top of osx we run a hypervisor (e.g. xhyve, vmware, virtualbox)

  3. on top of our hypervisor we are running a virtual machine with CoreOS as our docker_engine (with the help of or without vagrant)

  4. on top of our docker_engine we run an arbitrary set of docker_container instances most of which are comprised of a "bespoke" docker_image of our own; a certain "microservice" in development

@musha68k
musha68k / init.coffee
Last active November 28, 2015 18:33
Load env variables from ZSH for Atom
# the shotgun way..
exec = require('child_process').exec
exec('source ~/.zshrc')
@musha68k
musha68k / alias_osx_notification_center.txt
Last active November 28, 2015 18:31
Alias for OSX Notification Center notification
```
notify_me() {
osascript -e "display notification \"$1\" with title \"$2\""
}
alias notify_me=notify_me
```
@musha68k
musha68k / vagrant_with_docker_engine.txt
Last active November 28, 2015 18:30
Vagrant with Docker Engine
We need a Docker container engine which will enable us to run docker containers on OSX.
So the first step to get there is to create a Vagrant virtual machine image with the provider of your choice.
Vagrantfile:
```
Vagrant.configure(2) do |config|
config.vm.box = 'ubuntu/trusty64'
var a = function(){
var index;
function log(){
console.log(index);
}
function iterate(){
log();
if(index>1) setTimeout(iterate, 1000);