Skip to content

Instantly share code, notes, and snippets.

View joet3ch's full-sized avatar

Joe Nicosia joet3ch

View GitHub Profile
@GABeech
GABeech / haproxy.cfg
Created August 21, 2014 18:35
Stack Exchange HAProxy
# This is an example of the Stack Exchange Tier 1 HAProxy config
# The only things that have been changed from what we are running are:
# 1. User names have been removed
# 2. All Passwords have been remove
# 3. IPs have been changed to use the example/documentation ranges
# 4. Rate limit numbers have been changed to randome numbers, don't read into them
userlist stats-auth
group admin users $admin_user
user $admin_user insecure-password $some_password
@joet3ch
joet3ch / gist:6157bb9cac0b33bb9bc5
Last active August 29, 2015 14:04
Maintenance Update - Message Template Example
Maintenance update from *|STATUSPAGENAME|*
Title: *|MAINTENANCETITLE|*
Affected Infrastructure:
Components: *|AFFECTEDCOMPONENTS|*
Locations: *|AFFECTEDCONTAINERS|*
Update: *|UPDATEMESSAGE|*
@joet3ch
joet3ch / gist:bf4d4523c8f22ad50161
Last active August 29, 2015 14:04
Maintenance Reminder - Message Template Example
Scheduled maintenance reminder from *|STATUSPAGENAME|*
Title: *|MAINTENANCETITLE|*
Details: *|MAINTENANCEDETAILS|*
Affected Infrastructure:
Components: *|AFFECTEDCOMPONENTS|*
Locations: *|AFFECTEDCONTAINERS|*
@joet3ch
joet3ch / gist:5a1ac5b895eae5937147
Last active August 29, 2015 14:04
Incident Message - Message Template Example
Status update from *|STATUSPAGENAME|*
Current Status: *|CURRENTSTATUS|*
Started: *|TIMESTART|*
Resolved: *|TIMERESOLVE|*
Affected Infrastructure:
Components: *|AFFECTEDCOMPONENTS|*
Locations: *|AFFECTEDCONTAINERS|*
@robmathers
robmathers / readinglisturls.py
Last active November 16, 2023 21:18
Prints out URLs of items in Safari’s Reading List
#!/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'
@drakkhen
drakkhen / gist:5473067
Last active December 21, 2020 14:30
Workaround for Ubuntu guest suspension warning in VMware Fusion

I see this error when I try to suspend an Ubuntu 10 guest in Fusion:

The request to Suspend this virtual machine failed because the corresponding VMware Tools script did not run successfully.

If you have configured a custom suspend script in this virtual machine, make sure that it contains no errors. Attempting the operation again will ignore the script failure. You can also submit a support request to report this issue.

As the dialog states, the second time you try to suspend the VM it ignores the non-zero return code of the script and it seems to work. But it's annoying.

The problem appears to not be VMware actually, but Ubuntu (or Ubuntu's service script). I tried to figure out where exactly Ubuntu's initctl configuration/scripts is broken to no avail but found a work-around that I'm happy with.

@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
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Getting Started Form</title>
<!-- The required Stripe lib -->
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<!-- jQuery is used only for this example; it isn't required to use Stripe -->
@chadselph
chadselph / okcupidgirl.py
Created January 3, 2013 23:36
TCP server that listens for connections but never replies. Useful for testing certain kinds of timeout behaviors.
# okcupidgirl.py ignores you
from __future__ import print_function
import argparse
import socket
import select
def listen(port):
print("Listening on port {}".format(port))
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@cyberwombat
cyberwombat / CORS Configuration
Created November 1, 2012 19:18
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>