-
abs(float)
- Returns the absolute value of a given float. Example:abs(1)
returns1
, andabs(-1)
would also return1
, whereasabs(-3.14)
would return3.14
. See also thesignum
function. -
basename(path)
- Returns the last element of a path. -
base64decode(string)
- Given a base64-encoded string, decodes it and returns the original string.
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
$ sudo aptitude install libssl-dev zlib1g-dev e2fslibs-dev debhelper libbz2-dev libattr1-dev libacl1-dev | |
$ wget https://www.tarsnap.com/download/tarsnap-autoconf-1.0.35.tgz | |
$ wget https://www.tarsnap.com/download/tarsnap-sigs-1.0.35.asc | |
$ gpg --decrypt tarsnap-sigs-1.0.35.asc | |
$ sha256sum tarsnap-autoconf-1.0.35.tgz | |
$ tar xzf tarsnap-autoconf-1.0.35.tgz | |
$ cd tarsnap-autoconf-1.0.35 | |
$ ln -s pkg/debian . | |
$ dpkg-buildpackage | |
$ cd .. |
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
# Get Linode API python bindings from https://github.com/tjfontaine/linode-python | |
#!/usr/bin/python | |
from linode import api | |
instance = api.Api(key='abcdefg') | |
for domain in instance.domain_list(): | |
if domain['TYPE'] == 'master': | |
print "Updating %s (%i)..." % (domain['DOMAIN'], domain['DOMAINID']) |
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
package utils | |
import ( | |
"log" | |
"os" | |
) | |
var ( | |
Log *log.Logger | |
) |
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
desc 'List defined routes' | |
task 'routes' do | |
App::routes.each_pair do |method, list| | |
puts ":: #{method} ::" | |
routes = [] | |
list.each do |item| | |
source = item[0].source | |
item[1].each do |s| | |
source.sub!(/\(.+?\)/, ':'+s) |
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
salt '*' cmd.run 'rm -rm /var/cache/salt/minion/files/base/*' | |
salt '*' saltutil.sync_all |
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
filters { | |
grok { | |
type => "mongodb" | |
pattern => [ "%{DATA:mongo_ts} \[%{DATA:mongo_conn}\]? %{DATA:mongo_type} %{GREEDYDATA:mongo_message}" ] | |
} | |
mutate { | |
type => "mongodb" | |
replace => [ "@message", "%{mongo_message}" ] | |
} | |
grok { |
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
#!/usr/bin/env ruby | |
require 'date' | |
require 'xml' | |
def htmlit(infile) | |
lines = File.readlines(infile) | |
/<!--\s+(.+)\s+-->/.match lines.shift | |
lines.unshift('<h2>%s</h2>' % $1) | |
html = '' | |
lines.each do |line| |
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
FROM ubuntu | |
MAINTAINER Eric Mill "eric@konklone.com" | |
# turn on universe packages | |
RUN echo "deb http://archive.ubuntu.com/ubuntu raring main universe" > /etc/apt/sources.list | |
RUN apt-get update | |
# basics | |
RUN apt-get install -y nginx openssh-server git-core openssh-client curl | |
RUN apt-get install -y nano |
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
// Usage: | |
// Copy and paste all of this into a debug console window of the "Who is Hiring?" comment thread | |
// then use as follows: | |
// | |
// query(term | [term, term, ...], term | [term, term, ...], ...) | |
// | |
// When arguments are in an array then that means an "or" and when they are seperate that means "and" | |
// | |
// Term is of the format: | |
// ((-)text/RegExp) ( '-' means negation ) |
OlderNewer