Skip to content

Instantly share code, notes, and snippets.

View vdel26's full-sized avatar

Victor Delgado vdel26

View GitHub Profile
@vdel26
vdel26 / simple_server.js
Last active August 29, 2015 13:55
simple node.js debugging server
/*
* dummy API that returns the endpoint that was called
* and the apikey in JSON format
*/
var http = require('http');
var server = http.createServer(function (req, res) {
var responseContent = {};
res.writeHead(200, {'Content-type': 'application/json'});
@vdel26
vdel26 / xml&json pretty print
Created October 28, 2013 15:35
XML and JSON command line pretty printing
# XML (requires libxml2)
echo '<root><foo a="b">lorem</foo><bar value="ipsum" /></root>' | xmllint --format -
# JSON (requires python)
echo '{"foo": "lorem", "bar": "ipsum"}' | python -mjson.tool
@vdel26
vdel26 / learn.lua
Created October 25, 2013 09:12 — forked from tylerneylon/learn.lua
-- Two dashes start a one-line comment.
--[[
Adding two ['s and ]'s makes it a
multi-line comment.
--]]
----------------------------------------------------
-- 1. Variables and flow control.
----------------------------------------------------
@vdel26
vdel26 / debug_server.py
Created September 26, 2013 14:55
Simple webserver for debugging HTTP requests
import SimpleHTTPServer
import SocketServer
import logging
PORT = 80
class ServerHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_GET(self):
logging.error(self.headers)
SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self)
@vdel26
vdel26 / public-ami-cleaner
Last active December 21, 2015 20:58
Clean instance before pubslihing custom AMI
# erase bash history
find /root/.*history /home/*/.*history -exec rm -f {} \;
# erase ssh authorized keys
find / -name "authorized_keys" –exec rm –f {} \;
sudo rm /etc/ssg/ssh_host_dsa_key* /etc/ssh/ssh_host_rsa_key* /etc/ssh/ssh_host_key* /etc/ssh/ssh_host_ecdsa_key*
# disable root and ubuntu user password
sudo passwd -l root
@vdel26
vdel26 / oauthtools
Last active December 21, 2015 01:48
OAuth tooling
OAuth tool - https://www.runscope.com/oauth_tool
Request bin - http://requestb.in/
FOAuth (OAuth for one) - https://foauth.org/
Google OAuth playground - https://developers.google.com/oauthplayground/
OAuth.io - https://oauth.io/
HTTPbin - http://httpbin.org/