Monday, 19 October 2020

Random GPU passthru notes

Random GPU passthru notes

Setting up rlimits

if qemu says this:

2020-10-20T03:55:36.078813Z qemu-system-x86_64: -device vfio-pci,host=02:00.0,id=hostdev0,bus=pci.0,addr=0x7,multifunction=on,x-vga=on: VFIO_MAP_DMA failed: Cannot allocate memory

dmesg probably says something like this:

[  147.460769] vfio_pin_pages_remote: RLIMIT_MEMLOCK (65536) exceeded

Add this to /etc/security/limits.conf (at least on gentoo):

dave         hard memlock    20000000

dave         soft memlock    20000000

Giving myself permission to use vfio

I've never found a better way to do this, on boot I execute this to give myself permission to use the correct vfio group that my second video card is in:

    chown dave:dave /dev/vfio/31

Keys getting stuck, mouse jumping randomly 

Only seems to happen when the kbd and mouse are used at the same time. Easiest way to test was to move the mouse while typing in nodepad.  The mouse would jump around and sometimes (not often) a key would get stuck. 

Started happening after I did a full emerge -vup world upgrade (the kernel from 4.13.? to 5.9.1, it had been a while).  Even tried using my old kernel, and old qemu (I saved them before upgrading), still broken.

thanks to: https://www.reddit.com/r/VFIO/comments/824cdi/evdev_passthrough_problem_in_games_keys_get_stuck/

My startup script only had the -object input-linux lines for keyboard and mouse, so I guess it was defaulting to PS/2 devices?  Has been working fine for 3 years.  Installed virtio drivers and added these devices and it was all fine again.
-device virtio-keyboard
-device virtio-mouse

Sound needs to be modules

My monitors use the snd-hda sound driver, so does my computer.  That's 3 snd-hda devices.  When I compile the hda intel/realtek driver in the kernel it claims all three devices.  vfio requires all devices in an iommu group be unbound (so to pass the video card to qemu, the sound card must also be passed, not possible when the kernel has claimed the sound device on the monitor).  echoing something to the /unbind thing just waits forever and never returns.
The way around this is to make a modprobe file to claim the gpu and onboard sound for vfio before the kernel driver can get hold of it.
/etc/modprobe.d/vfio.conf:
options vfio-pci ids=10de:1b81,10de:10f0
softdep snd-hda-intel pre: vfio-pci


Monday, 12 August 2019

dbell review review

I posted a review to dbell's website that went over the problems I had.  No surpise, dbell responded with "Thank you for your detailed review. Few of your points are notable and others we couldn’t simply agree. "

They went on to object to each of my points, and I notice my 2/5 stars review has been removed from their website.  

Here are the points in my review, and their response, and my response back to them.  I sent my thoughts back to them but didn't get anything in response.


1. Motion detection is useless – the motion detection is way too sensitive. On the least sensitive setting (or most sensitive, I tried both), on a day with no wind it would push motion alerts at least once minute to my phone. I’m not exaggerating–at least once a minute. The closest thing that could trigger motion it is my neighbour’s tree, 25ft away. So, this device pretty much needs to point at a wall. Tech support said this was a known thing and there was no fix. So I had to turn off motion detection.
dbell: "If you set motion detection sensitivity to 6, it won’t capture 25ft away, value 6 allows max 10ft but motion detection can be improved, we acknowledge that"
me: I tried min and max sensitivity and all values in between.  no change.  I disagree that value 6 captures max 10ft.  That is not consistent with what I experienced.

2. The button sticks. Over the week that it was installed I had six visitors say they rang the doorbell and nothing happened. I had to push very hard on the button to unstick it, leaning into it with my body, and there would be a loud click. Then it worked properly again for about an hour with barely a touch needed to ring the door. Then it would get sticky again. Tech support offered to send me a new dbell, but because of the other issues I decided to return it.
dbell: " We are sorry to hear this – we shipped out 10k+ units, haven’t had a single complaint on stickup button. So it must be our bad luck – you may have received something like that. I haven’t verified your return unit as it went to damaged pile, hard to find it. We do not resell customers return."
me: Ok, I agree it is bad luck, but it still happened to me.  All I can report on is my n=1 sample size. 

3. It can’t actually save clips to a NAS… unless you press a button in the app, assuming the app doesn’t crash first. If you want to save the clip of what happened, or what’s happening, you need to answer the door or motion event in the app and press the record button. If you don’t answer, there is no saved clip. Tech support recommended inserting an SD card to automatically upload to my NAS, however this records continuously, it doesn’t save just the clips of the event.
dbell: "I am not sure which NAS you have. We have tested with QNAP and it saves file in h264 format which VLC can play, need to configure VLC, we have a help topic on that too."
me: My NAS is irrelevant, I mentioned that writing to the NAS wasn't a problem.  Writing only the clips of motion events was the problem.  You either get a constant stream to the NAS (which VLC can't play) or you have to manually initiate recording from within the app.
  
4. It can’t save clips to the SD card either. With the SD inserted, the video is broken into a continuous stream of files which have no header and tech support couldn’t tell me how to play them. So it seems that technically the claim that it can save footage to a NAS or cloud is true.. you either have to manually initiate the recording, or you get a continuous stream in a format that no one knows how to play.
dbell: "Video is not broken into continuous stream. When SD card is formatted it creates 32 blank stream file. But when the video is recorded, it overwrites one of those blank file as one video – video is never truncated in any chunk. So not sure how you are saying that. you can access the video files from app or from the IE browser or any other major browser interface."
me: So the continuous video stream is broken into files, that's what I said.  But the issue wasn't this it's that it's continuous video.  If I'm away and don't answer the motion detection, how do I find the video for it on my NAS.  I have to go through all the video to find the right time index... but I can't even do that because VLC won't play it.  They claim there's a knowledge base entry to play the files on VLC, but the tech I was interacting with didn't know how.

5. I ordered black and they sent a white interior bell. Tech support offered to send a new one of these, but I declined because of the other issues.

dbell: "Black doorbell is shipped with white indoorbell and black indoorbell, we have both options. Some customers like white and some likes black. This was our error and we were happy to replenish with a white one."
me: the website shows black.  This wasn't presented as an option anywhere in the ordering process. 

6. The app crashes frequently and I couldn’t use it to configure the dbell. The app kept complaining that I wasn’t on the same network as the device. I found the (mostly undocumented) web interface and used that to configure the device. After I answered the door two or three times the app would just crash.
dbell: "Which app did you face that? For Android and iOS we get report when the app crash and we continuously fix it. For Android there are over 10k devices, so we are on constant bug fix. For iOS Apple updates the OS and sometimes breaks the app, again we are always patching/fixing the issues. I use the iOS everyday, it will crash once in a while, may be once in a week. So not sure how frequent was yours. It appears your views are sort of more than regular views, for example, you say you couldn’t even configure using the app due to crash – this one is hard to believe as I do configure around 10-12 units each day. So not sure what’s going on here."
me: Again, my experience.  But during the process of configuring the unit I was using the app heavily.  Crashing once a week probably translated into crashing every 10 minutes while setting things up and trying settings.  Also, it crashes once a week under normal use?  That's once a week too many times.

Review on Amazon:

I bought the next version of this doorbell (the dbell HD x2) directly from dbell .  Ultimately I returned it for a refund.  Some of the claims on the website do not match the capabilities of the device (see below).   If you're looking for a device that can send you a notification when someone is at your door and let you talk with them right away, this will work fine.  If you want to do more complicated stuff like motion detection or saving clips to the cloud/home NAS, I can't recommend this product.

1. Motion detection is useless.  The motion detection is way too sensitive.  On the least sensitive setting (or most sensitive, I tried both, and all values in between), on a day with no wind it would push motion alerts at least once a minute to my phone.  I'm not exaggerating.  The closest thing that could trigger it is my neighbour's tree, 25ft away. 

2. The button would stick.  Over the week that it was installed I had six visitors say they rang the doorbell and nothing happened.  Each time the button was stuck.  Maybe I got a bad unit, but it doesn't change that it happened.

3. It can't actually save clips to a NAS... unless you press a button in the app.   If you want to save the clip of what happened, or what's happening, you need to answer the door or motion event in the app and press the record button.  If you don't answer, there is no saved clip. 

4. It can't save clips to the SD card either.  Tech support recommended inserting an SD to automatically upload to the NAS.  And yes, while this does auto-upload to the NAS, it uploads a constant stream to the SD and the NAS (if configured) broken into files.  There is no option to write just clips of events.  

5. The app crashes frequently.  The dbell would not configure from the app, it either kept crashing or threw an error that I wasn't on the same network as the device (I was).  The dbell also has a web interface, mostly undocumented, but I found it and this is how I configured it.  Every 3rd or so time I answered the door within the app it would crash too.




 

Sunday, 28 July 2019

dbell Smart Doorbell

I got a dbell x2 (their newest model) in May 2019.   I really wanted to like it, like really really wanted to like it.  It has a unique set of features that sets it apart from other doorbells where paying a monthly fee just to see who is at your door, or who was at your door yesterday has somehow become the norm.  The dbell is designed in Canada and has no subscription fees.  You can pay for cloud storage but since I wasn't going to be using it, I didn't really pay attention to that.  What interested me was that could, according to the website, write clips of motion and visitors directly to my NAS.  This means two things: First, I don't need a subscription or any cloud storage, I can integrate the clip directory with my home automation software to see all the events and footage.  And second, I don't need to use a hack like constantly streaming HD video stream across my home network to monitor the feed to extract motion and doorbell events to collect these clips.

Sadly, the website overstates the capabilities of the device and software, and there are other issues too.  If all you want is a smart doorbell that can push a notification to your phone so you can see who is at your door when they are at your door, this is the doorbell for you.

Here is why it didn't work for me and why I returned it for a refund (minus shipping):

  1. Motion detection is useless - the motion detection is way too sensitive.  Other reviews have said this too, I should have paid more attention.  On the least sensitive setting (or most sensitive, I tried both), on a day with no wind it would push motion alerts once or twice a minute to my phone.  I'm not exaggerating--at least once a minute.  The closest thing that could trigger it is my neighbour's tree, 25ft away.  So, this device pretty much needs to point at a wall.  I wasn't expecting to have to turn off motion detection, which is kind of a dealbreaker.
  2. The button would stick.  Over the week that it was installed I had six visitors say they rang the doorbell and nothing happened.  Each time the button was stuck.  I had to push it very hard to unstick it, leaning into it with my body, and there would be a loud click.  Then it worked properly again for about an hour, with barely a touch needed to ring the door.  Then it would get sticky again.  A doorbell that visitors can't use is also a dealbreaker.  To their credit, they offered to send me a new one, but because of the other issues I decided to return it.
  3. It can't actually save clips to a NAS... unless you press a button in the app.   If you want to save the clip of what happened, or what's happening, you need to answer the door or motion event in the app and press the record button.  If you don't answer, there is no saved clip. 
  4. It can't save clips to the SD card either.  Tech support recommended inserting an SD to automatically uploaded to the NAS.  And yes, while this does make auto-upload work, it causes the dbell  to write  a constant stream to the SD and the NAS (if configured).  There is no option to write just clips of the event.  The stream is broken into a continuous stream of 60MB files which have no header and tech support couldn't tell me how to play them.
  5. I ordered black and they sent a white interior bell, despite black being shown on the website.  They also offered to send a new one of these, but I declined because of the other issues.
  6. The app is broken and crashes frequently.  The dbell would not configure from the app, it either kept crashing or threw an error that I wasn't on the same network as the device.  The dbell also has a web interface, mostly undocumented, but I found it and this is how I configured it.
I contacted their technical support to see about resolving the motion detection and writing clips to the NAS.  They always responded within a day or two so that was great, but it became evident that I was experiencing a device and software limitation, not a configuration problem.  The device just didn't perform as advertised.  I was told that trees are a known problem and there was no way to fix the motion detection, and that I should insert an SD card to automatically capture the video to the NAS (see #4 above, it just records continuously).

Because of the dealbreakers and that I couldn't save clips to my NAS, I eventually asked for a refund.  They said there would be a 30% restocking fee (the website states 20%).  Then they told me that I should have tested the device inside first, before I removed the protective plastic, so they could resell it, and then they would have waived the restocking fee.  I found this a little insulting.   I did test it, but not long enough to figure out that the button would stick, and not to test the sensitivity of the motion detection -- these are things that I just assumed would work.  I also connected it to my NAS and assumed the clip writing thing was just a configuration problem which, because the app kept crashing, I hadn't hit on the right settings yet.

In the end they waived the restocking fee, maybe because I pointed out that the device didn't work as advertised, and also that I'd have to send it back anyway because the button was sticking.   But they did keep the shipping.  So all in all I'm out about $34 because I had to cover the return shipping too.

So now I'm in the market for a smart doorbell again.  Once that has motion detection, and one that will write motion and doorbell events to my NAS without bouncing all the video off the cloud or requiring a subscription fee.




Monday, 31 December 2018

Resetting the Page Count on a Samsung Laserjet (MLT-R116 Drum)

Our Samsung M2835 printer's drum unit (MLT-R116, not toner, the drum unit) finally hit its software-programmed end-of-life of 10,000 pages.  This is annoying for several reasons:

  • Page 9,999 was perfectly fine
  • I disagree with business practices involving software-enforced obsolescence 
  • Other printers (Brother and HP) provide an option to reset the page count
After some research, it turns out drum unit uses the same technique as toner cartridges to enforce end-of-life.  It uses a small 4Kbit i2c EEPROM to store the page count.  

There are some great resources for resetting almost the same EEPROM on toner cartridges on Samsung printers.  I used and adapted these to reset the drum counter.

Here's the Chip with contacts soldered to it so I can plug it into my raspberry Pi.





And here's the chip by itself:





And here's the connection to the RPI:



So once connected, dumping and re-writing the ROM is easy.  Use the above links to enable i2c on the RPI and then:

  • python speer.py -b 0x50.bin --addr 0x50
  • python speer.py -b 0x51.bin --addr 0x51
  • bvi 0x50.bin
    • Change offset 0x0C to 00 00 00 00  # See Note Below!
  • python speer.py -r 0x50.bin --addr 0x50
Now the drum counter reports 0 and the printer will print again.  Note: from what I have been reading, some versions of the firmware require modifications to other offsets too.  It's probably easiest to take a snapshot of the eeprom, save it somewhere safe, and then reload the eeprom 5 years later when the page counter is too high.

Note: Thanks to Joe Cooper, you may also, or instead, have to reset bytes of the 0x50.bin starting at 0x26 to 00 00, and at 0x2E to 00 00.    It's possible different printer models/firmware are storing the page count at different offsets.


Tuesday, 1 September 2015

First Uber Ride *Updated*

First trip with Uber: driver and trip was great, app and experience was sub-par.

Update: Customer service swings experience to positive agian.

I'd like to think I'd be writing this if all went smoothly, but it didn't, and here we are. Let's start with the positive.  My wife and I were standing outside at Bay and Wellesley, we requested a ride to YYZ, Steve was there within 2 minutes.   It was a pleasant ride.  It was cheaper than a cab, it was cleaner than a cab, it was cheaper than the new train thingy from downtown Toronto to the airport ($30/person, really?), and the subway wasn't running that early anyway.

Now, we did the estimate fare thing, and requested the pickup no less than 5 seconds after that, and ZOMG 1.5x SURGE PRICING!  I'm suspicious that demand rose "through the roof" at 8:30am on a Sunday morning within those 5 seconds, but maybe it was a coincidence, or maybe we were the last grain of sand.  It was still cheaper than a taxi, so we accepted the 1.5x fare.

The night before I added a $20 promo off the first ride.  Everyone said add it, and offered their user-specific codes. I realize now I could have, and should have, added the user-specific code from one of my friends so they get $20 too.  The system accepted the promo code I used.  It knows I'm in Canada.   You can see where this is going.

Three days later it has charged the full amount to my credit card, no promo code.  The promo code still shows up in my account "Enjoy $20 off your first ride" (that's it, no restrictions are visible).   I have a sneaky suspicion that this was a US-only code and the system didn't bother to tell me, or at least warn me.  It would be such a simple thing to do--FYI, you have a Canadian postal code, you just put in a US-only promo.  That's just annoying.

I navigated their help system and entered that the system didn't apply the promo code for the trip.  Now my pessimist is taking over and I expect this to happen:
1. They'll mail me back eventually and tell me it's a US-only code, or had some other restriction the system didn't tell me about.
2. I'll request that they apply it anyway because there was no indication it wouldn't work so they should put $20 back on my card, since that would have been the outcome had I used one of my friend's code (which I can't use anymore because I've taken my first trip).
3. They'll offer a $20 credit.
4. I'll pretty much have no choice to accept, even though I don't see myself using Uber again in the near future.

So feeling a bit taken-advantage-of by the last-second surge pricing and no promo code.  But it was cheaper than a taxi.  A little good customer service right now could turn my feelings around but right now I'm unlikely to use Uber again in the near future.



Update:  No sooner did I finish writing that than Chad from Uber responded with some great customer service.  The code is indeed a US-only code, they put the $20 back on my CC.  







Monday, 12 July 2010

Skype + Compiz + Cairo Dock

Apparently skype video has issues with cairo dock.   I can confirm this, it definitely doesn't work, where all other webcam apps (like cheese, or guvcview) work fine.  The recommend solution from skype is to simply turn off all visual effects and compositing.  Just like Adobe recommended all 64bit users switch to a 32bit browser just to use their latest flash player that fixed a rather nasty bug.  It's the "hit it with a big hammer corporate approach".

Thanks to the folks at http://forum.linuxmint.com/viewtopic.php?f=47&t=36236&p=208735 for this one.  Just add "export XLIB_SKIP_ARGB_VISUALS=1"  to /usr/bin/skype and skype.  And it all works.

Saturday, 24 October 2009

Thursday, 13 August 2009

Greasemonkey + Facebook

Psst, facebook, I don't want to be friends with random people just because "we both went to UBC", or "we both live in Vancouver". UBC is pretty big, so is Vancouver. I also don't want to become fans of things just because my friends have. So.. bye-bye suggestion box:

Step 1, install greasemonkey: https://addons.mozilla.org/en-US/firefox/addon/748

Step 2, install this greasemonkey script, just detaches the suggestion box from the HTML, making it disappear, the more elegant solution would be if facebook would just not send the HTML in the first place.. but that's asking too much mehtinks: http://slicer.ca/files/facebook_desuckify.user.js

Step 3, enjoy facebook without the stupid suggestion box.

Wednesday, 22 July 2009

Recovering Ubuntu

A few days ago I did something bad.  I did a distro upgrade to bleeding edge Ubuntu (9.10) before release, all for the want of the latest version of libvirt on my antiquated laptop.

I know pre-release software might be rough around the edges, I know things might not work, but I didn't really care, after all these things are usually fixed over time.  However, what I didn't bargin for was that the upgrade process was to totally bjorked that it sent dpkg into an infinite loop unpacking the same packages, over and over again, until I stopped it.

Big mistake, but what else could I do?

Thursday, 25 June 2009

Error message FAIL

I'm trying to get libvirt working, just to play with it.  Here's the error:


libvir: Network Config error : cannot create bridge 'virbr0': Package not installed

Package not installed?  But the bridge utilities are installed.  After much googling, I discovered it's a bridge-utils error message, and here's my translated version:


Ethernet bridging support isn't enabled in the kernel

lrn2writeerrormessages.  kthx.


Tuesday, 16 June 2009

nVidia blocking signal problem fixed

have been experiencing this bug since the 180.35 nVidia drivers were released.  The dreaded blocked signals bug.  The .37 driver was supposed to fix it, and did for many people, but not me.  Neither did .41, .44, .51, or the latest ones, 180.60.  This wasn't a big problem,  I reasoned I'd just wait until it was actually fixed and continue using the 180.29 drivers.  That waiting ended today when I upgraded to kernel 2.6.30 and discovered the .29 drivers don't build against that kernel.  Curses.

Wednesday, 3 June 2009

Profiling PHP Code

I have a PHP script I wrote for my research that takes stupidly long time to run. Why? I don't know.  So on an off chance of finding something useful, I put "PHP profiling" into google.


So it turns out that PHP profiling is a huge topic, there are many websites ready to provide HOWTOs and tutorials for a zillion different techniques.  And, like everything in the computer world it seems, the solution is easy and sifting through all useless advice and "type-this-random-thing-into-your-console" is what takes the time.


Here's what gentoo users need to know:



  1. emerge xdebug

  2. Edit /etc/php/php-cli/ext/xdebug.ini , set xdebug.enable_profiling="1", and I also had to increase my max_nesting_level to "1000".  It took forever to figure this out, ALL the documents say "oh, just put the settings in php.ini.". WRONG.  They get ignored in there.

  3. Install kcachegrind, and use it to load the profile dumps now being written in /tmp/cachegrind*


Done.




Friday, 13 February 2009

Rogers sold my email address

One of the advantages of having my own domain name is that I can give out a different email address to every company that wants my email.  I use a pattern to generate these addresses, they're not one-word somethings that a spambot would guess.


Yesterday, I recieved an email from netmarketingcanada.com with links that point me back to netmarketingcanada.com to unsubscribe and view things.  They're advertising.. 30% off.. something... my email client doesn't load the remote images (also from netmarketingcanada.com) so I can't see the majority of their email, but that's not the point.


The email was TO the email address that Rogers Canada (and only Rogers Canada) has for me.  So, a big thanks Rogers for selling my email address to spammers. I don't remember seeing "will sell your email address to spammers" in their privacy policy, but perhaps it has been updated and someone could point me to that clause?


Wednesday, 11 February 2009

iPhone Bliss

I have three beefs with my iPhone:

  1. I can't use gtkpod or other software to sync my music, because it's running firmware >= 2.0

  2. Disregarding music, I can only sync everything else (contacts, whatnot) in Linux over ssh to a jailbroken iPhone (requires remote mounting via. sshfs), even if the phone is sitting beside, me plugged into a USB port.

  3. 1 and 2 should happen automatically as soon as I plug in to USB, I shoudn't need to drop to a terminal and type stuff.


Happily, there is a solution for all 3.  Here, I'll talk about 1 and 2.

Thursday, 11 December 2008

UBC VPN


I need to document this.  Why do most help manuals and HOWTOs read like the author assumes the reader is an expert, and knows what he or she is doing?  I had a professor like that once in undergrad; he taught his course as though we all had already mastered the content.  We learned nothing.

I couldn't help thinking of him while trying to setup VPN access to UBC.  "It's easy, even in Linux" the HOWTO claims, but it is scarcely more than: 1. Setup VPN.  2. Add routes.  3. Done.  Steps 1 and 2 could use a few sub-points.

Sunday, 30 March 2008

Bridging Media

I haven't posted anything hackishery in a while, so here we go.. Yesterday I attended Bridging Media, my super sekret invite was secured through a friend of mine, Erica, who happened to be co-running the event. A very successful event. Hats off to Erica and the whole organizing crew! I'd signup for another one in a heartbeat.

Sunday, 16 March 2008

Exiting a Bus - Episode 4 - A New Dope

I just don't understand the logical processes used by some people. Further, I don't understand how these people have avoided being eliminated from our society through some sort of accident of their own causing. But whatever.


Let's set the scene: It's a nice quiet day, I'm on a bus coming home from campus, the bus is rather empty. It's an extended "accordion" bus, 60 feet long, and plenty of seats available.


DING stop request, nothing unusual. I'm sitting at the front left of the bus, in the first set of seats facing forward, just minding my own business. The bus pulls up to the stop, stops, and opens the front doors just incase anyone at the stop wants to get on, but no one does. Then comes the "hiss" of the compressed air opening one of the rear doors, judging by the volume, the middle doors, evidentially someone is getting off, another successful bus stop. Those doors will hiss again in 5 seconds and we'll be on our way.


But before that happens, the excitement starts. About 2 seconds before the doors close, an asian lady (why is it always asian?) probably early 40s, sitting in the closest seat to the front of the bus (shown in blue in the diagram below), gets up and starts walking towards the back of the bus. I'm in the first set of forward facing seats so she quickly passes out of my vision. I just assumed she was going for an empty pair of forward facing seats.


Apparently Not.


It takes a good 10 seconds to walk the length of one of these buses. The doors have closed for a good 5 seconds and the driver is already pulling out into traffic. And then we hear it. "WAIT STOP I WANT TO GET OFF, DOORS DOORS!".


How to Exit A Bus


Naturally, we all turn around to see what the ruckus is about. Yup, it's that same lady. She walked from the front of the bus to the rear, and then attempted to exit by the rear doors. I admire her strictly obeying all those signs that say "Please Exit by the Rear Doors". But .. maybe a little common sense next time? Please? So let's review.. When sitting at the closest seat to the front of the bus, the only appropriate exit to use is the one furthest from you.



Monday, 4 February 2008

Exiting a Bus

I'll probably go back and write about previous IPTPYA episodes, but here's a fresh one for today.


The procedure for exitting a bus is rather complicated (I'll write more about other experiences later). But today all the stupidity of Vancouver mustered itself into one lady in a spectacular manifestation of misfiring neurons. Today we got to ride an older bus. These buses don't have advanced door opening technology like a pushbar (which, if repeatededly and violently shaken will eventually trigger the door opening switch normally triggered by a single push), no, these buses have a large 30 point font in clear yellow on black letters on both doors at eye level that reads: "STEP DOWN ON TOP STEP TO OPEN DOORS".


Let's dissect that. STEP DOWN. As opposed to stepping up, or sideways, or backwards, or remaining immobile, clearly indicates a step in a downward direction is required. But required for what? ON TOP STEP. Ohh, now as a reasonable person, I interpret this to mean that I need to step onto a step, as opposed to standing in the aisle waiting for something to happen through telepathy. TO OPEN DOORS. Ahhhh, so all this only applies if I actually want to open the doors. So what I'm getting out of this is standing in place probably won't open the doors. I need to move my footsies somewhere.


So, the bus stops and the lady is standing in the aisle directly infront of the door. As a bonus, the big green light above the door turns on, indicating that the doors will open on command. And two big white lights also turn on, illuminating the 30 point yellow on black font. Or rather, would have illuminated them if it wasn't the middle of the day with a clear sky. She stands there, staring at the door for a second, then leans forward, skillfully avoiding losing her balance and grabs the door handle (which is actually a handrail after the doors swing open), and starts violently shaking it. Nothing happens. Now, this is actually an impressive gymnastic feat. There are two large downward steps between the aisle and the door, to lean forward and grab the door without losing balance and accidentally stepping on the TOP STEP would take a lot of skill. I doubt I could do it without practicing. Over time the shaking becomes more violent until it climaxes when the green light turns off and the bus starts moving. Then the yelling starts. "Bah Doos! BAH DOOS! BAH DOOS! BAH DOOS!". (Translated in to English, that's "Back Doors", I think.)


I'm surprised the driver could even hear her over the racket of the engine and the violent door shaking which upon climaxing showed no signs of relenting. The driver stops the bus.. the magic green light and two white lights go on.. again.. and the driver yells back "You have to step down on the top step".


Pause. Pause. Violent door shaking. Complete foot immobility. BAH DOOS! BAH DOOS! At long last the three chimes sound indicating that all the doors are about to open, and the driver manually opens them. She storms off the bus in a huff. The kicker is she had a monthly bus pass dangling from her neck validated for the past several months, she's clearly a regular customer of the transit system, but apparently not a regular customer of logical thought processes. I guess we should thank her ineptitude for holding all of us up for a good minute of entertainment.


So to recap, when your attempting to exit a bus, the aisle is an IPTPYA.

Inappropriate Places to Park Your Assstronomically unintelligent keister

What is IPTPYA? Inappropriate Places To Park Your Ass. I live in Vancouver, and while I'm sure every city has its fair share of idiots, they seem to congregate around Universities. Vancouver has two of these institutions. I'm not just talking about students either, I'm talking about people, in general, who have somehow manged to avoid being eliminated by natural selection while simultaneously demonstrating they have only evolved enough logic and common sense to triumph over the turnip table of the local produce store in a battle of the wits.


One subtype of these people are my pet peeve. I'm a person that likes to get where I'm going without being held up for no good reason. I don't speed or drive dangerously when in my car, and I don't bump into people or shove I'm walking/running, and if there's a traffic jam, whatever, I'm fine with that. But it's the people who impede traffic (either vehicle or people traffic), the ones that are completely clueless to their surroundings, that don't even notice they're creating an impassible obstruction, and that can't fire the 3 required neurons to figure it all out, that really annoy me.


"I am constantly amazed by the lack of common sense and general awareness in University students". I started using this phrase back in undergrad. I noticed many of my fellow students didn't seem to be "all there" mentally. Just little things like on a perfectly flat section of street on a clear day: look left, look right, look left again, then step out on a quest to cross the street directly infront of the bus that is no more than 20 meters away. Oh, but then, hearing the horn and screeching brakes, look at the bus, and then stop. Deer in headlights. Do i keep crossing or do I go back? I know, I'll just stay here for a few seconds and think about it. IPTPYA.


These are their stories as witnessed by me.

Sunday, 3 February 2008

Making Drupal exist in a subdirectory

I have a confession: I am a bit of a neat freak when it comes to my files. Clutter annoys me almost as much as compressed files that extract themselves into the current working directory.
I set out on a quest today, to upgrade Drupal AND to make it happily exist in a subdirectory on my server, BUT, to make it appear that it exists in the root directory.


Actually just that turned out to be easy, Drupal even provides a guide that conveniently assumes you don't have any other content in your directory. I mean, you've got Drupal, why would you want a /photos directory that's not "inside" Drupal? Or a /files directory that Drupal doesn't manage? Stop being silly.


It turns out, though, that what I wanted was also quite easy, but piecing together the bits and cutting the cruft took excessively long.  But that's a typcial computery solution: A simple solution and a long and winding road to find it.


So, let's begin.



  1. Put Drupal in a subdirectory. Mine is called drupal-5.7

  2. Add a .htaccess to the root of the website to rewrite incoming requests to Drupal:
    RewriteEngine on
    RewriteRule ^$ drupal-5.7/index.php [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ drupal-5.7/$1 [L]

    Now, I'm not a .htaccess expert, so I may be slightly wrong in how exactly this works. The first RewriteRule directs the server to redirect all requests for "/" to Drupal's index.php, so drupal is what you see when you just type the base URL. The .htaccess inside the drupal directory can further rewrite this.
    The two rewrite conditions are for the next rule, !-f and !-d mean that only do this next rewrite if the file(or directory) doesn't already exist. I have /photos on my server that I don't want rewritten to /drupal-5.7/photos/
    The final rule simply appends the prefix drupal-5.7/ to the request, and sends it off. Drupal further rewrites this when Tidy URLs are used.

  3. Delete /index.php, we don't want the server to find it.

  4. Make sure you don't already have any existing files/directories that are inside the Drupal install. For example, I already use a /files directory, so does Drupal, so I renamed Drupal's to 'dfiles', and changed the config accordingly (Administration -> File System).


Cake. It all works as far as I can tell.