(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
# statsd | |
sudo tcpdump -i eth0 -p -n -s 1500 -A udp port 8125 | |
# statsd flushing to graphite | |
sudo tcpdump 'port 2005 or 2009' -s0 -A | |
# collectd | |
sudo tcpdump -i eth0 -p -n -s 1500 -A udp port 25827 |
#!/bin/sh | |
FILE_URL=http://speedtest.wdc01.softlayer.com/downloads/test10.zip | |
if [ -e /usr/bin/curl ] && [ -e /usr/bin/bc ] && [ -e /usr/bin/xargs ]; then | |
echo "scale=2; `curl --progress-bar -w "%{speed_download}" $FILE_URL -o /dev/null` / 131072"\ | |
| bc\ | |
| xargs -I {} echo {} mbps | |
elif [ -e /usr/bin/curl ]; then | |
curl -o /dev/null $FILE_URL |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
# The MIT License (MIT) | |
# Copyright (c) 2014 Dave Clark | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
#!/bin/bash | |
# | |
# Carries out a full mysqldump, calls percona-xtrabackup and then | |
# copies the sql dump, the percona backup and your mysql bin logs | |
# to S3 using s3cmd http://s3tools.org/s3cmd | |
# | |
# TODO: extract out the S3 backup stuff to make it optional, and so | |
# other s3 programs can replace the s3cmd call. | |
# TODO: the if [ $? == 0 ] alert blocks should be a function | |
# TODO: make the if [ $? == 0 ] if [ $? != 0 ] more consistent - test |
require 'rack' | |
class RackApp | |
def self.call(env) | |
[200, {'Content-Type' => 'text/html'}, ['derp']] | |
end | |
end | |
# For a full list of options, see | |
# http://www.ruby-doc.org/stdlib-1.9.3/libdoc/webrick/rdoc/WEBrick.html |
######################################### | |
# Very basic rack application showing how to use a router based on the uri | |
# and how to process requests based on the HTTP method used. | |
# | |
# Usage: | |
# $ rackup rack_example.ru | |
# | |
# $ curl -X POST -d 'title=retire&body=I should retire in a nice island' localhost:9292/ideas | |
# $ curl -X POST -d 'title=ask Satish for a gift&body=Find a way to get Satish to send me a gift' localhost:9292/ideas | |
# $ curl localhost:9292/ideas |
(* To the extent possible under law, Rob Mayoff has waived all copyright and related or neighboring rights to “AppleScript to make Google Chrome open/reload a URL”. This work is published from: United States. https://creativecommons.org/publicdomain/zero/1.0/ *) | |
tell application "Google Chrome" | |
activate | |
set theUrl to "http://tycho.usno.navy.mil/cgi-bin/timer.pl" | |
if (count every window) = 0 then | |
make new window | |
end if | |
set found to false |