#Mac OS X
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
{-# LANGUAGE ScopedTypeVariables, ViewPatterns, OverloadedStrings #-} | |
import Control.Applicative | |
import Control.Exception (SomeException) | |
import Control.Monad (when, mapM) | |
import Control.Monad.Trans (lift) | |
import Data.Char (ord) | |
import Data.Enumerator hiding (map, mapM, length, filter, foldl') | |
import Data.List (foldl') | |
import Data.Word (Word8, Word64) | |
import qualified Data.ByteString as SB |
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 | |
# Some things taken from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Set the colours you can use | |
black='\033[0;30m' | |
white='\033[0;37m' | |
red='\033[0;31m' | |
green='\033[0;32m' |
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
/**= | |
* User: zircote | |
* Date: 16/10/2013 | |
* Time: 08:59 | |
*/ | |
var SERVICE_HOST = 'http://aws.amazon.com' | |
var data_sources = { | |
"linux-od": { |
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
--This script MUST be named "Switch to <User>.scpt", where <User> is the name of the user to switch to. | |
--You must first make a password item (a.k.a. a key) for the other user's password using Keychain Access, | |
--and call it "<user>", where "<user>" is the other user's name.the field "Kind" must be "User Login" (without quotes). | |
--The script assumes that you make this key in your login.keychain, which is the default one. | |
--The first time you run this script, you will be prompted to allow Keychain Scripting to access the password of the key. | |
--This script requires "Enable access for assistive devices" to be enabled in the Universal Access system preference pane. | |
set username to word -1 of my findReplace(".scpt", "", (path to me as text)) | |
-- Invoke Fast User Switching. The `id -ur username` part gets the uid number that corresponds to the username and substitutes it at the end of the CGSession command |
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/bash | |
# Summary: | |
# Bash script repoints all inbound access for a given AWS EC2 security group | |
# to your current IP addr(v4) as provided by ifconfig.me/ip | |
# To use this script: | |
# Pass the name of a security group as a command line argument | |
# e.g. $ aws_repoint_to_my_ip.sh SECURITYGROUPNAME |
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
------------ | |
Amazon (http://calculator.s3.amazonaws.com/index.html) | |
------------ | |
type price CPU RAM Disk I/O EBS opt. | |
t2.micro 10$ 1 1.0 -- Low -- | |
t1.micro 15$ 1 0.6 -- Very Low -- | |
t2.small 10$ 1 2.0 -- Low -- | |
m1.small 34$ 1 1.7 1 x 160 Low -- | |
t2.medium 41$ 2 4.0 -- Low -- | |
m3.medium 56$ 1 3.7 SSD 1 x 4 Moderate -- |
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
from imaplib import IMAP4_SSL | |
import email as em | |
from email.utils import parsedate, parsedate_tz | |
from email.parser import HeaderParser | |
class GmailAccount(object): | |
def __init__(self, username=None, password=None, folder=None): | |
self.username = username | |
self.password = password | |
self.folder = folder |
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
# Based off of https://github.com/jupyter/notebook/blob/master/docs/source/extending/savehooks.rst | |
import io | |
import os | |
from notebook.utils import to_api_path | |
_script_exporter = None | |
_html_exporter = None | |
def script_post_save(model, os_path, contents_manager, **kwargs): |
OlderNewer