So, for the first time in about 2 months, I commuted to work by bike today. It’s always more challenging than it should be for me to convince myself to get on the bike in the morning, especially considering that I usually enjoy most of my ride. My goal for this summer was to consistently commute via bike 3 times a week, and thus far I’ve been failing miserably. TDY’s haven’t helped, but that’s an excuse. The ride today was mostly enjoyable, but my ass hurts. Plan is to do it tomorrow, weather pending. I was also supposed to buy myself some rain-gear tonight so I could stop using possible rain as an excuse.
What’s interesting, though, is the speed I rode at today. After 2 months away from biking and generally not being all that active, I not only broke my time and speed records in both directions, but I broke my outbound by 10%, which I feel significant. My previous best had been a about 52 minutes, and today I rode it in 47. My average speed beat my old average speed by almost 2 miles an hour.
My ride back wasn’t so impressive, and although I beat my previous best by about 2 minutes, I think it was likely because of extreme luck in stoplights. I barely hit any.
I have noticed a theme with physical activity for myself. Any time I take about 1-2 months off of doing something, I usually get a small window of really high performance right when I start doing it again. This has been true of most of the stuff that I’ve tracked; fencing, lifting, and now biking. Running seems to be the exception, but I feel like my biggest foe running is mental: not exhaustion, but boredom. I get really bored running, and it takes me awhile of doing it to find the zen ability to let my mind drift and THINK about things to keep myself from getting so bored running that I stop.
I find when I am doing any long-time-frame (anything over about 20 minutes) solo physical activity, the only way that I can continue to do it is to find some kind of balance between pain and boredom. Pain I can deal with, boredom I can deal with, but apparently I can’t or won’t deal with being bored and in pain. (I’m good at differentiating between healthy working pain and you’re injuring yourself pain, so to protective friends and family: I am not, and never will, hurt myself or try and “tough it out” through injurious pain.) If I’m gasping for breath, and my legs are getting tired, and I’m bored, not only will I likely quit, I likely won’t come back to it.
This is one definite reason I’ve always been better at team sports. One of the things I’ve noticed on my bike commute is that when I get passed, I can outperform my normal best easily and without much mental sacrifice just staying close on the tail of whoever passed me. Competing, even at the same thing that bores me without just a hint of competition, keeps me entertained.
It’s all very odd.
I’m kinda half-wondering if I’ve been owned again. There’s some weird shit in my logs. But. If I’ve been owned they’re being much sneakier about it this time…there’s nothing on my pages, nothing hidden in the html…so I guess I”ll just have to keep an eye on it. I will tell you, it makes me nervous when people are hitting my website by searching on a theme, given that that’s the vector I got hit with last time.
So, nothing really to report. Helped Jessica move, which was about the easiest move ever…she doesn’t have very much stuff, so there wasn’t a lot to carry. It was fun though. She also took me for a swim in one of the ponds around her house, which was AWESOME. Crystal clear water, sandy bottom. The way swimming should always be.
Also, I set up her wireless internet. She had a cisco/linksys E1000. I gotta say, I have never used their installation programs in the past, but this time, it was worth it. It was secure by default, and it didn’t install any crap-ware or set itself up to reside in memory on her box. It set up her home network with a random SID, a randomly generated strong password and WPA key, and even set up a guest network that is unencrypted, but requires a password to log in to. It was awesome. I may have to see if the trendnet that I bought for our house has anything similar, because It Just Worked, AND it was secure. I don’t know how the router is going to work out, but kudos to cisco for the setup.
When I got home today, and started to work on chores and errands, I talked to Regina about my plans for the bed loft. She suggested that I just go with a custom closet organization, and I have to say, it should work, and be easier to get set up then doing the loft, if not as cool. So I guess I need to go to that organization store, whatever it’s called, with measurements for my closet so I can start moving into my new room.
NOT doing the bed loft gives me some time to work on my other organizational project: digitizing my files, encrypting them, syncing them to the cloud, and reducing my filing cabinet from 4 drawers down to 2, so I can fit it in my room. That’s what I’m starting on tonight: finding out if I can happily encrypt and sync to a cloud storage.
Finally, I put up some pictures from the trip to St. Louis.
For a very long time, I’ve been wanting to be able to use the same amarok database from all my computers in a relatively seamless fashion. I’ve hacked it before by moving the underlying single-file database (collection.db) to the network drive that also housed the music. That worked ok, except that for some reason, it updated far too slowly and I couldn’t get it to play music. The other thing is, I also eventually want to have a multi-user amarok, one where multiple users listen to the same music database. The options that opens up are endless. Let’s say several people are in the same room playing games; now you can have a dynamic playlist that only plays music everyone likes. Or you’re having a party. Now you can play music that you don’t usually like without it screwing up your personal scores, but still taking advantage of the power of the dynamic playlists. Maybe you’re having an impromptu eighties party, and you want to play lots of 80′s music without taking hours making playlists, but you don’t like 80′s music, so you don’t want it to effect your own score.
You could, with a multi-user amarok.
Anyway, that’s why I started down this path.
So, step 1 was to enable the external database and move my data over. Since I haven’t listened to music on amarok 2.2.2 (the version I’m going to be using) very much, that means all my statistics are still in my 1.4.x database. That actually makes things a little easier.
Following this guide, I got started. There’s a couple of things missing from the guide. First, you have to actually create a database. Then, you can create your user and grant them rights to it. However, when you grant them rights, don’t use localhost. Use %. So: grant all on amarokdb.* to user 'amarokuser'@'%' rather than amarokuser@localhost.
Then, you go into amarok, set up your external db as stated. But don’t do anything right then. It won’t actually create the db tables. So you have to exit amarok, then start it again. That will cause the tables to be created assuming you’ve everything correctly set up. Which I did, so I can’t give you any infos about it not being set up.
Then, you go through the import process for your old collection. This will mostly go fine. BIG NOTE: there is info on the web about making sure that all your versions of amarok are the same, and that your music is mounted on the EXACT SAME PATH on all the computers that are going to connect. For the import, this is also true in that all the music has to be mounted on the same path for the mysql database doing the import that it was on the computer using the 1.4.x sqlite db. SAME PATH!
Anyway, the collection seems to import just fine, but in my case, it’s missing all the scores. I’ll get to that in a minute.
Great, now it’s working on one computer. So how do we get it working on another?
I’ve been dealing with this off and on for awhile, so my computers all share the same mount-point and are running the same version of ubuntu, so no worries there. I checked to make sure that all the versions are the same, just to be safe, and then set up the external db on the second box. Nothing. So, I started searching the web, and low and behold, you have to modify a couple of mysql settings to get it to work. so you edit /etc/mysql/my.cnf and change bind_address to your actual IP. And, if and when your IP changes because you’re using dhcp like mine is sure to, this is going to blow up on you. Not sure how to fix that one, actually. Well, gain control of your router and set a static ip for the mac address of your server, but I have to get regina to let me do that.
Anyway, there was also an instruction for changing mysql.db(host) to %, but I don’t think that’s necessary. We’ll see if I ever change it back. I did it. I haven’t undone it. But I don’t think it’s necessary.
So, finally, I”m able to connect from my other computer. It’s got the rows there. Now to solve the scores issue. I’ve been using amarok for 3 years now. I’m not about to give up my scores.
After digging in for a couple of hours and playing with it, here’s what I did. First I exported the data from the old sqlite database, following the instructions here:
sqlite3 collection.db .dump | \
egrep -vi '^(BEGIN TRANSACTION|COMMIT|CREATE|INSERT INTO "devices")' | \
perl -pe 's/INSERT INTO \"(.*)\" VALUES/INSERT INTO \1 VALUES/' > temp.sql
Then, I used a little grep magic strip out the statistics info, and a little sed to change “statistics” into “tempstats” for the insert statements. Next, I used sqlite3 collection.db .schema statistics > tempstats.sql to get my create statement. You have to change the table name again to tempstats or whatever, and reduce it from 1024 to something less for the url field. I used 256, you might be able to get away with like 384 if you need the extra characters.
Then, back in your mysql instance, you can do source /path/to/tempstats.sql to import the statistics table.
source /path/to/temp.sql
I should note now that this is NOT efficient. It’s a dirty, unoptimized hack. If you have a better way of doing it, please, for the love of spaghetti, let me know.
Anyway, at that point, you can do a really ugly update on join to get your scores back:
update statistics right join urls on urls.id = statistics.url right join tempstats on tempstats.url = urls.rpath set statistics.score = tempstats.percentage;
It took my nettop about 7 minutes to do this on about 4k rows updated. That join is NASTY. I just don’t know enough about db’s to make it cleaner.
I’m thinking about learning enough python to do this that way, but let’s be honest. It’s working now, so I’ll probably never get around to it.
Next step, I gotta sit down and change the database schema to handle multiple users.