Opinions are like assholes, every one has got one.
This one is mine.
Punctuation is a bikeshed. Put your semicolons, whitespace, and commas where you like them.
#!/bin/bash | |
export THEOS=/opt/theos | |
# clone theos.git | |
cd /opt | |
git clone git://github.com/DHowett/theos.git | |
# clone iphoneheaders.git | |
cd $THEOS | |
mv include include.bak |
# depmod -a; modprobe pmu_sync_sample ; sleep 0; modprobe -r pmu_sync_sample | |
dmesg output | |
[91376.479217] Found 6 counters | |
[91376.479339] Hello, ARM from core 0 | |
[91376.479492] PMNC registers dump: | |
[91376.479583] PMNC =0x41093001 | |
[91376.479736] CNTENS=0x8000003f | |
[91376.479827] INTENS=0x00000000 | |
[91376.479919] FLAGS =0x00000000 |
This is the most basic example of vertical scaling by transferring connections to workers, rather than sharing server sockets. It was presented at JSConf US 2012. With this you can create some interesting balancing algorithms that cluster would defer to internal/OS logic.
A good first project when working with this is to implement sticky sessions based upon connection.remoteAddress and/or connection.remotePort.
A good advanced project is to change from a TCP based balancer to a HTTP(S) one and balance based upon not just connection.remoteAddress etc. but also on the protocol and/or Host header.
#!/usr/bin/env python | |
"""Split large file into multiple pieces for upload to S3. | |
S3 only supports 5Gb files for uploading directly, so for larger CloudBioLinux | |
box images we need to use boto's multipart file support. | |
This parallelizes the task over available cores using multiprocessing. | |
Usage: | |
s3_multipart_upload.py <file_to_transfer> <bucket_name> [<s3_key_name>] |
alias server='open http://localhost:8000 && python -m SimpleHTTPServer' |
/* cdr.c | |
* David Weinstein (2011) | |
* offset bytes into a file and write to stdout | |
*/ | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> |
Standard practices say no non-root process gets to talk to the Internet on a port less than 1024. How, then, could I get Node talking on port 80 on EC2? (I wanted it to go as fast as possible and use the smallest possible share of my teeny tiny little micro-instance's resources, so proxying through nginx or Apache seemed suboptimal.)
Alter the port the script talks to from 8000 to 80:
}).listen(80);
#!/usr/bin/env ruby | |
# iOS App Store Crawler by Nowa <nowazhu@gmail.com> | |
# 2010-08-04 | |
require 'rubygems' | |
require 'hpricot' | |
require 'open-uri' | |
USERAGENT = 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.99 Safari/533.4' | |
LETTERS = %w{A B C D E F G H I J K L M N O P Q R S T U V W X Y Z *} |