Skip to content

Instantly share code, notes, and snippets.

View YarGnawh's full-sized avatar

Ray Hwang YarGnawh

View GitHub Profile
@YarGnawh
YarGnawh / reverseAuth.m
Last active May 19, 2017 15:10
Twitter Reverse Auth API Request
- (void)reserveAuth
{
NSString * http_method = @"POST";
NSString * request_url = @"https://api.twitter.com/oauth/request_token";
NSString * oauth_consumer_key = @"bcn3PUKI0PZoxfPTqEDkMru9A";
NSString * oauth_consumer_secret = @"YiVeSteQBplk8xzAtuoulA7i2vLkVF5kIwc5x1A6ZaxmugdmXg";
NSString * oauth_nonce = [[NSUUID UUID] UUIDString];
NSString * oauth_signature = @"";
NSString * oauth_signature_method = @"HMAC-SHA1";
@YarGnawh
YarGnawh / ec2-host-update.sh
Last active February 21, 2017 09:26
AWS EC2 Route53 Update CNAME using JSON USER_DATA
#!/bin/bash
# Write to /usr/local/ec2/ec2-host-update.sh
# Execute chmod 755 ec2-host-update.sh
# Append /usr/local/ec2/ec2-host-update.sh to /etc/rc.local
# Referenced: http://realguess.net/2013/12/06/amazon-route-53-via-command-line/
if ! type "aws" > /dev/null; then
@YarGnawh
YarGnawh / ec2-hostname.sh
Last active March 2, 2016 21:47
AWS EC2 Ubuntu Update HOSTNAME Using JSON USER_DATA
#!/bin/bash
# Write to /usr/local/ec2/ec2-hostname.sh
# Execute chmod 755 ec2-hostname.sh
# Append /usr/local/ec2/ec2-hostname.sh to /etc/rc.local
# Referenced: http://ternarylabs.com/2010/09/15/automatically-configure-hostname-for-new-ec2-instances/
USER_DATA=`/usr/bin/curl -s http://169.254.169.254/latest/user-data`
IPV4=`/usr/bin/curl -s http://169.254.169.254/latest/meta-data/public-ipv4`