Monday, December 24, 2007

HOWTO set up NUT 2.2.0 on Gentoo Linux for Tripp Lite OMNI1000LCD USB UPS

Last December after a significantly power outage, I purchased a Tripp Lite OMNI1000LCD USB UPS from Costco. I spent awhile integrating it with my Gentoo distro running on my home server. I found that Network-UPS Tools (NUT for short) was the best way to go. I would recommend them and their mailing list if you are interested in getting anything running -- I've been lurking on their mailing-list for 12 months now and it is one of the most helpful lists I've seen in my days.

Back in December of 2006, I had no choice but to get a development tree and compile it and integrate that with Portage (see old HOWTO link ). Today NUT version 2.2.0 is in the tree but all architectures are marked as in 'testing'. That is the tilde in front of them : ~alpha ~amd64 ~ppc ~sparc ~x86 ~x86-fbsd when you look at portage nut package . unmasking this package will be much easier than my last experience of integrating my own build in portage (overlaying).

I've been running on this 2.2.0 package for a couple months and I declare it seems good to me.

If you want to unmask it and test it yourself that is simple:

(1) add the following line to the file /etc/portage/package.keywords
=sys-power/nut-2.2.0 ~x86

This will allow you to install this package.

(2) emerge nut with the hal flag
USE="hal" emerge nut

(3) Configure NUT

- the OMNI1000LCD is working fine with the new usbhid-ups driver

Now that we've made this build, you can follow the steps at the wiki:
Gentoo HOWTO NUT (Network UPS Tools)

You'll get to start after the Install Software section. Yes, you'll need the usbhid-ups driver. I am pasting my last instructions with the appropriate substitutions for the OMNI1000LCD for NUT 2.2.0.

I added the bit about adding a MONITOR line to uspmon.conf. This is necessary for upsmon to work

Configuring

Go to /etc/nut . Open ups.conf. Add to this file every UPS you want to monitor. Mine looks like this:

# [powerware]
# driver = bcmxcp
# port = /dev/ttyS0
# desc = "Server, adsl, 3com"


Change the values to something that fit's your configuration better and save. If you have a USB connection to your UPS, your entry might look like

[OMNI1000LCD]
driver = usbhid-ups
port = auto
desc = "Tripp Lite OMNI1000LCD USB"

Open upsd.conf. This file contains access-policy to the UPS's you have.

To only allow the same computer to connect to them, the file should look like this:

ACL all 0.0.0.0/0
ACL localhost 127.0.0.1

ACCEPT localhost
REJECT all


The ACL-lines are used to add hosts. The syntax is ACL name IP. If the name is placed after ACCEPT connections from there are accepted, if it's placed under REJECT, connections are rejected. This sort of reminds me of a hosts.allow file?

Next open upsd.users. This file contains accounts for users who can make modifications. The following line grants access to the user server to everything. This isn't integrated with particular logins from my observation. So you can make-up a new user/pass and run with that. The only place one needs to remember this if you are setting properties through NUT on the UPS.


[server]
password = changeme
allowfrom = localhost
actions = SET
instcmds = ALL
upsmon master


Next take a look at upsmon.conf. This is the UPS Monitor configuration. A scan through this file is going to answer more questions than me writing about it. It is pretty simple, but the below three changes are all I needed to make.

1. in Gentoo, the nut package uses the 'nut' user, so ensure this is in there.
RUN_AS_USER nut
2. The UPS to monitor
MONITOR OMNI1000LCD@localhost 1 server changeme master
3. for those of us with a measly single UPS for our home network you'll need this line:
MINSUPPLIES 1



Next if you want look at upssched.conf too, it may be interesting if you want to schedule events. This will be useful if you want to automate something like "30 seconds after the power is out, send an email via SMTP." I currently am not interested in this

Finishing

Now, start the upsd and upsmon service:

/etc/init.d/upsd start
/etc/init.d/upsmon start

This should identify if there is some still wrong.
If nothing is wrong add them to the default runlevel

rc-update add upsd default
rc-update add upsmon default

If you didn't get any error when you started the services you seemed to configure it right. Else, have a look at the error output and think what might be wrong. One error I got was the permissions of the serialport, which is easy fixed with adding nut to the tty-group.

Testing

You'll be using tools upsc and upscmd

Test upsc and see if your UPS replies:

upsc yourupsname@yourupshost ups.status
specifically from above conf: upsc OMNI1000LCD@localhost ups.status

If you get "OL" (On Line) everything is working good (if it is on the line and not battery).

To see every command your UPS supports, type

upscmd -l OMNI1000LCD@localhost

A full status looks like the below.

#upsc OMNI1000LCD@localhost
battery.charge: 100
battery.type: PbAc
battery.voltage: 13.4
battery.voltage.nominal: 12.0
driver.name: usbhid-ups
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.2.0
driver.version.data: TrippLite HID 0.1 (experimental)
driver.version.internal: 0.30
input.frequency: 59.8
input.voltage: 117.2
input.voltage.nominal: 120
output.frequency.nominal: 60
output.voltage.nominal: 120
ups.beeper.status: disabled
ups.delay.reboot: 65535
ups.delay.shutdown: 65535
ups.mfr: Tripp Lite
ups.model: TRIPP LITE UPS
ups.power.nominal: 1000
ups.productid: 2005
ups.serial: 692195 B
ups.status: OL CHRG
ups.test.result: 0
ups.vendorid: 09ae

If you've typed that command and gotten a similar response you are on the winning side of this conf.

(4) UPSMON conf
At this point you have the default configuration for the monitoring. If you want to do something aside from a straight shutdown on the battery level reaching a critical level I highly recommend reading up here: Network UPS

Keywords: Tripp Lite, USB UPS, Tripp Lite Gentoo, Tripp Lite OMNI1000LCD, USB HID UPS Linux, Gentoo HID UPS, gentoo NUT 2.2.0 portage overlay, Gentoo UPS NUT, Tripp Lite Linux, Tripp Lite OMNI1000LCD Gentoo, Tripp Lite OMNI1000LCD Linux, Tripp Lite OMNI1000LCD UPS.

Monday, October 15, 2007

How to add a DiggIt, Del.icio.us, Reddit, and more links/button to blogger

Several generations of the internet before today, one manually had to add each link to their blog template. In fact I posted about how to do this sometime a year ago. Time has passed and things have improved.

Yesterday I discovered www.addthis.com, a site that simplifies the process. They manage the details of the links, buttons, and adds the very latest social bookmarking sites. You the blogger can get back to posting, and not waste your day tweaking your templates (unless you like that sort of thing).

Read up on AddThis by going to their site: link

Keywords: add social bookmarking links to your blogger blog, to any of Favorites, Google Bookmarks, Del.icio.us,Digg, Facebook, Furl, StumbleUpon, Yahoo MyWeb, Newsvine, Reddit, Technorati, Live Bookmarks, Yahoo Bookmarks, Twitter, Ask, myAOL, Slashdot, Fark, Simpy, Propeller, RawSugar, Blogmarks, Spurl, LinkaGoGo, Mister Wong, Wink, Backflip, Magnolia, Diigo, Blue Dot, Segnalo, Netvouz, Tailrank, BlinkList, DropJack, Feed Me, Link. Add button to Favorites, Google Bookmarks, Del.icio.us,Digg, Facebook, Furl, StumbleUpon, Yahoo MyWeb, Newsvine, Reddit, Technorati, Live Bookmarks, Yahoo Bookmarks, Twitter, Ask, myAOL, Slashdot, Fark, Simpy, Propeller, RawSugar, Blogmarks, Spurl, LinkaGoGo, Mister Wong, Wink, Backflip, Magnolia, Diigo, Blue Dot, Segnalo, Netvouz, Tailrank, BlinkList, DropJack, Feed Me, Link, Blogger Templates.

Sunday, October 14, 2007

open your files from a find command in emacs/vi or your favorite editor

For those shell experts this is obvious:

emacs `find . -name *.java`
vi `find . -name *.cpp`
etc...


Notice the back-quote which is one of the forms of command substitution.

More about Command Substitution here



keywords: open all files from find command, using find with emacs, using find with vi, find, bash, shell, Command Substitution, open multiple files with emacs, vi.

Saturday, September 29, 2007

LiveJournal to Blogger or Blogger to LiveJournal or to/from Wordpress blog migration tool (Blog2Blog)

Last year I built a little tool that migrated blogs from LiveJournal to Blogger. It was aptly named lj2blogger. Today is the release of version 2.5

I've recently extended it to be able to move blogs from LiveJournal, Blogger, WordPress and publish to LiveJournal, Blogger, Windows Live Spaces, WordPress. This means you can move your blog to a new blog name or clone it.

Time to rename the tool, subsequently, it is now called Blog2Blog. Possibly further blogging systems will be integrated in later versions.

This is now a .NET 2.0 Application.

Download Blog2Blog (2.5.0.0 updated March 9, 2009)

ATTENTION: Noted added Oct, 9, 2008
Users with trouble (0 entries downloaded/exceptions/etc) downloading blogspot.com blogs:

We've identified a bug in the latest google feeds and client libraries. (http://groups.google.com/group/bloggerDev/browse_thread/thread/6fa01659eb21b0d for deep details)

Basically as a work-around, you need to put the blogger.com feed SOURCE-API-URL. To find this you will need to view the html source of your blog and look for the string that will contain "service.post" it will contain a URL like:
"http://www.blogger.com/feeds/*blog_id_number_here*/posts/default"

That is the URL you'll need for the SOURCE-API-URL or DEST-API-URL



Recently added:
Version 2.5.0.0
* Integrated the latest GData .NET framework

Version 2.4.0.2
* Fixed regression in saving journals to disk (empty titles would crash application).Version

Version 2.3.0.1
* Fixed Blogger fetching of large journals 500 entries or greater
* Added Blogger (only) Label fetching and publishing

Version 2.2.1.0
* Publishing to Microsoft's live spaces.
* Fetching from and publishing to WordPress.
* Delete All for Wordpress, LiveJournal, Blogger.
* Subject Title fix for Livejournal
* More description in LiveJournal errors.


You liked this application and you'd like to support its author? Feel free to donate:







There is a Blog2Blog Manual included, but the interface is relatively simple. If you are having a problem, please scan through the comments below; many users have discovered the same things and the solutions. If you don't see your problem, please post a comment and send an email to "blog2blog.support (at) gmail.com".


Blog2Blog Manual


Introduction

This tool migrates a blog from online line Blog systems. It uses the public API of LiveJournal, Blogger, WordPress, and Spaces to extract data and create equivalent entries in a different account.

Features
- Download Journal Entries from LiveJournal, Blogger, or Wordpress
- A simple read-only viewer of downloaded entries
- Publish Journal Entries to multiple online blogs
* upload private entries (it will make them public)
* parse entries and wrap http:// entries with HTML to make them active links
- Delete ALL entries for your destination journal (Blogger, WordPress, LiveJournal supported).

Usage

The designed usage pattern is below.

Download from source Journal
First, Select a source
1. Enter username (e.g. user1).
2. Enter password (e.g. pass1).
3. Enter source-url (the URL of the blog you wish to download): http://user1.livejournal.com.
4. (optional) if necessary modify the source-api-url of your journal. This is auto-populated with a typical value.
5. Press Fetch Button.

View Entries (optional)
6. Press View Entries Button.
7. Use the Entry Number Dialog to change the entry being viewed.
8. When complete Press the upper right close window (the X).

Save Entries (optional)
1. Press Save Entries
2. Choose the filename, it is an XML file with the extension (*.B2B)
Note: once saved you can load these Entries without downloading from LiveJournal (use the Load Entries button)

Publish to Destination
Next, Select a Destination
9. Enter username (e.g. user1).
10. Enter password (e.g. pass1).
11. Enter dest-url (the URL of the blog you wish to upload): http://user1.blogspot.com.
12. (optional) if necessary modify the dest api-url of your journal. This is auto-populated with a typical value. (if you have a non-upgraded blogger blog take note; for non-upgraded blogs you will need to update the dest-api-url! To find the URL you will have to look at the page source of your journal. See below for more information)
13. (optional) select options you please; publish private entries and/or wrap http:// with html tags and/or Publish Back Dated posts.
14. Press Publish Button.
15. Select the Entries you will to publish (defaults to all entries).

Further instructions (non-upgraded Blogger blogs circa late 2006):
For non-upgraded blogs you will need to find your feed URI.
- To do this you will have to use your favorite browser and type in the URL of you blog (e.g. http://user1.blogspot.com)
- Using your browser you will need to 'View Source'. This differs slightly between browsers.
- In the source look for link rel="service.post" type="application/atom+xml" title="User1 (Atom 1.0)"
- The api-url is the http:// location in the href

Additionally it is not possible to post to an old journal with a new 'google' integrated account (for those of you that have only partially upgraded all your journals). Additionally the publish dates of your livejournal won't be regarded. This is part of the API limitation.


Known issues

· The Application is not multithreaded – The UI refreshes slowly while connected to LiveJournal/Blogger.
· Does not import/export comments
· found 01/02/2007 - defaults for api-url only work with upgraded blogs.
· There are occasional connection problems with the XMLRPC interface to livejournal, but immediately retrying Fetch from Livejournal seems to connect successfully. Just try a couple of times. No harm should be done.


Keywords: Blog migration tool, LiveJournal to Blogger migration, LiveJournal to Blogger conversion, transfer blog to Blogger, Import blogs from LiveJournal into Blogger, lj2blogger, livejournal2blogger, migrate livejournal blogger, Blogger to LiveJournal migration, Blogger to LiveJournal conversion, transfer blog to Livejournal, Import blogs from Blogger into livejournal, blog2blog, migrate blogger livejournal blogger, migrate blog to Microsoft spaces, live spaces, migrate blogger to wordpress, migrate blog wordpress to blogger, migrate blog LiveJournal to Wordpress, migrate blog Wordpress to livejournal, import blog into Wordpress, LiveJournal, Bloggger, Windows Spaces.

Saturday, August 25, 2007

HOWTO tether your Blackberry Pearl (8100) to linux (AT&T or T-Mobile)

Since many of you have likely hit this blog while looking HOWTO tether a blackberry on Linux, it would be kind of me to point you to somewhere you can do this. Thibaut posted a comment on my blog with a link, so I'll share it here.


I've not personally tried this, but this looks solid. Let me know how it goes out there.

HOW setup tethering for Blackberry Pearl (8100) on a linux machine (Thibaut's Blog).

Reminder that if you are connecting to AT&T you'll need to use the modem information below in the etc/chatscripts/blackberry conf (the entry above uses T-Mobile's settings)
Modem Initialization String: AT+CGDCONT=1,"IP","wap.cingular"
Dial-up Phone Number: *99#
Dial-up username/password:blank/blank


Keywords: Tether Blackberry, Tether Blackberry Pearl, Tether Blackberry Linux, Tether Blackberry 8100, Tether Blackberry with Cingular, Tether Blackberry with AT and T Wireless, Dialup via Blackberry, Wireless internet through Blackberry, Tether Blackberry with AT&T Wireless, Tether Blackberry with T-Mobile, Tether Blackberry 8100, Tether AT&T, Tether T-Mobile.

Sunday, July 22, 2007

AT&T wireless Motorola RAZR V3xx import contact list

Of the several million people who have purchased this phone, I may have been one of the few that wanted to import a Comma Separated Value (CSV) contact list into my Motorola RAZR V3xx cellular phone? Before handing over my Blackberry Pearl to my former company I had exported my contacts for importing once I got another mobile phone. A practical solution, right? After all who wants to re-enter 75 contacts through a mobile phone's interface?

This address book import turned out to be a little more challenging than it should have been. First off, Motorola provides an application to do all variety of communication to ones phone, for a price ($40). I've already paid for the phone and this didn't seem practical/economical for a single use.

Not my solutions
Hence I wandered the internet in search of an open-source solution. After stumbling across KMobilePhoneTools (linux), P2KTools (Windows), and P2K Commander (Windows). I found that I had spent a number of hours discovering the following tidbits:

  • Put your Motorola RAZR V3XX Phone into DATA Mode while talking over USB for KMobilePhoneTools. Main Menu - > Settings -> Connection -> USB settings -> Default connection
  • Get the driver download (single install) from developer.motorola.com (you'll need to register) rather than attempt all the varieties of drivers provided on the Motorola Modding sites. They worked immediately rather than sitting around and tweaking like I ended up with the other way. This is for P2KTools and P2K Commander (Windows).
  • Neither of these three tools provided an easy way to upload my contacts. Maybe it is there and I missed it, but I looked around and these tools were developed for a different purposes.
The solution? Use the Mac and the built in OS X Tiger's iSync.

Sadly I didn't try this right away with my Mac book Pro (OS X): use iSync. Unfortunately the connection to the Motorola RAZR V3xx phone isn't built in yet, but there is a forum that appears to develop the plugins for the phones rather rapidly. www.clockskew.com the link to the RAZR V3xx plugin: http://www.clockskew.com/blog/2006/12/18/isync-and-a-motorola-razr-v3xx/

Once I installed this plugin for iSync, I could sync the phone's contact list with the built in address book for the MAC. This address book of course has an import functionality. I imported my CSV and hit sync and within 20 minutes from start to finish I had my old contacts imported. However, I will not get back the minutes I spent trying to attempt this on Linux/Windows :(.

Just hoping to save you time...

Happy iSyncing.

Keywords: Motorola RAZR V3xx import CSV contact list, Motorola RAZR V3xx import CSV address list, Motorola RAZR V3xx import Comma Separated Value contact list, Motorola RAZR V3xx import contact list, Motorola RAZR V3xx import address list, AT&T wireless Motorola RAZR V3xx import contact list, Cingular Motorola RAZR import contact list, RAZR, RAZR V3xx, Motorola RAZR V3xx sync CSV contact list, Motorola RAZR V3xx sync CSV address list, Motorola RAZR V3xx sync Comma Separated Value contact list, Motorola RAZR V3xx iSync, MAC, OS X.

wx200d Text File Headers - Tab separated value (TSV)

To re-iterate some other posts, I use the Oregon Scientific WMR-968 weather station with the wx200d version 1.3 ( Sourceforge link ). One of the nice side-effects of the wx200d daemon is that it collects and stores the data in a text format at /usr/local/share/wx200d/. This is TAB separated format (TSV).

I didn't find a succinct definition of this TAB separated format file when searching for it, so here is with one line of data for context my extrapolation of it from the source file tab.c:

Time--TAB--Indoor Temperature--TAB--Outdoor Temperature--TAB--Indoor Humidity--TAB--Outdoor Humidity--TAB--Dew Point Indoor--TAB--Dew Point Outdoor--TAB--Barametric Pressure Indoor--TAB--Barametric Pressure Outdoor--TAB--Wind Gust Direction--TAB--Wind Gust Speed--TAB--Wind Direction--TAB--Wind Speed--TAB--Wind Chill--TAB--Rain Rate--TAB--Rain Total
0.6564--TAB--24.5--TAB--18.6--TAB--63--TAB--98--TAB--18--TAB--19--TAB--1011--TAB--1011--TAB--0--TAB--2.4--TAB--0--TAB--1.2--TAB--18--TAB--0--TAB--991

Our if you prefer to read this in comma separated format:
Time,Indoor Temperature,Outdoor Temperature,Indoor Humidity,Outdoor Humidity,Dew Point Indoor,Dew Point Outdoor,Barometric Pressure Indoor,Barometric Pressure Outdoor,Wind Gust Direction,Wind Gust Speed,Wind Direction,Wind Speed,Wind Chill,Rain Rate,Rain Total

Happy parsing.

Note:The units are in this file are metric.

Keywords: wx200d text file headers, wx200d log file headers, wx200d tab separated value file, wx200d comma separated value file, wx200d TSV, wx200d CSV.

Monday, May 28, 2007

The Apple Graphite AirPort Base Station, Windows Vista, and failing to connect to the internet

Recent experience with the Apple Graphite AirPort Base station and the newest MS OS Vista found me googling without an answer. This is likely to be a rare combination these days, so it isn't a surprise to not have a solution out there. This is used for wireless modem sharing up my parent's (in-law) cabin where the cost of high-speed Internet is preventative.

The basic symptom was that the "Internet" wasn't functioning on the Vista machine. It could connect fine with the AirPort base station, but would get no further. Digging deeper it appeared that DNS was not functioning for the Vista machine. A little more digging and installing a separate copy of Vista using bootcamp for Mac confirmed it was reproducible.

Another step in the digging was to try an nslookup from a functioning machine -- note Windows XP, MAC OS X all work while simultaneously Vista does not.

Welcome to Darwin!
macpowerbookpro:~ user$ nslookup www.google.com
;; reply from unexpected source: 198.6.100.140#53, expected 10.0.1.1#53
;; reply from unexpected source: 198.6.100.140#53, expected 10.0.1.1#53

This seemed to be potentially at the root of the problem. I suspect that Windows XP/Mac OS X don't mind a response from a DNS server that it didn't ask. Vista is a bit more particular about it.

The temporary solution is to put the nameservers that your ISP has directly in the TCP/IP configuration of Vista (see image below). I admit there is probably a more complete solution, but this will keep one going until that is solved.

Keywords: Apple Graphite AirPort Base Station, Windows Vista, Internet connection problems, DNS problem, DNS lookups fail.

Friday, May 04, 2007

D-link Emulators

Bumped into this because of a LinuxLore browser.

D-link is now providing user interface emulators for many of its products. Not a bad idea in the try-it-before-you-buy-it world. And for many of us out here, we've encountered awful interfaces for some of these consumer level products that have impaired the product's function enough that one wished they never bought it.

Link to D-link Emulators

Interestingly enough, trying out the DCS-950G Wireless Internet Camera's interface on Firefox has shown me there is potentially a bug there. I couldn't log-in.

Keywords: D-link network gear, d-link emulators, dlink emulators, Dlink network gear, dlink product demos, dlink

Thursday, May 03, 2007

DSM-G600, DWL-G820 and DI-724GU default username and password

Occasionally Google indexes this blog and determines that my site has the default admin username and passwords (root, administrator, ...) listed for the following devices: DSM-G600, DWL-G820 and DI-724GU. Up until now, many of you have come here and not found that information. Since I like to help out, I will make it true (what Google wants, you'll get -- in a good way).

Please note that everyone out there will highly recommend that you immediately change the passwords for your networking equipment. There is no need to grant access to every one that can Google to this page or read the manuals.

The information:
D-Link Wireless 108G QoS Gigabit Router -- DI-724GU:
username: admin
password: {blank}
DI-724GU Product Manual link

D-Link Wireless Network Storage Enclosure -- DSM-G600 revision B:
username: admin
password:
{blank}
DSM-G600 revision B Product Manual link

D-Link AirPlus Xtreme G Wireless Gaming Adapter: -- DWL-G820:

username: admin
password:
{blank}
DWL-820 Product Manual link

You may start to notice a trend in the default usernames and passwords. I cannot say for sure, but if you have a D-Link product it might be a good first start.

Keywords: D-link default username and password, Dlink DSM-G600 default username and password, Dlink DI-724GU default username and password, Dlink DWL-G820 default username and password, D-link DSM-G600 default username and password, D-link DI-724GU default username and password, D-link DWL-G820 default username and password, D-link consumer network gear default username and password.

Saturday, April 14, 2007

HOWTO cleanup gentoo portage distfiles, packages that are unused (eclean)

eclean can be your friend, it is a part of the gentoolkit. If you don't have the gentoolkit: emerge gentoolkit.

eclean can cleanup distribution files and packages. Because you are a regular emerge --sync, emerge --update --deep --ask world sort of person, you will likely be using disk space on all those old packages you have upgraded out of.

eclean distfiles
eclean packages



DESCRIPTION

eclean is small tool to remove obsolete portage sources files and binary packages. Used on a regular basis, it prevents your DISTDIR and PKGDIR directories to infinitely grow, while not deleting files which may still be useful.

By default, eclean will protect all distfiles or binary packages corresponding to some ebuilds available in the Portage tree. This is the safest mode, since it will protect whatever may still be useful, for instance to downgrade a package without downloading its sources for the second time, or to reinstall a package you unmerge by mistake without recompiling it. Sure, it's also a mode in which your DISTDIR and PKGDIR will stay rather big (although still not growing infinitly). For the 'distfiles', this mode is also quit slow mode because it requiries some access to the whole Portage tree.

If you use the --destructive option, eclean will only protect files corresponding to some currently installed package (taking their exact version into account). It will save much more space, while still preserving sources files around for minor revision bumps, and binaries for reinstallation of corrupted packages. But it won't keep files for less usual operations like downgrading or reinstalling an unmerged package. This is also the fastest execution mode (big difference for distfiles), and the one used by most other cleaning scripts around like yacleaner (at least in its version 0.3).

Somewhere in the middle, adding the --package-names option when using --destructive will protect files corresponding to all existing versions of installed packages. It will allow easy downgrading without recompilation or redownloading in case of trouble, but won't protect you against package uninstallation.

In addition to this main modes, some options allow to declare a few special cases file protection rules:

o
--time-limit is useful to protect files which are more recent than a given amount of time.
o
--size-limit (for distfiles only) is useful if you want to protect files bigger than a given size.
o
--fetch-restricted (for distfiles only) is useful to protect manually downloaded files. But it's also very slow (again, it's a reading of the whole Portage tree data)...
o
Finally, you can list some categories or package names to protect in exclusion files (see EXCLUSION FILES below).

Keywords:gentoo, portage, cleanup, portage cleanup, eclean, cleanup portage directory, cleanup portage storage /usr/portage/distfiles, /usr/portage/distfiles, cleanup of /usr/portage/distfiles

Sunday, April 01, 2007

VMWare with Gentoo Guest - why is fit guest now grayed out?

My configuration
HOST: Windows XP
Guest: Linux Gentoo 2006.1
VMWARE Version: VMWare Server 1.0.2 build-39867
X Windows: 7.2
Desktop Environment: KDE 3.5

I wished to fill my 1600X1400 monitor with my Gentoo VMWare image while in 'Quick switch' mode. However, the Fit Guest Now was grayed out. The reason? I needed to have vmware-user running (location for me: /usr/lib/vmware-tools/bin32/vmware-user). This is a tool in the VMWare tools. For VMWare tools installation see Install Gentoo on VMWare - VMWare Tools Section.

As soon as I launched the vmware-user, the Fit Guest Now menu becomes un-grayed and works beautifully. Enjoy your new found desktop real estate.

I've yet to have the autofit guest work, but I am happy enough that the fit guest now works. Another day for the autofitting.

Keywords: fit guest now grayed out, gentoo, vmware, linux, VMWare server, vmware-user, maximizing desktop for Gentoo Guest in VMWare, autofit guest.

VMWare with Gentoo Guest - why does copy and paste not work

My configuration
HOST: Windows XP
Guest: Linux Gentoo 2006.1
VMWARE Version: VMWare Server 1.0.2 build-39867

First off, the copy and paste is provided by VMWare Tools. VMWare Tools run under X Windows.

There are a number of articles out there describing how to do this for various flavors of VMWare; however, my experience has demonstrated that these work just fine for VMWare Server. I would worry not.

I found that with these instructions (HOWTO install Gentoo on VMWARE - installation of VMWARE Tool Section) and my original version of X11 R6.8 did not work out as well with driver module installation. Perhaps I was careless, but my solution was simply to upgrade to X Windows 7.2 - a seamless upgrade for me. Note to you: you may as well take a snapshot to allow a roll back.

I would recommend following the path of upgrading if you've not, insuring that you have in your make.conf: INPUT_DEVICES="keyboard vmmouse" VIDEO_CARDS="vmware". If you have/want to upgrade, as I did, follow these instructions: Migrating to Modular X HOWTO

After migrating to Modular X Windows 7.2 the VMWare tools launch automatically as I start X so copy and paste works seamlessly now.

Keywords: gentoo, vmware, copy and paste, vmware tools, vmware server, gentoo guest, x windows, why doesn't copy and paste work?

Sunday, March 25, 2007

The ever improving Internet, Mashups and innovations and where to find them listed

In the quest to turn the data into information, many unique ideas as quickly formed when someone integrates two or more internet APIs these days. The marketing phrase Web 2.0 has been used to describe this, but it is news to me that someone has been managing the web releases from a configuration management standpoint.

What can be done with the 'Mashup'?

  • Want to know where Tim Hibbard is? Where's Tim. (I had no idea who he is, but I know where he is) - 3/25/07 8:31 PM. I stand corrected I know a little more about who he is and I infer he has a decent sense of humor now. :-)
  • Local Ski conditions? Ski Bonk. Integrating Google Maps with ski resorts/cameras/etc.
  • Nintendo Wii finder. Wii finder. Search ebay, walmart, target, bestbuy, circuit city and overlay the locations on a google map.
  • Auctions nearby? Find Near By. Like the above, but finds items up for sale on craigslist, ebay, amazon, walmart.
  • Dig through the earth. Dig Here. Have Google maps show you where a hole thru the earth would come out.
  • Birth place of Oscar winners. Oscar Winners. From 1928 - 2006
  • Internet Domains. Domain Tools. A multitude of information about a domain name.
  • Webcams. GooCam. Google Maps integrated with found streaming web cameras.
  • Downgrade your graphics? Ascii Maps. Transform Google Maps images into Ascii
  • Blog value calculator. How much is your blog worth?

As you can tell, there is plenty of ideas -- Several useless, others are entertaining. Programmableweb is registering 3.1 mashups per day. Soon we will need to mashup the mashup listings to add value to that infinite data.

Keywords: Mashups, Web 2.0, programmable web, Web APIs, google maps mashups, technorati mashups, mashup listings.

Saturday, March 10, 2007

HOWTO tether your Blackberry Pearl (8100) to a PC using Windows XP and Cingular

One of the advantages to having a Blackberry phone is the built-in ability to connect your PC/laptop to the internet via the phone. Now the hunt for free wireless connections while traveling has been made simple. No more of the questions (and the incessant googling that ensues to know for sure): does that hotel have free wireless? does this coffee shop have free wireless? Admission of internet addiction will be prevented and you (and I) can continue to remain in denial. Using this method I was able to achieve 120 Kbps downloads/ 60Kbps uploads in the Seattle area in March of 2007. It is not broadband speed these days, but it is better than 0 Kbps.Want to do this for Linux? Go here to the Linux post.


Prerequisites:

  • The latest Software For BlackBerry Desktop Software v4.2 Service Pack 1 from Research in Motion installed. Today this is version 4.2.1.8. Download link.
  • A Blackberry Pearl (8100). This may work with others.
  • A USB cable to connect computer to Blackberry
HOWTO

Summary
You will need to have the Blackberry Device Manager running, it provides the emulated serial port. You will need to modify the modem initialization string, this was a modem added when the BlackBerry Desktop Software was installed. Lastly a dial-up connection will need to be made.

Data you will need (Cingular, now AT&T Wireless again):
Modem Initialization String: AT+CGDCONT=1,"IP","wap.cingular"
Dial-up Phone Number: *99#
Dial-up username/password:blank/blank

This web-page has an excellent step-by-step guide that you can plug in the Cingular data above
How to: Tether BlackBerry Pearl to PC for use as a modem

Enjoy.

Keywords: Tether Blackberry, Tether Blackberry Pearl, Tether Blackberry Windows XP, Tether Blackberry 8100, Tether Blackberry with Cingular, Tether Blackberry with AT and T Wireless, Dialup via Blackberry, Wireless internet through Blackberry.

Tuesday, February 20, 2007

Visual Studios 6.0 shortcut keys that matter to me

At work I end up living within Visual Studios 6.0 for long durations. These below are probably my most used short-cuts.

Failed compile?

F4 - Move to next Error (and highlight in the IDE)

Auto-Complete
ALT+SPACE

Structure members
CTRL+SPACE

View function parameters

CTRL+SHIFT+SPACE

Auto-indent current selection
ALT+F8

Callgraphs
ALT+F12

Brace Matching
Ctrl-}

Or if you want do 'know it all'

To display keyboard shortcuts

  1. From the Help menu, choose Keyboard Map and perform one or more of the following actions:
    • Click Category, Editor, Command, Keys, or Description to sort the keyboard shortcut list alphabetically in different ways.

    • Click the Printer button to print a copy of the list.

    • Click the Copy button to copy the list to the Clipboard so you can paste it into a word processor or other text editor.

    • Click the drop-down menu to filter the list to view either All Commands, Bound Commands, or by menu.

Tuesday, February 06, 2007

HOWTO turn off sticky keys in windows


I am normally not one to get riled up, but I have to admit that the number of times I've seen the above dialog makes me ready to use words I shouldn't.

We are blessed with every Windows installation having Sticky Keys ready to respond to either a rapid press of the shift key or a long pause on the shift key. If you are anything like me, I often pause in thought with a finger on the shift key. Right now I pause with my finger on the shift and wonder whose decision it was to leave this on by default in Windows? ... On a lighter note, on the name "sticky keys." Isn't that something you would get if you use your keyboard immediately after peeling an especially juicy orange?

To the get dialog above:
Hit shift 5 times
or
Hold shift down for 5 seconds.


To turn it of from the dialog above:

  1. Click Settings
  2. On Keyboard Tab, as seen the dialog below un-select use StickyKeys

  3. Careful you aren't done yet. Click the settings button in the StickyKeys area.
  4. In that dialog un-select all the items.
  5. Click OK.
  6. Click OK once more.
You are now not going to be interrupted while you are paused thinking any more.

Keywords: Windows, StickyKeys off, Turn off StickyKeys, how to Turn off StickyKeys, Stop StickyKeys dialog.

Saturday, February 03, 2007

HOWTO turn off the UPS alarm on Tripp Lite OMNI1000LCD UPS (USB)

All UPS units tend to have an alarm (also known as the beeper) that sounds when the power is removed from the unit. This alarm maybe valuable to some people, but I would say for my computer room closet it would be more annoying in the middle of the night than necessary. I'll deal with a power outage when I wake up.

I am running NUT on Gentoo Linux to manage my Tripp Lite OMNI1000LCD UPS (USB) and to turn off the alarm one simply needs to run the following command, remember the username is what you defined in /etc/nut/upsd.users:

#upsrw -s ups.beeper.status=disabled -u nutusername
-p nutpassword theUPS@localhost:3493


immediately following that the command
upsc verified the change was live:

# upsc theUPS@localhost
battery.charge: 53
battery.type: PbAc
battery.voltage: 12.3
battery.voltage.nominal: 12.0
driver.name: newhidups
driver.parameter.port: auto
driver.version: 2.1.0
driver.version.data: TrippLite HID 0.1
(experimental)
driver.version.internal: 0.30
input.frequency: 59.8
input.voltage: 116.7
input.voltage.nominal: 120
output.frequency.nominal: 60
output.voltage.nominal: 120
ups.beeper.status: disabled
ups.delay.reboot: 65535
ups.delay.shutdown: 65535
ups.mfr: Tripp Lite
ups.model: TRIPP LITE UPS
ups.power.nominal: 1000
ups.serial: 692195 B
ups.status: OL CHRG

Now when there is a power loss to the unit it is silent and will shut down the computer when the low battery signal occurs.

keywords: UPS, NUT, alarm off, beeper off, disable alarm, disable beeper, linux, Gentoo, Tripp Lite OMNI1000LCD UPS USB.

Sunday, January 28, 2007

Enlighten your windows desktop or background with the Computer Name - BGInfo

In my current employment, I am typically remote "desktoped" (RDP'd) into several machines at the same time. The tool I use to keep myself informed is BGInfo a SysInternals (now owned by Microsoft).

For instance see below. There is a nice background, overlayed with particular machine information.

This tool is for the admin and people with some windows know-how, but still I would love to wrap this tool up in a little installer to add a little more value like an example configuration file and allow it to use a config file and run on startup.

I am willing to bet that several people in the legal department at MS would not be willing to let me redistribute this tool with my own MSI. I am not willing to experiment and find out for sure.

Instead of an installer, I'll list out the minor steps that made this tool more valuable to me and provide the configuration as above for you to experiment with.

Configuration

  1. Download the BGinfo zip from Sysinternals site
  2. Unzip into C:\Program Files\BGInfo (or a path of your choice)
  3. Download my example configuration BGsetup.zip.
  4. Unzip into C:\Program Files\BGInfo
  5. Launch BGInfo.exe by double clicking.
  6. Use the File Menu -> Open to open the bgsetup.bgi file.
  7. Tweak as you see fit. Hit apply and view the results.
Autorun BGinfo at Windows start up
  1. You could download autorunBGInfo.zip, a registry entry and double click the .reg file to put it in your registry
    OR
  2. Add the following to your registry:
    Key Location: [HKEY_LOCAL_MACHINE\SOFTWARE\
    Microsoft\Windows\CurrentVersion\Run]
    String Name/Value:
    Name: BGIno
    Value: \"C:\\Program Files\\BGInfo\\Bginfo.exe\" \"C:\\Program Files\\BGInfo\\bgsetup.bgi\" /timer:0 /silent /all

With those two things together, this tool is more valuable to me. Notice that you aren't limited to only the options listed in GUI. A quote from the BGInfo manual:

If BGInfo does not contain information you would like to display you can create a user defined field that contains whatever information you want. You can define one or more custom fields that display:
· An environment variable;
· A registry value;
· The contents of a text file;
· The version information contained in a DLL or executable file;
· The time stamp (last modified date) of a file;
· The output of a VB Script;
· The result of a Windows Management Instrumentation (WMI) query.

For the working soul in the tech industry, I can imagine that data could add further value to your desktop.

Keywords: BGInfo, Background text, background overlay Windows, Machine information desktop overlay, Wallpaper text configurator, machine information on background, Machine information on desktop, solve the what machine am I logged into problem, desktop background, desktop wallpapter.

Sunday, January 21, 2007

HOWTO customize your D-Link DSM-G600 NAS with Telnet (BusyBox), iTunes server, gentoo and more.

To solve the always on storage, network attached storage [NAS], problem I choose to purchase the D-Link DSM-G600 device; in part because my tendency to stick with a the same hardware vendor. I may be naive and my demonstration is I believe that companies do more testing with their own hardware components than other hardware. The other part of the choice is that is a Gigabit NAS with a drive enclosure and with potential to plug in our external USB drives. The other, other part is that it is running Linux underneath.

I have the DSM-G600 revB and to demonstrate this last statement of it running a copy of embedded Linux, the following is the output of uname.
# uname -a
Linux NAS 2.4.21-pre4 #480 ¤­ 4¤ë 28 11:21:43 CST 2006 ppc unknown

And it looks like the below image
First step is to understand 'fun_plug'. This is a script that is called after after the DSM-G600 boots, but the user has full control over it. It resides on the drive that you've put into the enclosure. For the full background: How to fun_plug . This concept is a big seller to me, it allows customization to your heart's content.

Starting to fun_plug
(reference: Wiki Page Howto fun_plug )

There are several way to get the fun plug script on the device. I would recommend connecting via Samba from a Linux host. Most importantly you'll save yourself the hassle of Unix vs. Windows linefeeds.

(1) You'll want your DSM-G600 booted (and a drive in the enclosure).
(2) From your linux host:
mount -t smbfs -o username=admin ///HDD_a /mnt/nas
(3) Enter your password (the same as the web interface admin password).
(4) Execute:
touch /mnt/somedir/fun_plug
chmod 777 /mnt/somedir/fun_plug
(5) Customize fun_plug (open fun_plug up and do some customization) - See below
(6) Execute: umount /mnt/nas


Customization of fun_plug

There many customizations and the the limit only in your imagination . Several that seem worthy to mention are starting a telnet daemon, starting an itunes server, chrooting to a Gentoo distribution.

Starting small
output dmesg to a text file

(1) Open fun_plug with your favorite editor
emacs /mnt/nas/fun_plug
(2) Add
#!/bin/sh
dmesg > /mnt/HD_a2/dmesg.out
(3) reboot the DSM-G600

Why /mnt/HD_a2? because that is where the NAS device mounts the internal IDE drive.


Getting bigger
Telnet daemon (and more) Telnet and your DSM-G600
(1) Open fun_plug in your favorite editor
(2) enter the following
#!/bin/sh
if [ ! -e /mnt/HD_a2/ash ]
then
ln -s /mnt/HD_a2/busybox /mnt/HD_a2/ash
fi
if [ ! `grep root /etc/shadow` ]
then
echo kontroll.`grep admin /etc/shadow` >> /etc/shadow
/mnt/HD_a2/sed -i -e 's/kontroll.admin/root/' /etc/shadow
fi
/mnt/HD_a2/sed -i -e 's/root:.*/root:x:0:0:Linux User,,,:\/:\/mnt\/HD_a2\/ash/' /etc/passwd
cd /dev && /mnt/HD_a2/busybox makedevs ptyp c 2 0 0 9
cd /dev && /mnt/HD_a2/busybox makedevs ttyp c 3 0 0 9
/mnt/HD_a2/busybox telnetd &
(3) Get and extract
busybox-telnetd-1.2.1.tar.bz2 in the root folder of the DSM-G600. Download it
(4) reboot the DSM-G600

Medium sized
Firefly/mt-daapd itunes server on your DSM-G600
Step by Step: Step by Step for itunes server on DSM-G600

Slightly larger than Medium
A NFS server server on your DSM-G600
(1) Download the nfs binaries (nfs-utils-1.0.10-portmap5-nfsd.tar.gz)
(2) Unzip in an appropriate folder
(3) Add this to fun_plug
# nfs server
# Vars. Change these according to your setup
NFSROOT=/mnt/HD_a2/nas_packages/nfs

# Set up needed directories and files
if [ ! -d $NFSROOT/var/lib/nfs ]
then
mkdir -p $NFSROOT/var/lib/nfs
fi

if [ ! -d $NFSROOT/etc ]
then
mkdir -p $NFSROOT/etc
fi

if [ ! -f $NFSROOT/etc/exports ]
then
cat > $NFSROOT/etc/exports <<"EOF"
/mnt/HD_a2 192.168.0.0/24(rw)
EOF
fi

if [ ! -f $NFSROOT/etc/hosts.allow ]
then
cat > $NFSROOT/etc/hosts.allow <<"EOF"
lockd: 192.168.0.*
rquotad: 192.168.0.*
mountd: 192.168.0.*
statd: 192.168.0.*
EOF
cat > $NFSROOT/etc/hosts.deny <<"EOF"
lockd:ALL
mountd:ALL
rquotad:ALL
statd:ALL
EOF
fi

if [ ! -d /usr/sbin ]
then
mkdir -p /usr/sbin
fi

# Make symlinks
ln -s $NFSROOT/etc/exports /etc/
ln -s $NFSROOT/var/lib /var/
ln -s $NFSROOT/etc/hosts.* /etc/
ln -s $NFSROOT/sbin/* /usr/sbin/

# start the server
/sbin/insmod $NFSROOT/modules/nfsd.o
/usr/sbin/portmap
sleep 1
/usr/sbin/rpc.mountd
sleep 1
/usr/sbin/rpc.nfsd
sleep 1
/usr/sbin/rpc.statd
# re-export...

$NFSROOT/sbin/exportfs -ra
(4) Reboot the DSM-G600.

Reference (Forum post)


Big and Bold
chroot into Gentoo on DSM-G600
Step by Step: Chroot to Gentoo

There you have it, the world is yours now that you are in Gentoo. Enjoy it.

References:
DSM-G600 revB Hack Forum
A well organized Wiki about the DSM-G600 revB

keywords:D-Link DSM-G600, dlink DSM-G600, linux, NAS, configuring, fun_plug, fun plug, Customizing DSM-G600, embedded linux on DSM-G600, tweaking DSM-G600, itunes DSM-G600, telnet DSM-G600, gentoo DSM-G600, D-Link NAS, gentoo, embedded linux.