start new:
tmux
start new with session name:
tmux new -s myname
| # for some reason facter takes the raw memorysize and reports it as | |
| # a formatted string, which is useless for calculation | |
| # | |
| Facter.add("memorysize_raw") do | |
| confine :kernel => :linux | |
| setcode do | |
| size = 0 | |
| File.readlines("/proc/meminfo").each do |l| | |
| size = $1.to_f if l =~ /^MemTotal:\s+(\d+)/ |
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
| #@see rynop.com for details | |
| sudo apt-get install xbindkeys | |
| ####now put the following in ~/.xbindkeysrc: | |
| #KeyboardPlay | |
| "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause" | |
| XF86AudioPlay | |
| #KeyboardStop |
| file_to_disk = './tmp/large_disk.vdi' | |
| Vagrant::Config.run do |config| | |
| config.vm.box = 'base' | |
| config.vm.customize ['createhd', '--filename', file_to_disk, '--size', 500 * 1024] | |
| config.vm.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk] | |
| end |
| int speakerPin = 9; | |
| int length = 70; | |
| String notes[] = {"G4","G4", "G4", "D#4/Eb4", "A#4/Bb4", "G4", "D#4/Eb4","A#4/Bb4", "G4", "D5", "D5", "D5", "D#5/Eb5", "A#4/Bb4", "F#4/Gb4", "D#4/Eb4","A#4/Bb4", "G4", "G5","G4","G4","G5","F#5/Gb5", "F5","E5","D#5/Eb5","E5", "rest", "G4", "rest","C#5/Db5","C5","B4","A#4/Bb4","A4","A#4/Bb4", "rest", "D#4/Eb4", "rest", "F#4/Gb4", "D#4/Eb4","A#4/Bb4", "G4" ,"D#4/Eb4","A#4/Bb4", "G4"}; | |
| int beats[] = { 8, 8, 8, 6, 2, 8, 6 , 2 ,16 , 8, 8, 8, 6, 2, 8, 6, 2, 16,8,6,2,8,6,2,2, 2, 2,6,2,2,8,6,2,2,2,2,6,2,2,9,6,2,8,6,2,16 }; | |
| int tempo = 50; | |
| void playTone(int tone, int duration) { | |
| for (long i = 0; i < duration * 1000L; i += tone * 2) { | |
| digitalWrite(speakerPin, HIGH); | |
| delayMicroseconds(tone); |
| #!/bin/bash | |
| # | |
| # Copyright 2014 Hewlett-Packard Development Company, L.P. | |
| # All Rights Reserved. | |
| # Authored by Yazz D. Atlas <[email protected]> | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); you may | |
| # not use this file except in compliance with the License. You may obtain | |
| # a copy of the License at | |
| # |
| Solarized | |
| #FDF6E3,#EEE8D5,#93A1A1,#FDF6E3,#EEE8D5,#657B83,#2AA198,#DC322F | |
| Solarized Dark | |
| #073642,#002B36,#B58900,#FDF6E3,#CB4B16,#FDF6E3,#2AA198,#DC322F | |
| var Rx = require('rx'); | |
| var readline = require('readline'); | |
| var fs = require('fs'); | |
| var rl = readline.createInterface({ | |
| input: fs.createReadStream('lines.txt') | |
| }); | |
| var lines = Rx.Observable.fromEvent(rl, 'line') | |
| .takeUntil(Rx.Observable.fromEvent(rl, 'close')) |
Picking the right architecture = Picking the right battles + Managing trade-offs