This file contains hidden or 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
| These change the background color in X (and I think they don't work if you are | |
| using a desktop system, so the `xset` command ought to be changed for whatever | |
| Gnome/KDE/LXDE/XFCE/ASDFJKLSEMICOLON thing you are using if you are using such a | |
| thing) based on battery power remaining. The Lua one requires luaposix to be | |
| installed. | |
| The reason there are two versions is that Ruby was, when it ought to have been | |
| sleeping, doing some select() loop. I figured Lua would not do that to me, and | |
| it does not. (Porting is usually more fun than fighting the language.) |
This file contains hidden or 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 | |
| # Hey, wanna see something fun? | |
| # | |
| # My disk broke. Thinking quickly, I decided to harness the unlimited power of | |
| # User Error, and partially wreck my backup. | |
| # | |
| # Don't ask. | |
| # | |
| # md0 had most of the data. But the filesystem and partition table were | |
| # wrecked, and some unknown amount of data had been exchanged between it and |
This file contains hidden or 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
| implement Tac; | |
| include "sys.m"; sys: Sys; | |
| include "bufio.m"; bufio: Bufio; Iobuf: import bufio; | |
| include "draw.m"; | |
| Tac: module { | |
| init: fn(nil: ref Draw->Context, args: list of string); | |
| }; |
This file contains hidden or 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 | |
| dropdb thedb | |
| createdb thedb | |
| ssh root@host5 /usr/local/pgsql/bin/pg_dump \ | |
| gzip -c \| \ | |
| tee prod.db.gz | \ | |
| gunzip | \ | |
| tee prod-without-audits.sql | \ | |
| psql thedb |
This file contains hidden or 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 'json' | |
| require 'pp' | |
| mode = :ruby | |
| ARGV.each_with_index { |arg, i| | |
| next unless arg.start_with? ?- |
This file contains hidden or 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 "/" has to be there before rack even gets to it; you cant do a GET without a path of some sort. |
This file contains hidden or 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 Olin Shivers's "opinion file", a collection of posts from the "Opinion | |
| Bboard" at CMU ( http://www.ccs.neu.edu/home/shivers/opinion.html ): | |
| 17-May-89 12:18 Hans.Tallis@ML metabolic fascism | |
| Article 106 of ics.whimsey: | |
| >From: David A Honig <[email protected]> | |
| Subject: Metabolic Fascism | |
| Lines: 144 | |
| ------------------------------------------------------------------------ |
This file contains hidden or 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
| I was looking at the traffic New Twitter was sending across, having | |
| opened Firebug to see just how wide the content was (too wide for my | |
| 848px-wide phone at 920px). I kept seeing 1x1 transparent .gifs, which | |
| all True Patriots have been at war with since the 90s, so I was curious | |
| as to what they were doing in there. There was nothing interesting in | |
| the headers (except the expected six or so different ways to instruct | |
| all browsers everywhere to not cache the content), but the URLs are | |
| huge. | |
| As far as I can tell from the five or six URLs I looked at, it's just |
This file contains hidden or 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/awk -f | |
| # Assuming no Ruby installation, gets and installs Ruby, Rubygems (if 1.8), and | |
| # bundler and isolate (latest versions). If your OS is detected as Debian (or | |
| # Ubuntu), the prerequisites for compiling Ruby will be installed. Other OS's | |
| # either aren't supported, don't need this script, or perhaps I didn't consider | |
| # them. | |
| # If you pass -h, help, -help, or --help, you'll get some helpful info about how | |
| # to control the script. |
This file contains hidden or 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
| Here I have started sqlite3 and pointed it at the xmms2 database. | |
| Note the columns "id", "key", and "value": it is a bad, one-level | |
| key/value store done in sqlite3. The sound file used as an example | |
| is apparently shipped with xmms2. | |
| sqlite> select * from Media where id = 1; | |
| id,key,value,source,intval | |
| 1,added,1301974718,1,1301974718 | |
| 1,album,Dreamweb,4, | |
| 1,artist,mind.in.a.box,4, |