#If you're on Ubuntu or working with a Linux VM...
SSH into your server as a root or do sudo -i.
Then install necessary software:
apt-get update
| # Example Dockerfile | |
| FROM hello-world |
| ## Install a necessary packages | |
| $ sudo apt-get install kvm cloud-utils genisoimage | |
| ## URL to most recent cloud image of 12.04 | |
| $ img_url="http://cloud-images.ubuntu.com/server/releases/12.04/release" | |
| $ img_url="${img_url}/ubuntu-12.04-server-cloudimg-amd64-disk1.img" | |
| ## download the image | |
| $ wget $img_url -O disk.img.dist | |
| ## Create a file with some user-data in it |
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |
| /** | |
| * Created by andy hulstkamp | |
| */ | |
| var webpage = require("webpage"), | |
| fs = require("fs"); | |
| var debug = false, | |
| pageIndex = 0, | |
| allLinks = [], |
| # replace PAPERTRAIL_HOSTNAME and PAPERTRAIL_PORT | |
| # see http://help.papertrailapp.com/ for additional PHP syslog options | |
| function send_remote_syslog($message, $component = "web", $program = "next_big_thing") { | |
| $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); | |
| foreach(explode("\n", $message) as $line) { | |
| $syslog_message = "<22>" . date('M d H:i:s ') . $program . ' ' . $component . ': ' . $line; | |
| socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, PAPERTRAIL_HOSTNAME, PAPERTRAIL_PORT); | |
| } | |
| socket_close($sock); |
| /* | |
| * PLEASE DO NOT USE THIS CODE, BUT GO TO: https://github.com/coderofsalvation/syslog-flexible | |
| */ | |
| // local, remote and papertrail compatible syslogclass | |
| class Syslog{ | |
| public static $hostname = false; | |
| public static $port = 514; | |
| public static $program = "[]"; |
| # amazon.rb - amazon affiliate links for jekyll | |
| # assumes that you have a configuration variable called 'amazon_associate_id' with your associate id | |
| # usage: {{ asin | amazon_product_href }} | |
| # returns url of a product | |
| # usage: {{ asin | amazon_image_href: 'M' }} | |
| # returns image of the product, size argument can be S, M, or L, default M | |
| # usage: {{ asin | amazon_product: 'A Product' }} |
| #!/usr/bin/env python | |
| #------------------------------------------------------------------------------ | |
| # UDP Load Balancer featuring simple round robin with session affinity. | |
| #------------------------------------------------------------------------------ | |
| import sys | |
| import signal | |
| import logging | |
| from socket import * |
| # Modify this file accordingly for your specific requirement. | |
| # http://www.thegeekstuff.com | |
| # 1. Delete all existing rules | |
| iptables -F | |
| # 2. Set default chain policies | |
| iptables -P INPUT DROP | |
| iptables -P FORWARD DROP | |
| iptables -P OUTPUT DROP |