Skip to content

Instantly share code, notes, and snippets.

@zed9h
zed9h / ambient.pl
Created July 17, 2009 03:54
random ambient sound (pink/red noise)
#!/usr/bin/perl
use strict;
use warnings;
use Math::FFTW;
use Audio::DSP;
use Time::HiRes qw(time);
my $amp = 0xffff;
my $len = 0xfff;
@zed9h
zed9h / trayicon.pl
Created July 17, 2009 03:54
trayicon monitors x11 idle state to perform activities on the desktop applications
#CHECK { print map { "$_\n"} keys %INC }
END { print map { "$_\n"} keys %INC }
use Gtk2::TrayIcon;
Gtk2->init;
sub evolution_empty_trash
{
system qq{
@zed9h
zed9h / exchange_cleanup.pl
Created July 17, 2009 04:07
connect imap server to clenaup unwanted emails
#!/usr/bin/perl
use strict;
use warnings;
use Net::IMAP::Simple;
use Encode qw/encode decode/;
my $host = 'imap.server.com'
my $login = 'carlo.caputo';
my $password = '123456';
my $delete_pattern = 'Undeliverable: (maillist|useless|automatic)';
@zed9h
zed9h / 62kevin.pl
Last active May 12, 2022 22:15
six degrees to kevin bacon [and other queries] using dbpedia
#!/usr/bin/perl
use strict;
use warnings;
use Compress::Raw::Bzip2;
use Graph::Undirected;
use Storable;
use Term::ReadLine; # Term::ReadLine::Gnu
$|=1;
my $root = 'Kevin_Bacon'; # dbpedia resource name of an actor
@zed9h
zed9h / alice-sample.pl
Created July 17, 2009 04:19
synth phrases from alice in wonderland
#!/usr/bin/perl
use strict;
use Graph::Directed;
use Graph::Layout::Aesthetic;
use Graph::Layout::Aesthetic::Monitor::GnuPlot;
use Graph::Layout::Aesthetic::Topology;
our $filename = $0; $filename =~ s/\..*?$/'-'.time/e;
sub plot($)
{
@zed9h
zed9h / doublets.pl
Created July 17, 2009 04:55
Lewis Carroll's doublets automated solver
#!/usr/bin/perl
use strict;
use warnings;
my $VERSION=2;
# TODO append results to file (doublet-w1-w2.txt:$0 @ARGV\n...)
printf "Lewis Carroll's Doublet Automated v%d\n", $VERSION;
print "$0 @ARGV\n";
@zed9h
zed9h / gmail_wide.user.js
Created July 17, 2009 06:59
greasemonkey to removes the right column from the inner section of gmail
// ==UserScript==
// @name GMail Wide
// @version 1
// @description Removes the right column from the inner section
// @author zed9h
// @include http://mail.google.com/*
// @include https://mail.google.com/*
// @include http://*.mail.google.com/*
// @include https://*.mail.google.com/*
// ==/UserScript==
@zed9h
zed9h / dup.pl
Created July 18, 2009 15:20
suggests duplicate-file removal and small-file backup
#!/usr/bin/perl
use strict;
my @starting_points;
my ($recycle);
my ($del_check, $checksum, $no_name, $smaller_tree, $keep_path_pattern);
my ($zip_check, $zip_sizefactor, $zip_minsize);
my ($denied_pattern, $allowed_pattern);
my %byPath;
@zed9h
zed9h / zed9h-2005.xsl
Created July 18, 2009 15:50
pure xsl homepage, with folding and toc
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="zed9h-2005.xsl"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:bio="http://9hells.org/">
<xsl:output method="html" indent="yes" encoding="UTF-8"
omit-xml-declaration="yes"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />
@zed9h
zed9h / 0fetch
Created July 18, 2009 16:11
semi-automatic scheduler for rio int'l film festival, former riocine
#!/bin/bash
mkdir -p site
cd site
for i in $(seq 1 99)
do
file=$(printf list%02d.html $i)
url="http://www.festivaldoriobr.com.br/f2005/web/seleciona_filmes2.asp?search=%25&escolha=1&aprovado=LIBERADO&id_diretor=%25&id_cinema=0&id_dia=0&id_mostra=0&page=$i"
wget -c -O $file $url