This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
na ~/dev/states cat phantomjs/init.sls | |
phantomjs: | |
pkg.installed | |
phantomjs: | |
pkg.installed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ps_mem | |
Private + Shared = RAM used Program | |
4.0 KiB + 77.0 KiB = 81.0 KiB agetty | |
60.0 KiB + 59.0 KiB = 119.0 KiB init | |
176.0 KiB + 38.0 KiB = 214.0 KiB dhcpcd | |
180.0 KiB + 63.5 KiB = 243.5 KiB crond | |
56.0 KiB + 280.5 KiB = 336.5 KiB udevd [updated] (3) | |
276.0 KiB + 95.0 KiB = 371.0 KiB sshd | |
324.0 KiB + 232.5 KiB = 556.5 KiB ntpd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Requires: apt-get install inotify-tools | |
# Usage: inotifier buster test | |
FORMAT="%w%f written" | |
"$@" | |
while inotifywait -qre close_write --format "$FORMAT" .; do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var page = require('webpage').create(); | |
if (phantom.args.length !== 5) { | |
console.log('Usage: rasterize.js URL filename width height delay'); | |
phantom.exit(); | |
} else { | |
var address = phantom.args[0], | |
output = phantom.args[1], | |
width = parseInt(phantom.args[2]), | |
height = parseInt(phantom.args[3]), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
base: | |
'web1': | |
- nginx: | |
- hostname: www.uggedal.com | |
'web1': | |
- nginx: | |
- hostname: blog.uggedal.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node "helium.uggedal.com" inherits servernode { | |
include europe | |
hostname { "helium.uggedal.com": | |
aliases => ["helium", "he"], | |
} | |
include sshserver::web | |
include webserver | |
include sqlserver | |
include postgresql::python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# <udf name="fqdn" label="Fully qualified domain name" /> | |
PUBLIC_IP_ADDRESS=`ifconfig eth0 | awk -F':' '/inet addr/{split($2,_," ");print _[1]}'` | |
echo $FQDN > /etc/hostname && hostname -F /etc/hostname | |
echo $PUBLIC_IP_ADDRESS `hostname` `hostname -s` >> /etc/hosts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* matchMedia() polyfill - test whether a CSS media type or media query applies | |
* primary author: Scott Jehl | |
* Copyright (c) 2010 Filament Group, Inc | |
* MIT license | |
* adapted by Paul Irish to use the matchMedia API | |
* http://dev.w3.org/csswg/cssom-view/#dom-window-matchmedia | |
* which webkit now supports: http://trac.webkit.org/changeset/72552 | |
* | |
* Doesn't implement media.type as there's no way for crossbrowser property |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Should return "it works!" for all inputs | |
function is_it_working(key, value) | |
return "it works!" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Return keys with a given prefix for a particular node where there are a | |
-- known total of nodes. Uses the reamainder of the keys' hash values to | |
-- segment the keys. | |
function slice(prefix, index_and_total) | |
local args = _split(index_and_total, "\t") | |
if #args ~= 2 then | |
return nil | |
end | |
local index = tonumber(args[1]) |