Skip to content

Instantly share code, notes, and snippets.

@appnus
appnus / repos.md
Last active August 29, 2015 14:08
Ubuntu 14.04 Repositories

DOCKER

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9

sudo echo "deb https://get.docker.com/ubuntu docker main" > /etc/apt/sources.list.d/docker.list

PHP

sudo add-apt-repository ppa:ondrej/php5 -y

NGINX

sudo add-apt-repository ppa:nginx/development -y

@appnus
appnus / ss.js
Last active August 29, 2015 14:10
Web Screenshots using PhantomJS
var page = require('webpage').create();
var system = require('system');
if (system.args.length !== 6) {
console.log('Usage: phantomjs ' + system.args[0] + ' [source] [destination] [width] [height] [delay]');
phantom.exit(1);
}
//page.settings.javascriptEnabled = false;
page.viewportSize = { width: system.args[3], height: system.args[4] };
@appnus
appnus / twitch-chat.php
Last active April 17, 2022 10:25
PHP Twitch Chat Client
#!/usr/bin/env php
<?php error_reporting(E_ALL); set_time_limit(0);
if (php_sapi_name() !== "cli" || $argc < 4) {
echo "Usage: php ", $argv[0], " [nickname] [password] [#channel]";
exit(1);
}
$host = "irc.twitch.tv";
$ip = gethostbyname($host);
@appnus
appnus / 4chan-images.php
Created November 22, 2014 02:27
4chan Image Downloader
#!/usr/bin/env php
<?php error_reporting(E_ALL); set_time_limit(0);
// ref: https://github.com/4chan/4chan-API
if (php_sapi_name() !== "cli" || $argc !== 2) {
echo "Usage: php ", $argv[0], " [board]";
exit(1);
}
@appnus
appnus / stream-mp3.php
Created November 22, 2014 02:32
Stream MP3 Songs using PHP
<?php header("Content-Type: audio/mpeg");
$playlist = glob("*.mp3");
shuffle($playlist);
foreach ($playlist as $song) {
$file = fopen($song, "r");
while (($buffer = fgets($file, 1024)) !== false) {
echo $buffer;
@appnus
appnus / Hiragana.data
Created December 8, 2014 02:25
Hiragana
ん=n
あ=a
い=i
う=u
え=e
お=o
わ=wa
を=wo (o)
@appnus
appnus / Katakana.data
Created December 8, 2014 02:25
Katakana
ン=n
ア=a
イ=i
ウ=u
エ=e
オ=o
ワ=wa
ヲ=wo (o)
@appnus
appnus / pkg.sh
Created December 11, 2014 19:42
PKG
#!/bin/bash
<<C
Debian (testing) - Jessie
Amazon EC2 AMI -> ami-1420b57c
C
dir=/tmp
cabal_version=1.20.0.3
@appnus
appnus / .tmux.conf
Last active August 29, 2015 14:12
tmux Config File
set -g default-terminal "screen-256color"
set -g history-limit 5000
set -sg escape-time 1
set -g repeat-time 1000
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
setw -g mode-keys vi