In order to upgrade the hard drive,
the first thing I had to do was get my current disk space
consumption down to around 16GB (which is the maximum size
of a memory stick that I own). I offloaded all of the
videos, MP3s, and pictures. Then I deleted all of the
demos and some of the DLC (that I could re-download
later). I then created a backup of my current drive
using the handy utility from the Sony XMB. I used a
memory stick as my backup device:
The hard drive is held in the chassis by 6 small Phillips-head
screws. You'll need a good Phillips 1 screwdriver and apply a
bit of pressure to get the 6 screws loose (they are cranked on
there pretty tight). Remove the stock hard drive from the
chassis and put the new one (pictured below) in its place:
Insert the hard drive chassis with the new hard drive
back into the PS3, slide the chassis toward the back of
the PS3 to lock it into place, then screw in the blue
colored Phillips-head screw to secure it. Reattach the
access cover. Power up your PS3. The PS3 will detect
the new unformatted drive and prompt you to format it.
Select "Yes". Wait a few minutes and then the PS3 will
reboot. Then restore the backup from the memory stick
(which, for me, took about half an hour). Finis!
:: Posted by
rus on Thu, 17 Sep 2009 11:43 pm
:: Filed under
/tech
Ubuntu Tech Tip: Fixing Camera "could not claim usb device" Errors
Once in a great while when I connect my camera to my
Ubuntu
desktop, I'll get an error code "could not claim the usb device". Usually
I bypass this annoyance by logging out and logging back in again, but today
I decided to google around and I found a fix.
The first step to fix the problem is to find out the hexadecimal vendor ID
and hexadecimal product ID of the camera. To get these, type
lsusb at the command prompt, like so:
-
% lsusb
Bus 007 Device 013: ID 04a9:3113 Canon, Inc.
The vendor and device IDs are shown in red above and are delimited with
a colon; the vendor ID is the first hexadecimal number and the product
ID is the second hexadecimal number. Now open up the file
/etc/udev/rules.d/40-permissions.rules and find the
USB device section. This section will be demarcated with
"usb_serial_start" and "usb_serial_end" lines and look something like
this:
-
# USB serial converters
# USB serial converters
SUBSYSTEM=="usb_device", GOTO="usb_serial_start"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GOTO="usb_serial_start"
GOTO="usb_serial_end"
LABEL="usb_serial_start"
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", \
MODE="0660", GROUP="dialout"
LABEL="usb_serial_end"
Just before the "usb_serial_end" line, add the following:
-
ATTRS{idVendor}=="vendor_id", ATTRS{idProduct}=="product_id", \
MODE="0666", GROUP="plugdev"
In my case vendor_id is '04a9' and product_id is '3113'.
It's all better now... sweet!
(Update Tue May 5 09:26:20 PDT 2009 // fixed html validation errors... oops)
:: Posted by
rus on Tue, 28 Apr 2009 11:51 pm
:: Filed under
/tech
Streaming Media Content to a Sony Playstation 3 from a Linux Desktop
The "Find Media Server" menu items on my Playstation's XMB
(XrossMediaBar)
have been teasing my curiosity lately.
I have a fairly large repository of media available on my desktop
computer... about 20 GB of family pictures, 16 GB of music ripped
from my less-than-impressive CD library, and a handful of DVDs
encoded to DivX (for my own personal purpose of creating a backup
copy of course!). So it would sure me nice to access that content
on my PS3 over my home network now wouldn't it?!
One possible problem... my music and my videos are located on my
desktop computer running (Ubuntu) Linux, and my pictures are located on
my home file server running FreeBSD (NFS-mounted on my desktop). I
can access this media on other (less reliable) platforms using SMB
shares, but accessing SMB shares is not supported by the PS3. Drat.
(Actually not supporting SMB shares is probably a good thing... it is a
messy ugly protocol.)
Enter MediaTomb, a free open source
(GPL) UPnP media server that supports a variety of UPnP compatible
devices... including
the Sony PS3. MediaTomb runs on a variety of platforms, most notably
Debian and Ubuntu. Seems like a perfect fit!
Download and installation of mediatomb was
pretty easy. I just added the appropriate deb line ("deb
http://apt.mediatomb.cc/ gutsy main") to my sources.list and then
installed it via Ubuntu's "Add/Remove..." GUI interface. I
had to modify one line of the config file to add support for the PS3
(I did this according to the instructions found in mediatomb's on-line
documentation). Once installed and configured, I
started the mediatomb server by simply typing the command
"mediatomb &" at a command prompt. This launched the
media server... and it was running in the background listening for
connections.
To add content to the server, access mediatomb's web interface
available on port 49152. There is a handy menu item Ubuntu
automagically installs in the "Applications -> Sound & Video" menu
that can be used for this purpose... or just type
"http://127.0.0.1:49152/" into the address bar of a web browser and
create a bookmark in your browser for future easy access.
Adding media content to the mediatomb server is an easy point/click
process... as easy as surfing around any web site on the net.
Nice and simple. I added my mp3 albums directory, some photo albums,
and a couple of DivX movies. I then went upstairs, fired up the
PS3, and clicked on the "Find Media Server..." menu item. After
about a 10 second search it found the server and all of the content.
The MP3 music, JPG photos, and DivX videos all
appeared under the "MediaTomb" media server in the Photo, Music, and
Video menus (respectively) on my PS3... and stream over the (wired)
home network on command. Sure, the DivX movies are pretty blocky on
such a large screen (1080 lines of resolution on the TV compared to
about, oh, 300 or so on most of the DivX movies)... but it's still a
pretty darn cool trick! Thanks mediatomb (and Sony)!
:: Posted by
rus on Thu, 13 Mar 2008 11:42 pm
:: Filed under
/tech
Streaming with Amarok and Nullsoft's SHOUTcast Server
I continue to fiddle with
amarok,
my new desktop computer music player. When I showed my wife the
"Now Playing"
feature I added to my blog last week, she immediately asked how she
could "listen in" - I didn't have an answer for her. That is... until
today!
I found and downloaded a script plug-in called
Amarok Shouter
that I installed on top of my Ubuntu desktop. After running a few
commands and modifying one file to get the shouter plug-in running
(hat tip: the amarok shouter plug-in message boards),
I was able to start up a shoutcast stream of my music on my computer
and broadcast it out on the LAN. It was pretty cool to set a playlist
on my desktop, and then load up the stream in iTunes on the MacBook in
the other room. The song came streaming over just fine complete with
artist and title information for each song.
I can have as many listeners to my stream on my LAN as I want (my home
network is 100Mbps), but my Internet provider (Comcast) limits my
outbound bandwidth quite significantly. Since I work from home, I
can't have all my outbound bandwidth gobbled up by stream listeners.
Enter the Nullsoft SHOUTcast Server
(or Distributed Network Audio Server). Running the SHOUTcast Server
on a computer outside my home network, I can (in theory) relay my desktop
stream and have as many listeners as I want (well... within reason)
without ever having more than one listener gobbling up my precious
outbound bandwidth here at home. The SHOUTcast Server opens a
connection to my desktop computer here at home, listens to my
desktop stream, and then relays the stream out to any person on the
Internet who cares to listen.
Well... that's the theory anyway. But my on-paper solution didn't
quite work out of the box with the Amarok Shouter plug-in. But, I'm
happy to report that after some tweaking I was able to get it to work.
For any other Amarok Shouter user out there, here is what I did.
First, set up the Amarok Shouter stream using the
"Configure" capability of the Amarok Script Manager. Add one stream
and accept the default mount point "amarok".
Close out the GUI interface, launch a command line terminal, and cd to
the "~/.kde/share/apps/amarok/scripts-data/" directory.
There should be a shouterrc file... find it and open it.
In this file, find the mount point for the
amarok stream ("mount = amarok") and remove the mount
point name, leaving it blank. The shouterrc file should
now look something like this:
[Server]
desc1 =
desc2 =
url = http://rus.berrett.org/
max_clients = 12
icy_interval = 16384
publish = 1
chunk_size = 524288
dl_throttle = 20
port = 8000
buf_size = 4096
[amarok]
name = Live Stream From Rus Berrett's Desktop Computer
mount =
random = 0
stream_type = 0
stream_type0_arg =
repeat_tr = 0
genre = Mixed
stream_type1_arg =
stream_type2_arg = ~
stream_type3_arg = ~
repeat_pl = 1
Now the SHOUTcast server (running out on the Internet somewhere with a
big fat pipe) will be able to make a single connection to the stream
created by the Amarok Shouter script. To use the SHOUTcast server as
a relay, simply set the "RelayServer" and
"RelayPort" to the appropriate values (e.g. the WAN IP
address at home and the port the Amarok Shouter script is using). If
applicable, be sure to configure the home firewall/nat router to
forward port 8000 traffic to the appropriate LAN IP address. Easy
cheesy.
After all that, a stream of the music playing on
my home computer is available to anyone who would like to
listen in.
Listening to my desktop computer stream on iTunes. Go to the "Advanced"
menu. Click on "Open Stream..." and type the following URL into the
text entry box.
http://shoutcast.berrett.org:8000/listen.pls
Listening to my desktop computer stream on Winamp. Go to the
"File" menu. Click on "Play URL..." and type the following URL into
the text entry box.
http://shoutcast.berrett.org:8000/listen.pls
Listening to my desktop computer stream on Windows Media Player.
Go to the "File" menu. Click on "Play URL..." and type the following
URL into the text entry box.
http://rus.berrett.org/blogmedia/audio/desktop_stream.asx
Have a look at
what is currently playing
before tuning in... I typically play a lot of classical music, Dead Can
Dance, Sigur Rós, and albums I've purchased from Magnatune. My
latest purchase is the
Once
Motion Picture Soundtrack, so that should be in the queue
somewhere. E-mail me your request. Heh.
(Update Fri Jan 4 22:51:11 PST 2008 // added Windows Media Player instructions)
:: Posted by
rus on Sat, 29 Dec 2007 11:40 pm
:: Filed under
/tech
Learning Ajax
A couple of days ago, I inserted
"Now Playing"
information on my blog. As I noted, it's not extremely useful (you
cannot "listen in") - it's just geeky. I added a bit of pizazz to the
feature by adding a pop-up "tooltip" that displays a list of detailed
information about the track currently playing. The information
includes the track title, the artist, the album,
track number, track length, and a jpeg image of the cover art as well.
Again... not extremely useful, just geeky. Go ahead and move your
mouse over the "Now Playing" graphic in the upper right corner of this
blog - then wait for half a second for the information to display.
The information in the pop-up window is populated via an asynchronous
javascript call to a CGI script that just dumps the contents of a text
file. There is nothing really novel about the system (it was extremely
easy to accomplish), but this is my first experience using
Ajax
programming. Learning Ajax is one of those items on my long "To Do"
list of stuff I should learn to keep my technical skills "fresh" (just
in case I never need to start "fresh" at a new company). So I'm very
pleased I got off to a successful start after only a couple of hours
reading some on-line tutorials.
If interested in the code that accomplishes the effect, then you can
view source... here are the relevant parts of the HTML:
<div id="nowplayingtooltip"></div>
<div class="nowplaying">What I'm listening to:<br/>
<a onMouseOver="getNewContent(); ddrivetip('loading... please wait')"
onMouseOut="hideddrivetip()" onClick="openWindow(this.href, 420, 180); return false"
href="http://rus.berrett.org/now_playing/"><img id="nowplayingimg" border="0"
src="http://rus.berrett.org/now_playing/nowplaying.png"></a>
</div>
My blog's javascript code is here.
The relevant section is labeled "ajax stuff".
Note: the pop-up includes a jpeg image of the cover art. But for
whatever reason the image is not displayed in MS Internet Explorer (5,
6, or 7). Not sure why. It works great in Firefox though. *shrug*
(Update Fri Dec 28 10:05:32 PST 2007 // my -> by)
:: Posted by
rus on Sat, 22 Dec 2007 11:02 pm
:: Filed under
/tech
Now Playing on Amarok
I have been having a lot of fun playing around with
amarok
these past few days, specifically the custom script support (open
source software kicks arse!).
I found a handy little amarok script called
"amarokNowPlaying"
that will build a PNG image of the currently playing song.
Furthermore, it will scp (of ftp) the image to any valid network
destination, e.g. a remote web server. At the top right of my blog you
can now review the currently playing track I'm listening to on my
desktop computer. Is that useful information? Probably not.
I'll work on streaming a podcast sometime in the future. That would be
cool.
:: Posted by
rus on Thu, 20 Dec 2007 11:53 pm
:: Filed under
/tech
Building Polaroid Thumbnails with ImageMagick
My brother Brent recently
(re-)started publishing to his blog.
He made a comment to me a few days ago about how much time it
was taking him to create a blosxom entry that includes images;
building the thumbnails, creating the html for the entry, etc.
He uses blosxom - the same blog engine that I use.
I told him about a perl script I wrote and have been using
("thumbs")
that will take a set of images and create small 100 pixel high
thumbnails and build a blosxom-ready text file with the html all
nicely built automagically.
Well, that was all well and good, but Brent had something better in
mind. He thought that it would be cool to have "polaroid-like"
looking thumbnails... like the ones shown in
ImageMagick documentation (see
here).
So over the past few evenings I set to the task of reading the
ImageMagick documentation and then converting my plain
'old thumbnail generating script,
"thumbs",
into one that would build cool polaroid-like thumbnails... complete
with a caption, the slight rotation, and the drop shadow. I'm happy to
report it is done... and I have rebuilt all of the previously published
entries in December (that included family pictures) to use the new
polaroid-like thumbnails. See
here,
here,
here,
here, and
here.
(Pretty cool eh?)
The script does little more than issue a handful of ImageMagick commands
in series. But hat tip to my brother Brent for bringing this capability
of ImageMagick to my attention. The script is yours to download if you
like, it is simply called:
"polaroids".
There should be enough documentation in the script itself,
but feel free to e-mail me if you have any questions.
Oh... the caption for each polaroid... what text is used for the caption
itself? The caption text is globbed from the "Comment" field embedded
within the jpeg image.
There are probably several programs on Microsoft Windows or Mac OSX
that you can use to set the Comment field. I don't know what those
programs might be because I use Linux on my desktop and FreeBSD on my
web server... so I use a command line tool called
"jhead".
To install jhead on the Ubuntu desktop, type this:
sudo apt-get install jhead
To install jhead on a FreeBSD server, then do this:
cd /usr/ports/graphics/jhead
sudo make install
To use jhead to set a Comment for a jpeg image, then type
something like this:
or for multiple images:
jhead will even preserve the file modification date when
writing the comment to an image. This is a nice bonus since I use a
script,
"touchjpgs",
to set the image file modification date to match that of when the photo
was taken. The file modification date is used by my
"polaroids"
script to build a file name for the blosxom text file.
Happy photo blogging!
:: Posted by
rus on Wed, 19 Dec 2007 11:45 pm
:: Filed under
/tech
Embedding Video in HTML Pages
One of the tasks that I have now that the
Skyline High School Class of
1987 Reunion is over is to showcase the Reunion DVD on-line
and allow people to order it. To showcase the DVD, I wanted to
include a little snippet of video embedded in the page. To do
this I figured that I needed to created a flash video snippet
from the DVD.
To rip and encode the section of the DVD I was interested in, I
used AcidRip (and the
Xvid codec). Then I converted
the avi file to a flash video file (flv) using the very handy
ffmpeg tool. For example:
ffmpeg -i video.avi -ar 44100 -f flv video.flv
where,
-i input file name
-ar audio sampling rate in Hz
-f output format
After I created the flash video file, I needed a flash player in order
to embed the flash video in a web page.
Fortunately, I found a free one called
FlowPlayer (that includes
plenty of well-written
documentation).
It works great... check it out:
Viva free software!
:: Posted by
rus on Thu, 02 Aug 2007 11:56 pm
:: Filed under
/tech
HDR Imaging
Inspired by a photo posted in a
blog
entry by Khan (that he took while vacationing in France),
I read up about the methodology he used to produce the photo -
High
Dynamic Range Imaging or HDR. If you like the very striking
picture that Khan took, then you will probably also enjoy these
two HDR photo sites:
This is my own first (poor quality) effort at HDR (click to enlarge):
You can see a bit of ghosting is present because I didn't keep the
camera completely still between the three exposures.
This is because I have not yet figured
out how to set up the exposure bracketing on my camera to take
three exposures with just one click of the button. (Note: I have
since figured out the bracketing feature of my camera... reading
the manual works wonders!)
Now compare the HDR image to the "normal" image taken at just the
one exposure:
To create the HDR image from the three RAW exposures, I used
Qtpfsgui on my
home office box running Ubuntu Linux. Qtpfsgui installed cleanly
(props to davromaniak.eu) and seems to work well. There are also
Windows and Mac builds of Qtpfsgui that can be downloaded.
(Update Wed Jun 27 16:03:29 PDT 2007 // updated for clarity)
:: Posted by
rus on Mon, 18 Jun 2007 11:56 pm
:: Filed under
/tech
New Ubuntu User
After trying in vain much of last night and tonight trying to get
the FreeBSD drivers to recognize the audio and network device on
my motherboard, I decided (with a heavy heart) to drop FreeBSD as
my primary desktop OS. My new box is dual-booting XP... and
Ubuntu v7.04 ("Feisty Fawn").
I'm now primarily a Linux user.
(I haven't abandoned BSD for Linux completely.
I'm still running FreeBSD on my file server and my backup
server.)
I'm very impressed with the Ubuntu "live disk" install
process. Everything seems to work great right out of the box:
the audio device, the network card, the dual-head display, DVD
playback, network printer discovery, ACPI sensor monitoring,
etc. After I downloaded
the Ubuntu ISO image and burned myself the install CD, I was up
and running in less than an hour. Wow.
I mentioned to Stacey that I have switched from Linux to BSD and
am now using Ubuntu and he said: "Get a real man's OS... like
Gentoo!" lol. I've heard
that the Gentoo install process is much like that of FreeBSD, e.g.
lots and lots of user input in a command-line type of interface.
Conversely, the Ubuntu GUI-based install experience is
quite minimal. I input my name, my preferred username, and about
7 or 8 other minor tidbits, and that was it. Everything else
was either pre-configured or was dynamically assigned based on
my network environment. I have since tweaked a few things, but
not much.
Just a bit of trivia... with Ubuntu on my desktop, my
home network composition is now much more diverse:
WinXP on my laptop (provided by work),
Win2K on Kristy's laptop (and my second laptop),
Mac OSX on the kids laptop, FreeBSD on the
file server and the backup server, and Ubuntu Linux
on my desktop. Quite a motley array of machines.
(Update Wed May 30 01:11:37 PDT 2007 // removed some artifacts)
(Update Wed May 30 01:11:37 PDT 2007 // added ACPI)
:: Posted by
rus on Tue, 22 May 2007 11:43 pm
:: Filed under
/tech
Second Life: First Impressions
A friend of mine has been sending me several articles over the
past few weeks about
Second Life,
a virtual world that has received a fair amount of media attention
lately, including the announcement of the
first person
to make 1
million dollars (US) from transactions made in the virtual world.
The entire concept of a virtual world with virtual property that can
be bought and sold (or rented out) in a virtual currency (pegged in
value to the US dollar) is nothing short of fascinating.
Tonight I signed on to Second Life (it's free for non-land owners)
to check things out. I teleported to IBM's HQ inside of SL as
well as a NASA museum thingy. Interesting stuff. But by and
large, I must admit that SL is rather boring. The virtual world
is vast, open, and strangely... seems largely abandoned. People
do congregate in certain areas, yet the vibe I get is that of an
on-line singles bar... and everyone (except me it seems) has a
custom set of clothes, hair styles, and animations. From a
personal standpoint, I'm not sure exactly where people find the
time for their second life. However, from a business standpoint,
I can see the opportunity for creative entrepreneurs that sell
virtual items to the persons controlling these on-line SL
avatars. Supposedly there are
millions of SL users,
each with his or her own stash of
Linden dollars.
:: Posted by
rus on Wed, 11 Apr 2007 11:48 pm
:: Filed under
/tech
Create PDF Documents On-The-Fly
One of the things that we are doing for the
Skyline High School Class of
1987 Reunion is compiling a journal that includes the answers
to a small questionnaire. This was done for the 10-year, but it
was all with pencil/paper and postal mail. The person who put it
together for the 10-year flat out refuses to do it again manually;
and I can't say I blame her. So, I suggested we offer the
questionnaire on-line and build the journal pages from the answers
on-the-fly (as PDFs or as HTML documents). We could even have the
classmate include a picture I promised.
At the time, I didn't really know how I was going to accomplish
the task, but I figured it wouldn't be that hard. Thankfully, it
wasn't. Using the PDF::API2 perl library and a very handy
PDF::API2 tutorial
as a crutch, I authored a web app that administers the
questionnaire, collects the answers, allows the user to upload a
picture, and then builds a PDF file that includes both the answers
and the picture. Picture placement is determined based on the
aspect ratio of the photo, and the font is resized incrementally
from 13-pt down to as low as 8-pt (if necessary) to fit everything
on one page. After the document is produced, the classmate can then
choose to make the document public or private... in either case, a
copy is e-mailed to the person compiling the journal. It's pretty
slick. Here is a
sample
of the questionnaire results (in PDF form) for review.
Source code is available upon your polite request.
:: Posted by
rus on Wed, 21 Mar 2007 11:04 pm
:: Filed under
/tech
Creating a Simple PayPal-Based Storefront
One of the things I've been doing in my spare time lately is
working on the Skyline High
School Class of 1987 Reunion web site. One of the apps that I
have written (from the ground up) allows alumni to send their
confirmations (or regrets) on-line. If it is a confirmation being
sent, then I display a "Buy It Now" PayPal button to allow the
person to pay with PayPal if he/she so desires.
So, in order to do this, I created a set of products that include
all the combinations of confirmation possibilities (with their
respective price points) - five products in all. This is pretty
easy for anyone to do, and you don't need a shopping cart... I
just used the
"Buy It Now" buttons.
What I wasn't aware of is the elaborate "sandbox" system, called the
PayPal Development
Center, that PayPal has set up to allow any user to test
out the payment processing system with any set of pre-configured
products. It is very handy and allows a developer to get all the
kinks of of the system while using quasi-cash, instead of the real
stuff.
PayPal also allows you to redirect the buyer back to a
specified URL after the transaction has been completed.
It is pretty easy to set up. Furthermore, there is a handy
Payment
Data Transfer mechanism that PayPal has put into place. With
just a little help from the LWP::UserAgent and Crypt::SSLeay perl
modules, I am able to retrieve a whole bunch of information about
the buyer's transaction such as the payment type, payment status,
payment date, payment gross, and payment fee after the buyer has
been redirected back to my script.
Contact me for source code if interested.
:: Posted by
rus on Wed, 14 Mar 2007 11:19 pm
:: Filed under
/tech
Embedding Audio in HTML Pages
I continue to work on content for the
Skyline High School Class of
1987 Reunion web site.
It's a fun little thing to do and gives me an excuse to reach out
and contact some of my old dear friends (for example, I spoke with
Tony Coombs yesterday... something I had not done since our 10-year
reunion).
One of the pages on the site that I have put together (and
referenced previously in my blog) is an
"In
Memoriam" page dedicated to classmates that have passed. I
decided today to dress it up a bit more by putting a bit of
music on the page... something that would cause a visitor to
perhaps stop, look over the names, and contemplate briefly on the
fragility of life. However, embedding audio can be tricky
business, especially in the cross-browser cross-platform arena
that is the World Wide Web.
Fortunately, I stumbled on a
great
tutorial about embedding music in html content, authored by
Thomas Boutell (of GD fame) that includes a link to download a
snappy little flash widget that will stream mp3 audio files.
If you visit the
"In
Memoriam" page, you can see the little flash widget embedded
in the lower left of the page.
(Update Mon Mar 26 14:26:53 PDT 2007 // changed link text for the benefit of Google)
:: Posted by
rus on Sun, 04 Mar 2007 10:42 pm
:: Filed under
/tech
Restoring Files on Windows XP/2000
My brother-in-law Scott wiped his "My Pictures" directory on his
wife's laptop accidentally. Um... oops.
The data wasn't listed in the Recycle Bin so it seemed lost to
the ether. He called me up last night in a fairly frantic state.
I told him not to do anything else on the computer (not even shut
it down) and bring it over. Years ago I had found this clever
little freeware utility to accomplish the task of "undeleting"
files from disk, but I couldn't remember the name. Fortunately,
google is my friend. I found the utility after a few searches;
it is simply called
restoration.
restoration is small enough to fit on a floppy and will
easily fit on a portable USB drive. It installs without any need
for a reboot. This is important because every action that
requires a disk write (such as a reboot/shutdown event) could
possibly access and overwrite free area of the disk that used to
hold crucial data that needs to be restored.
After Scott came over, we loaded up and ran the utility on his
laptop. The utility found a ton of stuff... and most, if not all,
of his deleted pictures (and video).
I mounted my laptop drive as a network
drive on his laptop and then he, for the next 6 hours (from 9pm
last night until 3am this morning), poured over
his disk using the restoration utility and restored about 5
GB of pictures and video. After he was satisfied that he had
grabbed everything he could, only then did he copy the
pictures he restored (and had saved to my laptop) back to his
own laptop. It is crucial when using the restoration
utility to copy the files to a
separate file system... either a different partition on the
same drive, a mapped network drive, or an
external local drive. If the file is restored to the same drive
where it was once located, then the disk write could be made on
the file system where other files are stored waiting to be
recovered. That would be self-defeating.
Note: restoration will only work on FAT, FAT32, and NTFS
file systems.
:: Posted by
rus on Sun, 25 Feb 2007 10:54 pm
:: Filed under
/tech
Creating Shortcut Icons in Mac OS X
I created a few shortcuts on the desktop for the kids account on
their new computer (running Mac OS X 10.4). The shortcuts are for
various internet web sites that include some flash games for the
kids to play... sites such as Kids CBC, PBS Kids, Thomas the Tank
Engine, Disney Playhouse, and Nick Jr. In order to differentiate
one shortcut (and thus one website) from another, I wanted to
create custom icons for each shortcut. For future reference, this
is how I accomplished the task:
- Create a 128x128 pixel image for use as the shortcut. The
image should use a transparent background. I recommend the
PNG format.
- Open "Icon Composer" (part of Apple's Development Tools) and
drag the PNG image to the Icon Composer screen and drop it on
the "Thumbnail" row. Then drag the Thumbnail icon to the
"Huge", "Large", and "Small" rows... click on "Use Scaled
Version" and "Extract Mask" when prompted. Save and exit
Icon Composer.
- Drag the .icns file and drop it onto the
icns2icon
application.
- Open up the file information (Command-i) for the new icon
file and select the icon in the upper left of the dialog.
When selected the icon will have a blue shadow. Copy the
icon (Command-c).
- Open up the file information (Command-i) for the shortcut
and select the icon in the upper left of the dialog. When
selected the icon will have a blue shadow. Paste the new
icon (Command-v).
Works like a charm. To view an example of the final product, see
here
for the set of custom icons I created for my kids desktop.
:: Posted by
rus on Mon, 19 Feb 2007 11:54 pm
:: Filed under
/tech
vi Tip: Find Character in Current Line
I'm a vi
addict. I know the majority of my colleagues prefer the sexier
Emacs, but for me...
only vi will do. Today I was trying to remember how to
easily delete a section of code from my current cursor position to
another position on the same line. I used to know how to do this, but
I'm old now... so such trivial knowledge is sometimes hard to recollect.
So I did a bit of
searching for the complete vi key binding list and soon
found the key bindings I was looking for:
f find character after cursor in current line (followed by character to find
t same as "f" but cursor moves to just before found character
So the full key sequence needed to delete from the current cursor
position to another position on the same line is 'd', 'f' (or 't'),
followed by the character to find. Very handy.
:: Posted by
rus on Fri, 29 Sep 2006 10:56 pm
:: Filed under
/tech
Mailman on FreeBSD
I am in the midst of migrating my personal web hosting content from an
old iServer FreeBSD-based virtual
server platform to the next generation hosting platform that the web
hosting company I work for (Verio)
has developed. The new platform is also "virtual" and is FreeBSD-based,
but it is identical in look and feel to a dedicated server... a virtual
dedicated server if you will. The marketing term coined for the new
platform is
Virtual
Private Server or VPS.
Everything you are viewing on this blog is hosted (and has always been
hosted) on one of the new next-generation Verio Virtual Private Servers.
I haven't moved the other stuff (mail, family web content) yet
because of 1) inertia, 2) it ain't broke, and 3) lack of time. Recently
however, the old iServer Virtual Server has become somewhat cluttered
(having served our family well for almost 10 years now) and is low on
free disk space (the new VPS platform has over 10x the storage
capacity). Over the past few days I have been moving content over, one
domain at a time. The last ones (berrett.org and sorenson.org) I'll
move probably sometime late at night when no one will mind a delayed
e-mail message or two).
I maintain a few mailing lists on several of the domain names I host for
family and friends. I use
mailman -
which I highly recommend. While migrating over the mailing lists to the
new platform (which basically acts and feels as if it were my
FreeBSD-based desktop system), I learned a few things and thought I would
share.
Setting up mailman mailing lists on a FreeBSD server:
- Set up a 'mailman' CNAME (canonical name) in each of the domain
names that will be hosting a mailing list.
- Install
mailman. This is easy... just
cd to /usr/ports/mail/mailman
and type:
- Set up Apache to handle all domain requests for the mailman.*
virtual host names. To do this add the following VirtualHost
blocks to your Apache config file:
<VirtualHost YOUR.IP.ADDR.ESS:80>
SSLDisable
User www
Group www
ServerAlias mailman.*
DocumentRoot /usr/local/apache/htdocs
TransferLog /dev/null
ErrorLog /usr/local/apache/logs/error_log
ScriptAlias /mailman "/usr/local/mailman/cgi-bin"
Alias /pipermail "/usr/local/mailman/archives/public"
Alias /icons "/usr/local/apache/icons"
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/icons/
RewriteCond %{REQUEST_URI} !^/mailman/
RewriteCond %{REQUEST_URI} !^/pipermail/
RewriteRule .* http://%{HTTP_HOST}/mailman/listinfo [R=301]
</VirtualHost>
<VirtualHost YOUR.IP.ADDR.ESS:443>
SSLEnable
User www
Group www
ServerAlias mailman.*
DocumentRoot /usr/local/apache/htdocs
TransferLog /dev/null
ErrorLog /usr/local/apache/logs/error_log
ScriptAlias /mailman "/usr/local/mailman/cgi-bin"
Alias /pipermail "/usr/local/mailman/archives/public"
Alias /icons "/usr/local/apache/icons"
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/icons/
RewriteCond %{REQUEST_URI} !^/mailman/
RewriteCond %{REQUEST_URI} !^/pipermail/
RewriteRule .* http://%{HTTP_HOST}/mailman/listinfo [R=301]
</VirtualHost>
- Set up the new mailing lists.
cd to
/usr/local/mailman and for each mailing list type:
bin/newlist --urlhost=mailman.domain.name \
--emailhost=domain.name listname
where "domain.name" is the domain name that is hosting the mailing
list name "listname". Note: I broke up the newlist command into two
lines... type it as one line on the command prompt.
Works like a champ.
:: Posted by
rus on Tue, 28 Mar 2006 9:47 pm
:: Filed under
/tech
Layering with CSS
Ok, so I don't do much web design any more. Hardly any really. If you
don't include what little design I did for this blog, I haven't designed
anything from scratch since the
old iServer
days. Since that time, support for
Cascading
Style Sheets (or CSS) has become much more robust. While working
on my current project
(redesigning my wife's website...
Berrett Psychological Services),
I decided to dabble a bit more with CSS-based design.
I'm by no means an expert at CSS,
but I did have some fun and learned a few new
things during my project. The most useful of which was learning how to
do layering with CSS using the "z-index" property. If you
look at any web page on Kristy's new site (other than the home page...
for example, see here,
here,
here,
here, and
here), you'll see a
little logo in the upper left corner of the page. This logo is actually
sitting in it's own layer, neatly isolated from everything else on the
page. The underlying content is presented in a simple table with some
left-justified padding so that it isn't obscured by the logo. Sweet.
:: Posted by
rus on Fri, 24 Mar 2006 2:19 am
:: Filed under
/tech
PNGs with Alpha Channel Transparency and MSIE
I've been hacking on the BPS web
site for the last few days (er, uh, technically, the last few years).
As part of the new design effort, I created several
PNG images that have
alpha channel transparency. Alpha channel transparency allows an image
to sit on top of any background (single-color or multi-colored) and
look like it fits in the place perfectly. It is an extremely useful and
versatile feature... and a necessity for what I'm doing with Dr. Kristy's
new web site.
During my web design phase I did all of my testing using
FireFox (of course!).
Everything was looking great until I popped up Kristy's new website
in an MSIE browser I keep around just for compatibility testing.
You guessed it (*smacks head*) MSIE doesn't appear to properly support
the alpha-channel transparency (at least the version of IE I'm using on
Windows XP, which appears to be up-to-date). MSIE will show the image,
but all of the pixels that have opacity values are rendered with a
light cyan hue. To see what I mean and if you are using a version of
MSIE that is flawed, nav
here... you'll
see the light cyan in the lower right of the image. Yuck.
So, I fished around on google and found a workaround for MSIE that
uses a style filter that only MSIE recognizes. Using a nice
JavaScript
browser sniffer I found, I was then able to
author some code so that the PNG images with alpha channel transparency
are displayed on MSIE through the style filter, and simply displayed
directly as the image source for all other browsers. Here is an example
of what I did:
<html>
<head>
<title>MSIE Workaround for PNGs with Alpha Channel Transparency</title>
<script language="Javascript" src="/browser_detect.js"></script>
<script language="Javascript">
<!--
function loadAlphaTransparencies() {
var logoImage = document.getElementById("logo");
logoImage.src = "/media/home_left.png";
}
-->
</script>
</head>
<body>
<img id="logo" border="0"
style="width: 250px; height: 450px;
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/media/home_left.png',
sizingMethod='scale')"
width="250" height="450" src="/media/sp.gif">
<p>
<script language="JavaScript">
<!--
if (!is_ie) {
loadAlphaTransparencies();
}
-->
</script>
</body>
</html>
Works great.
(Update Sun Mar 26 15:55:44 PST 2006 // updated the code to wrap better)
:: Posted by
rus on Fri, 24 Mar 2006 1:28 am
:: Filed under
/tech
JavaScript Browser Detection
While I have been working on redesigning my wife's company web site,
Berrett Psychological Services, I
encountered a problem with browser support for PNG images that include
alpha channel transparency... specifically, older (but still widely
used) versions of
Microsoft's
Internet Explorer do not correctly render
such images. Because too many people have not yet switched to
Firefox (which renders the PNG
images just fine), I was forced to modify my perfectly valid design to
accommodate for the implementation flaw in MSIE. Blech.
The first step in making such an accommodation was to detect whether or
not the browser viewing the pages is MSIE. Fortunately, many
people have walked this path before I have and authored some very robust
browser detection code in JavaScript. Here is one such example:
If you view source on any page found on the
BPS site, you'll note that I am
importing my local copy of WebReference's browser sniffer from
here. It works
great! I'm glad I didn't have to re-invent the wheel.
:: Posted by
rus on Fri, 24 Mar 2006 1:24 am
:: Filed under
/tech
Downloading Media from MMS Servers
A good friend of mine, Dave, and his brother recently attempted to swim
across the English Channel. The ABC
affiliate in Salt Lake City travelled with them to England,
documented their attempt, and broadcast a couple of vignettes per day
about their endeavor.
The video broadcasts were also made available on-line, albeit in a way
that isn't very friendly to my operating system of choice (FreeBSD);
specifically, the electronic broadcasts are windows media video (WMV)
streamed using an MMS server. Furthermore, it doesn't seem possible (with
Windows Media Player at least) to save a local copy of MMS streams after
you watch them (so I could archive the broadcasts for my own personal and
private use). Argh.
Fortunately, I found a handy little program,
mmsclient,
that will download video streams using Microsoft's MMS protocol. It will
probably compile on any platform (there are even ifdef's in the code for
cygwin) as it doesn't use anything but standard libraries. If you are
running FreeBSD, you can easily install mmsclient from ports;
just nav to "multimedia/mmsclient" and make install.
(Update Thu Aug 18 00:14:39 PDT 2005 // fixed some grammatical errors)
:: Posted by
rus on Fri, 12 Aug 2005 1:34 am
:: Filed under
/tech
Network printing from MS-DOS-based programs in Windows 2000
My wife uses several old psyhcological testing battery software packages
that were written in the 1950s (or thereabouts)... they are MS-DOS based
and print directly to the LPT1 port. This was fine until about a year
ago, when we ditched our old parallel-port-based 3-color HP DeskJet for
a fancy new 6-color HP OfficeJet All-in-One network printer. Without
the printer connected directly to the parallel port (LPT1), these old
(but essential) programs became essentially useless.
So, Kristy asked me if I couldn't get these programs to print to her new
network printer (this was about a year ago). After some googling, I
finally found a
Microsoft-authored
knowledge base article that provided the simple solution. Just run
this on a command prompt:
net use lptx: \\printserver\sharename /persistent:yes
Or on Kristy's computer, use:
net use lpt1 \\kmsb\hp7310 /persistent:yes
This wouldn't merit a blog entry were it not that every 3 or 4 months
Kristy finds that the "persistent" connection isn't quite so persistent.
And so I have to repeat the google search to find the solution... now I
should have it right at my fingertips.
Thanks blog... you're the greatest!
(Update Sat Dec 17 08:08:16 PST 2005 // fixed a formatting problem)
:: Posted by
rus on Wed, 29 Jun 2005 12:16 am
:: Filed under
/tech