Skip to content

Instantly share code, notes, and snippets.

View serverwentdown's full-sized avatar

Ambrose Chua serverwentdown

View GitHub Profile
@serverwentdown
serverwentdown / static_server.js
Last active December 26, 2015 14:43 — forked from ryanflorence/static_server.js
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument. (Modded for larger files)
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 4002;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
@serverwentdown
serverwentdown / github-latest-package.js
Created March 10, 2014 15:09
Random snippet to get latest links for GitHub releases.
var username = "github"; // Put username here
var repo = "ruby"; // Put repository name here
/*
That's it! Now use this URL format:
http://github.com/<username>/<repo>/releases#MyAwesomePackagedApp.zip
Where <username> and <repo> are exactly as defined in those variables, and MyAwesomePackagedApp.zip is whatever filename of the ZIP you uploaded in the "releases" page of your repository.
**DOES not work with source code downloads**
@serverwentdown
serverwentdown / typethis.js
Created May 8, 2014 12:47
Typing thingy...
process.stdin.setEncoding('utf8');
var str = "File I/O is provided by simple wrappers around standard POSIX functions. To use this module do require('fs'). All the methods have asynchronous and synchronous forms.";
console.log("Hello! ");
console.log("Type this out and press return: ");
console.log("--------------------------");
console.log(str);
console.log("--------------------------");
process.stdout.write("Press enter to start: ");
<!--
Feel free to edit this document!
-->
<!DOCTYPE html>
<html lang="en">
<head>
#!/bin/bash
#
# Very simple ping request spammer
#
# Usage:
# sudo ./pingspam.sh ipv6address datasize threads &
#
# eg: sudo ./pingspam.sh ::1 4096 40 &
#
@serverwentdown
serverwentdown / nushemails.md
Last active June 6, 2016 08:59
Setting up NUS High emails on iOS/OSX and Android, and most other email applications. Pass this to those who need it? IDK

Get your inbox synced down to your phone!

TL; DR: IMAP outlook.office365.com:993 SSL/TLS; SMTP smtp.office365.com:587 STARTTLS.


iOS/OSX

Settings > Mail, Contacts, Calendar > Add Account

@serverwentdown
serverwentdown / randomindex.html
Created August 23, 2014 16:19
Random jekyll post
---
title: random
---
<script>
var posts = [{% for post in site.posts %}"{{ post.url }}", {% endfor %}];
var id = Math.floor(Math.random() * posts.length);
window.location.href = posts[id];
</script>
@serverwentdown
serverwentdown / LAB_Makefile
Created August 31, 2014 08:14
Makefile for all my CS C labs
all:
for f in `find * -type d -maxdepth 0 ! -regex .`; do\
gcc -o $$f/main.o $$f/main.c;\
done;
@serverwentdown
serverwentdown / infocomm.html
Created September 1, 2014 12:53
Derping around
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>infocomm</title>
<style>
* {
padding: 0;
margin: 0;
}
@serverwentdown
serverwentdown / enc.b64.Makefile
Last active August 29, 2015 14:07
Jekyll _posts encryption Makefile, but can be reconfigured easily. Feedback please! 😄
SHELL := /bin/zsh
DIRECTORY = "_posts"
EXT_ENC = ".aes.b64"
EXT_FILE = ".md"
ENCRYPTION = "aes-128-cbc"
all: usage
usage: