Skip to content

Instantly share code, notes, and snippets.

@wizact
wizact / forwardport.sh
Created December 20, 2015 08:07
Forward port 80 to 8080 on EC2 instance.
sudo iptables -t nat -L
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8000
@panbanda
panbanda / installer.sh
Created December 20, 2015 08:06
Install Screaming Frog in the Amazon AWS Cloud
# Setting up Ubuntu
sudo apt-get update
sudo apt-get -y install xfce4 xfce4-goodies openjdk-7-jdk vnc4server
# Setup the login and configs
vncserver
vncserver -kill: 1
# Uncommenting settings required for normal vnc startup
sudo sed -i.bak s/"# exec"/"exec sh"/g ~/.vnc/xstartup
////////////////////////////////////////////////////////////////////////////////
/* old
* T("sin", {freq:880, mul:0.5}).play();
*/
let sin = timbre((T) => {
return T("SinOsc.ar", { frequency: 880, mul: 0.5 });
}).start();
////////////////////////////////////////////////////////////////////////////////
/* old
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <map>
#include <string>
#include <cstring>
//#include <unordered_map>
#include <queue>
#include <algorithm>
@jacobtyq
jacobtyq / api.json
Created December 20, 2015 08:04 — forked from digitaljhelms/api.json
A JSON formatted response containing all posts from a Jekyll blog
[
{
"homepage": "http://digitaljhelms.github.com",
"name": "digitaljhelms",
"description": "finally blogging...",
"author": "Jeremy Helms",
"post": {
"url": "http://digitaljhelms.github.com/howto/creating-a-branch-with-no-parents-or-history",
"slug": "creating-a-branch-with-no-parents-or-history",
"title": "Create a Git Branch without Parents or History",
@franzwong
franzwong / index.js
Created December 20, 2015 07:59
Get docker container ip and port
// sudo docker run -it --rm -p 3000 -v /var/run/docker.sock:/var/run/docker.sock rwwa/test_service
var http = require('http');
var hostname = process.env['HOSTNAME'];
console.log('hostname: ' + hostname);
function getContainerInfo() {
var options = {
socketPath: '/var/run/docker.sock',
// 詳しい解説は下記
// https://trifort.jp/blog/development/%E6%8E%A2%E6%A4%9C%EF%BC%81swiftyjson-%E5%89%8D%E7%B7%A8/
struct SampleStruct {
var object:Any?
}
// ここに実装を追加していきます
// [] を実装
extension SampleStruct {

- Mission

The purpose of this tutorial is to mimic setting up a DigitalOcean/AWS EC2/Linode server. The main advantages of having a virtual machine is that you can learn without worry of breaking things.

The first lesson will be all about getting familiar with a headless machine and getting a language we all know and love (ruby). Then we can mess around and try things out purely in the terminal.

The only three good options for a text editor are: emacs, vi, and vim. We will be using vim but vi itself is great and comes by default on Ubuntu 12.04.

Now you can practice getting used to ssh'ing into headless machines, using terminal based text editors, and using a terminal based window/session manager (tmux). The reason we have to use vim and tmux is that there is no X environment in a headless machine (the GUI, graphics, pretty things, etc..). The main reason for this is to save space on precious costly SSD data.

- Mission

The purpose of this tutorial is to mimic setting up a DigitalOcean/AWS EC2/Linode server. The main advantages of having a virtual machine is that you can learn without worry of breaking things.

The first lesson will be all about getting familiar with a headless machine and getting a language we all know and love (ruby). Then we can mess around and try things out purely in the terminal.

The only three good options for a text editor are: emacs, vi, and vim. We will be using vim but vi itself is great and comes by default on Ubuntu 12.04.

Now you can practice getting used to ssh'ing into headless machines, using terminal based text editors, and using a terminal based window/session manager (tmux). The reason we have to use vim and tmux is that there is no X environment in a headless machine (the GUI, graphics, pretty things, etc..). The main reason for this is to save space on precious costly SSD data.

@miguelcobain
miguelcobain / alert-box-button.component.js
Last active December 18, 2015 16:27 — forked from avaz/alert-box-button.template.hbs
ContextualComponentsTriggerAction
import Ember from 'ember';
export default Ember.Component.extend({
click() {
this.get('close-button')();
}
});