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
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/ |
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
# 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 |
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 SimpleHTTPServer | |
import SocketServer | |
import logging | |
PORT = 80 | |
class ServerHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): | |
def do_GET(self): | |
logging.error(self.headers) | |
SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self) |
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
-- Two dashes start a one-line comment. | |
--[[ | |
Adding two ['s and ]'s makes it a | |
multi-line comment. | |
--]] | |
---------------------------------------------------- | |
-- 1. Variables and flow control. | |
---------------------------------------------------- |
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
# 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 |
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
/* | |
* 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'}); |
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 | |
# | |
# chkconfig: 2345 55 25 | |
# Description: Nginx init.d script, put in /etc/init.d, chmod +x /etc/init.d/nginx | |
# For Debian, run: update-rc.d -f nginx defaults | |
# For CentOS, run: chkconfig --add nginx | |
# | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $all |
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
--[[ | |
Authorization logic | |
]]-- | |
function get_auth_params(where, method) | |
local params = {} | |
if where == "headers" then | |
params = ngx.req.get_headers() | |
elseif where == "basicauth" then |
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
# curl -s http://169.254.169.254/latest/meta-data/ | |
ami-id | |
ami-launch-index | |
ami-manifest-path | |
block-device-mapping/ | |
hostname | |
instance-action | |
instance-id | |
instance-type | |
kernel-id |
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
#### SETTINGS | |
NGINXDIR = /usr/local/openresty/nginx/ | |
NGXCONF = nginx_dummycustomer.conf | |
USER = ubuntu | |
REMOTE = ec2-54-224-138-186.compute-1.amazonaws.com | |
REMOTEDIR = /home/$(USER)/dummycustomer/ | |
PRIVATEKEY = /Users/victordg/.ssh/aws/vdg-3scale.pem | |
#### | |
OlderNewer