California DMV improvement suggestions

I left our first DMV appointment practically empty-handed despite being a 30-year-old college-educated web programmer, and spending probably two hours researching and preparing for our DMV visit. If I got confused and forgot some necessary documents, I’m sure it’s nearly impossible for most people who don’t know what to do when links don’t take you straight to the right section or have trouble parsing complicated lists of requirements. Check out Arizona’s MVD site as if you were a new driver or new resident… it’s not perfect, but it seems to do a quite good job hand-holding people through things. They even have a survey at the end of each request for feedback to improve their site. I never had to make two trips to an Arizona MVD, and have done everything 100% online for the last ~7 years there, so it’s pretty decent. Though I do greatly appreciate California’s appointment system (which could use clearer outdoor signage at least at Petaluma, by the way… I only saw the Appointment line after standing outside in the rain for fifteen minutes.)

Many links for more info don’t always work, they send you to the top of the page instead of the anchor. Maybe there’s some JS that reloads the page minus the anchor? This is both on Firefox Mac and Chrome Linux.

It’s not clear when “Birth date verification and legal presence” is mentioned in the list that this is something you need to bring documentation for, as opposed to something you can just do in-office. Group requirements under a “things to bring” list to save wasted trips.

In the section of acceptable presence documents it would be helpful to say that driver’s licenses and state ID cards are not sufficient, which is what I assumed the first time I went to the DMV.

The link to True Full Name (#true) doesn’t work, there is no #true anchor on the page.

The fact that smog certifications are necessary for basically all cars including brand-new Priuses is buried in between a Gross Vehicle Weight requirement and a Weight Certificate without a link to the details. Also it says “When you transfer a vehicle that is four or less model years old a smog certification is not required” — but the word transfer in this case apparently means “sell in-state” not “transfer from out-of-state.” So there’s another wasted trip. Oh and then there’s the “Areas subject to the biennial smog program” which in my county is on a per-zipcode basis. There are so many exceptions you should almost have a wizard for “what do I need to bring for my car.”

The knowledge test page does not mention how many questions you can miss while still passing.

Will I still be issued a driving permit even if I already had a license from another state? The text is unclear.

The text about taking a driving test should all be indented under the “another country” paragraph so it’s obvious that most people won’t need to take a driving test.

The headings aren’t obvious, I keep reading after the “How to apply for a driver license if you are over 18” section and start reading the Interpreter and CDL sections before I realize that they don’t apply to me. Bolding or making the top-level heading text the largest (or maybe having little icons to the left to indicate that each is its own major section) would help people navigate these super-long pages. Even better might be splitting each major section into its own page so that you can be more topical and cover each topic thoroughly instead of lumping things together and cross-linking a bunch of things.

Cable for connecting APRSdroid to a Baofeng UV-82 Radio (APRS via RF)


Warning, this alternative *may* be more reliable than mine:

And this article has a lot of helpful hints:

And of course, using a Bluetooth TNC, etc, is going to be much more reliable than this hack.

Finally, this cable seems to work well on my Samsung Galaxy Nexus, but is not detected as an output by my Nexus 5x when plugged into the radio so it might need different resistors depending on your devices.

I harvested a cheap Baofeng handheld speaker/microphone for its cable (although you can buy them here — the Kenwood type) and bought a 3.5mm TRRS plug from Digi-key. It’s a bit tight to solder the resistors inside the plug housing, but it is possible (just remember to put the plug housing on the cable BEFORE soldering, otherwise you’ll be unable to put it on later… a mistake I made about three times.)

aprs cable

Your wire colors may be different; I made this diagram match the wire colors from my cable so I wouldn’t get things confused.

aprs cable

This cable follows the above diagram precisely; note the color-coded heat shrink, and note that the TRRS plug’s internal wiring is such that the Tip is wired to the furthest-left solder point, followed by R1 and R2, and finally the Sleeve solder point is actually also the strain relief and threaded housing. So you’ve gotta think a bit backwards (and/or use an ohmmeter to check your wiring.)

I’m sure there is some science behind the correct resistor ohm values (and as in the Github link, an additional capacitor might help; I’m not sure, this is just a hack.) I used 480ohm resistors. The idea is to mute the audio slightly because amplified earphone output being wired straight into amplified microphone input is a surefire way to transmit nothing but distortion.

In my experience on a Galaxy Nexus running APRSdroid with this cable into a Pofung UV-82, the best reception is with the radio volume at barely audible (1/3rd of a rotation) and with the phone volume at 1/4. Further experimentation would yield better data, but keeping an eye on received packets and repeats of your transmissions can help you even if you don’t have a separate radio to listen on. You can also use a recording app on your phone to see what the phone is hearing.

Helpful settings in APRSdroid: 3-4 second preamble (so VOX has a chance to turn on); output via AFSK (not Internet/bluetooth etc); AFSK output via headset (not ringer/speaker). Also, before opening APRSdroid, set your phone to Vibrate so hopefully no notification sounds are transmitted.

Helpful settings on radio: VOX at ~2, Squelch at ~1. Ensure that both channels are set to the APRS channel before enabling VOX or connecting cable, and connect cable while radio is off, to avoid unwanted transmission. Consider listening to transmissions/receptions on a separate radio and looking at the radio’s receive/transmit lights to ensure that the phone is being polite and not transmitting over other stations.

Fixing: Cannot set session ID after the session has started in PHPUnit

I got this error after adding an onKernelRequest listener to my Symfony project and trying to pass Twig_Environment to it as an argument. It worked via the web browser, but not in any PHPUnit tests hitting multiple pages.

After much head scratching and reading of the Symfony source code, I ended up making an onKernelException listener instead. Magically, rendering a twig template from it (passing a TwigEngine argument) worked.

So, here’s how I handle custom exceptions in a custom way. Notice I’m testing for Twig_Error_Runtime because my specific error is coming via Twig; you may be able to just test for regular Symfony exceptions instead:

Two Unrelated (No association) Entities in One Form in Symfony2

A lot of tutorials are showing you how to create embedded forms with associations/relations — what about unrelated entities?

I figured out you can pass the second entity as a parameter to the parent form, pass it normally to the embedded form via the ‘data’ parameter, which will let the embedded form update the object. Then just persist() the object back in the controller like normal. No crazy data/request wrangling necessary! Continue reading

Logging NAT/Firewall/state entries in Pfsense

Sometimes you really need to know what computers on your network were doing yesterday at noon, because you get a nastygram from the MPAA about bittorrent demanding that you do something — but bittorrent is notoriously hard to block.

You can try installing BandwidthD on your Pfsense router, to see who’s using a bunch of bandwidth at that time, and you can look back through DHCP or WiFi logs to see who was connected at the time, but the complaint letter tells you the exact time and port number used. Wouldn’t it be cool if you could log that?

Here’s what I came up with. Download the Cron package for Pfsense, and add a new Cron job:

Minute: 1
Hour/etc: *
Who: root
Command: pfctl -ss | egrep '(>.*>|<.*<)' | logger

The firewall states (who is connected to what) will now dump to your system log every hour — kinda noisy, but also kinda effective for tracking long downloads on random ports.