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
Emscripten does not work with LLVM 3.3, which is provided with Fedora 19. | |
Download LLVM 3.2 and Clang from http://llvm.org/releases/. Copy the clang | |
source code into tools\clang, and run make (but not make install). | |
Set LLVM_ROOT='/home/yourname/Development/llvm-3.2.src/Release+Asserts/bin' in ~./emscripten. | |
sudo yum install nodejs - I found that chromium installed later versions | |
of the v8 package, which meant that nodejs would not install. So download | |
Node.js from http://nodejs.org/download/. |
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
/* most efficient way to print the last X lines of a file. | |
* | |
* it's done using my favourite system call - mmap(2). Instead of reading the file | |
* from start to finish and count newlines, the program maps the file into memory and | |
* scans it backwards from the end, counting newline characters as it goes. When it decided | |
* thet it found the beginning of the X line from the end (or reached the beginning of the file) | |
* it prints the entire block of lines in one call. | |
* | |
* Options to improve: | |
* 1. Use direct call to write(2) on file descriptor 1 instead of fwrite() |
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/local/bin/gawk -f | |
# Taken from http://stackoverflow.com/a/8949920/164137 | |
BEGIN { | |
FS="," | |
FPAT="([^,]+)|(\"[^\"]+\")" | |
} | |
{ |
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 | |
# Shell script to install your public key on a remote machine | |
# Takes the remote machine name as an argument. | |
# Obviously, the remote machine must accept password authentication, | |
# or one of the other keys in your ssh-agent, for this to work. | |
ID_FILE="${HOME}/.ssh/id_rsa.pub" | |
if [ "-i" = "$1" ]; then |
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/bash | |
spin='-\|/' | |
i=0 | |
ceol=`tput el` | |
while read filename | |
do | |
if [[ -f $filename ]] | |
then | |
i=$(( (i+1) % 4 )) |
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
boxes = Dir.glob("puppet/hiera/nodes/*.yaml").map {|f| YAML.load(File.read(f)) } | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
boxes.each do |attrs| | |
# Required attributes | |
boxname = attrs['box'] |
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
# The following Bash function will automatically pick up the stdout (and/or stderr, | |
# depending on command line options) of another Bash background job and tail it | |
# until the given job terminates. | |
# | |
# example usage: | |
# $ ls -R / &> ls.out & trc | |
# will run recursive "ls" in the background and redirect its output to a file | |
# then start "tail --pid <background job pid> -F <backgroun jobs' stdout file>" | |
# | |
# The default is to tail stdout (file descriptor "1") of the given job |
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
zcat ...CloudTrail....json.gz | jshon -e Records -a -e userIdentity |
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
"UserData": { | |
"Fn::Base64": { "Fn::Join":["", [ | |
"#!/bin/bash -ex\n", | |
"apt-get update\n", | |
"apt-get -y install python-setuptools\n", | |
"mkdir aws-cfn-bootstrap-latest\n", | |
"curl https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz | tar xz -C aws-cfn-bootstrap-latest --strip-components 1\n", | |
"easy_install aws-cfn-bootstrap-latest\n", | |
"/usr/local/bin/cfn-init --stack ", { "Ref":"AWS::StackName" }, " --resource WebServer", " --region ", { "Ref": "AWS::Region" }, "\n" | |
"\n", |
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 python | |
# Example usage: ./tc-query-params.py --user username --teamcity https://teamcity.server.host.name/ | |
from __future__ import print_function | |
import os | |
import getopt | |
import requests | |
import sys | |
import getpass |