Convert Windows shortcuts into Ubuntu shortcuts
Here's another entry in the "dumb little scripts that work for me and may or may not be helpful to other folks" department…
I use both Windows and Ubuntu at home, gradually transitioning from the former to the latter. I've accumulated a bunch of Windows URL shortcuts, mostly things I wanted to read once so instead of bookmarking them, I dragged their links to my desktop. This creates .URL files which are simple little plain-text two-liners. It turns out that on Ubuntu, and probably similar *nix systems, web shortcuts are also simple little plain-text files. These files have the .desktop extension (though you won't see the extension by looking at the desktop).
I wanted a way to convert my .URL files to .desktop files so that I can just toss them on my Ubuntu desktop and double-click them the same way I would if I were on Windows. This cruddy little Python script does the trick.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | #!/usr/bin/env python # shortcut_converter.py from __future__ import with_statement import os.path import sys TEMPLATE = """[Desktop Entry] Version=1.0 Encoding=UTF-8 Name=%(basename)s Type=Link URL=%(url)s Icon=gnome-fs-bookmark """ def convert(f): """ Takes a full filepath to a .URL file, converts it to a .desktop file in the same directory """ print "Converting %s" % f (filepath, filename) = os.path.split(f) (basename, extension) = os.path.splitext(filename) with open(f) as urlfile: lines = [line.strip() for line in urlfile.readlines()] url = lines[1].split('URL=')[1] dtfname = os.path.join(filepath, '%s.desktop' % basename) with open(dtfname, 'w') as dtfile: print "Writing %s" % dtfile.name dtfile.write(TEMPLATE % locals()) if __name__ == '__main__': for arg in sys.argv[1:]: if os.path.isfile(arg) and arg[-3:].lower() == 'url': convert(arg) else: print "*** %s is not a URL file" % arg |
I used scp to pull over all my .URL files and then invoked the script thusly:
python shortcut_converter.py *.URL
worksforme!
Is John McCain a socialist?
Central to the McCain/Palin campaign's rhetoric lately has been the allegation that Barack Obama is a socialist (which, sadly, is something of a four-letter word). Their evidence: Obama's encounter with the now famous "Joe the Plumber," wherein Obama explained to Joe that the point of his economic plan, and by extension the progressive tax and the liberal welfare state, was to help bring up those "behind" Joe. Obama's misstep was using the (honest) phrase, "spread the wealth around." McCain has used this soundbite to justify labeling Obama with the scarlet letter 'S.'
Yet John McCain embraces the same "socialist" principle:
Here is the relevant soundbite:
When you reach a certain level of comfort, there’s nothing wrong with paying somewhat more.
If John McCain believes Barack Obama is a socialist, then he too is a socialist — it's the very same principle. (For the record, I don't believe either is a socialist. And I believe soundbite politics insults our intelligence.)
I tip my hat to Daniel Miessler for posting about this.
Call for Proposals - code4lib 2009 conference
Hear ye, hear ye, techie librarians and library techies:
Birkin James Diana, representing the host, Brown University, announces a call for proposals for talks at the code4lib 2009 conference:
The code4lib conference is wonderful in large part because of what you folk share.
Head over to the Call For Proposals page and submit your idea for a prepared talk. Information about the time-frame, scope, and evaluation process — as well as the link to the submission form — can be found at:
http://library.brown.edu/code4libcon09/proposals/
Some important notes:
- Proposals can be submitted through Sunday November 23 2008.
- Just like when you vote, use your code4lib username and password.
- You initially won't be able to edit your proposal(s), but I'll have that implemented in the near future.
More information on prepared talks from the proposal page:
Prepared talks are 20 minutes, and must focus on one or more of the following areas:
* "tools" (some cool new software, software library or integration platform)
* "specs" (how to get the most out of some protocols, or proposals for new ones)
* "challenges" (one or more big problems we should collectively address)The community will vote on proposals using the criteria of:
* usefulness
* newness
* geekiness
* diversity of topicsWe cannot accept every prepared talk proposal, but multiple lightning talk sessions should provide everyone who wishes to present with an opportunity to do so.
Do consider submitting a talk if any of that sounds interesting to you.
Not to be dramatic
That to secure these rights [of Life, Liberty, and the Pursuit of Happiness], Governments are instituted among Men, deriving their just powers from the consent of the governed, — That whenever any Form of Government becomes destructive of these ends, it is the Right of the People to alter or to abolish it, and to institute new Government, laying its foundation on such principles and organizing its powers in such form, as to them shall seem most likely to effect their Safety and Happiness.
Just saying1.
- Okay, yes, totally dramatic. [↩]
