
Halloween
5 years ago
...the thrilling ride of sitting on a chair and coding...
init.d
script for it. This is the default one they tell you to use:
# chkconfig: 345 93 14
# description: will start FAH client as a service
cd /path/to/folding
./fah6 -verbosity 9 < /dev/null > /dev/null 2>&1 &
This doesn't seem to work for me, the process does not start. What I've found to work is this:
### BEGIN INIT INFO
# Provides: fah
# Required-Start: $local_fs $network $named
# Required-Stop: $local_fs $network $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start Folding@Home client
### END INIT INFO
# chkconfig: 345 93 14
# description: will start FAH client as a service
cd /home/felix/fah/
./fah6 -verbosity 9 < /dev/null > /dev/null 2>&1 &
There you go. Now you have no reason to not run this :)
Edit: No, it doesn't work. It seems init
starts the script twice, which messes things up. I think this has something to do with runlevels, but I'm too tired to figure it out now. If anyone knows a solution, please comment.
$HOME/Ubuntu One
folder and synchronize its contents with the Ubuntu One servers. The main idea of it is that of syncing between computers -- you associate all your PCs/laptops with the same account and your files get automatically synced between them. However, I use it for another purpose -- backups. I back up my work and other stuff on Ubuntu One, 2GB is really enough (for me, at least). What's great is that they also provide a web interface to download / upload files from / to your account, so I can access my files wherever, whenever, from whatever.
Don't jump head first, though. You might want to have a look at Dropbox, too. The main advantages are:
/home
partition, so all my settings, e-mails, documents, work is saved (I still do backups, just in case). Installing was a breeze (as always with Ubuntu), so here are my impressions (it's already been about two weeks since I updated), I'll start with the good ones.
Boot time -- definitely improved. I had little faith in this as I saw it being advertised everywhere, but it seems that they have done quite a good job. My system definitely boots faster now (although I have yet to install additional startup software, like Apache, MySQL, VirtualBox, and the like).
My bluetooth dongle is working again -- yay! The previous release had some buggy kernel module which rendered my dongle useless, but it seems it has been fixed. Finally, I can send stuff to my mobile phone without having to connect it via USB. Well, it still doesn't work perfectly, for example I can't send files from my phone to my PC, but otherwise everything works (even browsing the contents of the mobile phone on my PC).
The new notifications are pretty cool, but only if you use a compositor, which I don't generally use. If you don't use a compositor, they suck. Thus, I have enabled metacity compositing (so I don't have to run Compiz).
Ok, now with the bad ones: first off, what's with THE PINK!? Seriously, way too much pink in the new theme. I think that the 8.04 theme was the best (I love orange and brown). This theme is way too pink! Here's Transmission with no torrents:
GET
variables: artist
, title
, album
, genre
, year
, duration
(seconds).
The configuration dialog:RhythmToWeb
directory to ~/.gnome2/rhythmbox/plugins/
$ rhythmbox -D RhythmToWeb
and send me the output, either as a comment on this post or on my email (it's in the plugin properties).
As you may have guessed, I'm using this plugin for the widget in the sidebar of this blog (the "Now Playing" one). Thus, I will show the PHP script that is called when I change the song which creates a simple Javascript file:
<?php
$G = $_GET;
function prep($var) {
// Prepare a value to be included in a Javascript string
$var = htmlentities($var, ENT_COMPAT, 'utf-8');
if (!get_magic_quotes_gpc()) $var = addslashes($var);
return $var;
}
function test($var) {
if ( strlen($var) && mb_strtolower($var) != 'unknown' && $var != '0' ) {
return true;
}
return false;
}
$s = 's_nowplaying = "';
if (test($G['title'])) {
$s .= '<b>Song:</b> ' . prep($G['title']) . '<br />';
}
if (test($G['artist'])) {
$s .= '<b>By:</b> ' . prep($G['artist']) . '<br />';
}
if (test($G['album'])) {
$s .= '<b>From:</b> ' . prep($G['album']) . '<br />';
}
if (test($G['genre'])) {
$s .= '<b>Genre:</b> ' . prep($G['genre']) . '<br />';
}
if (test($G['year'])) {
$s .= '<b>Year:</b> ' . prep($G['year']) . '<br />';
}
if (test($G['duration'])) {
$min = floor($G['duration'] / 60);
$sec = $G['duration'] % 60;
if ($sec < 10) $sec = '0' . $sec;
$s .= '<b>Length:</b> ' . $min . ':' . $sec;
}
if (empty($G)) {
$s .= 'Not playing anything.';
}
$s .= '";';
$s .= <<<EOS
if (document.getElementById && document.getElementById('nowplaying_info'))
document.getElementById('nowplaying_info').innerHTML = s_nowplaying;
else document.write(s_nowplaying);
EOS;
$fp = fopen('nowplaying.js', 'w');
fwrite($fp, $s);
fclose($fp);
?>
Then, in my blog I have a HTML widget with the following content:
<span id="nowplaying_info">Loading...</span>
<script src="http://znupi.ath.cx/felix/nowplaying/nowplaying.js" type="text/javascript"></script>
And there you have it :). This is just an example, you could make a script that generates an image on which it writes that information. This way, you could include that image in your signature on forums or emails.
Don't hesitate to ask questions either here or on my email address if you have them.
$ sudo apt-get install transmission-cli
$ transmission-daemon
After that, just navigate to http://your-server:9091/ and there you have it!
The only thing you should still do is install an init.d script so you can run Transmission as another user and automatically on system start-up, which is documented here (and pretty easy). Although the init.d script can't stop Transmission for me (I don't know why, it just hangs), I can always kill it ;)... or wait more than 5 seconds before doing that.
Anyway, Transmission is incredibly easy to set up and incredibly efficient, but the Web UI lacks a few features. For example, you can't add a torrent by URL -- you have to download it from the torrent website and upload it to your server, which is a bit annoying. Also, you can't specify a download folder when adding a torrent, all torrents go to the default folder (which you can change, of course). But anyway, all around, it's a good app :).