I just had an opportunity to install a new APC (Model BN1250LCD) UPS to support an Ubuntu Linux server. Configuration was really easy thanks to this post on the Ubuntu forums and this post in Ubuntu's Community Help documentation.
The only oddity I noticed was that after starting apcupsd, there was no notice in the /var/log/apcupsd.events of the successful start. No big deal, I guess...it still responds to /etc/init.d/apcupsd status with all the happy details of the UPS' condition.
I ended up plugging my cable modem, wireless router, printer, and scanner into the UPS too, just to try to keep some 'extra' services alive for as long as possible. Even with all that plugged in, the UPS still reports only about 16% load.
Incidentally, Sam's Club had the best price for this device...pretty cheap insurance at $140, me thinks.
Since I started using Atlassian's Confluence in a few projects, I find myself wanting to type in wiki markup everywhere. I especially like being able to create links like this:
[Title of url|url of link]
Using this markup, you can type something like this:
[John's Blog and Stuff|http://www.gobowen.com]
...and get this:
John's Blog and Stuff
I think that's a really easy system to remember and use. So, I took my first stab at writing a custom module for Drupal, a filter that can be used in the Input Formats to produce this kind of link. Rather than start completely fresh, I copied a good deal of the concept from the amazon filter for Drupal and just adapted it to my own purposes.
It works, but it needs work. The Regular Expression validation and matching is very weak. If you're reading this and want to improve on things, have a go at it and let me know how it turns out.
The code is attached. I recommend assigning it as a filter before the default url handler filter in Drupal...otherwise, you may get unexpected behavior.
| Attachment | Size |
|---|---|
| wiki_linkify_filter.tar.gz | 6.94 KB |
I already love OpenOffice for all the typical reasons (functionality, freedom, etc.), but it's always been a little slow to load. It might take 15 seconds or so to initially open writer or calc...once they're open, everything is fine...it's just that load time that's a little annoying.
Here's a link to an article that shortens that load time by allocating more memory to OOo. I *did not* try the JRE trick listed there...just the first part about changing memory usage in Tools>Options>OpenOffice.org.
With that done, OOo load time is down to 3-4 seconds!
Welcome to another opening day of the firearm deer season in Michigan...something of a local holiday I guess.
Here's my view on this windy afternoon...
I found a really nice script that backs up all my MySql databases on a rotation, and generally provides insurance against database crashes and the like. I followed the instructions given, popping my copy of the script into /etc/cron.daily, and double-checking the permissions. The only change I had to make to get the script to run properly was to set #!/bin/sh at the beginning of the file...after that, I could run it *manually* all I wanted. Neato.
But, I found after the first night that autocron wasn't running my new script (at least, I wasn't getting the email notification about how the backup went). So I went digging around and found this article, where the author mentions he had the same problem and _may_ have found a solution in removing all the '.'s from script names in cron.daily.
I took a quick look inside cron.daily, but besides my own new script (automysqlbackup.sh), there are 5 others that have dots in their names...presumably, they were put there by a package/tool...they can't be wrong...right?
A little more digging turned up a suggestion to run "ls -lut" in the /etc/cron.daily folder, essentially listing the scripts by their last run time. Check this out:
My script has been renamed already in this screenshot, but you can clearly see that the scripts with a dot in their name haven't been run in a long time (probably not since they were created).
I'll try to post back tomorrow with results, but it sure looks like that advice was right on...*scripts in cron.daily (on Ubuntu) won't run unless there is no dot (".") in their name*.
[update:2008-11-25]
This has worked perfectly since making these changes!
[/update]
If things go well, this post from email will have an image of a doggy
inline right below this text...
| Attachment | Size |
|---|---|
| black_dog.jpg | 4.31 KB |
If things go well, this post from email will have an image of a doggy
inline right below this text...
NOT FOUND: 1
My first, second and third tries at posting to this Drupal site from a cell phone have taught me a lot about the MailHandler module. They've also left me with a few questions.
I've learned that you don't want 'Full HTML' set as the 'Input Format' for email-submitted items. It's probably best to come up with a custom input type, but for now I've settled on using 'Filtered HTML'. Also, make sure your phone/email application isn't sending HTML formatted messages. That will add an extra set of and tags in your post, which is in a page that already has those tags. It just screws up the pages' HTML, which could lead to unexpected results.
A larger lesson I've picked up is that you have to be careful with the 'default commands' you enter in the Mailhandler module's settings for your email account. In my case, I made the mistake of setting 'type: Story', thinking I wanted all my emailed posts to end up as stories (on this blog).
Unfortunately, Drupal recognizes 'story' as a content type, but 'Story' is only partially recognized. It would display (in view mode) OK, but trying to edit these 'Story' types would give me a blank screen (well actually, it had the site's title, color scheme, etc...just no body content for the post to be edited).
Changing the node type in the database from 'Story' to 'story' made all this better.
Now, to figure out how to keep images that were attached to the message...
This is a third test from email. Hopefully, it will format better.
I'm trying to use email (the Mailhandler module) to post to news items to this (Drupal) blog. So far, I've been able to get a post to show up, but now it can't be edited (or removed), and it's format is a little odd on the page.
Does this one do the same thing?
Sometimes, a Windows printer will print multi-page documents in the 'wrong' order...so you end up with a stack of papers with the last page on top. One possible reason is a configuration problem in the Printer Settings:
I recently set up a Linux (Ubuntu) based network to allow VPN connectivity, and to avoid headaches1 I wanted to modify the internal IP address scheme from the default (192.168.1.0) scheme.
In this network, the Linux server has two NIC's, and external (ADSL) connection and an internal LAN. DHCP, DNS, and Samba shares are served from the internal LAN to as many as 6-7 users at a time. Some of the internal clients have fixed IP's, and some take advantage of the server's DHCP offering to get IP's.
I expected this to be a more difficult process, but it was surprisingly easy to make the changes. I'll try to list the mods needed in the server (and clients) to make the change:
Network Devices
/etc/network/interfaces
All references to the old network have to be changed to the new scheme
DNS (Bind)
/etc/bind/zones/
Both the forward and reverse lookup zones have to be changed
DHCP
/etc/dhcp3/dhcpd.conf
All references to the old network have to be changed to the new scheme
Hosts
/etc/hosts
All references to the old network have to be changed to the new scheme.
Samba
Samba itself doesn't need any changes when the LAN's IP's change, but if client machines have mapped Samba drives using IP addresses (i.e. \\192.168.1.1\share), those mappings will have to be changed at the client.
Firewall (iptables)
The firewall rules are tied to the adapter name (i.e. 'eth2'), not the IP address of the server. So, changing which IP is assigned to the adapter (in /etc/network/interfaces) will take care of the firewall. If your rules worked before, they'll work after the change.
Static Client IP's
Any clients in the internal network (LAN) that have static IP addresses assigned need their assignments changed.
Restart the affected systems:
sudo /etc/init.d/networking restart
sudo /etc/init.d/dhcp-server restart
sudo /etc/init.d/bind9 restart
That's it! As always, your mileage may vary, so back up files before you mess around with them too much.
This definition was categorized as 'cynical', but it looks pretty honest to me...
My definition of an expert in any field is a person who knows enough about what's really going on to be scared.
--P. J. Plauger, Computer Language, March 1983
Found on the Quotations Page.
I wish I could remember which airport this was in...it just struck me as funny that EVERYONE has trouble with Windows and the 'help' it offers:
| Attachment | Size |
|---|---|
| WindowsDisplaySettings.JPG | 26.17 KB |
5 or so years ago, I had all my domain management and hosting done through Network Solutions. It turns out they were charging $35 per year for domain name renewal, when relative newcomers like GoDaddy were charge about $8. Switching away from Network Solutions was purely cost-savings for me then, and I haven't been disappointed with GoDaddy since switching.
I just got off the phone with Network Solutions, after about 2 weeks of mind-numbing attempts to wrestle another domain from their clutches. Here's the run-down:
The domain isn't mine; it belongs to a customer. The admin contact has left their organization, and left only the login information for the NetSol account. I logged into his account and changed the admin email address, so I'd get the authorization code, instead of him. I requested the authorization code for the transfer, and when it didn't come, I requested it again. When that didn't come, I requested it a third time (all in the same day).
The first message I got from NetSol (shortly after the third auth code request), was a special 'transfer lock' that was put in place because of 'suspicious activity' on the account. Here are the highlights:
Some of the domains in your account(s) will not be able to be transferred to another registrar for a period of 30 days. This transfer-lock has been applied for security reasons to help prevent unauthorized transfer of your domain registration(s) to another registrar.
To see which domains have been locked, simply log into your Account Manager and click on a domain.
The transfer-lock will be removed on October 7, 2008, after which, you may transfer your domain registration(s). If you wish to transfer sooner, please contact our Customer Service and we can assist you with submitting a request to have this lock removed.
As suggested, I called Network Solutions. They were closed (it was Sunday). I called this afternoon (Monday), and successfully navigated their phone prompts to get to the guy who can help. It turns out, he can't help. Even though my email address clearly is the admin contact, the old contact's *name* is still there. While he was escalating my problem to someone else, I changed the name (via the NetSol site) on the account.
The second guy introduced me to a new problem. Because of the "special lock" (that's a real quote) placed on the account, there's nothing we can do until 1-2 days from now. I asked why he can't just remove the "special lock" right now, and he advised it's against policy. When I asked who's policy...the answer, of course, is Network Solutions.
So, I'm left wondering what is the advantage of having such a policy. You've got a guy on the phone who's information is all over the account, and who obviously has control of the account; why not release it? The answer, I think, is in the sales pitch I was given (by both guys). Why not just migrate all your other sites to us? How about if I make the renewal price $8.95 per domain? We have hosting here too, can I interest you in that?
Blah. Maybe GoDaddy (or some other registrar) would do the same thing, but that's just a ridiculous, used car salesman approach to dealing with people (no offense toward any used vehicle sales people :\ ). Network Solutions will never see any of my accounts.
On a decent sized (500+ users) Drupal 5 web site, I ran into the same problem documented here, wherein the extra fields defined for users (in the Profile module) caused each user to occupy several rows of the table in a table-mode View.
Mark Peal did a nice job describing the problem, so I'll just copy/paste it here for completeness:
In the directory table, each username appears eight times.
The displayed columns in the table (after username) are first_name (1), last_name (2), and maiden_name (3). Each of the eight rows shows a combination of fields either filled in with correct data or left blank, in this pattern:
Row 1: All 3 columns blank
Row 2: Column 3 filled in
Row 3: Column 2 filled in
Row 4: Cols. 2 and 3 filled in
Row 5: Column 1 filled in
Row 6: Cols. 1 and 3 filled in
Row 7: Cols. 1 and 2 filled in
Row 8: All 3 columns filled in
And the cycle repeats for each succeeding username.
I actually ended up finding the solution in a related thread. I took that code, pasted it into a new 'news' item (with PHP Code as the input format), and viewed it to fix records. The only problem was that the script timed-out after every 35-100 records, so I had to run it several times.
In each successive run, I found the userid of the last user that had been 'fixed' by the script, then modified the script to select all users above that userid (select * from {user} where uid > 123). The effect was to take the problem in chunks, and while it took 5 attempts to get them all, it beat editing more than 500 users' profiles to get it working.
I followed the tutorial detailed here and am now able to use my Palm 755p as a tethered USB modem, connecting to the Internet with an eeePC. My service provider is Alltel, and I paid for the USB modem software (I tried it first - the demo version worked fine too).
The only hiccup I had was also mentioned in the tutorial - I had to force reset the wired connection before connecting with the modem. Otherwise, Ubuntu was holding onto the wired NIC's gateway assignment and trying to use it for the dial-up connection.
FWIW, says I'm getting about 491k download and 79k upload speeds this way.
In scanning through a ZDNet article/interview with Lawson's Harry Debes, this quote caught me as particularly funny...
People are stupid. History has shown it repeats itself, and people make the same mistakes.
I'm working on a project which requires me to read (with C#) existing SQL Server 2005 'Image' datatype data, making it useful to the end user in an ASP.NET application. The trouble is, the mime type for the data stored in each row is not stored...there isn't an easy way to tell, in advance, if the data I'm pulling out is a pdf, gif, jpg, zip, docx, xml, bmp or some other file type.
Looking closely at the stored data, I noticed that they start with consistent values (headers), and there are only a handful of different headers there.
Examples:
0x1F8B08....
0X255044....
0XFFD8FF....
A few Google searches turned up this article/chart, where I confirmed that those headers identify the type of binary file that's stored.
Once that's handled, you can change the Response FileType header of the web page, then Response.BinaryWrite() the data, and the user gets what was stored! If the browser can handle the filetype (like xml, txt, pdf), it just displays it; if not, the file download dialog pops up and offers options for viewing/saving the file.
A few other articles I found alluded to 'magic numbers' or 'magic headers'. They look like they might be talking about that same leading header...but I wasn't able to find an example that would lead me along.