Skip to content

Instantly share code, notes, and snippets.

View plombardi89's full-sized avatar
🤔
Darwin. I Ching. Improvise. Adapt.

Philip Lombardi plombardi89

🤔
Darwin. I Ching. Improvise. Adapt.
View GitHub Profile
@plombardi89
plombardi89 / authorize.go
Created April 30, 2020 01:17 — forked from ItalyPaleAle/authorize.go
Authorize Azure SDKs for Go with a Service Principal (Azure AD token), including Azure Storage SDK for Go
package main
import (
"fmt"
"time"
"github.com/Azure/azure-storage-blob-go/azblob"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/adal"
"github.com/Azure/go-autorest/autorest/azure"
@plombardi89
plombardi89 / followers.py
Last active February 12, 2019 05:25
Print order of people in a dictionary
#!/usr/bin/env/python3
def link_map(items):
res = {}
for idx, it in enumerate(items):
if idx == 0:
continue
res[items[idx - 1]] = it

Keybase proof

I hereby claim:

  • I am plombardi89 on github.
  • I am plombardi (https://keybase.io/plombardi) on keybase.
  • I have a public key ASA4z3xJ4DpNoEN0ienFF9rgnz2-McPio9XJhlJVuYX9kwo

To claim this, I am signing this object:

@plombardi89
plombardi89 / telepresence.log
Created April 9, 2018 20:08
telepresence network crash log
0.0 TL | Telepresence launched at Thu Apr 5 11:54:30 2018
0.0 TL | ['/usr/local/bin/telepresence', '-d', 'mydeployment', '--run', '/bin/sh']
0.1 TL | BEGIN SPAN main.py:408(go)
0.1 TL | Scout info: {'latest_version': '0.78'}
0.1 TL | Context: telepresence-admin-context, namespace: tele-v7, kubectl_command: kubectl
0.1 TL | [1] Capturing: ['kubectl', '--context', 'telepresence-admin-context', 'cluster-info']...
0.9 TL | [1] captured.
0.9 TL | [2] Capturing: ['ssh', '-V']...
1.0 TL | [2] captured.
1.0 TL | [3] Capturing: ['which', 'torsocks']...
# rules.toml
################################################################
# Traefik Rules Configuration
################################################################
[frontends]
[frontends.foo]
passHostHeader = true
backend = "foo"
rule = "PathPrefixStrip: /foo"
#!/usr/bin/env sh
set -e
python_version="python2.7"
q3k_install_root="${HOME}/datawire"
is_python_installed () {
amsg " Checking if python is installed: "
if command -v python > /dev/null 2>&1; then
@plombardi89
plombardi89 / NamedThreadFactory.groovy
Created September 7, 2014 18:27
NamedThreadFactory in Java and Groovy style
import java.util.concurrent.ThreadFactory
import java.util.concurrent.atomic.AtomicInteger
// --- Java Style ---
class NamedThreadFactory implements ThreadFactory {
private final String prefix
private final AtomicInteger count
@plombardi89
plombardi89 / LatestVersion.groovy
Created September 5, 2014 02:03
Given a list of versions then determine the latest
def latestVersion(versions) {
def sorted = versions.sort(false) { a, b ->
a = a.split('\\.')
b = b.split('\\.')
// determines how many numbers need to be compared
def commonIndices = Math.min(a.size(), b.size())
// compare each number in a version
@plombardi89
plombardi89 / vbox_soap_getting_started.groovy
Created September 5, 2014 01:18
VirtualBox SDK (via SOAP) Example
@GrabResolver(name='clojars.org', root='http://clojars.org/repo')
@Grab('org.clojars.tbatchelli:vboxjws:4.3.4')
import org.virtualbox_4_3.*
// Setup Instructions
// ------------------
//
// Getting setup is a bit of a PITA. I recommend disabling auth for testing purposes. Also in a
// a real development environment I would recommend pulling the vboxjws.jar from VirtualBox
// rather than using the version published on Clojars... why VirtualBox does not publish more
@plombardi89
plombardi89 / fizzbuzz_recursive.groovy
Created August 29, 2014 01:39
Recursive Fizzbuzz
// Performs the FizzBuzz test using recursion. I intend to use this more often when interviewing job candidates to find out if they
// even have a basic grasp of recursion.
def fizzbuzz(int max) {
fizzbuzz(1, max)
}
def fizzbuzz(int current, int max) {
if (current == max)
return