This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import os | |
import sys | |
import requests | |
import json | |
api_base = 'https://api.digitalocean.com/v2' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pprint | |
print("Hello, this is a Python script.") | |
print("Hook['params'] is populated with request parameters") | |
pprint.pprint(Hook['params']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure('2') do |config| | |
config.ssh.private_key_path = 'sshkey/id_rsa' | |
config.vm.box ='ubuntu/trusty64' | |
config.vm.network "forwarded_port", guest: 80, host: 8080 | |
provider_is_do = (!ARGV.nil? && ARGV.join('').include?('provider=digital_ocean')) | |
config.vm.provision 'shell', inline: <<-SHELL | |
sudo apt-get update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
This script take a cloud-config file as input and returns the 'shellified' | |
script that would be produced by cloudinit from the runcmd stanza. | |
https://github.com/number5/cloud-init/blob/74e61ab27addbfcceac4eba254f739ef9964b0ed/cloudinit/config/cc_runcmd.py | |
https://github.com/number5/cloud-init/blob/74e61ab27addbfcceac4eba254f739ef9964b0ed/cloudinit/util.py#L1708 | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: unicorn | |
# Required-Start: $local_fs $remote_fs | |
# Required-Stop: $local_fs $remote_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: unicorn initscript | |
# Description: unicorn | |
### END INIT INFO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module['exports'] = function echoHttp (hook) { | |
hook.debug("Debug messages are sent to the debug console"); | |
hook.debug(hook.params); | |
hook.debug(hook.req.path); | |
hook.debug(hook.req.method); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'droplet_kit' | |
require 'json' | |
token = ENV['DO_TOKEN'] | |
client = DropletKit::Client.new(access_token: token) | |
droplet_id = ARGV[0] | |
snapshot_name = ARGV[1] || Time.now.strftime("%b. %d, %Y - %H:%M:%S %Z") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git push deploy | |
++ id -un | |
+ [[ dokku != \d\o\k\k\u ]] | |
+ [[ -n git-receive-pack 'nodejs' ]] | |
+ export -n SSH_ORIGINAL_COMMAND | |
+ /usr/local/bin/dokku git-receive-pack ''\''nodejs'\''' | |
++ id -un | |
+ [[ dokku != \d\o\k\k\u ]] | |
+ [[ -n '' ]] | |
+ case "$1" in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from gi.repository import Gtk | |
from gi.repository import WebKit | |
import urlparse | |
BASE_URL = 'https://cloud.digitalocean.com/v1/oauth/' | |
CLIENT_ID = 'specialsnowflake' | |
CALLBACK_URL = 'http://andrewsomething.com' | |
class AuthWin(Gtk.Window): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/ |