Update and locate
by Chris on Jun.10, 2009, under Tech
Linux tip! There’s many different ways to search your entire filesystem in Linux to find files you’re looking for. Most people seem to be familiar with the “find . -name <searchterm>” method (or the less efficient “find | grep <searchterm>). But most distros include an easier way to search your filesystem using a few command-line tools, and a database.
Two commands you can use to your advantage when searching for files are updatedb and locate. The first command (which is normally run as part of daily cron jobs on most distros) creates a database which holds a index of your entire filesystem. The second command allows you to search that database.
So assuming you’ve run “updatedb” on the command-line, or it’s being run as part of cron… You can type something like:
locate resolv.conf
…will result in finding two files
/etc/resolv.conf
/usr/share/man/man5/resolv.conf.5.gz
Looks like it basically is doing a string search in the database, so if you’re searching for the “hosts” file under /etc and you typed “locate hosts”, you’re going to find more files than you probably need. (”ghostscript” matches so it’ll show you those too).
Check the man pages for each to find out more on each!
Kaboom
by Chris on Jun.08, 2009, under Tech
So I blew up my main Linux server at home over the weekend apparently. You’d think that with me being a systems engineer and all that I’d know better (I do). I have an old Compaq server with two drives in it. They’re small drives so I had setup both as a stripe (RAID0).
Advantage: faster, more drivespace available
Disadvantage: if you lose one drive, you lose everything.
Heh, guess what happened?
Well I pulled it out, did the old Nintendo trick (you know, blow on the cartridge, and then stick it back in), and tried the drive. Seems to be working fine now, but I decided to wipe out the install and rebuild it anyway. This time as a RAID1 configuration (mirrored drives). Now if one fails, I’m still ok. Just don’t have as much drivespace to work with. Live and learn (or don’t).
Pogoplug
by Chris on May.07, 2009, under Tech
Well, I’ve been testing out my new Pogoplug for about 2 weeks now. Most of what I’ve been doing is trying to come up with a backup scheme that works. I keep running into obstacles that make one process or another not work. Mostly revolving around the fact that the client software is designed to be run interactively (not as a service under windows, or a daemon under Linux), and that it’s kindof a “weird” drive mapping under Windows. Robocopy really was cranky with it.
Well, I think I’ve decided on a Linux solution. I’ve done some decent work on getting an init script working so I can start up the Pogoplug mount or stop it with a RedHat “service pogoplug ” command.
Also, I have a backup script created now which will create a tar.gz file directly on the Pogoplug once it’s mounted.
I’ll post my init script for Linux once I test it more so you can use it if you want. It supports start|stop|status|restart|condrestart, although I haven’t tested the conditional restart (not sure I even understand why it’s needed).
Crossover
by Chris on Dec.30, 2008, under Tech
Wowie wow wow! I just tried my free copy of Codeweaver’s Crossover for Linux today for the first time, and I LOVE IT!
“What is this?” you say. It’s none other than another way for you to play with a Microsoft ball, on a Linux field. I’m talking about running Windows applications right inside Linux, with no VM. This is Wine on steroids.
WINE is a free application for Linux which allows you to run MS-Windows applications natively under Linux. It’s not perfect, a lot of programs don’t run well, but you have to give the developers credit. It’s not easy to reverse-engineer Microsoft’s proprietary Windows code, and then make it work under Linux.
Crossover is a tweaked, proprietary version of WINE which is designed to make installing and configuring the environment easier. Along with that, it adds some better compatibility patches and offers commercial support. It comes in a number of different flavors, but the two I have are the Pro and the Game versions. The only difference being that Crossover Games is released more often to keep up with the fast-paced gaming industry and is aimed more at performance for better Windows-gaming under Linux
So how did I get this free? They gave it away on October 28th, 2008. It was part of a challange that Codeweavers posed to the current president. I jumped on the opportunity and downloaded it, but I’ve been hanging onto my free software for all this time.
So today I installed the Pro version on my work laptop running Ubuntu 8.10, and managed to get Office 2007 Enterprise installed with very little trouble. I originally had tried to install it from the local filesystem, but I think the copy I had might’ve been corrupted because I couldn’t get it to install. So, I just downloaded an ISO from Microsoft’s MSDN subscriber site, burned it, started up Crossover Pro, and it installed smooth.
I’m still not sure at this point how to perform updates, but the raw install works well. I had to manually configure Outlook because under Linux there’s no AD or domain visibility. No problem, it configured fine. I’m so shocked to see MS-Outlook working natively, with Compiz Fusion effects on the windows and everything.
I did have an occasional crash with it. Usually they seemd to occur when I was scrolling through a mail list, or if I viewed an email which had HTML or embedded content that just wouldn’t display under Linux (most likely because it’s missing some Windows libraries or something). But I really didn’t care, I don’t expect it to run perfect. There’s bound to be some minor glitches. I’m just glad it does run as well as it does.
I also got a nice suprise when I started up OneNote, and the screen clipping app that normally shows up in the tray in Windows, also showed up in the top bar under Gnone. And yes, it works! I can actually use it to take screenshots under Linux, and then paste them into OneNote or other apps. I’m speechless! Amazing stuff.
It looks like there’s a list of supported apps for Crossover. For the heck of it I figured I’d try to see if I could get Microsoft Office Communicator to work under Crossover. I haven’t yet found a Linux chat client that’ll do LCS SIP style communication over TLS. Crossover installed it just fine, and I was able to apply a few patches. But, when you try to launch Communicator, nothing happens. It doesn’t crash, or give you an error, or do anything.
I’ll be testing it out more this week as I have time, but so far I’m completely amazed at this product. It almost remindes me of the feeling that I got back in 1999 when I tried VMware’s virtualization software under Linux, and got Windows running in a VM for the first time. Check it out if you have a need to run Windows apps under Linux, but don’t want to use a virtual machine solution. This one’s a winner.
Bashpodder
by Chris on Dec.26, 2008, under Tech
I discovered a super cool podcast aggregator a few weeks ago, but hadn’t actually put any time into setting it up on my CentOS box at home. Well, dove into it last night and I have to say (in my best Quicken Loans-speak) “simplicity is genius!”
This thing rocks. It’s simple. It does what it’s supposed to do. It harnesses the power of Linux. And it’s highly configurable. Bashpodder is what I’ve been looking for in a podcatcher for a LONG time. I listen to about 10-15 podcasts regularly, and really wanted to find a way to download them automatically after hours, and then just copy them to my MP3 player in the morning before I head out for work.
I’ve been using podcastready.com for quite a long time to manage my subscriptions to podcasts I listen to. And the software they offer to download podcasts, myPodder, has been working ok for me. It’s a portable app that can run in Linux or Windows (making it nice for me…I switch hit all the time). I run it right from my MP3 Player. But I ran into issues when I dropped my home internet connection speed down to 768k (yeah, I’m cheap). It was taking so long in the morning for me to download podcasts, I couldn’t get them all before I had to leave for work. So I wanted something else that was automated and simple.
I tried their AutoPodder software, but that program is WAY too buggy for me. It hasn’t been updated in quite a long time (I tried it a year ago), and still has troubles running beyond 2-3 days without dieing or missing podcasts…or just flat out not working at all.
So I found BashPodder (Google rocks!), which is nothing more than a collection of three files: a bash script, a configuration file, and an XSL file which helps grab enclousre info from feeds. That’s it! There’s no instructions, there’s no installation or compiling. So this truly is one of those DIY type deals, and honestly you should have some experience with Linux, bash, and maybe even vi or nano if you hope to customize it a bit.
So you drop these three on your Linux box, customize the config file with your RSS feeds that you want, and then execute the script and BAMMO!!! You have podcasts downloaded. It uses a series of log files to determine what was downloaded, so the next time you run it, you’ll only get the newer stuff.
By default it organizes your downloads into folders that are based off the date the script was run. But if you check out the developer’s website (who is Linc from the LinuxLink Tech Show Podcast), he has links to modified forms of his script which will allow you to do different things with the script, such as download podcasts into folders based off the name of the feed.
If you’re a Linux user, or someone that’s interested in learning more about Linux, bash scripting, and love podcasts…check this thing out.
HERE
by Chris on Dec.22, 2008, under Tech
Holy wow I’ve not visited this blog in quite a while. Alright, I’ve had some time to settle in to my new digs at work and have been learning quite a lot (too much almost, I can’t keep all this in my brain.) So I figured I’d start to put some fun stuff out here that I’ve been learning. Maybe you’ll find some of it useful, maybe not. Whatever.
Let’s take a look at what is commonly known as a “HERE Tag” in Bash scripting/command line.
In Bash, you can use a “double-less than” combination to tell the shell to redirect all typed text beyond the tag to a command.
wc -l << HERE line one line two line three HERE
The above sequence would output the result of “3″. Here’s what’s going on.
The first part of the sequence is just the *nix “wc” command, which is used to count stuff. We use a -l switch to tell it to count lines in this case. Right after that is the << redirect and the tag. In the example I used “HERE” which is traditionally what most people will use, but you can use whatever you like as a tag name (and it doesn’t have to be uppercase either, but to keep things simple you might want to leave it upper).
Beyond the HERE tag, you enter in your lines to have redirected to the command, one at a time on a separate line each. Once you reach the end of your typed commands and you want to close out the HERE tag sequence, you enter in another “HERE” on a line by itself. It must not have any leading spaces, or anything following it to be considered the end of the tag.
Once the end is found, the lines are redirected to your command one line at a time, and in our case it just counts how many lines were sent to it…to give a result of 3.
You can try things out both at the command line, as well as inside a script.








