James' Tech Blog

Acer E5-575-57a4

by on Dec.05, 2016, under Uncategorized

Running log of what I did:

BIOS set password and disable secure boot. Change touchpad to basic.

Per manual condition battery; 3 full charge cycles 

Boot System Rescue CD into cache. 

Unsquash dev loop into dev shm

While true; do tar cf – unsquashed/ pipe pigz -9 /dev/null

Leave a Comment more...

High battery usage mediaserver

by on Mar.26, 2013, under Uncategorized

I noticed on my gtab2 that the mediaserver process was using >37% of the battery. Searching the web doesn’t provide much, but that it’s probably hung up trying to scan some file. Great! I’ve got a bunch of MP3s on the SD card.
I wasn’t able to quickly determine what file it’s choking on. Online advice basically says you have to eliminate files 1by1. Very tedious for a large number of files!
I had a hunch it was the BMP cover art files I had on there. I deleted them all and the usage dropped to ~3%. Not bad! I can live without album art on there. Problem solved!

Leave a Comment : more...

Dockstar Debian VS. OpenWRT

by on Dec.08, 2010, under dockstar

So why would anyone choose debian over OpenWRT on their Seagate Dockstar? Why go with OpenWRT? Let me clutter the internet with my opinions:

Why Debian:

You can make an actual “computer”. All you need is either some kind of USB LCD or USB VGA adapter and you have a display pretty easy. Well, LCD would not be that practical, you might as well have OpenWRT then. Some guy got on engadget for doing this. Big deal, I hacked an Xbox powersupply to power my dockstar and 2 harddrives! Come on engadet!!!

You want to use programs that aren’t compiled for OpenWRT. In my case, there is no mythtv package for OpenWRT let alone all it’s dependencies.

You feel more comfortable with a “real” distro. OpenWRT is real, but debian is meant to be played around with so it’s geared toward the “middle-of-the-road” end-user.

You have some special USB gadgets that require kernel modules that OpenWRT doesn’t have.

Why OpenWRT:

It will fit many times over in the NAND! Even with a lot of packages it will only take 8MB. This leaves more USB ports open for drives. Also, you don’t need to worry about the bootloader cause it’ll just boot the NAND.

You’re making a headless server, like how it’s supposed to be. Even using a USB drive, you can make a pretty robust server out of these things. I think I saw someone use it as an asterisk backend. If all you want is file and print sharing debian is total overkill (so is OpenWRT).

With the right wireless adapter you could turn this into a wireless router with a gigE port.

You want a proxy on your network. You could easily set this up using squid. If all you needed was a proxy, again, debian would be overkill.

You know what you’re doing and know that OpenWRT is really flexible, especially if you have the build system setup.

Otherwise, it’s not really going to matter. Debian isn’t built with all the gcc flags that could speed up programs or reduce their memory requirements, I’m not sure if OpenWRT build with a lot either probably just -Os for smaller binaries. The only way you’re going to see a lot of improvements is if you use NAND instead of some slow USB harddrive. Well, add your opinions in the comments!

Leave a Comment :, , more...

How to update Mythvideo file titles

by on Sep.13, 2010, under Uncategorized

The title of the post is a little confusing, I’ll admit that straight away. Here is the problem. I had a bunch of series AVI files name as such: 101.avi 102.avi 103.avi … ad nauseum. This was great, but episode titles make it easier to pick out which one I really want to watch. Especially when I’m using UPNP. So I renamed all my files to be like 101.Rose.avi. Great, super easy to tell what the episode is about!

Good thing mythtv is smart and made hashes of all the files. Now it knows that 101.Rose.avi might as well be 101.avi. Awesome! If I had trailers, poster-art, and other metadata it would be right there with the files with new names. Unfortunately, what it didn’t change was the title. So when I look at my videos in mythfrontend 101.Rose.avi is called 101. The titles didn’t update. Well, this is good behavior. If we’re going to track which file is which by hashes, then we don’t want to change the title just because the filename changed (or path I’m presuming).

This is not the behavior I wanted though. I searched a little bit, but couldn’t find anything. I did find out the structure of videometadata though. That gave me the clue to just write a script to update the titles based on the filenames. Here we go, in glorious PHP:


//replace master_IP with your MySQL IP address and password with whatever your password is
$con = mysql_connect("master_IP","mythtv","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("mythconverg", $con);
//if you want all the files the next line is good. Otherwise see line after that
$myquery = "SELECT intid,title,filename FROM videometadata";
//I did it for a subset of files which is why I used LIKE to match part of the path in the filename field
//$myquery = "SELECT intid,title,filename FROM videometadata WHERE filename ". 'LIKE "%who%"';
$myquery_rows = mysql_query($myquery);
while ($myrow = mysql_fetch_array($myquery_rows)) {
//update query
$new_title = substr(basename($myrow['filename']), 0, strrpos(basename($myrow['filename']), '.'));
$up_query = "UPDATE videometadata SET title = '" . $new_title . "' WHERE intid = '" . $myrow['intid'] . "'";
print $up_query;
//mysql_query($up_query); //uncomment this after you're satisfied with the output
}
mysql_close($con);

To protect the innocent I have it just print what it would change the titles to. All you have to do is uncomment the mysql_query line. Sorry the code plugin I have squashed my tabs. Not a deal breaker, but it would be easier to read. Also, the code plugin doesn’t like php tags you’ll have to add them. The next script is probably the one you want to run first. It just prints the intid, title, and filename (which in my case included path) for each file. This is handy to see if the filenames/titles match. Also, to see if your update went well.


$con = mysql_connect("master_IP","mythtv","password");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
mysql_select_db("mythconverg", $con);

//if you want all the files the next line is good. Otherwise see line after that
$myquery = "SELECT intid,title,filename FROM videometadata";
//I did it for a subset of files which is why I used LIKE to match part of the path in the filename field
//$myquery = "SELECT intid,title,filename FROM videometadata WHERE filename ". 'LIKE "%who%"';
$myquery_rows = mysql_query($myquery);
while ($myrow = mysql_fetch_array($myquery_rows)) {
  print $myrow['intid'] . " | " . $myrow['title'] . " | " . $myrow['filename'] ."\n";
  }
mysql_close($con);

Please don’t go running amok in your database and blame me for it getting screwed. Use mysqldump before running the update script. Although it should be pretty innocuous because you can always use mythfrontend to rebuild the videometadata database. Though you would lose any metadata you had input for your files. Happy hunting! Maybe I’ll port this to a proper scripting language like PERL or python. Or maybe someone’s nice enough to do it for the rest of us???

Leave a Comment :, more...

Xbox Dockstar (another late night post)

by on Aug.28, 2010, under dockstar

By now you’re probably wondering what’s going on with my Seagate Dockstars. Well, the answer is awesomeness. Jeff has done a great job and built an updated U-Boot. This should take care of chainloading U-Boot. AKA I could install OpenWRT to MTD3 and pretty easily change what’s booting. He added netconsole support so I (or anyone else) don’t need the serial cable. You can get to U-Boot over the network.

Okay, what’s been going on on my end? I have gone through a couple revisions of how to power my Dockstar. First I made a switch-box that I could control power to the Dockstar and WD Elements. I cut up my AC adapter for my EEE 900A because it is 12V 3Amp. This is perfect for powering both the Dockstar and WD Element USB hard drive. One switch for Dockstar and one for WD Element. This way I could power them on and off independently.

Power switch-box

Power switch-box

I have a couple old Xboxes from my days of Xbox hacking. I ended up with a mobo that didn’t have RAM. I was going to use the power-supply to power my beagleboard and a hard drive or 2, but that’s still in the works. I clipped the mobo connector off and soldered it up to a cheap perf-board. I hooked up a switch to the standby voltage and the on pin. This way I have a switch to turn on the power-supply whenever I want. You can see both in the picture below. I also tied in the original case fan. I’m pretty sure I’m going to need it.

Xbox PSU

Version 1.0 Xbox PSU

You can already see my Dockstar in the case along with the WD Element board. I used a SATA extension cable to hook up the hard drive and the board. I hooked up the power supply to the hard drive. I cut out part of the HDD tray to accommodate passing the SATA and power to the drive. There was not enough room behind the drive for the USB board and also getting power from the PSU means I had to do it this way.

Hard drive tray

Cutout in hard drive tray

With the HDD settled I added a plug to the 12V rail to power the Dockstar and WD Elements board. The USB board shouldn’t be drawing a lot of power off the 12V now. I’m pretty sure it’s fine off the USB port power, but I kept it connected to 12V. The Dockstar shouldn’t be pulling a lot off the 12V rail either. I’m pretty sure the original AC adapter was either 1.5 amps or 1amp. Yeah I know I switched wire color, but I made it so I know it’s 12V and also I didn’t have any yellow wire.

Power plug for switch-box

Power plug for switch-box

You can see my serial cable coming out the top. I had mentioned it in a previous post. Here are some pictures. First some of you might be wondering how to open a Seagate Dockstar. It’s super easy! If you squeeze the sides a little there will be room to jam in a guitar pick. You could use whatever you want, but a guitar pick is probably safest. Then gently pry around the edges till it comes apart.

How to open Seagate Dockstar

How to open Seagate Dockstar

Then it looks a little like below. The board is screwed down to the bottom and the top just has the mini-USB cable attached. To connect to the serial pins I used a 3 wire cable that probably came off a mobo (used to hook up to audio headers on the mobo). I removed the mini-USB port from the Dockstar cause at this point I don’t need it and also I wanted to feed my serial cable out neatly.

Serial cable attached to Dockstar

Serial cable attached to Dockstar

I got a FTDI USB-to-serial cable to interface with the Dockstar. I made a little header board to connect my serial cable and the FTDI cable. It’s not a 1-to-1 hookup, but it’s close. I only had to jump one pin, the TX.

TTY header board

Serial Port to USB header board

Okay, with all that done. It’s time to throw it all in the case and hope for the best. For the second HDD I used a Bytecc USB to eSATA bridge adapter. This is a pretty good shot of all of what’s going on. I have a ethernet cable coming out the back where it would have for a real Xbox. I fed the serial cable and a male/female USB cable out one of the control port openings. The second HDD is a 1TB WD10EACS 7200RPM and I think 64MB cache. It’s a beast of a drive. I’m hoping it’s faster than the one from the Element. That brings me up to 2TB with the possibility to add more outside the case quickly/easily.

Open case of Xbox Dockstar

Open case of Xbox Dockstar

I think the Xbox PSU is probably maxed out. I know it’s got something insane like 13amps on the 5V, but I think it’s only got a few on the 12V rail. There is a good possibility that I could swap one of the HDD for a DVD-burner though. I have a PATA drive and a crappy USB to SATA/PATA adapter. The SATA just plain doesn’t work, but the PATA works just fine. I don’t remember the brand, but it’s got a JMicron 20337 chip in it that totally sucks!

DVD-RW PATA to USB

DVD-RW PATA to USB

What do I have in mind for future hardware mods? Hopefully get a PSU from mini-box.com. They have some good PSUs that would easily fit in the Xbox case and provide enough power for what I’ve got. Maybe even both HDD and the DVD-burner. Who knows?

Leave a Comment : more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...