Archive for the ‘Linux’ Category
Unix Command Line Tools for Windows
I work on Mac, Linux and Windows machines during the course of an average day. A lot of this work is done on the command line. Since underneath a Mac is the heart of a Linux type machine, the basic commands that work on one also work on the other. Windows machines are a different story. Lots of commands that work on Mac/Linux are different on Windows machines or simply don’t exist at all.
For example, when you want to see what’s in a directory from the command line the Mac/Linux command is “ls”, but on Windows, it’s “dir”. Since most of my time is spent with Mac/Linux I end up trying to use “ls” frequently when I’m working on a Windows machine. This doesn’t hurt anything, but it doesn’t work and it is a little break in the concentration.
![]()
The good news is that since most of the command line tools on a Linux machine are open source, they can be ported to different operating systems. This is exactly what was done with the Open Source project UnxUtils. It’s a collection of most of the key command line tools Linux folks are used to working with. If you spend most of your time on Mac/Linux but have to bounce around the Windows command line on occasion, I highly recommend them.
Perl – The Duct Tape of the Internet
In terms of my job, one of the single most important (and luckiest) things that I did early in my computing days was to start learning the programming language Perl. I had done a little HTML and gotten some JavaScript to work before, but Perl was the first language I really started with.
I’ve often heard Perl referred to as The Duct Tape of the Internet. That was probably more the case in the early days of the web than it is now. Lots of other specialized languages and tools have cropped up to specifically address web site programming, but Perl still gets very steady use from me in publishing my other site.
One case in point is the transition I’m currently working on to move from one production partner to a new one. Ideally, I would have had about eight months to complete the transition, but I wouldn’t expect more than six. What I got was a little over three. Suffice it to say that without Perl that time line would have gone from incredibly tight to impossible. There are just so many moving parts that without Perl’s ability to quickly create a very powerful program that can do just about anything we would have had to abandon several features on our site.
What’s even more amazing about Perl is the fact that it’s free. It comes install on virtually every Linux OS and can be had on Windows with a quick download. Once again going to show that sometimes the best things in life really are free.
Explore linux drive on windows
If you ever have a linux drive that you need to look at on a windows machine (say, one that is attached via a USB external enclosure, a tool named explore2fs will get you there. It appears to be open source. There is no install, it’s just an .exe that you launch and you can view linux volumes.
Repartition Hard Drive
If you ever need to repartition a hard drive and don’t have Partition Magic, you can do it with a Linux LiveCD like knoppix using an application called “QTParted”. Basically, what this lets you do is have one physical hard drive that shows up as two separate ones in your opperating system. (Note, I’ve only tried this with a Windows box. YMMV with Macs.)
On my laptop, I setup the one physical drive to appear as a “C” and a “D” drive. This way, I can keep all my applications on the “C” drive and my data on the “D”. This makes organizing and backing up a lot easier.
Basic instructions for how to use QTParted can be found here. (The article describes using a different LiveCD, but any one with QTParted should work just fine.)
A few proof sets
I’ve finally gotten around to building my new “gallery” web page tool. Of course, since I’m a web geek this actually involved transfering my site to a new server, building my own personal PHP framework, setting up a staging server, building a deployer from the stage to the production site, constructing a script on the production server to unwrap the content sent over by the deployer, and, of course, the gallery templates them selves.
Could I have simply downloaded a peice of software to do this for me, or use photoshop to auto generate them, or just used flickr? Sure, but none of those are really my style. Why do something that easy when you can create a ton of work for yourself?
Yes. I’m that much of a geek. All of that is also to say that the galleries themselves are pretty bare at the moment. Someday I’ll jazz them up a little, but probalby not too much. I’m a big fan of the simple approach to display. Anyways, here’s a few from shoots that I’ve done out at Freebird. If you’ve looked at my stuff before, you’ve probably seen these before:
Victor Wooten
Galactic
Mofro
Johnny A.
Now that all that is done, one of the next steps is to get my IR stuff posted. I hope to do that over the long weekend.
Answering prompts in a cron tab
Most commands that you are likely to run from cron should have some type of flag that can be passed to them so they run with requiring any interaction. Occasionally, you run into a piece of software that doesn’t have a “silent” option.
For example, if you have a cron setup to run:
/bin/runthis
and there is no flag you can pass to prevent it from asking:
Are you sure [y/n]?
the app won’t work as a cron tab on its own. One solution is to pipe the “yes” command with the app like so:
yes | /bin/runthis
The yes command will answer with the “y” for you. “yes” just keeps feeding “y”s until it exits. If you need you can even pass it another string. For example, “yes working” will pass “working” until it exits.