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 perl | |
use strict; | |
use warnings; | |
my @args = @ARGV; | |
my %opt; | |
$opt{f} = '%g'; | |
foreach (@args) { |
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
// ==UserScript== | |
// @name youtube tweaks | |
// @description Add H.264 version link and .mp4 file link | |
// @namespace f99aq8ove.net | |
// @include http://*.youtube.com/watch?* | |
// ==/UserScript== | |
var video_file_url = function(fmt) { | |
var s = unsafeWindow.yt.getConfig("SWF_ARGS"); | |
return "http://" + location.host + "/get_video?" + |
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 | |
# | |
# CPU frequency from sysctl | |
# | |
if [ "$1" = "config" ]; then | |
echo "graph_title CPU frequency" | |
echo 'graph_category system' | |
echo "graph_info This graph shows the cpu frequency" | |
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 | |
for i in `perl -nle'print "https://launchpad.net/~$1/+archive/ppa" if m!deb\s+http://ppa\.launchpad\.net/(.+?)/!' /etc/apt/sources.list`; do | |
wget -q -O- "`wget -q -O- "$i" | perl -nle'print "http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0x$1" if m!"http://keyserver.ubuntu.com:11371/pks/lookup\?search=.+?([[:xdigit:]]{16})&!'`" | sudo apt-key add - | |
done |
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 | |
# | |
# zfs snapshot auto-rotation | |
# | |
# usage: zfs_snapshot.sh <mountpoint> <snapshot name> <number of keeping snapshots> [recursive] | |
# | |
# recursive option: Recursively create snapshot (zfs snapshot -r) | |
# | |
# for crontab | |
# |
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 MyCassandra; | |
use Any::Moose; | |
use namespace::autoclean; | |
use Net::Cassandra; | |
use Data::MessagePack; | |
use Data::Dumper; | |
use Encode; | |
has 'keyspace' => (is => 'ro', isa => 'Str'); |
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
--- a/portupgrade 2010-11-14 14:46:24.112307993 +0900 | |
+++ b/portupgrade 2010-11-14 14:47:29.271209261 +0900 | |
@@ -1001,7 +1001,7 @@ | |
rescue IgnoreMarkError => e | |
$results << PkgResult.new(origin, :ignored, pkgname) | |
rescue => e | |
- $results << PkgResult.new(origin, e, pkgname) | |
+ $results << PkgResult.new(origin.nil? ? "nil" : origin, e, pkgname) | |
ensure | |
$use_packages, $use_packages_only = use_packages, use_packages_only |
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
--- a/Stream.pm 2011-01-23 00:27:05.243140965 +0900 | |
+++ b/Stream.pm 2011-01-23 00:28:17.402025511 +0900 | |
@@ -154,7 +154,7 @@ | |
my($handle, $json) = @_; | |
# Twitter stream returns "\x0a\x0d\x0a" if there's no matched tweets in ~30s. | |
$set_timeout->(); | |
- if ($json) { | |
+ if ($json && $json =~ /^{/) { | |
my $tweet = $decode_json ? JSON::decode_json($json) : $json; | |
if ($on_delete && $tweet->{delete} && $tweet->{delete}->{status}) { |
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 -e | |
ldd_list=$(mktemp -t lddlist) | |
if [ $? = 0 ]; then | |
trap "rm -f '$ldd_list'" EXIT | |
fi | |
set +e | |
ldd /usr/local/bin/* /usr/local/lib/*.so* > "$ldd_list" 2> /dev/null | |
set -e |
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 perl | |
use strict; | |
use warnings; | |
use File::Spec; | |
use Getopt::Long; | |
use Pod::Usage; | |
use Data::Dumper; |
OlderNewer