One thing I enjoy doing with my Asus Eee Ultra Laptop is playing youtube files from a flash drive hooked up to it. That way I don’t need internet access, and I can play a bunch at a time, while in bed before going to sleep, or whenever.

The most common script for downloading YouTube videos is “youtube-dl”, written by Ricardo Garcia Gonzalez. This can be Googled and downloaded freely, and runs on all platforms without modification. Python is good that way.

Before I get to my small helper script, I’ll add that if you indeed want, “out of the box”, you can call this script with a bunch of youtube URL’s as parameters. Don’t know of a limit.

c:\python\python.exe youtube-dl http://youtube.com/watch?v=BqLvBUSJucg <anotherurl> <anotherurl2>

But if you’d like to just simply have a text file that you open up conveniently (name it youtubeurls.txt, cuz that’s what it refers to in the script below or change it of course), each line containing one url, and be able to call one script to take care of it, instead of having to paste a bunch of url’s in the command line, use the following script (maybe there’s a way to do in DOS, but I couldn’t figure it out.)

————————————–name this something.py—-

import os
urlfile = "youtubeurls.txt"

youtubefile = open(urlfile,'r')
for line in youtubefile:
    os.system("c:\python25\python youtube-dl.py " + line)

youtubefile.close()

Somehow Zonealarm got set on “High” for internet security, and I did not know it. This prevented web pages from loading, and it prevented outlook from getting email. The error messages looked exactly like I either had a cable problem, or something with my network card.

Embarrassing to say, I spent half the day troubleshooting, and then took a 20 mile drive to Fry’s for another network card.

Yes, because of a radio box that was set in Zonealarm.

All I had to do was take the basic troubleshooting steps that anyone, even the least tech-savvy should know, and simply remove all resident programs to make sure software was not the cause.

So I got back with the network card, plugged it in, and it is working, but only because zonealarm was accidentally not loaded due to another reason.. i didn’t know it was connected to the problem. I thought the new Network card fixed it.

Upon another reboot, somehow Zonealarm reverted to that High security radio box being set, and dang if the Internet was once again unreachable.

.. does Checkpoint (Zonealarm) do this on purpose when it knows that you’ve been using their free version for many years and not contributed a dime to them?

So really, though, the “Thanks Zonealarm” is moreso a genuine thanks, rather than the sarcasm that probably comes across at first.

This teaches me to the need to be smarter when it comes to eliminating causes that are soooo easy to eliminate (right click on context icon, choose EXit!)

As much as I overwhelmingly love, I mean LOVE, my Garmin GPS, it doesn’t exactly help me meet my health/financial goals. I left a motel this morning that I stayed at last night (apt neighbor problems, don’t ask, I’m trying to maintain sanity by getting away once in a while).

And of course the Garmin was going to get me home.

However, it also has this ability to let me type in “Starbucks” and lead me to the closest one near the motel so that I could indulge in a grande drip and a Classic Coffee cake (which are getting smaller somehow) before the day even starts.

I wish I would have just tapped the “To Home” button before even thinking about the “Spell Name” function, so that it would just get me home instead of passing-go directly to Starbucks.

That’s it, no important point other than that.

(yes, that’s right, another crappy apt neighbor situation after moving away from the previous ones I mentioned 2 or 3 blog entries ago.. why don’t i rent a house?)

I decided I have been going through too many loops every time I need a simple Associate link for an Amazon product:

- I have to go look at another page where I have a link on a website, and get the amazon Associate ID

- Get the ASIN for the book

- Copy the entire link from the first step and put in the correct ASIN in its spot.

My solution:

A python script using pyAWS.

All I need to do is call on the command line

createAmazLink.py

What I get back:

A menu of possible products listed, and each of them numbered:

I just choose the best match, i.e. the book that I actually want, and python calls Window’s notepad and there is the complete URL to copy into the clipboard ( I chose to do it this way, in case I already have something in the clipboard - plus you can change the link text if you need to, before copying into clipboard )

To install,

1. get Python 2.4 at least.

2. download and install module pyAWS

3. download createAmazLink.zip here

4. open createAmazLink.py and change to:
- your Associate ID (If you don’t have)
- your API KEY (If you don’t have)
- Also an optional constant variable that decides how many results are just too many
The variable is called maxResults and is currently set to 30.

5. To run: Run your DOS command line (linux should work too but you’ll have to edit the py script to take out the call to notepad), and the command is:

/pathto/yourpython/python createAmazLink.py some search terms

Some additional Recommended steps below

  • Download slickrun (i posted about this previously)
  • Set up a “slickrun command” that calls createAmazLink and prompts you for the keywords to search Amazon for


A Possibly Major Caveat: It only works for Amazon books, not the other stuff like music, DVDs, etc… I’m working on this, and you can go to the contact page (link on top menu) to be notified.


If you know of anyone looking for a Python developer (or even php), please click the Contact link above.

Since I can’t even get my .exrc working on windows, I’m going to give up on it as Windows.. that’s the main point of using Vi: the macros, .. and you need .exrc for this. It’s just too “wrong” to spend so much time on the configuration. I got websites to do.

UPdate, 3/23/08, I just upgraded to UEdit 14.00, so I’ll use that on Windows at home, and if I get a job with a linux/unix environment, VIM is the easy choice. I really enjoy using it in its natural environment.

Not sure why i’m keeping this blog going, but wanted to mention the asus eee is my new gadget infatuation. It’s a full-fledged laptop, but small.. i mean really small.
Check out on amazon.. , or asuslaptop.com I think.
It comes with Linux, though you could put XP on it (though it would be pain to do that for me, becuase I’d have to install NT 4 first, and then use my XP Upgrade Only Cd) . I’d like to keep linux on it anyway.

This is theee machine to use as a mobile internet computer. Very, very small, verry light and many satisfied users.

eeeuser.com

eee at www.amazon.com

… Beefing up miscellaneous skills, especially because I became permanent recently at a company doing php/mysql. Would like to beef
up even more php-specific design pattern knowledge, mysql, unix, etc…

… Bought a TV finally, since moving here to Seattle a year ago, and then went ahead and bought the second (and last) season of Dead Like Me, Season II of Lost and Season 2 of Stargate SG-1 (something I didn’t realize i liked so much until somewhere in the middle of season 5, but then had to stop watching after that).

… Looking for another place to live. . I must have been, in a past life, in a war where I continually heard bombs and other noise, above me. Because I absolutely can’t freakin stand my upstairs neighbor’s occassional noise, even though he’s not an especially loud neighbor. In this current life, I just absolutely can’t stand noise above me..

I”m not sure why I chose this unit. I guess I was so stoked when I found a brand new apartment building, just built, with nice washer and dryer, oven, etc.. so I didn’t think it mattered that anyone was going to be living above me. So .. the major duhhh was in signing a one-year lease.
On weekends, the obnoxious noise factor kicks in though. He’s relentless in his decluttering, vacuuming routines. I need to start planning something out of the apartment for today as a matter of fact. — I might just plan to purposely get nothing done on the weekends and just take bus rides, and see movies or something, just to avoid the noise at home, until I find another place.

… Starting a new blog, very anonymously, where I’m going to talk about, comment, complain about, etc.. the job search process and other factors associated with the technical field. Mostly about recruiters though, and the painful interview process.. But the thing is, I’m going to focus MOSTLY on the poor attitudes of job searchers, that I see in various forums, (including the dice.com forum) where people whine about not being able to find a job. It’s all about what the world owes them, and not about them maybe making an effort to makes notes about what their atittude was like during the interview and then improving on them.. and maybe reading a self-help book on reducing anxiety, etc.. I have a lot to talk about.. as you can see.. this is the longest paragraph so far in this blog post.

… Books and more books. I buy a lot of books about the mind and the subconscious, and how beliefs shapes your life, and just a lot of metaphysical stuff that goes beyond the mind. I didn’t realize how many I have been buying but not reading. Even reading on the bus, doesn’t allow you to catch up sometimes.

.. Eating better.. And this requires work, because you need to chop vegetables, and plan shopping and make stuff beforehand.. etc.. it takes time, unless you’re Oprah and you hire someone to do all your healthy cooking

When I worked for a real estate listing website in ‘99, the language was perl and we were using MKS Tools (so that we could simulate nix over windows) and basically VI was what most people were using. My impression was that thing thing was just “wrong”. I looked at it as the equiv of notepad for windows in the sense, that it was the default editor that was always there for the particular operating system. So I saw it as a painful tool, in the opposite sense of notepad. Too cryptic, too hard to use.. too many hidden powerful things that only someone very android-like could be attracted to.

I hated the fact that I had to remember to type “I”, or else I’d get all of these strange messages at the bottom, like “mark not set”, or “recording”. Drove me up the wall.

But then I worked a contract position at a cool little seattle company selling research material for students a couple of months ago, and VI is was what the owner uses. He had a very “robust” .vimrc. I was pretty impressed by how powerfully you could customize it. And then bought Learning the VI Editor and spent an entire night doing internet VI tutorials.

The primary reason to make the permanent switch: The O.S.-independence-ness of it.

I can now work and accumulate to my .vimrc file that I use at home, and I know that no matter what job I go to (as long as it’s open source, or at least not require a windows IDE), I can use at anywhere.

I’m now using gvim on my XP machine at home, and I use a dos batch file to open up files. Having just switched from UltraEdit, where I had the benefit of projects, and a project menu where I pull open just the files I need,. I had to figure out how to come close to that convenience.

The answer was just to look up in the vi reference, how to do tabs, and how to do automatically open files on the command line.

It’s VI -p file1 file2 fileN.

So I use a dos batch file that opens VIM, and even better, I use slickrun, a Win tsr utility comes up with WindowsKey-Q to run that batch file.

So it’s just win-Q, OJ (a slickrun magicword that runs openjungle.bat, which opens my files for junglehappy.com website), and I have an Instant VI window with tabs.

The ability to do anything I’d need in UltraEdit, JEdit.. is pretty much there. It’s just simply a matter of spending a little extra upfront time for learning. The way it splits windows is so much better than the way that UltraEdit and other MDI-style apps do it.

What’s next is to start mastering scripts so that I can start writing text macros and be able to insert debugging commands, or other frequently needed text strings into my php/python/ruby code.

As far as the links section in this post, instead of trying to give you every vi link that I find helpful.. here is a link that has a healthy number of VI resources at the bottom:
The Vi Lovers Home Page

Next Page »