Tag Archives: linux

automatically extract email attachments with common linux tools

I had need to automatically process emails to a specific address to pull attachments out, and this is how I did it:

$ yum install mpack

$ cat extract-attach.sh 
rm -rf ~/attachtmp
mkdir ~/attachtmp
mv ~/Maildir/new/* ~/attachtmp
cd ~
munpack ~/attachtmp/*
rm -rf ~/attachtmp

$ crontab -l
*/5 * * * *	~/extract-attach.sh

Why, you may ask? Because I get a report a few times per day to the email address in question.

Note – this runs in my crontab every 5 minutes on a CentOS 6 x64 server; I’m sure the process is similar/identical on other distros, but I haven’t personally tried.

network install of centos 6

I wanted to try something different when playing with CentOS 6 recently, so I did a network install. Other than one very small detail, the install is identical to installing off a normal ISO.

Here’s the difference:

  1. use the netinstall.iso (eg http://centos.datente.com/media/6/isos/x86_64/CentOS-6.4-x86_64-netinstall.iso)
  2. when it asks for the URL to grab your image from, use something like http://centos.datente.com/media/6/os/x86_64 (make sure it’s the full path (this example is off my mirror for an x64 install))
  3. proceed as usual 🙂

olf 2013 in the bag

This past weekend I went to OLF with my friend Peter and a fella who’s now more than an acquaintance, Nathaniel – one of the lead devs for FreeIPA at Red Hat.

Got to go to a variety of great talks and sessions, met some awesome folks, and just generally enjoyed the geek weekend 🙂

I’ll be talking about the weekend at tonight’s BGLUG IRL Meeting – if you’re in the Lexington area, come on out to Eagle Creek Library at 1800 (I know – short warning … but come anyway).

I’ll post more throughout the week on the different sessions and what I learned – also, I was one (of many) who live-tweeted large portions of the fest: #olf2013 and #ohiolinux on Twitter.

this is not the year of the linux desktop

2013 will not be the YoLD.

Nor will 2014. Or 2015.

This will be a shock to the fanatical FLOSS heads out there. But not to me. I’ve never thought that “this will be the year of the Linux desktop” – regardless of how many magazine, journal, blog, and other articles have been published about it. Regardless of the ardency of LUGs: it won’t happen.

There will never be a year of The Linux desktop.

And it’s not because Linux is bad. Or because there’s too much of a learning curve. Or because there is not interest in running Linux at home (as opposed to “merely” on servers).  It’s not because you can’t run Office on Linux (see CrossOver).

It’s because we don’t care any more. Linux is here. Windows is here. OS X is here. iOS is here. Android is here.

We have GUI devices ranging from smartphones to tablets, netbooks to all-in-ones, desktops, workstations, portables, stationaries … nobody cares any more.

All anyone has really cared about for the last decade+ is whether or not they can get their work done. For more and more of us, that is being done via web interfaces, email, remote connections, portable apps, cloud computing, and a host of other non-strictly-platform-dependent tools.

I can collaboratively create and edit documents in Google Drive with scores of colleagues (if I wanted) as long as they have a “modern” browser. You can edit on an iPad while I’m running KDE while she’s on a Mac while he’s on a Windows box. I can sync files with tools like Dropbox and Copy (and scores more).

As long as I am running on “traditional” hardware somewhere (ie x64), I can run [almost] any platform’s native applications – I can run VirtualBox on Linux, Windows, or a Mac and install Linux, Windows, or OS X (if on Apple hardware) in the VM. I can even run platforms like Solaris x86.

We have been treading steadily towards platform-independence for years. Major companies like VMware, Google, Salesforce, and Canonical have all been pushing us in that direction, in their own ways – along with thousands of smaller outfits: there is very little reason to ever worry about what platform you are running as your main environment for at least 5 years, perhaps as many as 10.

There used to be lots of underdogs in the race. Ghandi has been quoted as saying something incredibly relevant to the nature of the current platformless monoculture:

First they criticize you
Then they laugh at you
Then they fight with you
Then you win.

How does that apply to YoLD? Red Hat used to have a “Road to Red Hat” monthly seminar series offered to college students on how to get into their internship program. They had an energetic video every month that would lead-off the presentation, and it always had the Ghandi quote in it. They used it in the context of being a then-substantially-smaller company than Sun, Microsoft, IBM, etc – but one that was helping to disrupt the establishment and bring about change in IT worldwide.

Sun and Microsoft for years ignored, laughed-at, and attacked Red Hat because they were not following the mold that so many others had used. They were going into the most staid of technology environments, and acting-out, effectively, a blue-ocean strategy. (Irony – everyone I knew who worked at Red Hat at the time ran Windows as their primary desktop because there were no good (or even semi-good) non-proprietary tools for things like productivity software where you had to continue to maintain “Microsoft compatibility“.)

I remember seeing my first YoLD article back in 2001 – a year or two after I had started “really” playing with Linux (back when Red Hat Linux was in the release 6 family (first edition I ever tried was 3.3 way back when)).

Linux never got “its year”. Instead, it got something far greater – the ability to be healthily ignored. It became ubiquitous.

The same thing was true of Adobe Flash for years: every computer had it installed. It was so widespread, no one thought about it. Adobe never needed the “Year of Flash” – it happened. AT&T never had the “Year of the Telephone” – people got so used to using them that they spread everywhere.

That’s happened with Linux on the desktop. Oh, sure, there are still the ardent fanatics who scream death to Microsoft. There are the religious nuts who get into yelling matches over whether Ubuntu contributes enough back upstream. There are folks who complain that everyone should use the .rpm standard (and those who want .deb, and those who just want .tar.gz files – they can compile themselves, thankyouverymuch).

The simple fact of the matter is that because you can run a “modern” web browser anywhere (Firefox, Opera, Chrome, and more) – there is no over-arching need to worry (in general) about what OS is running the app. The Operating System’s job is to, well, operate – schedule and manage running tasks so users get stuff done. In truth, that should be the job of any tool: enable the user to get work done. OSes should be the concrete and rebar of the computing world – they enable other things to get where they want to go in an organized fashion. The ergonomics of computing – a fascinating area of inquiry, may I add – theoretically has as its ultimate goal that the computer be intuitive, natural, and even invisible.

So, folks, there will never be a Year of the Linux Desktop.

And I’m OK with that.

next bglug meeting: topic ‘raspberry pi’; speaker jordan keyes; 1900 (7p) 20 september @collexion hackerspace

After several months, the Bluegrass Linux User Group (see also G+ page) is resuming regular meetings in conjunction With Collexion – a hackerspace in Lexington KY.

Our first (next) topic is “The Raspberry Pi“, presented by Jordan Keyes (creator of twil.tv (also on youtube: http://youtube.com/twildottv)), at 1845 (6:45p) at Collexion. We’ll plan to “start” at 1900 (7p).

Collexion is located 109 E. Loudon Ave in Lexington.

We are looking forward to a good time being had by all.

Please bring a small donation for dinner (planning to order-in pizza) – any leftover cash will be left as a “thank you” to the kind folks at Collexion for letting us use their space.

Also to note: the new regular meeting day will be the third Thursday of each month.

automatically returning a host to the unprovisioned server pool in hpsa

In conjunction with the customized PXE process I wrote about previously, it could be highly desirable to be able to return a server to the unprovisioned server pool in HP’s Server Automation.

This is a specifically-Linux procedure: though I’m sure something similar can be done with Windows*.

run an ad-hoc script against a target server that contains the following:

dd if=/dev/zero of=/dev/sda bs=512 count=1
sleep 1
nohup reboot

This will erase the MBR and partition table, and then reboot the server.

Before it reboots, however, you need to deactivate and delete the server from SA – otherwise it will not register correctly.

If you’ve already enabled (or not disabled) PXE booting, when it reboots, it will pick the default entry off the PXE menu, skipping the hard drive as there is no valid boot record available to it.

Why would you want to do this?

Well, let’s say you’re doing a lot of build testing (verifying ks.cfg or unattend.xml files, for example) – this could be useful.

Or, maybe you want to get your build process completely streamlined and you’re working with the MBC functionality in SA – again, rapid recycling of machines is highly desirable.

In a later post I’ll discuss freeing the VM from SA in the process (ie, removing it from the ESXi host to fully release resources).

*In fact, you may be able to run fdisk /mbr on a Windows server – but I haven’t tried.