Skip to content

Instantly share code, notes, and snippets.

View rgbkrk's full-sized avatar
🌎
Think globally, act locally

Kyle Kelley rgbkrk

🌎
Think globally, act locally
View GitHub Profile
@rgbkrk
rgbkrk / cloudfiletrial.php
Last active December 28, 2015 20:29
Simple PHP-OpenCloud sample code
<?php
// Let's enable error reporting on this page
error_reporting(E_ALL);
ini_set('display_errors', True);
// If using composer
require 'vendor/autoload.php';
//// If using a zip, will have to register the OpenCloud namespace
// Define the path to the library
#!/usr/bin/python
import hashlib
import time
try:
from urllib.request import urlopen
except ImportError:
from urllib import urlopen
url = ('https://pypi.python.org/packages/source/v/virtualenv/' +
@rgbkrk
rgbkrk / notcurl.ps1
Last active December 29, 2015 14:19
Wow, this is how you cURL in PowerShell
Invoke-RestMethod -Uri "http://www.google.com" -Outfile "index.html" -UserAgent "hURL, ©20xx Microsoft"
@rgbkrk
rgbkrk / hubdecrypt.sh
Last active April 6, 2022 02:55
Encrypt a (short) file using someone's public key from github
#!/usr/bin/env bash
# HubCrypt
# ========
#
# Decrypt a file encrypted using hubencrypt (ok, it's just openssl + rsautl +
# your SSH keys). It needs the private key that matches your last public key
# listed at github.com/<user>.keys
#
@rgbkrk
rgbkrk / serviceCatalog.ipynb
Last active December 31, 2015 12:59
Massaging the Service Catalog
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rgbkrk
rgbkrk / ansi_colors.ipynb
Created December 19, 2013 04:49
ANSI Colors
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rgbkrk
rgbkrk / Dockerfile
Last active September 23, 2017 01:53
nbviewer in Docker
# Using the Ubuntu image
FROM ubuntu
# Make sure apt is up to date
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade -y
# Not essential, but wise to set the lang
RUN apt-get install -y language-pack-en

I'm working on something that queries the StackExchange API for tagged questions.

The search API comes out looking like

/2.1/search?order=desc&sort=activity&tagged=python;ruby&site=stackoverflow

Search requires tags to be separated by semi-colons. That's not a problem. Everything in my module works as I expect.

@rgbkrk
rgbkrk / gist:8317015
Created January 8, 2014 13:49
Installing nbviewer from scratch
07:34:05 /private/tmp$ git clone [email protected]:ipython/nbviewer
Cloning into 'nbviewer'...
remote: Reusing existing pack: 2070, done.
remote: Counting objects: 15, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 2085 (delta 7), reused 8 (delta 5)
Receiving objects: 100% (2085/2085), 7.99 MiB | 1.37 MiB/s, done.
Resolving deltas: 100% (994/994), done.
Checking connectivity... done
07:34:15 /private/tmp$ cd nbviewer
@rgbkrk
rgbkrk / keystone.md
Last active January 2, 2016 23:48
keystone.md

Oh hey, keystoneclient does work on Rackspace

Used all the environment variables from using novaclient. Only new one that needed to be defined:

export OS_IDENTITY_API_VERSION=2.0

The only command I could get to work right off the bat is keystone discover: