(No, I didn't mean to pull off a lame rhyme. :P )
Ubuntu Tracker Applet Error Quick-fix
Submitted by Hoza on Tue, 04/28/2009 - 14:12Quick problem I encountered when I upgraded my Ubuntu distro to 9.04 from 8.10. Periodically a dialog would pop up from the Tracker app saying something like this:
There was an error while performing indexing:
Index corrupted
Three buttons to either "Reindex all", "Cancel" or "Accept" (if I recall correctly.) Clicking these in just about any combination doesn't seem to do anything as the dialog keeps coming up. Here's what to do:
Problem
Ubuntu Linux 9.04 Tracker Applet stuck in an error loop where it's claiming "index corrupted." There is a known bug that will be fixed soon (it's actually already fixed and committed, but the patch has yet to roll out through the Ubuntu updater.) Clicking any of the buttons will do apparently nothing, bringing up the error dialog again... you won't get any work done if you keep clicking that button. If you're looking for a stupid button to click, you might as well score some points doing it! :P
This Worked
Quick fix is to do this stuff -- I don't know what it really does, and can't be bothered to research it -- to kill off the error and make life grand again:
Open Terminal of your choice (*ahem* Yakuake rocks! *cough*) & run these commands:
sudo apt-get install tracker-utilstracker-processes -r
If you have any dialogs still open, canceling them should be the last time you see any of 'em. Yay! Now, if ever decide to take the time and find out what this command actually does for the problem, I'll let you know. :P
New "Watcher" Now Available To Follow Site Updates!
Submitted by Hoza on Thu, 04/23/2009 - 18:00This is really cool, IMO: I've installed a really sweet little module that will allow you to "watch" posts that you're interested. Quite simply, it will toggle on/off and give you access to receiving email when a post is updated/edited/commented/etc. I've set up some basic defaults that I think most people will want most of the time, but if you want to change your Watcher settings, you can log in and go to your profile page. You'll see a "My Watched Posts" tab that brings up your Personal Binder of all the stuff you're watching. Nice!
In there you can also change up the settings as you like. You can choose to disable the defaults or turn on the "Sharing" option and let other registered users see the posts you're watching. That's interesting, but I don't know why anyone would want it. Heh.
For now, if you post a comment, you will automatically have the option to watch that post for replies. This will hopefully solve the problem where I'm missing comment replies on some of my sites! Doh!
So, to watch a post/thread, look for the link titled "You are not watching this post, click to start watching." When you're already watching a post, you'll see another link to turn off watching, as well as a direct link to your personal Watcher Binder. Again... nice!!
OK, enough on this topic. I think this is really great and ought to help people keep tabs on stuff their interested in. You can even watch something as an unregistered visitor -- but I haven't tested that yet to see how it works, TBH. I need to stop playing with this stuff and get back to work. :)
Transferring Domain Names Away From 1and1
Submitted by Hoza on Wed, 04/22/2009 - 23:42At first glance, this may seem like a strange article topic. However, if you're one of the many who have tried to get their domains away from 1&1 (aka: 1and1.com, Schlund & something-or-other, etc.), you'll be painfully aware of how much the process sucks the peel off a rotting lemon. Yeah, it's bad. There are a lot of steps and they seem to make it intentionally difficult to accomplish (conspiracy or just crappy programmin??)
So, the most recent "no way! That's just plain stupid!!" event in my last batch of domains being transferred to my preferred registrar (not mentioning it here -- contact me if you want suggestions) made me start writing this article to help folks get through the process a little smoother than I did at first.
Here we go...
Update Ruby Gems on Ubuntu
Submitted by Hoza on Sat, 03/21/2009 - 14:21Really quick post here:
I'm trying to run some Rails apps I'm tinkering with from a while ago. It seems my local Ruby Gems version was out of date and running the suggested "Please 'gem update --system' and try again." didn't do anything. The error here was:
ERROR: While executing gem ... (RuntimeError) gem update --system is disabled on Debian. RubyGems can be updated using the official Debian repositories by aptitude or apt-get.
Ugh. So I had solved this problem before in another environment, but of course didn't record it anywhere. Here's me recording the solution:
sudo gem install rubygems-update
"1 gem installed" and now the version is correct. Nice.
...uh... that actually didn't work apparently. Still getting the "need version 1.3.1" message. So, I found this and it worked:
$ sudo gem install update_rubygems $ cd /var/lib/gems/1.8/bin $ sudo ./update_rubygems $ gem -v 1.3.1 $ sudo gem install rails
Moving on...
Subversion Working Copy Locked "Fix"
Submitted by Hoza on Sat, 03/21/2009 - 13:45I was working with some old Subversion projects I had on my workstation but it a couple were coming up as "locked." Since I hadn't been working with these particular projects for a long, long time, I had no idea why they were locked. Here's a quick fix:
Problem
Performing an update (in my case) to get the latest files from a Subversion (svn) repository, I got the message that the "Working copy '/path/to/project' locked". The locking of files is done by SVN to prevent multiple copies of files from being edited in multiple places at once. If one user is performing certain tasks on a file, the system sets the file as "locked".
...Well, that's my lame way of explaining it, and it may not be exactly accurate, but you get the idea of the concept of Subversion file/directory locking. For more detailed info, look elsewhere. :)
In my particular case, I have not been working on the project and I don't know or care about anything that would be destroyed by just getting a new current checkout copy from the repository. I've seen notes online where people thought this often happens with interrupted checkout/in functions, among other situations. If the locking is unintended or you want to reverse it, I have a way that worked in my situation.
This Worked!
(Man, this is a long post for such a simple solution, but hey, give me a break! I'm trying real hard here to maintain a consistent format for posting these problem/solution pairs! Hopefully most of you appreciate the effort I'm putting in here.)
Running a "cleanup" command on the project of choice cleared up the problem right away for me. In my case, I'm running Ubuntu Linux as my OS of choice, so my current SVN client is PySVN WorkBench. I think the path to running cleanup is similar on most (all?) clients, but I just right-clicked on the chosen project and selected the "Clean up" option. It chattered away for a bit and came up, well... clean! Lockup problem averted.
As a side note, PySVN WorkBench has a "Reports" menu with a couple options to display "Working Copy Locks..." and "Repository Locks...". You may find yourself wanting to start there in your case, if you actually care about what is locked when you get this error.
Hope it helps!
How To Specify An AUTO_INCREMENT Value in MySQL
Submitted by Hoza on Sat, 02/28/2009 - 05:52I needed to reset the value of an auto_increment number after doing a bunch of tests in a MySQL database. I just wanted the number to be more accurate & reflect more closely the number of actual items in the database, since every deletion just leaves a "hole", as the incremented value doesn't reset after a delete.
This is a real quick solution, so here goes:
Problem
I've deleted a bunch of items in a database with an auto_increment field in one of the tables. (In my case, I did a ton of testing with importing/creating new posts on a Drupal site, and deleted them all to start fresh with the "real" content. In Drupal, new nodes just keep incrementing after those deletions, so my node values where way off... I wanted to align them more correctly with the new "real" import.)
Solution
Run a simple SQL command on the particular table with the auto_increment to set the value where you want it.
ALTER TABLE this_is_the_table AUTO_INCREMENT = 100;
That's it! I won't go into specific Drupal issues with doing this on the 'nid' field of your nodes table, but mainly, you should be careful to make this new value higher than the number of nodes you currently have in the database.
It's possible that ALTER will actually count the rows in the table and just +1 the value if you have fewer than the number you're asking for. IE: you have 110 rows already, but run the above command... I think it will just set the auto_increment value to 111, instead of failing. (Do your own research on that, though... I'm too lazy right now to do it for you. :P )
Cheers!
(BTW, how do you like the ultra-spiffy new code highlighting??!? Awesome how it sets up links to research the keywords, I thought. I'm going to have fun with that puppy. :)
Drupal FeedAPI & Feed Element Mapper Missing Unnamed Elements In Array
Submitted by Hoza on Tue, 02/03/2009 - 04:15I really need to figure out how to title some of these things! It's quite hard to find a way to make a title, when the posts are so varied! The title seems to need being both a summary and a brief title.. bad combo.
Aaanyway... Quick problem I've been having that cost me many days of headaches. I'm hoping this will help others as well as remind me later what the problem was and how to solve it.
Basically, I'm using the FeedAPI and Feed Element Mapper in Drupal to import some data feeds and create content nodes for display in one of my sites. The thing is, my data feed is not simple RSS formatted, so it includes a bunch of other XML elements that all the parsers coming with FeedAPI are missing! Argh! I figured out a way to expose a bunch of the elements that were getting missed... but be warned, it's a bit of a hack job.
(This is a solution for people already working with FeedAPI/FEM and isn't a tutorial on the usage of either of those... sorry.)
Read more for the rest...
Installing Zend Framework on Cpanel Server
Submitted by Hoza on Wed, 01/28/2009 - 03:51Another quickie for those of you wanting to install the Zend Framework on your Cpanel-powered Web servers.
I'm doing a bunch of updating to another set of Web sites I run (*ahem* OnlineGameHounds.com... PointlessGames.com, etc. *cough*) and needed to try out some modules that needed the Zend Framework. I'm not going to go into what that is (read for yourself, please) or why I need it (seriously, I need to get back to that work instead of writing this post! I shouldn't even be here at the bar with you blokes, I've got work to do!). If you need to know how to do this solution, you're likely only reading this because you're searching around for it on the Grand Googly-Moogly, et. al.
If you don't know what this stuff is, well... you're awful bored to be reading around on random posts about words like "Zend" that just look funny, aren't you??!? (Well, you're welcome here, for sure! Look around! :)
Hit the "read more"-type link to get at the problem/solution pair for this thing...
Linux: Listing the number of files in a directory
Submitted by Hoza on Thu, 01/08/2009 - 05:08Here's a quickie, but it was useful for something I was messing with: In Linux (or Unix, etc.), how do you list the number of items in a directory from the command line?
This Worked:
I'll admit up-front that this is a bit of a hack (in my opinion), but it works fine for simply finding out how many items are in a directory. The reason it's a hack is explained below.
This is a simple command option using the "ls" and "wc" commands in tandem. Here's what you run (from inside the directory you're interested in):
ls -l | wc -l
Briefly, that's the list command "ls" with the -l option, which gives a verbose list option to the command. This is combined with the "wc" (short for "word count") command, which displays a count of lines (the "-l" option in this case), words and characters in a file... yeah, a file, but we're interested in counting items in a directory, right? Well, that's the whole "|" bit, which is called "piping" -- executing commands in a sequence.
What we're saying with this command is roughly: "get a list of the contents in this directory, but show me a count of the lines in the list"... like I said, that's roughly what it means. I'll leave it to you to do more research to learn more about these commands and their options.
I'm calling this is a bit of a hack only because you're getting a count of lines in the listing, which can include some unwanted bits in this case... like directories will show up as a line item, which you may not be interested in counting. Maybe you see the slight draw back here? For my needs, total accuracy wasn't important -- just a close estimate.
Some variations on the theme:
ls -Rl | wc -l
Give me a count of the number of items in the current directory and all subdirectories ("R" means to "recurse" into the directories in the list... neat.)
ls -l someDirectoryNameHere | wc -l
Give me the count for a specific directory.
ls -l someDirectoryNameHere/*.jpg | wc -l
I'd like to know how many JPG files there are in a specific directory. Sweet.
...well, you get the idea. I'll leave the rest up to you. I've already spent waaaay too much time on this simple entry and I have work to do! :P
Joomla Community Builder "cb.core" foreach bug fix
Submitted by Hoza on Thu, 01/08/2009 - 01:34In the Joomla! CMS (which this site is not run on, incidentally, but I use at Flash Game Post), I was having trouble with the Community Builder component throwing an error. It's a simple fix to get around it in version 1.1 (currently, they have 1.2 RC4, but I don't have time to test software this month.)
Problem:
In Joomla 1.5, using Community Builder 1.1, when going into a user's profile page, this error was thrown:
Warning: Invalid argument supplied for foreach() in /components/com_comprofiler/plugin/user/plug_cbcore/cb.core.php on line 240
This Worked!:
This is a known bug in v1.1, so here's the known fix for it, presented in just one more place in case Google helps you come and visit me instead of someone else! :)
- Open the file ./components/com_comprofiler/plugin/user/plug_cbcore/cb.core.php with your favorite code editor. Change line 528 from this:
$params =& $juser->getParameters();To this:
$params =& $juser->getParameters(true); - Delete line #529, which is this:
$params->loadSetupFile(JApplicationHelper::getPath( 'com_xml', 'com_users' ));
Tada! All fixed up... well, you need to save that file and re-upload it to the server, of course. You knew that, though... right?
Cheers.
