Skip to content

Instantly share code, notes, and snippets.

@dylanroy
dylanroy / split-file.sh
Last active June 17, 2016 21:48
Splits up a file into multiple 1gb archives.
# Make sure you zip up the file first
echo "Splitting up archive $1"
tar -cvzf $1.tar.gz $1
split -b 1024mb $1.tar.gz $1.tar.gz.
docker-machine create -d virtualbox dev
eval $(docker-machine env dev)
docker-machine ls
docker-compose build
docker-compose up -d
echo `docker-machine ip dev`
@dylanroy
dylanroy / mandelbrot.sql
Last active August 29, 2015 14:25 — forked from rupey/mandelbrot.sql
Mandelbrot plot in postgres
WITH RECURSIVE
x(i) AS ( VALUES (0)
UNION ALL SELECT i + 1
FROM x
WHERE i < 101),
Z(Ix, Iy, Cx, Cy, X, Y, I) AS (
SELECT
Ix,
Iy,
X :: FLOAT,
@dylanroy
dylanroy / tweet_dumper.py
Last active August 29, 2015 14:23 — forked from yanofsky/LICENSE
#!/usr/bin/env python
# encoding: utf-8
import tweepy #https://github.com/tweepy/tweepy
import csv
#Twitter API credentials
consumer_key = ""
consumer_secret = ""
access_key = ""
import random
NUMBER_OF_PLAYERS = 5
NUMBER_OF_ITERATIONS = 1000000
def main():
if NUMBER_OF_PLAYERS < 2:
raise ValueError("Must have at least 2 people.")
if NUMBER_OF_ITERATIONS < 1:
import redis
import threading
class Listener(threading.Thread):
def __init__(self, r, channels):
threading.Thread.__init__(self)
self.redis = r
self.pubsub = self.redis.pubsub()
self.pubsub.subscribe(channels)
@dylanroy
dylanroy / minimum.html
Created February 5, 2014 19:24
Base Html Templates
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="" rel="stylesheet" />
<style></style>
</head>
<body>
#!/usr/bin/env python2.7
import time
_URL = 'http://localhost/tmp/derp.html'
_NUMBER = 1000
def test_urllib2():
import urllib2

Launch the instance and connect with ssh.

##Update the server

sudo yum update

##Install php and MySQL packages