Greetings from scenic "No GIS Position Available"!

<< Previous Page :: Next Page >>

Edward Snowden Is Lying His Ass Off About The NSA and PRISM

Date/Time Permalink: 06/13/13 09:06:07 pm
Category: Prophecies

You read the headline right: "Edward Snowden is lying his ass off about the NSA and PRISM." And now I will show you the evidence:


#1. He's lied about his salary already.

Snowden said he was making $200,000 at Booz Allen Hamilton, Booz Allen Hamilton says they only paid him $122,000 - and fired him. Furthermore, he only worked at Booz Allen for three months before taking off, so he didn't even get that much, since that figure is an annual salary.


#2. He's also lied about his job history.

Let's see here: High-school dropout, US Army but discharged for injuring himself during training (having never seen active duty), worked at the NSA as a security guard, quit to hop over to the CIA, merrily skipped back to Booz Allen to subcontract with the NSA again... and every place he's worked at was a few months steady employment at a time. Oh, and he worked undercover all over the world, too. Has anybody else heard of anybody getting such globe-trotting, glamorous mileage out of a GED? Apparently all you people out there sweating four years of college have the system all wrong.

Here's several doubts raised in this Washington Post article:

"For instance, Snowden said he did not have a high school diploma. One former CIA official said that it was extremely unusual for the agency to have hired someone with such thin academic credentials, particularly for a technical job, and that the terms Snowden used to describe his agency positions did not match internal job descriptions.

Snowden’s claim to have been placed under diplomatic cover for a position in Switzerland after an apparently brief stint at the CIA as a systems administrator also raised suspicion. “I just have never heard of anyone being hired with so little academic credentials,” the former CIA official said. The agency does employ technical specialists in overseas stations, the former official said, “but their breadth of experience is huge, and they tend not to start out as systems administrators.”

A former senior U.S. intelligence official cited other puzzling aspects of Snowden’s account, questioning why a contractor for Booz Allen at an NSA facility in Hawaii would have access to something as sensitive as a court order from the Foreign Intelligence Surveillance Court."


#3. A freshman high school student could make a better Powerpoint than this.

So far, the entire alleged PPT file has yet to see the light of day. But from what we see of the slides so far, they don't look like anything created by a government entity, no matter how inept government entities may be. They look like they were created by a crazy person who lies a lot and has delusional spy fantasies. (Or, as the media persists in calling him, a "computer whiz". It's like cheez whiz, but with computers.)

The alleged logo, especially?

I was drawing better than this in my first POVRay experiments back in the '90s. If you believe that this is an actual internal logo created by a US government entity to represent their own program, and not something cooked up by a manchild who suffers from mental problems and watching too many Matrix sequels, please go find a marker and write "STUPID" on your forehead as a warning to the rest of us. I want to be sure to give you the right of way when I meet you at an intersection.


#4. He also claims that he, himself, has impossible surveillance powers.

His claim: "But I, sitting at my desk, had the authority to wiretap anyone, from you or your accountant to a federal judge to even the president if I had a personal email."

The Director of the NSA himself has declared this untrue. Not just that Snowden wouldn't have had that level of clearance, but that nobody, even God himself, has that level of clearance. In fact, the technology itself sounds far-fetched; being able to punch in an email and have it come up with the correct line, area code, extensions, and all, internal or external, listed or private, would likely take a database bigger than anything on one of Google's server farms. After all, even Google doesn't crawl every web page!

An NSA and CIA lawyer also calls this an outrageous pack of lies. It just doesn't work that way; not that US Intelligence can't intercept data streams, but that there are processes and red tape in the way, like there are in any government operation.

Ditto for Snowden's claim about the NSA being able to just jack into every technology company on earth whenever it whims. That's also not just not happening, but impossible.


#5. Snowden also manipulated the newspapers to rush the story without fact-checking it.

According to this report, Snowden played the Guardian and the Washington Post off each other, threatening to publish with the other if they first didn't publish soon enough without fact-checking.


#6. I, myself, have worked security for a government contractor.

Snowden claims that he was able to steal documents from the NSA using a USB thumb drive, while working as a security guard.

I don't mention it often because it was just my starter job back in the late '80s and early '90s, and not what I consider my finest achievement, but yeah, I worked the rent-a-cop beat too:

Here's my old badge, if you'll permit the silliness of posting its photo for proof. With a Rubik's cube, just like Snowden has. And yeah, I'm an autodidact too. And while working as a security guard, one of the places I was posted at was a Parker Hannifin facility in Irvine, California, an outfit which made (and still makes, maybe) parts for the aerospace industry, including government vehicles of both a military and space-faring nature. OK, granted, I can't prove anything beyond owning this tin badge I've had put away in a drawer for years, but I'm sure a reporter with FACT-CHECKING SKILLS could verify everything I claim in my work history.

I'm doing this to point out that, despite having been promoted up as high as post commander within Pinkerton and despite having obtained both full weapons permits and some rudimentary government clearance, I was NOT given top-drawer access to every nook and cranny of the inner workings of NASA and Army designs. Anybody with the title of "security guard" would most likely be spending most of their time either in the parking lot, a booth at the gate, or a desk at the lobby, with a side order of scheduled patrol rounds - most of them outside.

Granted, I suppose I could have gathered up armloads of equipment from the facility and run out to the street to heave them onto the sidewalk and scream "Look! Secrets!" but then, I'm not a lying thief like Snowden is.


#7. Snowden's a Paultard.

Yeah, I know, that's not proof or evidence of anything that would discredit him...

...but it ought to be. Can there be any surer calling card of the crazies in our society than contributions to Wrong Paul's campaigns?


#8. Snowden is one of you.

Sure as hell isn't one of us.

But one of you... as his interests along his lifetime are reflected in his digital footprint under the screen name of "The True HOOHA." Yes, far from having left a hackerly "small digital footprint" as many are claiming, he has in fact always been right in front of us, being a whore for attention, clowning it up with juvenile fratboy-ish stunts, being a video game and anime fan, and of course being a Paultard online in forums.

Check this. This, ladies and gentlemen, is your International Man of Mystery, your Hombre Secreto, the guy who says he's, quote, "always been a spy," unquote.


Conclusion:


I don't lay the blame entirely on him. He's a sick, pathetic, delusional, wasted con artist with serious mental issues and a few crimes to answer for if even half of his stories are true. I blame the media circus that has been built around this figure. I can't think of a single major publication that hasn't fallen for this human firehose of bullshit, and I'm personally never trusting the "reporters" who broke and built and hyped this story ever again, not even if they just say that water's wet.

Finally, I'm blaming all of you for tolerating this shit. You're wallowing in it. It's not funny. Government is serious business, and once again the Internet Hacktivist Hivemind has ruined the serious business of fixing what's wrong with government.

Please go put yourselves to bed without any supper tonight, and then never give this idiot another minute of attention as long as he lives.

UPDATE And lo it came to pass the very next day, Snowden Is Lying, Say House Intelligence Committee Leaders You're welcome for the tip, Slashdot!

Follow me on Twitter for an update every time this blog gets a post.
Stumble it Reddit this share on Facebook

To Mozilla and the Rest Of The Open Source Community: Stop Making Idiots Of Yourselves About PRISM

Date/Time Permalink: 06/12/13 08:21:43 pm
Category: Prophecies

All this howling in the wind will accomplish exactly doodly squat, just like the howling over these non-stories accomplished:

  • PATRIOT
  • (end) The Fed
  • DMCA
  • KONY2012
  • Net Neutrality
  • OWS
  • NDAA
  • SOPA
  • PIPA
  • ACTA
  • CISPA

Every summer, huh? Hey, how did #OccupyWallStreet go for you? Huh? You sure changed that 99%-vs-1% situation around, didn't you? But we got that pretty souvenir hashtag out of it. I was right about all of the above being alarmist bread-and-circus prolefeed soap-opera bullshit that didn't mean anything, AND I'M RIGHT ABOUT THIS TOO!

I'll tell you right now: Every bill, law, or act ever to be proposed in Washington forever that brings the "hacktivist" cockroaches out of the Internet IN THE FUTURE will also be alarmist bread-and-circus prolefeed soap-opera bullshit that won't mean anything, pass or not, AND I'M RIGHT ABOUT THAT, TOO, AND EVERYBODY READING THIS KNOWS IT.

Let me put this straight:

I am no longer tolerating willful stupidity in my open source community. I expect it from prepubescent stoned bums hiding in mommy's basement in a nest of filth, not from a corporation.

The government is not snooping anything in 2013 that it wasn't already snooping in 2003, 1993, 1983, 1973, 1963...

It does not matter how much data the government collects. The US intelligence and antiterror community is already the most enormous and inefficient bureaucracy in human history. They aready have 25 copies in 13 agency branches of everything you think you're going to stop them from collecting. Let them collect more data they can't read, can't parse, can't process, can't afford to warehouse. LET THEM CHOKE ON IT

This whole moronic fiasco over the NSA and PRISM is a fake, contrived, reality-show, tabloid piece timed precisely at the first day of summer vacation to give delusional students something to piss about for three months and then forget forever. The petition goes nowhere, does nothing, couldn't change anything even if it did do something.

Not only is this not how a first-world democracy works, you are not even smart enough to participate in one.

Every word that has come out of Edward Snowden's mouth is a BIG FAT LIE, which WILL be demonstrated presently as soon as the fact-checking branches of the media (if such an animal exists, hello out there?) catch up with his BIG FAT LYING MOUTH.

Everybody who cares what kind of reputation the technology community has, needs to be boycotting any company or media source that mentions this gum-flapping idiocy one more single time. How about the people with actual SENSE do some activism for a change???

Huh? Where's Snowden's credentials? So far I haven't seen so much as a driver's license out of this kid, just four or five tabloid magazines who went on to cover his freaking girlfriend. Ask yourselves, people, is it more likely that a big bad organization like the NSA, supposedly capable of blowing out the sun (to hear you people tell it) couldn't stop one zitty pothead from defeating their dastardly plans... or is the whole story a crock?

Seriously, nobody but me has the wisdom to see through this?

Nobody but me had the wisdom to see through PATRIOT, The Fed, DMCA, KONY2012, OWS, SOPA, PIPA, ACTA, or CISPA, either. What, am I to just keep throwing it away for free out here?

I worked in government, too, you know. I also work in media. I'm the one blowing the real whistle here. Where's my cover story Time magazine spread?

And if you want somebody to stop watching you, the thing to do is sit down and shut up!!!

Footnote While prowling the archives of one of the greatest blogs ever, WFMU's "Beware of the Blog", I chanced upon this masterpiece of a pullquote:

"One thing I see the liberal writers saying over and over is, “Americans aren’t stupid.” I can’t believe that the pointy-heads who say that have ever been to America because, if they had, they’d realize that lots of Americans are, indeed, stupid. Deeply stupid. Not only are they stupid, but they are personally offended by anyone who’s smart. The teacher asks a question. You answer the question correctly. “You think you’re so smart!” hisses the stupid American kid sitting next to you in class. If you’re really smart, you’ll soon realize the only way to get along is to play dumb. If only 10% of Americans are stupid, that’s still millions and millions of people, or “voters” as our politicians like to call them."

Well said, Iowa Firecracker. Very, very well said.

Follow me on Twitter for an update every time this blog gets a post.
Stumble it Reddit this share on Facebook

How To Find A Spy Dollar

Date/Time Permalink: 06/09/13 10:52:22 pm
Category: Humor

How to find a spy dollar.

If any of you readers pass this around, and we start seeing bills in circulation with the eye mutilated or marked over, we'll know our campaign to raise citizen's awareness is working!

PS If anybody doubts this, you could always direct them to the hollow spy dollar at the CIA museum website. It's just a coin hollowed out to a little safe, but it makes you think... It was actually referred to as a "spy dollar" at this old numismatic listing... Did I mention that I'm also a coin collector?

Follow me on Twitter for an update every time this blog gets a post.
Stumble it Reddit this share on Facebook

Entire Internet Thunderstruck To Discover That US+UK Intelligence Agencies Do Their Job

Date/Time Permalink: 06/07/13 10:51:47 am
Category: General

Why are we talking about this again? Didn't we just do this? Let me repeat it again:

It doesn't matter how much data you collect.

What matters is having the eyeballs to read that data.

Apparently this simple, simple point is too hard for anybody but me to understand.

Look, if Johnny collects every streaming minutes of data on all 7 billion humans on planet Earth, and for every hour's worth of surveillance Johnny collects, it takes three hours to watch it, analyze it, research it, and decide whether it's important or not, how many staff members will Johnny have to hire just to keep up with the day?

That is correct, Johnny will have to hire three times as many people as exist right now.

But here comes summer, when thousands of Cheeto-encrusted bong rats suddenly have a lot of free time. And since there don't seem to be any new-released blockbuster video games to soak up that time this month, the next best thing for them to do for fun is scream and panic about nothing.

Scream! Freak! Even the EFF, which is getting way too #Occupy for my tastes lately Spaz! Gurk! And heebie-jeebies!

Who asked the US and UK governments to do this? Oh, United States and United Kingdom citizens, of course.

Remember, you wanted the government to keep you safe from the terrorists. Well, in a shocking development, it turns out that terrorists are, in fact, human beings who just up and decide to do bad stuff all on their own, without warning anybody. So to watch terrorists, they have to watch you.

Not that it does any good.

Me, I'd just as soon end all intelligence and antiterrorist programs of any government. They don't do shit. They're a black hole for money to disappear down. And the overblown danger is minuscule. The largest terrorist attack on US soil, 9/11, only scored 2,996 fatalities. In that same year, 42,196 US citizens died in..... traffic accidents. Every surveillance agent could go be a public-service designated taxi driver and save more lives, and it'd be cheaper on the budget too.

But it just isn't sexy to get worked up and worried about traffic accidents, is it?

No, it's more fun to imagine comic-book villains hatching dastardly plots against the US and UK, because they hate you for your freedom, see, and then turn around and get worked up even more because the people you told to do something about it are trying to do something about it.

And this, ladies and gentlemen, is where all the problems in the world come from. Quit getting your reality from comic books and watch how fast you start making better decisions at that ballot box.

Update A pretty fantastic post-mortem on the media fiasco that has been "PRISMgate" over on Daily Banter... and yes, this whole kaka-storm has made some strange bedfellows of mine. I even found myself not loathing Techcrunch for a half a minute.

But it's provided the inspiration for a satire, which it is your civic duty to spread and evangelize, citizen.

Follow me on Twitter for an update every time this blog gets a post.
Stumble it Reddit this share on Facebook

In Case You Missed It: Linux In Space!

Date/Time Permalink: 05/30/13 01:26:00 pm
Category: General

I know I certainly didn't see this story get nearly enough exposure: Robert Rose of the ambitious (to say the least) private enterprise space program SpaceX says he uses Linux software throughout its technical base. In fact, he was a Slackware slackie as far back as 1994 (hardcore former Slackware bros represent!) Hey, he even quotes Fred Brooks!

Putting aside my considerable skepticism at the SpaceX project's feasibility, I think it's a notch in Linux's belt to be so thoroughly trusted with space hardware. And a heck of a lot more notable than a sticker on a racecar (yes, I'll never get tired of beating up con artists, even when said cons have moved on to fake cancer schemes).

And now a digression. If all you came here for was the SpaceX story, adios!

I came upon this month-old news by way of this hours-old post comparing the Linux kernel favorably to the moon landing in terms of notable human achievements. Well, yeah, I do agree that Linux and the moon-landing at least belong in the same top-ten.

But I would raise the following points:

#1 The initial space program did a lot to shape our current computer industry. Inventions born out of necessity in reaching the moon later came down to Earth to power our desktops and smartphones. So really, Linux (and Unix and all software) at least has some debt of gratitude to the space programs of the past.

#2 When people are grousing that "we don't do big things anymore", they're talking about the United States. Linux was started by a Finnish programmer; most of worldwide Linux adoption as well as Linux development has happened outside the US. Here, watch what comes up when I Google "government adopts Linux" in quotes:

Notice anyone big missing from the party?

What US-based Linux adoption there has been has mostly been the product of corporations that are also multinational. There's no Yankee Doodle playing when Linux boots, bub.

Sure, we know that other countries are going on into the Jetsons age while the US will stay in the Flintstones era. We figured that out when we started learning feet and pounds and quarts in school. Or when we compare our Internet speeds with our international peers. Or, heck, when we see pictures of infrastructure in European plus-sign-flagged countries while we're lucky if we can drive a whole truck over an American bridge.

We got into the space race in the first place because of Commie paranoia. I sometimes wish the US would catch the same fever over Netherlands Socialism paranoia, because, by God, that would be somebody to beat!

Anyway, Linux in space, yay for the computer geeks of all nations. In spite of Microsoft... an AMERICAN software corporation.

Follow me on Twitter for an update every time this blog gets a post.
Stumble it Reddit this share on Facebook

Finally Found A Way To Record Desktop MIDI Output...

Date/Time Permalink: 05/27/13 01:58:56 pm
Category: Multimedia

Wow, since beginning playing with Linux desktop composition, this desktop music stuff is insane! Prithee, why in blazes does it have to be so complicated? Let's count the dialogues and windows we have to have open just to record the simplest audio file:

  1. Start QJackCTL. Its sole purpose is to make Jack Audio work.
  2. Now open Seq24 and load the song (which was saved before in MIDI format). My example song uses percussion and four instruments, and it's a very plain tune at that.
  3. Open Hydrogen, load the drum kit this uses.
  4. All the instruments are in WhySynth, so WhySynth copy #1...
  5. WhySynth copy #2...
  6. WhySynth copy #3...
  7. WhySynth copy #4...
  8. Now to play the whole song from Seq24, open the song editor window in Seq24.
  9. Now open... Wait, "Jack Capture" in my menu dies with "failed to open jack_capture_gui2." Forget it. Open a terminal to run jack_capture from the command line.

That's nine windows on the desktop:

Oh, and the command you see there, 'jack_capture --mp3', don't work 'cuz jack audio wasn't compiled with mp3 support. Ha ha, how stupid I was to expect that! OK, vanilla jack_capture gets it in .wav format and figure out what to do with it later (actually, it's just "ffmpeg -i file.wav file.mp3" if you don't care about quality).

One thing I've learned: Don't scroll the song editor window while it's playing. That made the first recording sound scratchy. Yes, I know, it makes no sense, but the second time I did this it worked and the only thing different was not touching the window until recording was over.

If you think that makes no sense, wait until you see this one: I was trying to set up my ancient and increasingly useless Fedora laptop to run all the fun sound toys. Except nothing worked, I had a dozen dead programs in my multimedia menu. No error messages, no crashes, nothing, just doesn't go.

I fruitlessly scoured the docs and searched the web frantically trying everything and breaking the system even worse many times. You know what the problem turned out to be? When you install Fedora, it doesn't write the hostname to /etc/hosts, and all the Jack-Audio-dependent tools' GUIs look there and won't run without knowing which computer to start on.

No, really.

How stupid of me to have not thought of that first, right?

So, for Googlable future prosperity: "jack audio" "GUI" "hostname" "/etc/hosts" "seq24" "hexter" "wsynth" "xsynth" "whysynth" "DSSI" I'm leaving out amSynth (which doesn't have a Fedora package and the tarball won't compile) and Hydrogen (which runs just fine).
First clue found here on Linux Musicians' forum, way at the bottom. Just slap you IP (127.0.1.1 or whatever) into /etc/hosts, plus your $HOSTNAME (what you named the computer when you installed the system; the part that helps other computers find it on the network without memorizing a MAC address), save, reboot, everything works now.

BTW, I got 90% of all this going on the original desktop Mint system, but jack_capture just plain old doesn't install there. No, really, I have dozens of "jack_*" programs on tab in the terminal, no capture.

So, two fixes to my former hacks: (1) Can finally compose, play, record, and play back on one machine. (2) No longer need notepad to write down instrument hook-ups when saving a MIDI from Seq24, because duh, just rename each module after whatever it's hooked up to.

Oh, almost forgot, the wretched little song I recorded:

greasy_burgers

That kinda takes the fun out of figuring this stuff out, when you suck so bad at music composition in the first place. But somebody who really groks computers needs to go discover how to make this work because there's hundreds of would-be musicians out there frustrated trying to figure out what the hell an "etc-hosts" is.

But I'm still going to make my own ringtones. And perhaps some custom "on-hold" music for my home office...

Follow me on Twitter for an update every time this blog gets a post.
Stumble it Reddit this share on Facebook

Meet the Hydrogen Digital Drum Machine

Date/Time Permalink: 05/26/13 02:36:56 pm
Category: Multimedia

Somewhere in my music writing, I remember an anecdote about Jerry Leiber and Mike Stoller, the songwriting team behind many hits by Elvis, The Coasters, and many others. Apparently when Leiber & Stoller hits were topping the charts, a music producer walked into a drum store and asked for the Leiber & Stoller drum kit. The store owner did a slack take, then responded that if he really wanted the Leiber & Stoller sound, he'd have to buy every drum in the store.

Leiber & Stoller would have loved Hydrogen.

Not only do you have dozens of drum kits at your disposal sensibly grouped by music genre, but you can download more and make your own custom kits besides. Here I am downloading the death metal drum kit, because \m/ METAL! \m/ Not that I have the skills to compose any.

The interface is pretty simple once you poke around some and read the excellent, complete manual. It will strike you as more familiar if you've already used LMMS. It's also one of the more well-behaved Linux desktop music-making apps, not conflicting with other programs that way some DSSI programs do (at least not usually). It's fairly stable, but on Mint I did get it to panic and die once when dragging and dropping instruments from two different instrument categories, while the Fedora install stayed stable. Huh.

Anyway, Hydrogen also works great as a Seq24 plug-in DSSI. Here's a cheesy little demo I composed using a full Hydrogen percussion library and a couple Hexter instruments:

jungle_telegraph.mp3

As always, my demos are meant to show off the software and not my non-existent ability. I suspect that to the trained ear, my MP3 files sound the way high school kids' Powerpoint presentations look. Every gimmick thrown in just because it's there.

Follow me on Twitter for an update every time this blog gets a post.
Stumble it Reddit this share on Facebook

Court Conviction Confirms Everything I Ever Thought About LULZSEC

Date/Time Permalink: 05/18/13 06:20:44 pm
Category: Geek Culture

Many times on this site, I have railed against online "hacktivists." Quite a few people have been critical of me for doing it, claiming that I must be a mean old Grinch who hates freedom-fighting and justice. So when we finally see a hacktivist group in the harsh light of day, without being shrouded in cyberpunk romanticism, it just makes me smile all the sweeter.

Four British members of LULZsec have begun serving relatively light sentences for various cyber-vandal crimes. Far from the Robin Hoods that websites like Boing Boing, Reddit, and 4chan like to characterize them as, they are revealed to be the same breed of petty thugs that steal your hubcaps and set fire to your trash cans.

Now for the fun part: The defense's pleas for the LULZsec members paints a picture that perfectly matches the way I imagined them:

  • Kids.
  • Claiming every psychological disease in the book, all the time.
  • Oh, and also mommy and daddy didn't love them enough.
  • Socially isolated.
  • No clear idea or goal. Waffling between "let's have some fun dude!" and "I'm Batman!"
  • Ignorant.
  • Arrogant in their ignorance.

Of course, the troll legion (who has my site on speed-dial) will insist that because I'm anti-LULZsec, I must be pro-Westboro-Baptist-Church (one of their targets) forgetting that I can dislike both equally. Two trolls do not make a citizen. Ditto Sony, a company I will always condemn. I condemned the presidency of GWB too, but you'll notice I didn't get arrested for committing any crimes against him.

I will say it again: Hacktivism HURTS THE CAUSES IT PROPOSES TO HELP. Now that LULZsec has gotten themselves busted like a meth lab, they have given credibility and honor to their targets. WBC and Sony can now point to themselves as victims, leveraging this case for the further abuses of the legal system they have in mind.

Follow me on Twitter for an update every time this blog gets a post.
Stumble it Reddit this share on Facebook

A Bash script to force Image Magick to use zero-indexing when it converts GIF to JPG

Date/Time Permalink: 05/14/13 12:33:38 pm
Category: HOWTOs and Guides

I can't believe this hasn't been solved somewhere before, but I was converting a .gif to individual image frames for a project when I discovered this behavior.

UPDATE: Guess what??? image magick CAN output zero-padded files, just by doing:

% > convert mygif.gif mygif_%05d.jpg

no wonder I couldn't find it by Googling. I was looking for an option switch. But you'd still need to find out how many zero-spaces to use for individual gifs for each case. My thing is, I hate remembering fifty commands when I can name a script after what I want it to do and forget about it.

We now return you to my folly, which you can still adapt for programs which don't zero-pad:

The command:
%> convert mygif.gif mygif.jpg

What it does with the file names:

mygif-0.jpg
mygif-100.jpg
mygif-101.jpg
mygif-102.jpg
mygif-103.jpg
mygif-104.jpg
mygif-105.jpg
mygif-106.jpg
mygif-107.jpg
mygif-108.jpg
mygif-109.jpg
mygif-10.jpg
mygif-110.jpg
...

What it should do with the file names:

mygif-000.jpg
mygif-001.jpg
mygif-002.jpg
mygif-003.jpg
...

That's because not all programs that are going to handle these image frames know to ignore Bash-file-sorting order and substitute logical numeric file-sorting.

And I'm searching all over the place, but there doesn't seem to be an option in convert to force this file-naming convention, or else I'm not searching for it right. Anyway, this script whacks the file names into shape:

#!/bin/bash

#
#  Apparently when you call image magick to convert gif to jpg
#    it doesn't use zero-indexing to ensure the files list
#    in order for each program.
#
#  So... ouch!
#

for FILE in $(ls *.gif)
  do
    DIGITS=$(identify $FILE | wc -l | wc -c)
    convert $FILE ${FILE%gif}jpg
      for JFILE in $(ls *.jpg)
      do
        NUM=$(echo $JFILE | cut -d- -f2 | cut -d. -f1)
        PSTRING="%0"$DIGITS"d"
        NEWNUM=$(printf $PSTRING $NUM)
        SEDLINE="s/-.*\./-"$NEWNUM"\./g"
        mv $JFILE $(echo $JFILE | sed $SEDLINE)
      done
  done

exit 0

You'll note the convoluted series of variable abuse. That's because of the various quirks of the individual text-mode tools.

First, $DIGITS finds out how many zeros to index for the file names. Since you want this to work on any gif with any number of frames, we have to use Image Magick's identify command on the gif, pipe it through wc -l to count the frames, then use wc -c to find out how many digits that number is. As you can see, we end up with one superfluous zero here, but the hell with it at this point, it does the job.

I also have to extract the number from the file name, and drop it into the $NUM variable.

In a perfect world, I could just expect to say something like:

% > mv $FILE $(echo $FILE | sed 's/-$NUM\./-printf "%0$DIGITSd" $1./g')

But no.

Second, sed won't take a mixed variable string like "s/$PATTERN1/$PATTERN2/g". So you have to put the sed argument in a variable.

But we're zero-indexing here, and the only tool I know of to do that is printf, and guess what? printf also won't take Bash variables in its argument string! So now you have to make $PSTRING to build the argument to printf so you can make $SEDSTRING to build the argument to sed...

So, is that done now? I'm crazy for doing it this way, aren't I?

It does work. If you use it, be sure to use it in its' own special little directory so it doesn't wantonly mess with other unrelated files...

Follow me on Twitter for an update every time this blog gets a post.
Stumble it Reddit this share on Facebook

<< Previous Page :: Next Page >>
suddenly the moon