Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Hardware Hacking

Journal Journal: Little Upgrades that Matter #2 1

I've mentioned before that I run a version of XBMC called OpenELEC for a wife-friendly way of presenting our media collection on the TV.

I'm currently running OpenELEC v2 Beta 5 and it is flawless. My wife loves it because it is brain-dead simple. I use the Android app for remote control, but have also used a generic Media Center remote an IR receiver. On my project list is to get a Bluetooth remote. I hate having to aim.

The hardware I use is a Zotac HD-ID11 mini-PC. For my use it is almost, but not quite, perfect.

OpenELEC has a tailored distribution just for this type of box. It is optimized for the nVidia ION-2 chipset and under 2 Gb in size.

I don't use a hard drive at all. The system is loaded onto a 4 Gb SD card for total silence, less heat and less power.

The box is mounted on a little VESA bracket that screws into the back of the TV. Perfect fit and totally out of sight. The only cables are HDMI to the TV, power and USB/IR adapter.

My only complaint is their choice of wireless chipset. Included as a mini-PCIe card is an Azurewave combo card which is 2.4 GHz only. That is, 802.11 b/g/n + Bluetooth 3.0.

My experience has been not good in playing HD video (h.264) or audio (Ogg-FLAC) on 2.4 GHz. I have too many things in that frequency in my house and it causes buffering and lag.

So today I opened the box and replaced the Azurewave with an Intel 6230 combo card for $23. Essentially the same specs but with 5.0 GHz a/n support as well.

That solves my problem. There is no lag or delay in playback of HD video or audio using this wireless connection. It isn't as snappy as when it is connected to the GigE wired link, but that is really overkill and this means one less cable and freedom to rearrange furniture.

Everything in this little unit works right out of the box with Linux. The Intel wireless card also just works. No drivers to download, no nothing.

Now to convince it to stream from my Amazon Prime account or Netflix. I think there is an XBMC plug-in for those.

Data Storage

Journal Journal: Little Upgrades that Matter #1 3

I've mentioned before that I have a small server in my basement that I use for media storage. All my movies, music and TV shows have been ripped from DVD or BluRay and encoded as h.264/AC3 files.

The server is nothing more than a mini PC case with a fanless Via C7 mini-itx motherboard, 2 Gb of RAM and a 2 Tb "green" hard drive. Since it is nothing more than a file server it needs very little horsepower and thus I used the low-power, low-performance parts. It works wonderfully.

I have about 1 Tb of files on it that took me almost a year to rip, encode and properly tag. I really don't want to do it again -- ever, so I bought a little external USB 1 Tb HD for $90 at Walmart.

The external drive is USB 2.0/3.0, but the motherboard is USB 2.0. You'd think 480 Mbps is fast, but once you try and copy over 1 Tb of data it seems a lot slower.

So I bought a USB 3.0 card to stick in the one slot the motherboard has. That was a trick, actually. It seems that the older Via motherboards have PCI slots and that since USB 3.0 is *faster* than the PCI bus, almost no one makes a USB 3.0 PCI expansion card. There are plenty of PCIe cards, but finding a PCI card was harder than I thought.

I finally tracked down one -- and only one -- on Ebay. It is from a Taiwanese OEM named "Serial Technologies Expander", whom I can't find online.

The card works like a champ under Linux. Power down, plug card into slot, plug in power from case power supply (for USB-powered device support) and go. No drivers, no nothing. Plugging in my external drive showed /deb/sdb1 available.

US 3.0 maxes out at 5 Gbps, but the PCI bus tops out at just a hair over 1 Gbps. So I'm not getting the full benefit of USB 3.0, but it is more than twice as fast as the USB 2.0 backup was.

I need to do a full benchmark of the speed just to satisfy by nerd curiosity. Because since I backed up once (just "cp -aR /home/media/* /mnt"), I wasn't really wanting to do the whole thing again. A quick "cp -aRu /home/media/* /mnt" did an "update" and only copied newer files over.

For the record: Makemkv is what I use to strip copy protection and rip DVD and BluRay movies. The actual encoding to h.264 is done with HandBrake. CD audio I rip to Ogg-Flac (lossless) using K3B. It all works like a charm. I chose h.264 for video because damn near everything has hardware acceleration support for it.

Cellphones

Journal Journal: Cell Phone Transformation

For the longest time the cell phone industry operated with a mix of OS vendors, handset makers and carriers each providing bits of the whole in an attempt to differentiate themselves from the competition.

This worked in the beginning, but once cellphones were used for more than just making phone calls it sucked Until Apple came along and showed people how much it sucked no one really saw any way to fix it.

It sucked because all three tiers had different goals and visions. The best business interests of AT&T didn't align with those of Motorola or Nokia, much less Symbian or Sun (JavaME). The result was not so much a fusion of form and function but rather a congealed mass of inconsistent implementation mixed with confusing designs shat out upon the consumer.

Apple caused a seismic shift in the industry by collapsing the OS and handset tier into one and completely neutering the carrier, turning them into a dumb connection that sells access only.

The phenomenal success of the iPhone was heralded as a wake-up call to the industry. But instead of waking up, the carriers and handset manufacturers just dreamed bigger. Apple showed them that 50-80% market domination was possible if only they had the coolest product.

Handset manufacturers like Nokia and Samsung bought or developed their own operating systems, tweaked it all out, and peddled it to carriers.

But none of them have enough mojo to force the carriers to toe the line. AT&T, T-Mobile, Verizon and the rest still insist on adding their little touches to differentiate. They are really fighting to add enough perceived value so they can charge a bigger price and stave off relegation to commodity dumb network access provider.

And back they are to the way things were. Except the carriers are racing ever faster to commodity status.

Handset makers aren't far behind the carriers and they have Google to thank for that. With the booming popularity and sub-zero cost of Android, big handset makers like Samsung can barely differentiate their hardware from cheap Chinese bulk manufacturers. So they add their software touches like TouchWiz and Sense.

The problem with that model is vanilla Android is pretty damn good. So good that the additions like Sense and TouchWiz aren't seen as enough of a premium to be able to capture a significant market share.

Google, with their Galaxy Nexus phone that Samsung makes essentially collapses the OS and handset maker tiers and by selling the phone unlocked they cut any carrier interference out of the picture.

The handset makers and carriers still try their damnedest to fight commodity status. The result is carriers dragging their feet on upgrading the software -- blaming compatibility issues but the reality is not compatibility with the HARDWARE but with their little software add-ons. (See: CyanogenMod for fixing this.)

Microsoft sort of sees the light. They're moving in Apple's control-the-entire-stack direction. They are fed up with relying one handset makers and carriers to fulfill THEIR vision. Whether or not it works is another story. And right now MS seems to be hedging their bets when it comes to phones. They have their hooks deep enough in Nokia to bring everything in-house but haven't pulled the trigger.

And the latest straw grasp by the carriers and handset manufacturers is partnering with Mozilla for "Firefox phones".

This move may bring some smart phones into the price range of "feature" phones. Telefonica has said the phone price will be significantly cheaper than the low-end Android models, meaning Firefox phones can be priced at levels around $50 excluding operator subsidies.

But after switching from T-Mobile to StraightTalk for essentially the same service and a savings of about 33%, and purging the rest of T-Mobiles infection by installing CyanogenMod, I have seen the light. My phone runs faster, has a longer batter life and is more useful.

What the carriers are providing isn't a value add, it is a value minus. T-Mobile's "features" actually made the user experience *worse*. From what I've seen of Verizon and AT&T, they rate right down there with T-Mobile for value. They exist on inertia alone and commodity status awaits.

Microsoft

Journal Journal: Microsoft Meh 2

It's a tablet, it's a netbook, it's the best of both!

Not.

When all you have is a hammer, every problem looks like a nail. Microsoft seems to be making the mistake that tablets are going to fully replace PCs. They aren't. They, like phones, are going to compliment them. Each is a different tool with different strengths and weaknesses.

There is a reason people don't use iPads and the like for serious spreadsheet and keyboard-based work. They aren't designed for it. Slapping a keyboard in the cover isn't going to change the fact. You can already get keyboards for the iPad and Android tablets.

Yes, they work in limited scenarios, but that doesn't mean people are going to give up full tactile respone and 27" monitors when doing long typing sessions. You think people have issues with carpal tunnel syndrome NOW, wait until they're doing all their typing on one of those things!

Most typical office tasks involving the classic Office suite of products aren't going to change. Those tasks still need to be done, and spreadsheets, word processors and heavy data entry aren't going to disappear anytime soon.

It is the software that drives the hardware. Microsoft knows it. Ballmer's famous "developers, developers, developers" chant is proof of it. Apple knows it, too. This is why they continuously tout the number of apps available for the iPad. And it is why, despite my dislike of Apple's walled-garden approach, I'm getting an iPad. There are apps there to support private pilots that just don't exist on Android (or Windows 8). LOTS more.

Microsoft pushed tablets for over a decade. They didn't sell. Microsoft's interface and applications don't work well in touch format. Windows Metro may change the OS interface, but I fail to see how data-entry heavy applications like Word and Excel are going to work any better than in the past.

Microsoft will sell a bunch of these, simply because they'll most likely dump a wad of cash into promoting them. But, unless they come up with more compelling reasoning that "you don't have to give up Office" for these, I can't see them passing Android or Apple on the sales charts.

Government

Journal Journal: TSP Epic Password Fail 2

TSP stands for Thrift Savings Plan. This is the 401(k)-equivalent that gov't employees can utilize. It is popular.

In April of 2012, the Federal Bureau of Investigation (FBI) informed the FRTIB (FEDERAL RETIREMENT THRIFT INVESTMENT BOARD) and Serco that in July of last year, a computer belonging to Serco, a third party service provider used in support of the TSP, was subjected to an unauthorized access incident. This incident resulted in the unauthorized access to the personal information of 123,201 TSP participants and payees. When the TSP learned of the cyber attack, we took immediate steps to investigate and notify our participants and other affected individuals.

The TSP notified their customers on June 1 of 2012 of the hack that occurred on July of 2011, but they only learned about sometime in April of 2012.

So off I go to change my password and what to my wondering eyes should appear? The following constraints:

1. Contain exactly 8 characters
2. Contain both letters and numbers
3. Not match any of your last four passwords
4. Not contain special characters.

And for "security tips" they have:

1. Create words or phrases by combining letters and numbers (golf4fun)
2. Substitute letters for numbers (5 for S or 3 for E)

Screencap of password page: https://plus.google.com/photos/108320036461391153047/albums/5752480492680965105

TSP announcement: https://www.tsp.gov/whatsnew/plan/planNews.shtml#pii

I'm on a password changing kick, using 12-20 character snippets from GRC's Perfect Passwords. Needless to say, TSP choked -- and so did I.

It sounds to me like it is tied directly to an old mainframe account, but there is no excuse for this level of sloppiness.

I thought you all would find it entertaining -- or frightening if this is where you have a chunk of your retirement funds set up.

Transportation

Journal Journal: Private Pilot Exam -- Passed 1

Yay! I passed the FAA written Private Pilot exam! Now to get some hours in and solo!

I'm on my way to telling the TSA to GFY and still be able to fly somewhere!

China

Journal Journal: Dozens Arrested After Riot at Foxconn Factory 5

Dozens of workers at a Foxconn plant in Chengdu, China were arrested this week after a clash with security staff, according to a report.
Taiwan-based Want China Times (WCT) reported that the clash broke out Monday night at a male dormitory for Foxconn workers. Security guards had attempted to stop a thief, when several employees with grudges against the officers forced them away.
The situation rapidly escalated, and up to 1,000 workers eventually joined in.

How long before the Chinese workers form real unions and clash with the gov't? That would be ironic. A communist gov't fighting a union.

http://www.pcmag.com/article2/0,2817,2405383,00.asp

Space

Journal Journal: The Transit of Venus in HD 1

In case you missed it, and don't want to wait a bit more than a century to see the next one, NASA took some pictures of the recent transit of Venus across the Sun.

Using the Solar Dynamics Observatory, launched in 2010, NASA captured multiple-spectral video and has put together a fantastic montage.

YouTube has a quickie version for the impatient, but if you want to see the really beautiful stuff, check out NASA's Goddard Multimedia site. The videos go up to 1280x720, 59.94 fps and clock in at up to 2 Gb in file size. There are also high definition stills galore.

The videos are all in the public domain. Share and enjoy.

Ubuntu

Journal Journal: Precise Upgrade Hell 7

Long rant condensed down for posterity.

Upgrading a working Ubuntu 11.10 to 12.04 broke the USB wireless and refuses to install the AMD proprietary driver. No, I'm not the only one with this problem. No, I can't use the OSS drivers because this is a flight simulator computer and I need 3D screen updates faster than I can draw them by hand.

Canonical has flat out neutered Linux. The penguin has lost his mojo.

1. The tool to modify the boot config has been removed in 12.04. And for the life of me I can't find the menu.lst file for grub. In order to allow me to boot to a different kernel I had to add a repository and install a 3rd party grub editor.

2. The Gnome terminal has horrible usability. The right, left and bottom borders are 1-pixel thick. You need to be exact with the mouse to grab the edge to expand it. And, to make it more of a challenge, if you move the mouse to the right edge a mini scroll bar pops into existence and takes over.

3. For some reason the linux-headers file is marked as x86/64. I didn't know source code was different for x86 and 64-bit! (Hint: It isn't) Since it is, the modules for fglrx (AMD graphics card) won't rebuild because the source installed doesn't match the running kernel! From what I can tell, this is a 32-bit specific issue. Thus I can't easily fix the graphics driver issue without re-installing the entire OS in 64-bit mode.

Since the software (X-Plane) is 32-bit and all I have is 4 Gb of RAM, I didn't bother.

I understand why at the last three places I worked (all 5,000+ employees) the only Linux in use was Red Hat Enterprise Linux, with Fedora for testing or playing around. QA at Canonical is a fucking joke.

Canada

Journal Journal: My new career path. 24

More here.

As a bonus , I'll probably soon reveal the unbelievable story of how I acquired my legal knowledge - by doing something nobody else ever has, and which, until now, would be considered pretty much impossible.

I'd rather not, because there is some danger involved, but it's necessary to achieve my goals in an open and transperent fashion.

Advice and help sought and welcome.

Open Source

Journal Journal: Yet another open source failure 14

Trying to print an envelope address in openoffice under linux? What a waste of time.

Do the people who code this sh*t actually ever use it? Or do they never use anything else, so they simply don't know that it's possible to do better?

Easy prediction - open source will never be competitive. When it's so bad that I'm tempted to throw a copy of XP (or even Wn95) on the box because linux on the desktop is still 2 decades behind the times anyway, there's a fundamental problem that obviously will never be fixed.

I really hate them, but my next computer is going to be a mac.

The Internet

Journal Journal: Every browser is *still* broken. 17

After 15 years, we still don't have an un-b0rked browser. CSS 2.1 was done in 1997, and yet firefox, opera, chrome, arora - they all render differently for non-trivial layouts.

15 years, and they still can't get the basics right. It means that the problem is not the implementation, but the underlying concepts that are flawed in fundamental ways.

And there's no blaming Microsoft or Apple for this fiasco.

No, we did this to ourselves. We're all suckers. The people setting the standards did it wrong, and we didn't immediately stone them to death, salt their fields, enslave their families for the next 3 generations, and all that other "Carthage must die!" goodness.

So we have let ourselves become slaves to stupidity.

What a waste of time, energy, brain cells, and just general aggravation. Have fun with html5 + css3, folks - you'll never see it finished in your lifetime, not even if you live for another 100 years.

Apple has it right - apps, not a stupid one-size-fits-nada web browser. Just like they have it right about not releasing stuff until it's good and ready.

Stupid browsers. Stupid us.

User Journal

Journal Journal: Getting a Job 4

Someone on Slashdot recently claimed I hadn't read Keep the Aspidistra Flying because I thought the ending was depressing. After I finished my PhD in 2007, I've managed to avoid the same fate and have successfully avoided having a real job for almost five years. I've done freelance programming and written four books, and had a lot of time to post on Slashdot (as you can tell from the fact that, so far, I've posted more than anyone else this quarter) and do open source stuff (Ohloh ranks me in the top 2,000 geeks with no life^W^W^W^Wopen source developers).

That's about to change though. I had two interesting job offers recently (I seem to get job offers from banks very often, but I have a very low tolerance for tedium, so I'd probably have been fired around day 3 if I'd taken any of them). One was from Google in Paris (yay!) but working on boring things (boo!). The other was from Cambridge University, which is about as well paid as you expect in academia (aww!) but basically involves working on the same stuff I do for fun (yay!) with some very intelligent people (yay!). Oh, and it's in a city where a quick search found four tango classes (yay!) and property prices not much lower than London (oops!) and which is both small and flat enough that I can cycle everywhere (yay!) and so does everyone else (look out!).

So, in a few weeks I'm moving to Cambridge. I'll miss looking out at the sea, but being able to dance tango more than once a week should be some compensation. There also seems to be a lively salsa scene, although having to learn yet another set of names for the same Rueda steps is going to be a little tiresome...

When I visited, I went for drinks with some of the makerspace guys the night before my interview (I have no idea how much I drank, but it didn't seem to affect my interview performance too badly...) and met someone who worked on the C++11 atomics spec (which I was in the middle of implementing at the time) and someone who had ported 2BSD to a 32-bit PIC with 128KB of RAM, so it definitely seems like a city with no shortage of geeks...

Programming

Journal Journal: NoSQL+ sprintf() == better. 7

Old technology doesn't die - it get re-implemented when newer ways get too bloated and turn everything it touches into Beavis and Butthead.

In the dying days of the last century (awk! - how time flies) I used to do web cgi using c, same as a lot of people. Used malloc and sprintfs() to insert variables into a "template" and then printf()s to output. It was easy to track memory allocation for such cases, so the whole "OMG you'll leak memory" issue was a non-starter.

And then along came the attack of the killer web scripting "pee" languages - php, perl, and to a lesser extent, python. The concept of a "templating language" evolved and eventually we ended up with "templating engines" - megabytes of code to make up for the shortfalls of the approach.

For example, output buffering. php includes stuff like ob_start() because even one stray newline emitted will prevent you from setting cookies on the client. c/c++ cgi programs didn't worry about a stray newline being output by an #include file because only printf() and putchar() would actually write stuff to stdout - so as long as you were just sprintf()ing to your format strings you were all good. In php, even one space before the opening tag or after the closing tag in index.php and you're hosed for sending cookies (which is why you should always omit the closing tag - the spec allows it).

Another advantage was that the ONLY character you needed to escape in any file you loaded as a template as a sprintf format string was the % symbol. No worrying about single or double quotes, angle brackets, or whatever.

For user input, the only sanitation needed was the left and right brackets (to prevent someone from entering raw html, such as script tags) and, again, the % symbol. No "escape_string", no "real_escape_string", no "really_really_escape_string", since the data was stored and read w/o needing sql.

In terms of performance and memory use, sprintf() easily beats regexes. You really can't help but notice the difference. And it sure beats the so-called "compiled templates" produced by templating engines like smarty.

Yet another advantage is portability - any language that supports sprintf() can be used w/o modifying your template files. This means that if you need the best possible performance on some really really HUGE files, you can always do it directly from a shell in c, or if you're so inclined, java.

So I decided to re-implement my old approach from scratch yesterday in a couple of hours in php. The entire code - including for variable range-checking, reading and writing data (strings and arrays), meta tag files, html, reading and parsing config files, getting and setting cookies, posts and gets along with verification and using sane defaults and coercing the values to those default types, loading templates, creating those little "go to page 1 2 3 4" clickies for larger web documents and everything else, is under 9k, including the site's index.php file.

THAT is a lot more maintainable than the 1.1 meg download for smarty templates (and smarty doesn't do the reading and type coercion from the client or the minmax range checking or some of the other stuff).

So, +130 files for smarty, or 2 for the old way (and one is index.php,so it really doesn't count ...)? Oh, and the template files look a LOT cleaner. For example, no embedded program logic like {include file='whatever'} in the templates, so stuff like

<input name="first_name" value=$smarty.get.first_name> // no default values!!!
<input name="last_name" value=$smarty.get.last_name> // no type coercion!!!
<input name="address" value=$smarty.get.address>
<input name="city" value=$smarty.get.city>
<input type="submit" value="Save">
<input type="reset">

becomes:

<input name="%s">, etc ...

... so your template looks like this instead:

<input name="first_name" value="%s">
<input name="last_name" value="%s">
<input name="address" value="%s">
<input name="city" value="%s">
<input name="age" value="%s">
<input type="submit" value="Save">
<input type="reset">

and your index.php file looks like

<?php
$BASE = '../'; all files live outside of public_html space
include "$BASE/php/libfoo.php";

$HTML = read_tpl("test_page"); // read_tpl automatically prepends "$BASE/tpl/", appends ".tpl" extension.

$css="my_skin_2";
$js = "new_js_lib";

$head = read_tpl("head");
$meta = read_meta("test_metadata");
$desc = $meta[0];
$keywords = $meta[1];

// want to test a new skin, new javascript libs
$HEAD = sprintf($head, $desc, $keywords, $css, $js);

$form = read_tpl("junk");
// get, post, cookie, gpc_pg, etc all sanitize the %, < and > symbols.
// also use an optional default value, and coerce any entered data to that type,
// so, if you ask for an integer and specify -42 as the default, anyone entering "FOO" returns -42
$first_name = get('first_name', 'Enter first name here');
$last_name = get('last_name', 'Enter first name here');
$address = get('city', 'Enter address here');
$city = get('address', 'Enter city here');
$age = get('age', -1);

// do any additional validation, data manipulation, etc.
// no need to do output buffering ... it's all in memory until you do the next line.
$FORM = sprintf($form, $first_name, $last_name, $address, $city, $age);

$footer = read_tpl("footer");
$FOOTER = sprintf($footer, "have a nice day!");

//okay, now write the whole thing
printf($HTML, $HEAD, $FORM, $FOOTER);

There is zero programming logic in the template itself - and that's the way it should be. Templates like smarty fail in the "presentation should be separate from code" department.

Plus, since most templates won't include variable names. they're pretty generic, again promoting template re-use. The footer, for example, could contain the output of several other templates instead of a simple message, and you'd never touch the main page template OR the footer template.

Government

Journal Journal: Ron Paul Hits 50 4

50 States, that is. He is the first of the Republican candidates this year to get on the ballot in all 50 States. Paul was also on the ballots of Puerto Rico, the Virgin Islands, the District of Columbia, Guam, the Northern Marianas and American Samoa.

While it is expected Mitt Romney will match this easily, neither Rick Santorum nor Newt $50-for-a-snapshot Gingrich can.

While RP has a whelk's chance in a supernova of winning, I believe this is another show of "I have enough resources to hamstring you people if you jerk me around".

Might as well go out with a bang!

http://www.huntingtonnews.net/27524

Slashdot Top Deals

6 Curses = 1 Hexahex

Working...