Amarok now playing... to remote irssi.
July 26, 2007 @ 15:10:27
I've got frustrated typing out now playing information in irssi when I'm using my laptop. Today I fixed the problem.
On the laptop:
On the server side, the script is very simple - all it has to do is cat the file into the current irc channel:
To the comments...On the laptop:
#!/usr/bin/php
<?php
while (true) {
system('echo "playing: `dcop amarok player artist` [`dcop amarok player album`] - `dcop amarok player title`"|ssh toba.ath.cx "cat > priv/playing.txt"');
echo "sent info...\n";
$c = array();
$t = array();
exec('dcop amarok player totalTime', $t);
exec('dcop amarok player currentTime', $c);
$c = explode(':', $c[0]);
$t = explode(':', $t[0]);
$w = intval($t[0]) * 60 + intval($t[1]) - intval($c[0]) * 60 - intval($c[1]) + 1;
echo "waiting " . $w . " seconds...\n";
sleep($w);
}
?>
How it works: get current playing information from Amarok, and write this to a file on my server. Ask Amarok how long the track is going to play for, wait until the next track will have just started. Rinse, repeat.<?php
while (true) {
system('echo "playing: `dcop amarok player artist` [`dcop amarok player album`] - `dcop amarok player title`"|ssh toba.ath.cx "cat > priv/playing.txt"');
echo "sent info...\n";
$c = array();
$t = array();
exec('dcop amarok player totalTime', $t);
exec('dcop amarok player currentTime', $c);
$c = explode(':', $c[0]);
$t = explode(':', $t[0]);
$w = intval($t[0]) * 60 + intval($t[1]) - intval($c[0]) * 60 - intval($c[1]) + 1;
echo "waiting " . $w . " seconds...\n";
sleep($w);
}
?>
On the server side, the script is very simple - all it has to do is cat the file into the current irc channel:
/alias m exec -o cat priv/playing.txt
It works like a charm:[15:10:06] <@Toba|BSD> playing: Duran Duran [Greatest] - Is There Something I Should Know?
Big 'ol pile of CIA documents
June 27, 2007 @ 01:12:43
As everyone knows, the CIA isn't exactly the most pleasant agency of the US government. I've got here a nice big archive, about 12,000 pages, of declassified CIA documents.
For information about the Family Jewels files, check CNN.com.
Torrent it all!
To the comments...This collection of declassified analytic monographs and reference aids, designated within the Central Intelligence Agency (CIA) Directorate of Intelligence (DI) as the CAESAR, ESAU, and POLO series, highlights the CIA's efforts from the 1950s through the mid-1970s to pursue in-depth research on Soviet and Chinese internal politics and Sino-Soviet relations. The documents reflect the views of seasoned analysts who had followed closely their special areas of research and whose views were shaped in often heated debate.
For information about the Family Jewels files, check CNN.com.
Torrent it all!
Things that piss me off
March 18, 2007 @ 19:45:38
- Morons who use human antibiotics which are increasingly the last line of defense against mutilple-resistant bacteria to make farm animals grow larger. As cannot be ignored, bacteria evolve to be more resistant when they are constantly deluged with one antibiotic in a re-infecting environment. For more information, visit http://www.sierraclub.org/factoryfarms/factsheets/antibiotics.asp
- People who don't finish blog posts
- I'll find something to put here
Why Adobe isn't one of the 'good guys'
March 16, 2007 @ 14:13:08
Sometimes companies that have a facade of good deeds and practices will do things that nobody really likes... but most people won't notice. Slight little incompatibilities with the company's own published standards is a fun trick to compete unfairly with other software.
I think this stands for itself, from pdf2ps:
Why, Adobe, why?
To the comments...I think this stands for itself, from pdf2ps:
**** This file had errors that were repaired or ignored.
**** The file was produced by:
**** >>>> Acrobat Distiller 7.0.5 (Windows) <<<<
**** Please notify the author of the software that produced this
**** file that it does not conform to Adobe's published PDF
**** specification.
**** The file was produced by:
**** >>>> Acrobat Distiller 7.0.5 (Windows) <<<<
**** Please notify the author of the software that produced this
**** file that it does not conform to Adobe's published PDF
**** specification.
Why, Adobe, why?
Linux disk space
March 2, 2007 @ 02:04:06
On my *nix boxes, I oftend find myself using df to check my free space. Unfortunately the Linux pseudo-filesystems such as /dev and /dev/shm clutter up the space with useless info. As usual, it took me a year to realize I could do something about it, so it wasn't until now that I wrote this shell script:
Using this script, you will see the same thing as the output of df -h, but showing only the filesystems that are 'real' (a device or file is mounted, not a kernel structure or network filesystems.
Much prettier, no?
To the comments...#!/bin/sh
mount|egrep "^/"|cut -f3 -d' '|xargs df -h
mount|egrep "^/"|cut -f3 -d' '|xargs df -h
Using this script, you will see the same thing as the output of df -h, but showing only the filesystems that are 'real' (a device or file is mounted, not a kernel structure or network filesystems.
eastein@glamdring:/home/eastein$ ds
Filesystem Size Used Avail Use% Mounted on
/dev/sda4 63G 29G 35G 46% /
/dev/sda3 7.7G 139M 7.6G 2% /tmp
/dev/hdc 150G 138G 12G 93% /home
Filesystem Size Used Avail Use% Mounted on
/dev/sda4 63G 29G 35G 46% /
/dev/sda3 7.7G 139M 7.6G 2% /tmp
/dev/hdc 150G 138G 12G 93% /home
Much prettier, no?
del.icio.us Firefox search hack
February 22, 2007 @ 02:28:26
When I installed del.icio.us, I did it to replace the annoyingly 1995-style Firefox bookmarking system. Seriously, who wants to go through a slow and badly designed menu with 400 items in it when you can just type a tag in and get your results?
Anyways, all was well and good until I realized that 99% of the time when I do a del.icio.us search from the search box in Firefox, I want MY tags, not everyone's. You can't really configure the search thing to do that, though. So I did my own configuring. Here's how you can do the same!
Voila! You are now searching your own bookmarks, not Joe Schmo's.
To the comments...Anyways, all was well and good until I realized that 99% of the time when I do a del.icio.us search from the search box in Firefox, I want MY tags, not everyone's. You can't really configure the search thing to do that, though. So I did my own configuring. Here's how you can do the same!
- find your profile directory (on Linux, this will be ~/.mozilla/firefox/[something])
- enter the searchplugins directory
- open the delicious-tag.xml file in your favorite text editor
- make these lines look like this (obviously use YOUR username):
<SearchForm>http://del.icio.us/eastein/</SearchForm>
<os:Url type="text/html" method="GET" template="http://del.icio.us/eastein/{searchTerms}">
<os:Url type="text/html" method="GET" template="http://del.icio.us/eastein/{searchTerms}">
- save the file
- restart firefox
Voila! You are now searching your own bookmarks, not Joe Schmo's.
Dual core... it's a beautiful thing
February 15, 2007 @ 11:49:21
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
30373 root 25 0 209m 186m 17m R 50 9.3 0:02.60 cc1plus
30379 root 25 0 123m 108m 10m R 50 5.4 0:01.50 cc1plus
30370 root 25 0 227m 204m 17m R 49 10.2 0:02.96 cc1plus
28130 eastein 35 10 114m 104m 1508 R 33 5.2 2:21.01 pisg
30373 root 25 0 209m 186m 17m R 50 9.3 0:02.60 cc1plus
30379 root 25 0 123m 108m 10m R 50 5.4 0:01.50 cc1plus
30370 root 25 0 227m 204m 17m R 49 10.2 0:02.96 cc1plus
28130 eastein 35 10 114m 104m 1508 R 33 5.2 2:21.01 pisg
I just thought I'd share how wonderful it is to see that in top.
RSS
February 12, 2007 @ 02:41:31
For the last 2 months or so, I've been using an RSS reader (talk about getting on the bandwagon late, eh?). It's the best thing since sliced bread. I don't have to wander the web trying to remember that site I wanted to come back to sometime; I can check 40 websites for updates in under a minute.
I'd feel guilty about not having an rss feed on my own site if anyone actually read this blog. Right now I have no indication that anyone does, so I am not really stressing about it... but eventually (in all that free time I have) I'll be rewriting my site with a database backend and RSS and comments and maybe even a cure for cancer.
Until then, my nonexistent readership, bookmarks are your friend.
To the comments...I'd feel guilty about not having an rss feed on my own site if anyone actually read this blog. Right now I have no indication that anyone does, so I am not really stressing about it... but eventually (in all that free time I have) I'll be rewriting my site with a database backend and RSS and comments and maybe even a cure for cancer.
Until then, my nonexistent readership, bookmarks are your friend.
More ridiculous law on the books...
February 1, 2007 @ 00:57:55
As everyone knows, as soon as you are legally defined as a terrorist, you have no rights. Any chance you had of a fair trial is gone. Your right to a lawyer is gone. Basically, your life is over. You'd think there would be extremely stringent rules on categorizing someone as a terrorist, considering how severe the results are.
Circumstances indicating intention? Wait, aren't we defining terrorist activity here? Isn't this definition recursive?
Gathering information is a terrorist activity now? This ambiguously worded clause would make picking up a subway map and then going to home depot a terrorist activity.
Where's the presumption of innocence here? You have to prove that you didn't know? Shouldn't that be that the government has to prove you DID know?
Why doesn't anyone seem to care about the constitution anymore?
For reference, here is the full text of the Real ID act.
To the comments...(b) ENGAGE IN TERRORIST ACTIVITY DEFINED.-Section 212(a)(3)(B)(iv) of the Immigration and Nationality Act (8 U.S.C.1182(a)(3)(B)(iv)) is amended to read as follows:
(iv) ENGAGE IN TERRORIST ACTIVITY DEFINED.-
As used in this Act, the term engage in terrorist
activity means, in an individual capacity or as a
member of an organization-
(I) to commit or to incite to commit, under
circumstances indicating an intention to cause
death or serious bodily injury, a terrorist activity;
(II) to prepare or plan a terrorist activity;
(III) to gather information on potential tar-
gets for terrorist activity;
(IV) to solicit funds or other things of value
for-
(aa) a terrorist activity;
(bb) a terrorist organization described in
clause (vi)(I) or (vi)(II); or
(cc) a terrorist organization described in
clause (vi)(III), unless the solicitor can dem-
onstrate by clear and convincing evidence that
he did not know, and should not reasonably
have known, that the organization was a ter-
rorist organization;
(V) to solicit any individual-
(aa) to engage in conduct otherwise
described in this subsection;
(bb) for membership in a terrorist
organization described in clause (vi)(I) or
(vi)(II); or
(cc) for membership in a terrorist
organization described in clause (vi)(III) unless
the solicitor can demonstrate by clear and con-
vincing evidence that he did not know, and
should not reasonably have known, that the
organization was a terrorist organization; or
(VI) to commit an act that the actor knows,
or reasonably should know, affords material sup-
port, including a safe house, transportation,
communications, funds, transfer of funds or other
material financial benefit, false documentation or
identification, weapons (including chemical,
biological, or radiological weapons), explosives, or
training-
(aa) for the commission of a terrorist
activity;
(bb) to any individual who the actor
knows, or reasonably should know, has com-
mitted or plans to commit a terrorist activity;
(cc) to a terrorist organization described
in subclause (I) or (II) of clause (vi) or to
any member of such an organization; or
(dd) to a terrorist organization described
in clause (vi)(III), or to any member of such
an organization, unless the actor can dem-
onstrate by clear and convincing evidence that
the actor did not know, and should not reason-
ably have known, that the organization was
a terrorist organization.
(iv) ENGAGE IN TERRORIST ACTIVITY DEFINED.-
As used in this Act, the term engage in terrorist
activity means, in an individual capacity or as a
member of an organization-
(I) to commit or to incite to commit, under
circumstances indicating an intention to cause
death or serious bodily injury, a terrorist activity;
(II) to prepare or plan a terrorist activity;
(III) to gather information on potential tar-
gets for terrorist activity;
(IV) to solicit funds or other things of value
for-
(aa) a terrorist activity;
(bb) a terrorist organization described in
clause (vi)(I) or (vi)(II); or
(cc) a terrorist organization described in
clause (vi)(III), unless the solicitor can dem-
onstrate by clear and convincing evidence that
he did not know, and should not reasonably
have known, that the organization was a ter-
rorist organization;
(V) to solicit any individual-
(aa) to engage in conduct otherwise
described in this subsection;
(bb) for membership in a terrorist
organization described in clause (vi)(I) or
(vi)(II); or
(cc) for membership in a terrorist
organization described in clause (vi)(III) unless
the solicitor can demonstrate by clear and con-
vincing evidence that he did not know, and
should not reasonably have known, that the
organization was a terrorist organization; or
(VI) to commit an act that the actor knows,
or reasonably should know, affords material sup-
port, including a safe house, transportation,
communications, funds, transfer of funds or other
material financial benefit, false documentation or
identification, weapons (including chemical,
biological, or radiological weapons), explosives, or
training-
(aa) for the commission of a terrorist
activity;
(bb) to any individual who the actor
knows, or reasonably should know, has com-
mitted or plans to commit a terrorist activity;
(cc) to a terrorist organization described
in subclause (I) or (II) of clause (vi) or to
any member of such an organization; or
(dd) to a terrorist organization described
in clause (vi)(III), or to any member of such
an organization, unless the actor can dem-
onstrate by clear and convincing evidence that
the actor did not know, and should not reason-
ably have known, that the organization was
a terrorist organization.
Circumstances indicating intention? Wait, aren't we defining terrorist activity here? Isn't this definition recursive?
Gathering information is a terrorist activity now? This ambiguously worded clause would make picking up a subway map and then going to home depot a terrorist activity.
Where's the presumption of innocence here? You have to prove that you didn't know? Shouldn't that be that the government has to prove you DID know?
Why doesn't anyone seem to care about the constitution anymore?
For reference, here is the full text of the Real ID act.
HOPE conference in jeopardy?
January 18, 2007 @ 05:57:30
Sad news. The HOPE conference is in danger of being discontinued after HOPE 7 in 2008 due to the venue being torn down.
That's true enough - the Hotel itself is in pretty sorry shape. I hope (pun not intended) that a new venue can be found to replace it...
Thread on the HOPE forums
To the comments...
The New York City hotel that inspired the song "Pennsylvania 6-5000" will be torn down for a 2.5 million-square-foot office tower.
"I don't think anyone who has stayed there recently has been overly in love with the place... Whatever tears are going to be shed, they're too late."
"I don't think anyone who has stayed there recently has been overly in love with the place... Whatever tears are going to be shed, they're too late."
That's true enough - the Hotel itself is in pretty sorry shape. I hope (pun not intended) that a new venue can be found to replace it...
Links
nationaltrust.org story about demolitionThread on the HOPE forums