Torrent session via terminal

I’ve been looking on how to start a torrent session on another machine lately (on *nix flavor), and I thought there’s probably a command-line for it, and I was right. Since I can SSH thru in my Ubuntu machine at home, this sounds like a fit option.

The need arises when I’m in the office, working of course, and a movie title suddenly pops in my head and I get eager watching it. So I’d search for torrent for that movie with good remarks, at least watchable quality. Download it then SCP that to my machine at home and start session torrent on CLI. Takes at least a minute of my time to fire it up, but most importantly, it’s finished downloading when I get home. And watch on dinner I guess.

So, if you’re using Ubuntu, transmission is commonly installed there. But we need the transmission-cli package installed, which includes transmission-daemon and transmission-remote for starting CLI torrent session. First fire up the daemon, then use remote to add torrent file, like this one below

marvin@localhost:~/Desktop$ transmission-daemon
marvin@localhost:~/Desktop$ transmission-remote -a Avatar-2009-TELESYNC-XviD-ORC.torrent

If it says The program 'transmission-daemon' is currently not installed, just type the suggested install command. It should be like this

marvin@localhost:~$ sudo apt-get install transmission-cli

Now, if you want to find out download stats just add the -l or --list like the one below, will list all torrents and status.

marvin@localhost:~/Desktop$ transmission-remote -l

Use transmission-remote --help for other options. You can set upload and download limits too.

Here are useful links:

If Windows, Linux and OSX Opened Cafes

What if really… LOL! I found this from DaniWeb, it’s short and entertaining! Read on…

The New York Times reported today that Apple has opened its first Apple Store in Paris, underneath the Louvre no less, and just two weeks after Microsoft opened up a Windows 7 cafe in Paris in another location. The idea of these two companies competing in a retail environment, and especially a Windows-themed cafe, got me thinking about what would happen if three cafes opened each run in the same style of the operating system it was named for. I figure it might look something like this:

Windows Cafe

The Windows Cafe is in a bland store front. The furniture consists of straight wooden chairs with tables with sharp angles. Unfortunately, every so often when you sit in a chair it crashes the to the floor, but you get used to this and figure it’s just part of the experience of going to the Windows Cafe. (To be fair they have been testing chairs from a new manufacturer and they are reportedly less prone to breaking in this fashion.) Pictures of a smiling Bill Gates and Windows logos adorn the walls. The coffee tastes fine most of the time, but a surprising number of patrons get sick there, so that it’s become standard practice to use hand sanitizer before you go in to protect yourself. The coffee is expensive, and refills are definitely not free, but it’s a known quantity, and many people are comfortable going there.

Linux Cafe

The Linux Cafe is a funky place in an artsy neighborhood with eclectic furniture donated by the patrons. It doesn’t match, but it’s comfortable and the walls are covered with donated pictures and paintings by local artists. The coffee is free, served in black cups (or you can just bring your own), but you need to make it yourself. If you can’t do it yourself, the cafe has consultants available to help you for a fee. It’s great for people who know about coffee brewing, but many people are intimidated by the idea of making their own coffee and stay away, even though very few people ever get sick who go there.

Apple Cafe

The Apple Cafe is a modern, state-of-the-art facility. The tables are stainless steel and the chairs are ultra-contemporary. Shrines to Apple CEO Steve Jobs are dotted around the wide space. The cups are cool and come in a variety of bright colors. The coffee is well made by a highly trained staff, and even though it costs a lot more, people line up around the block for a chance to drink it. Just don’t ask the staff about their coffee-making techniques because they are extremely tight lipped about this. People occasionally get sick there, but it’s rare enough for the cafe to brag about its safety record.

So there you have it. Three cafes with three distinct personalities just like the operating systems they represent

Source: http://www.daniweb.com/news/story236836.html?urlhash=yp4q&trk=nus_ritm-title by Ron Miller

Quickie Visitors Country WP Plugin

This plugin is dependent on WP/GeoTrack by Johannes Lietz, this is NOT a stand-alone plugin, it won’t work if WP/GeoTrack is not installed anyway, so it’s safe.

And don’t look for it in WP Plugins repo, you won’t find it there :D

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
Plugin Name: Top Visitors Flag
Plugin URI: http://www.marvinmarcelo.com/
Description: This plugin displays visitors on sidebar as widget dependent on <a href="http://dadabase.de/weblog/archives/2006/05/23/wordpress-geotrack-plugin">WP/GEO-Track plugin</a>.
Author: Marvin Marcelo
Author URI: http://www.marvinmarcelo.com/
Version: 1.0.0
*/
function tvf_get_topvisits()
{
  global $wpdb, $table_prefix;
  $sql = "select count(*) as `rows` , `country` , `flagname` from `".$table_prefix."geotrack` group by `country` order by `rows` desc limit 0 , 12";
  $flagstats = $wpdb->get_results($sql);
 
  $html = "<li id='top-country-flags'><h2>Top Visiting Countries</h2><div>\n"; /*  id string */
  foreach ($flagstats as $cf)
  {
    $cf->rows = number_format($cf->rows, 0, "", ",");
    $html .= "<img src=\"". GEOTRACK_URL . "flags/" . $cf-/>flagname . ".png\" alt=\"Flag of $cf->country with $cf->rows visits\" title=\"$cf->country with $cf->rows visits\" />\n";
  }
  $html .= "</div></li>";
  echo $html;
}
 
function init_tvf_init(){
	register_sidebar_widget("Top Visitors Flags", "tvf_get_topvisits");
}
 
if (defined('GT_NOT_INSTALLED'))
{
  echo "<!-- You need \"http://dadabase.de/weblog/archives/2006/05/23/wordpress-geotrack-plugin\" installed first-->";
}
else
{
  add_action("plugins_loaded", "init_tvf_init");
}

Also, you have to forgive the function, constants, and variables names, we all struggle for a better and sensible one :) Happy coding!

Windows Social, didn’t complain

2qa6yp0Ok, this is actually the first post I did about Windows. I haven’t used it as my working platform for more than 2 years, though honestly, it’s also where I started, back in Windows 95 in my school years. Even if that’s the only available version we had in 1999, it was huge then! I am now more in the FOSS community, and have been enjoying doing my stuff in Ubuntu Desktop. But what I really wanted to point out in this post is the new Windows Social, it is just like any social media but it runs real time feeds, “popping in” every second into the stream area with streams coming from different major social media out there – Facebook, Flickr, Twitter, etc. And that is a “WOW”, I admit. That’s the feature Facebook Developers haven’t really implemented in full capacity. But Facebook already rolled out their version with that feature, sort of saying “we’re on the way!”, as they had also announced in that release.

Windows Social

I still remember way back the upgrade of MSN’s Hotmail (or not exactly sure if older versions work smoothly on Firefox), it was always complaining that it’s not compatible with my browser. But this one, this one is really good, so Kudo’s to Windows Social team. When I found this in the Twitter’s box in popurls, posts just started popping in, sweet! Though I suppose it would do the same as on MS and IE platform. But if someone knew of a “flaw”, “fail” or “weak link”, complain about it properly to their support, and if you can bother to let me know ;) LOL

Mastering CSS Coding: Getting Started (Smashing Magazine)

I’ve been practicing strict CSS rules for years now, but it was only this year that I changed the way I fix floated containers inside another container, to stretch the height down to the bottom of the floated inner container. I guess almost everyone started with <br /> with ‘clear’ or the next element with CSS ‘clear’ in it to fix the issue, but we all know it’s ‘dirty’.

I found this great tutorial that would make a ‘css nobody’ become a ‘big guy’ on CSS, and I myself is going to keep this page available when needed.

6_b

Mastering CSS Coding: Getting Started covers:

  1. Padding vs. Margin
    • What Is Padding and Margin?
    • Margin and Padding Values
    • Quick Tip
  2. Floats
  3. Center Alignment
    • Horizontal Alignment
    • Vertical Alignment
  4. Ordered vs. Unordered Lists
    • Customizing Unordered Lists
    • Using Unordered Lists for Navigation
  5. Styling Headings
  6. Overflow
    • What Is Overflow?
  7. Position
    • Adding Flavor With CSS
  8. Background Images
    • Using Large Backgrounds
    • Text Replacement
    • CSS Sprites
  9. Image Enhancement
  10. PSD to HTML

PHPAnywhere – edit PHP from browser

Found this post from Smash!ng Apps

PHPanywhere is a new online service that’s changing the way people develop on the web. They enable users to develop and maintain their php/html projects online using any standard web browser.

This is a web based free Integrated Development Environment or IDE for the PHP language, in other words it is an application that gives developers all the code editing capabilities they need to develop PHP applications online. It includes a real-time syntax code editor with support for all web formats and a powerful FTP editor.

Because it works in a browser you can start coding right away, no need for installing anything and best of all you can work from anywhere, all you need is an internet connection and a web browser and you’re ready to go.

You can develop and maintain multiple projects with ease using PHPanywhere, because as soon as you log in all your projects (FTP servers) are immediately accessible. PHPanywhere even remembers what files you were working on and reopens them as well.

Real-time syntax code editor

The real-time syntax code editor is really what PHPanywhere is all about, so here is a list of just some of the things it does:

  • Syntax highlighting
  • Smart indentation for each language
  • Code folding
  • Full internationalization
  • Unlimited undo/redo (now handled on client (browser) side, no more waiting for server response)
  • Unlimited tabs
  • Find and replace feature (New Feature)
  • Displays line numbers (New Feature)
  • Code auto completion, snippets (New Feature)
  • Displays line numbers (New Feature)
  • Code indention (TAB key) (New Feature)

Continue reading

Smarty Gravatar plugin

I realize the need for this when working on an MVC based CMS especially with Smarty engine in it.

Oh and in case you’re wondering why its sounds like the upcoming movie Avatar by James Cameron, I don’t know. What it has to do with internet term ‘avatar‘? I really don’t know. But in ‘www’, Gravatar is a short term for “Globally Recognized Avatar” assigned by a user as his/her default avatar in every places of the internet, same people behind WordPress. There are other similar services too.

So, this plugin is based from its documentation

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**
 * Gravatar
 *
 * @link http://www.marvinmarcelo.com
 *
 * @param array $params
 * @param Smarty $smarty
 */
function smarty_function_gravatar($params, &$smarty)
{
  /**
   * constant $gravatar_host
   */
  $gravatar_host = "http://www.gravatar.com/avatar/";
 
  if ( !isset($params['email']) )
  {
    $smarty->trigger_error("gravatar: email parameter not set");
    return;
  }
 
  if ( !eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $params['email']) )
  {
    $smarty->trigger_error("gravatar: {$params['email']} is not a valid email.");
    return;
  }
  /**
   * @link http://en.gravatar.com/site/implement/url
   */
  $hash = strtolower(md5(trim($params["email"])));
  $src = $gravatar_host . $hash . ".jpg?";
 
  if ( !isset($params["size"]) || !($params["size"] >= 1 && $params["size"] < =512 ))
  {
    $params["size"] = 32;
  }
  $src .= "s={$params["size"]}";
 
  if ( !isset($params["default"]) )
  {
    $params["default"] = "identicon";
  }
  $src .= "d={$params["default"]}";
 
  if ( !isset($params["rating"]) )
  {
    $params["rating"] = "G";
  }
  $src .= "r={$params["rating"]}";
 
  $extras = "";
 
  if ( isset($params["class"]) )
  {
    $extras .= " class=\"{$params["class"]}\"";
  }
 
  if ( isset($params["id"]) )
  {
    $extras .= " id=\"{$params["id"]}\"";
  }
  /**
   * @example http://www.gravatar.com/avatar/7023218434f12aee57f4b03454dadcaa?s=32&d=identicon&r=G
   */
  print "<img src=\"$src\" alt=\"{$params["alt"]}\"$extras />";
}

Simply extract function.gravatar.zip into your Smarty plugin directory. And use it in your template file like this

{gravatar email='someemail@domain.com'}

You’re done!

Facebook 3.0 for iPhone

Hello, finally! The next version of Facebook for iPhone has been submitted for review, TechCrunch spills

List of what to expect is here

  1. The “new” News Feed
  2. Like
  3. Events (including the ability to RSVP)
  4. Notes
  5. Pages
  6. Create new photo albums
  7. Upload photos to any album
  8. Zoom into photos
  9. Easier photo tagging
  10. Profile Pictures albums
  11. A new home screen for easy access to all your stuff, search, and notifications
  12. Add your favorite profiles and pages to the home screen
  13. Better Notifications (they link to the comments so you can reply)
  14. Quickly call or text people right from the Friends page
  15. Messages you are typing will be restored if you quit or are interrupted by a phone call

Now that’s good news!

Working WP Core team

This is REAL work! They do not only trace bugs, but also annoyances, which is a big factor in UI experience.

WordPress 2.8.4: Security Release
Posted August 12, 2009 by Matt. Filed under Releases, Security.

Yesterday a vulnerability was discovered: a specially crafted URL could be requested that would allow an attacker to bypass a security check to verify a user requested a password reset. As a result, the first account without a key in the database (usually the admin account) would have its password reset and a new password would be emailed to the account owner. This doesn’t allow remote access, but it is very annoying.

We fixed this problem last night and have been testing the fixes and looking for other problems since then. Version 2.8.4 which fixes all known problems is now available for download and is highly recommended for all users of WordPress.

Source: http://wordpress.org/development/2009/08/2-8-4-security-release/