Skip to content

Instantly share code, notes, and snippets.

View joet3ch's full-sized avatar

Joe Nicosia joet3ch

View GitHub Profile
#!/usr/bin/env python
import plistlib
from shutil import copy
import subprocess
import os
from tempfile import gettempdir
import sys
import atexit
BOOKMARKS_PLIST = '~/Library/Safari/Bookmarks.plist'
@joet3ch
joet3ch / cf-ddns.sh
Created December 22, 2012 19:43
cloudflare ddns
#!/bin/sh
# modified by jfro from http://www.cnysupport.com/index.php/linode-dynamic-dns-ddns-update-script
# Uses curl to be compatible with machines that don't have wget by default
# modified by Ross Hosman for use with cloudflare.
cfkey=
cfuser=
cfhost=
WAN_IP=`curl -s http://ip.skafari.com`
@joet3ch
joet3ch / commands.sh
Last active December 16, 2015 11:19
mongod auto launch on boot
sudo vi /Library/LaunchDaemons/org.mongo.mongod.plist
sudo chown root:wheel /Library/LaunchDaemons/org.mongo.mongod.plist
sudo launchctl load /Library/LaunchDaemons/org.mongo.mongod.plist
sudo launchctl start org.mongo.mongod
@joet3ch
joet3ch / ec2-pub-dns.sh
Created March 22, 2013 20:57
Display ec2 instance public dns fqdn.
#/bin/bash
public_name=$(curl -s http://169.254.169.254/latest/meta-data/public-hostname)
echo $public_name
@joet3ch
joet3ch / ard-control.applescript
Created March 11, 2013 23:59
Shortcut to control a box via ARD
tell application "Remote Desktop"
activate
set server to first computer of computer list "All Computers" whose Internet address is "10.10.10.10"
control server
end tell
@joet3ch
joet3ch / screensharing.applescript
Created March 12, 2013 00:13
launch new apple screen sharing connection
do shell script "open vnc://some-box"
@joet3ch
joet3ch / send_love.applescript
Created March 9, 2013 02:20
Send some iMessage love
tell application "Messages"
set myid to get id of first service
set mygf to buddy "gf@example.com" of service id myid
send "<3" to mygf
end tell
@joet3ch
joet3ch / gist:4631702
Created January 25, 2013 04:18
New ObjectId using Mongoose
ObjectId = require("mongoose").Types.ObjectId
new ObjectId('xxxx')
@joet3ch
joet3ch / CORS Configuration
Created December 9, 2012 18:34 — forked from cyberwombat/CORS Configuration
JQuery file upload plugin (blueimp) with NodeJs Express3 directly to Amazon S3 with public access
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>PUT</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
@joet3ch
joet3ch / fab_ec2.py
Created January 19, 2012 00:57
Use fabric with dynamic auto scaling
def web_cluster():
env.user = 'ubuntu'
env.key_filename = ['mykey.pem']
env.conftype = 'prod'
env.project = 'sample'
ec2conn = ec2.connection.EC2Connection(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
web_group = ec2conn.get_all_security_groups(groupnames=['web'])
for i in web_group[0].instances():
hostname = i.__dict__['public_dns_name']