Upgraded Wordpress, Facebook Attack!

At long last, I’ve upgraded wordpress: it was surprisingly painless, since I’d finally figured out how to smooth the process. Well, I’m going to be upgrading much more often now.

Also, I’ve taken to writing stories on-the-fly for various posts on Facebook. I’m thinking about posting them here for posterity, so here’s the first one.

Friend status update: can't concentrate! :(

Me: having to exact revenge does wonders for focus. of course, it might not cause you to focus on what you want, but that's a small detail

Friend: what?

Me: Your entire extended family dies in a series of accidents at the optometrist's office: you later learn that a cabal of optometrists has decided your family would play a key role in alleviating the need for optometrists, by eventually expressing genes that could be used to engineer 20/20 eyesight in everyone, thus putting them out of business (Iknow, I'm not good at bio bs). After learning this, a gang of optometrists burst in with overpowered lasik machines and try to kill you too. You immediately go into hiding, building a new identity, tirelessly working to become a martial artist and study that which you hate, optometry, in order to infiltrate the ranks of the optometrists and destroy them from within. You get a degree in optometry in half a year. You slowly move from office to office, an intern at first, then an accepted optometrist, but only during the day: at night, you study and prepare for the final showdown, fighting disgraced optometrists to test yourself. You don't need sleep; the desire for revenge is too strong within you. You befriend an intern, but he accidentally finds about your pogrom, and you have to lasik him in the back. The police are closing in, but the cabal finally convenes... for the final time. You lock the door behind you, and run: the police are close behind, but they are no match for a properly planned escape route and corrective eye surgeries timed to fail catastrophically at this exact moment. Eventually, you are alone on a roof, sirens fading into the distance, watching the sun rise... what do you do now?

Tomorrow may or may not be productive: I'll try and get *something* done while celebrating a good friend's birthday. ?

Fun Friday #1: EZLO Upgrades!

So, I’ve decided that every friday will be devoted to ignoring homework as much as humanly possible, and instead working on one of my side projects. So, today, I fixed the showing older document function (technically, actually made it publicly available), fixed the image handling so that it works with the dual LaTeX engines, and just did some plain ol’ code refactoring for the image handling. You’ll also notice that there’s a new reload function that will reload your images for you, so you don’t have to reload the page to get the newest images uploaded by someone else.

A quick note: once you’ve inserted an image, changing the engine will not change the file extension for image code that is already inserted. Well, if I just lop off the file extension, it still works: plus, the image code should clean up after itself, and pdftex/vanilla latex are probably smart enough to look for the right extension (eps/png) so it should be all good, even if it doesn’t clean up well. Note to future users/self when documenting: vanilla latex will use the eps format will use lossy compression: pdftex images will use png. Just a caveat there…

Also, there is an annoying tendency for the mysql server to run off and consume 100% cpu on a single core system. It’s happened several times, and I can’t get into mysql to figure out what’s going on. Also, chrome (at least edge) doesn’t seem to like editarea, since it screws with the overlay. I’ll have to figure that out sometime: maybe later. It is, after all, 1am, and I need to sleep.

EZLO Update

I’ve done some work on EZLO! The first time in at least a month! Even though I haven’t exposed the functionality, you can access your old stuff now. Also, I gave the login page a facelift and exposed the link to the quickstart. Now for outstanding issues:

  • Diffs *need* to work. If more than one person (myself) uses this at a time, bandwidth could become a problem. Also, diffs would allow multiple people to work on a doc at a time.
  • Images need to be overhauled to handle multiple engines. Also, the thumbnails are cute, but not functional. I should probably combo thumbs with names, so that people also have an incentive to rename to something meaningful.
Smaller issues that I want to overhaul eventually:
  • Overhaul the visual style of the site.
  • Overhaul the templating system, make insertions votes, allow ajax search.
  • Support for Bibtex.
  • Custom keybindings.
Okay, so enough dreaming: time to do homework.

Printing Envelopes with Cups and the P1006 [Redacted]

Although it’s not technically a hack, I put some good minutes and iterations into making this work, so here’s a system I cobbled together one late night, when the rent was due and my handwriting bad.

Doing envelopes is not especially straightforward under Linux (as of yet). Open office does have an envelope wizard, but one has to play with the page/printer settings until it prints in the right direction, and then it prints down the middle of the page. Oh, and the HP P1006 does not take a single envelope: it won’t see a full page, and will refuse to print.

To get the printer to take an envelope, you have to combo it with another, full sheet of paper. Merely laying the envelope on the sheet has mixed results: it definitely works, but the envelope tends to move and the addresses come out strangely. Tape may work, but I’m not sure how much abuse the printer will take (I’m guessing a whole lot, but don’t fix what ain’t broke? (Which is actually a bad sentiment: I’m guessing real scientists would look to break things)).

To work around the fact that it seemed nothing could print an envelope correctly, I finally went back to the CLI, and found a new command: lp. This guy prints stuff from the command line, with arguments that control where it prints and how it positions the printing document. Read the man pages for more: the final command I ended up with this

#!/bin/sh
lp -d HP_LaserJet_P1006 -o position=right -o landscape -o com10 $1

Which reminds me, I really need to grab a code formatter for wordpress. Tally ho!

Anyways, save that into a file, chmod it so you can execute it, and pass it the name of the PDF. You can make a envelope PDF with open office just fine.

Hope this helped any poor souls out there.

EDIT: I stand corrected: Openoffice will print in the right orientation, you just have to browse around in the options tab next that is discretely hidden in the envelope wizard. I also found that you do not need a sheet of paper to act as a sabot for the printer. facepalm

Quickie LED Light Hack

This is a very quick and easy hack to convert an LED light that runs off batteries to mains (wall) power.

Standard warning: following these instructions may kill/maim/turn into flowers everyone your know and hold dear. Be smart.

Usually, LED lights run off batteries, because… well, let’s expand the acronym. LED stands for light-emitting diode, a diode being a circuit element that usually only lets current through in one direction. Hence, it stands to reason that trying to put an alternating voltage across it will result in subpar performance, since half the time the current is trying to go “the wrong way”, and it won’t light up very brightly*. Also, making a diode rated for 120V is probably a pain: regular 1N4001’s rate to 50V.

However, batteries are a very poor power source for a stationary light. Since the light has to put out an appreciable amount of light for long period of time (versus, say, a flashlight), the batteries wear out quickly (and I don’t get why regular alkaline batteries are so prevalent. Rechargeable batteries have not been shown to be detrimental to the environment to me, and taking the position of the armchair environmentalist, it seems that even if you could squeeze only 10 charges out of it, it would displace 10 batteries otherwise destined for the landfill, and grabs energy from the wall at at least 80% efficiency (depending on your charger). The only problem I would see with this is running out of Li (unless we’re talking strictly NiMH), but we just need to get working fusion, and we could probably synth our own Li. Of course, this would be incredibly ‘inefficient’ as a process to produce Li). Hence, the motivation for this particular mod.

To get DC from the wall, the easiest solution is grabbing a wall-wart (essentially an AC->DC converter in a plug) and sticking it in place of the batteries. Find yourself a wall-wart that outputs about the same voltage as all the batteries combined; mine used 3 AA batteries, for a total of 4.5V, so I used this 5V wall-wart from BG Micro http://www.bgmicro.com/index.asp?PageAction=VIEWPROD&ProdID=12944 (or something like it).

So, most of these wall-warts output their DC voltage through some obtuse connector: in my case, I got ’lucky’ and got a barrel type connector, where the outside of the connector was ground (0V) and the inside at 5V. To get at the 5V, I used a mangled paper clip. Note that you could also snip the wire, strip it, and figure out which one is 5V with a meter.

Now for linking the DC power into the light: in this case, I had to snip some more of the paper clip to get it to fit into the battery slot, and add some aluminum foil to connect the negative terminal with ground. If you snipped the wire, you could solder the wire to the battery terminals, or otherwise manhandle the two to stay together.

[caption id=“attachment_100” align=“alignnone” width=“300” caption=“A modded plug, using electric tape to secure the foil.”]A modded plug, using electric tape to secure the foil.[/caption]

If you have multiple battery slots like me, bridge it with wire, again soldering or manhandling it into place. I have not tried this yet, but sticking a resistor in place of a wire might lower the voltage across the LEDs, and make more apparent such things as a “half intensity” mode.

[caption id=“attachment_101” align=“alignnone” width=“400” caption=“Wires marked in red for visibility.”]Wires marked in red for visibility.[/caption]

Put the plug into place:

[caption id=“attachment_102” align=“alignnone” width=“500” caption=“What it says.”]What it says.[/caption]

Then, we cover everything up/partition with electrical tape to lessen chances of death by 5V:

[caption id=“attachment_103” align=“alignnone” width=“500” caption=“Electrical tape is pretty cool.”]Electrical tape is pretty cool.[/caption]

At this point, if the wart is plugged in, the light should turn on.

[caption id=“attachment_104” align=“alignnone” width=“400” caption=“Tape should be used to secure the plug.”]Tape should be used to secure the plug.[/caption]

Tada! If I have time/motivation, I may do a more DIY method for the same result.

Tangent: Future Electronics packs their stuff much more efficiently than Newark.

  • There are non-directional LEDs, but they tend to be a bit more expensive than your run-of-the-mill polar LED.

Also, sorry about blurry pics: still learning to shoot well with SLR.

Happy New Years!

Good things: I’m done (kind of, depending on whether I’ll apply tweaks to the final or before) with the animatric for anim3, I hacked a light (more on this, perhaps tomorrow), and I found another webcomic (dresdencodak.com, filled with all sorts of cool art, interesting stories, and thinking material. It’s a wonder I hadn’t found it sooner. However, the update rate is horrendous, although I suppose he has to do other things for a living scratch that, he does it for a living. Also, I’ll have to remedy the ‘cute girls as avatar’ syndrome that seems to overrun every webcomic I see, someday). I also may have a lead on that mystery component in the ott light stand, and parts are arriving. Yay!

Food for thought: having stayed out for New Years (playing Mario Kart and guitar hero, in addition to hanging out), I started driving home at around 2:30 AM. It was a pretty miserable night: not only did I have to watch out for drunks, the heavens decided to piss all over the place. It’s amazing I only passed on accident. I wonder what people think when they pass an accident, how close my thoughts are to the norm. Anyways, I’m pretty tired, so I’ll close here.

Windows 7 - Now with more verts!

For posterity, I will now record my actions that resulted in the installation of Windows 7 to my hard drive. Listen closely, for it is a sad, sad tale.

Maybe not so sad: the XP install I had was showing it’s age as boots took minutes and things were just generally slow. And since Windows 7 was discounted to 30-ish dollars for students, I figured I might as well get a modern OS and refresh everything in one kick (I figured trying to wrangle a copy of Windows from MSNDNAA through my university would be a pain, and more trouble than it was worth. Probably should’ve found out).

So, here’s the first hurdle: it was quite unclear what I was buying. There is an option to ship some disks out to you in addition to the access to download the update, and the site was not making it clear whether or not I was getting an iso, and upgrade executable, or both. If there was no iso, then having the disks would be extremely handy. If there was an iso, then the disks would be a redundant waste of money. To be safe, I got the disks, and discovered a few seconds later that they did give you an iso. It’s not that big a deal, but it still irks me that they need to assume their users are idiots so that you ultimately don’t know what you’re getting (probably should’ve googled it, but… yeah, probably should have. Feel free to heap shame on me for failing to do so).

So, anyways, I shuffle some data off the windows partition (although not all of it, so I lost some music. I think), wipe, and try installing. Hangs on expanding files (0%). Hmm… One night down, burn it slower, and install it successfully. Then I find out I shouldn’t have wiped my windows partition, since it’s only an upgrade key, and it needs to install over an old windows. Bust out the xp disc, reinstall, then install windows 7, key works, and the birds are singing. Now it’s time to stick grub back into the MBR (master boot record) so I can dual boot Windows and Ubuntu again.

Ominous drum roll…

So I boot up my Ubuntu live disc, and fire up gparted. And it appears that my Ubuntu partition has disappeared. Strange. Since I burned the second Windows disc from Ubuntu, the XP or Windows 7 installation must have done something to the partition scheme. Looking up how to recover damaged partition tables, I installed testdisk, learned how to use it, and took a look around. Apparently, the partition was there in the partition table, but it had somehow become a primary partition (when it was originally a logical) and hence dropped off the face of the earth as far as gparted was concerned.

Since I was using a full complement of partitions, I knocked off my swap (having 4Gb is good for something other than huge fluid sims) and put the lost partition on as a primary. Then I cp -R’d all the contents to my /home partition, and then rebuilt the extended partition. Since I also had to shuffle my data around, it took a while, until I finally got my partition scheme back the way I liked it. So, I cp -R’d the contents of the Ubuntu partition back, installed grub to the MBR, and rebooted.

Since grub didn’t have a menu.lst to go off of, I learned very quickly how to boot from grub with

set root=(hdX,0)
linux /vmlinuz root=/dev/sdaY
initrd /initrd.img
boot

It gets old after doing it 2 times.

The boot failed: it turned out that sudo was owned by someone else. Fixed that with a livecd, tried to boot again. After the 3rd or 4th boot, it dawned on me that everything was owned by root. That happens when you do sudo cp -R /media/ubuntu-partition /media/somewhere-else. So, I gave up, figured I’d screwed myself, and reinstalled Ubuntu. Verily, I tell thee that having a separate /home was a very good idea. You should do it too.

So, I learned somethings, and I’m much less restrained with partition editors than I used to be. Now it’s time to actually finish something so that I have other stuff to write about.

Windows 7

So, I installed Windows 7 this morning. Or was it yesterday night? Or yesterday morning? At any rate, one thing led to another and I finally got here, where I have a working windows 7 and kind of working ubuntu. Unfortunately, I learned about cp -aR too late, and now I have a whole installation of ubuntu that has screwed up permissions. It is almost not worth the effort I put into trying to save it. Maybe it isn’t, since I’ll probably have permissions issues biting me in the ass more frequently than usual.

Live and learn.

Oh, and I have some progress on the head and bow. Head has a hacky approach, and the bow may or may not look good. Haven’t taken a look yet. At any rate, I’m going to sleep. I may write up my adventures later. Maybe.

Also! http://samandfuzzy.com/ is my new drug. And we’re going to see Avatar tomorrow, so I can finally have an opinion on the matter.

EZLO Engines

I’ve just added the choice to build a pdf with either pdftex or vanilla latex and dvipdf. Although they’re pretty similar, sometimes you want one over the other (pdftex doesn’t work with pst-circ, for example, or pdftex can take png images). Note: I have not overhauled the image system to deal with this yet. This might mean I’ll have to convert on demand, or something, which might be for the best, since having more images than necessary might be detrimental to my hard drive space.

Also, I just learned about hyperref. I’ll have to keep that in mind for future experiments.

Fun fun!

Classy: Bach and Mozart

I’ve been wondering how to apply agile-esque methodologies to things outside of programming, especially since I’m not that great of a programmer. To recap, agile (or what agile means to me) is the mindset that releasing content early and frequently yields better results than finishing and polishing something you release/perform once in a great while. It would seem like this sort of methodology would work with something like the performing arts, since performers are always in a state of flux: one continually gets better. (The discrete nature of traditionally infrequent performances mask that fact, at least to myself.). For instance, last year a visiting violin professor reorganized studio class so everyone would perform at least bimonthly, instead of only three times in a semester. Once you’ve accepted an unmovable release schedule, then one adapts and progress is more apparent through the frequent performances. So that’s my previous experience with an agile-methodology with music performance: where do we go from here?

Well, we do it. Here are some recordings that I made today, about half a month from juries.

To kick things off, here’s mostly chaos. I just overlaid everything on top of each other when I was recording, and here’s a few seconds of the end result.

Now, some Bach: eventually, I’ll overlay the Sarabande and the Double, which works since Bach wrote the two to be harmonically isomorphic (or whatever music theory people say when they mean equivalence).

bach-sarabande-27-11-09_1

A second try at the Bach Sarabande: bach-sarabande-27-11-09_2

I just started the Double, so no, I don’t suck that badly. Really: bach-double-27-11-09_1

And have some Mozart:

A quick run-through of the Mozart. Maybe I’ll add some piano overlay sometime. mozart-concerto-4-I-27-11-09_1

Cadenza: mozart-concerto-4-cadenza-27-11-09_1

And a less gimpy run of the Cadenza: mozart-concerto-4-cadenza-27-11-09_2

Have fun: remember, all content is under cc-by-nc-sa. The lead in/out times are there if you want to do your own trimming/noise removal.