
Halloween
5 years ago
...the thrilling ride of sitting on a chair and coding...
ssh-copy-id
has known problems with handling non-standard ports (e.g. connecting to a different port than 22). To overcome this issue, use a command like:
$ ssh-copy-id "user@host -p 6842"
/proc/uptime
). Straight to the code:
function get_uptime() {
$file = @fopen('/proc/uptime', 'r');
if (!$file) return 'Opening of /proc/uptime failed!';
$data = @fread($file, 128);
if ($data === false) return 'fread() failed on /proc/uptime!';
$upsecs = (int)substr($data, 0, strpos($data, ' '));
$uptime = Array (
'days' => floor($data/60/60/24),
'hours' => $data/60/60%24,
'minutes' => $data/60%60,
'seconds' => $data%60
);
return $uptime;
}
/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:
$ 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 :).