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 | |
# | |
# Amazon EC2 user-data file for automatic configuration of IPsec/L2TP VPN | |
# on a Ubuntu server instance. Tested with 14.04 (Trusty) AND 12.04 (Precise). | |
# With minor modifications, this script *can also be used* on dedicated servers | |
# or any KVM- or XEN-based Virtual Private Server (VPS) from other providers. | |
# | |
# DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC! THIS IS MEANT TO BE RUN WHEN | |
# YOUR AMAZON EC2 INSTANCE STARTS! | |
# |
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
// Place in implementation of UITableViewDelegate | |
#pragma mark - Remove Seperator Inset | |
// Refer to http://stackoverflow.com/questions/25770119/ios-8-uitableview-separator-inset-0-not-working#answer-25877725 | |
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
if ([cell respondsToSelector:@selector(setSeparatorInset:)]) { | |
[cell setSeparatorInset:UIEdgeInsetsZero]; | |
} |
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
# Issues load testing a server on OSX, need to increase the OS limitations to get some real numbers out of everything | |
# Check what the current values are | |
sysctl kern.maxfiles | |
sysctl kern.maxfilesperproc | |
ulimit -S -n | |
# Increase the files per process | |
sudo sysctl -w kern.maxfiles=1048600 | |
sudo sysctl -w kern.maxfilesperproc=1048576 | |
ulimit -S -n 1048576 |
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 <SpriteKit/SpriteKit.h> | |
CGFloat DIM_DEFAULT_ZINDEX = 10.0f; | |
@interface SKScene (Dimmable) | |
/** Dims everything on the screen below the z-index to the provided color. | |
Percentage should be between 0.0f and 1.0f. | |
*/ |
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
# Login into the server | |
ssh user@ip-address | |
# Apply updates | |
sudo apt-get update && sudo apt-get upgrade | |
# Create a user to work under | |
sudo useradd -m -G sudo -s /bin/bash joe | |
passwd joe |
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 <SpriteKit/SpriteKit.h> | |
@interface SKTexture (Gradient) | |
/** Creates a SKTexture programatically with a vertical gradient. | |
Great suggestion for colors: http://ios7colors.com/. | |
Example: | |
(Inside a SKScene class) |
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 <SpriteKit/SpriteKit.h> | |
@interface NPointedStar : SKShapeNode | |
/** Creates a nPointed star with the odd point at the center-top. | |
Must provide all parameters normally added to a SKShapeNode except for the path. | |
Example: | |
(Inside a SKScene class) |
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 | |
# List the repository remotes found in a supplied directory. | |
# List the available repositories if no argument | |
if [[ "$#" -ne 1 ]]; then | |
echo "Provide a directory containing repositories." | |
exit -1 | |
fi |
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 | |
# List and clone gitolite repos using ssh keys | |
# Note: 'privategit' is a host found in ~/.ssh/config | |
# List the available repositories if no argument | |
if [[ "$#" -ne 1 ]]; then | |
echo "Provide the name of the project to clone" | |
echo "Available projects are:" | |
ssh privategit info 2>/dev/null | tail -n +3 | awk '{ print $3 }' |
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
#!/usr/bin/env python | |
""" | |
Get public repository list from github. Must modify the user name in the script. | |
""" | |
import json | |
import urllib2 | |
# Determine the github api call for the repository list |