Tuesday, April 23, 2019

  • Reapplied thermal tape to the compressor on the ducati yesterday to protect it from the exhaust pipes.
  • Dodgeball championships last night, was great playing with the team. I liked this group (cowbell).
  • Went to Slab (same as Trudy's) BBQ today. Brisket was better than Bludso's, chicken was about equal, and pulled pork sucked. They also didn't serve chicken quarters, only halves, which is dumb. Total was $33, which is absolutely ridiculous - that's the same price as an entire 10lb packer of USDA prime. Very thankful I learned to smoke at home. It's better quality at about 1/10th the price, for the sacrifice of a little effort!
  • Soundcloud requires you to pay for premium mode to download tracks for offline.

Friday, April 19, 2019

  • Supercontest
    • Scrubbed testing.postgresql. Wasn't configurable enough for my tests. Couldn't do stuff like changing the default encoding of the db, so collation in the static model failed. Instead, I just defined a separate uri for test (with proper cleanup) and piggybacked off the host postgres installation (which is obviously then required to run tests....system dep agh).
    • Removed the collation=NOCASE remnant from sqlite in my models. Then I was able to get a successful unnitest env working. Test app connected to test db.
    • The problem now is alembic. The migrations require a local postgresql instance, so I can't run them nominally on the host - I need to run them in the context of the container. Alembic enters through flask-script, which runs on the app container. So you can run a migrate operation while just connected to one container.  But the upgrade operation needs the migrate.py from the app container and the actual db from the postgres container, so who knows how that will work. I'll have to look up the right way to use alembic with docker.
      • I guess you'd run the manage.py migrate/upgrade commands through docker-compose exec, not on the host. Ok.
      • Didn't end up having to migrate since postgres doesn't need the collation, but for future reference: `python manage.py db migrate/upgrade` needs to be run through `docker-compose exec app_dev/prod` now that you're working in a container setup.
    • Testing.
      • Added extra_config_settings to get_app(), allowing direct flask args to be passed from elsewhere (like tests, where I suppressed mail and csrf).
      • Added tests to make sure all the user routes (login/profile/logout/etc) work.
  • Debugging.
    • You can run `python -m pdb <myscript.py>` or just put `breakpoint()` in your code.
      • Then you can step through with s.
      • To print, just use `p <var>`.
      • You can also check types, specify new variables, etc! `pp locals()` or globals as well.
      • `l` or `where` will list where you are in the script.
      • `exit` finishes.
  • Remember, a lot of system binaries (like echo) are at /bin, not /usr/bin or /usr/local/bin.
  • Security.
    • Bandit is a cool tool I started playing with: https://github.com/PyCQA/bandit.
    • Added to supercontest tox. I had no issues, just two (example) passwords I had to ignore with # nosec.
  • Internet fiasco.
    • They wouldn't activate the new account because the modem (which I own, not spectrum) is still attached (maybe mac address) to the old account. After calling them and getting transferred 10 times, and briley doing the same, we finally got it working.
    • In the meantime, I went to a few Hermosa cafes for wifi. The new yellow one doesn't offer public internet (lol) and gum tree gives out temporary codes which provide access for an hour (lol). What happened to cafes?
  • Indian BBQ.
    • My two favorite cuisines on the planet. Had a thought the other day they I might try some fusion with my smoker at home. Did some research, and nothing came up. I don't think it's a very common idea, since the origins of BBQ are the south, and there's not much overlap between the south and India, at least culinarily. High-level smoked meat with curry-based rubs....sounds delicious.
    • Started first batch today. Curry jerky! Thinly sliced cross rib roast with some premix curry powder. I can play with the levels and finetune later.
  • My xps13 ubuntu18 suddenly couldn't play sound and just showed "dummy output". Running `pulseaudio -k && sudo alsa force-reload` fixed it.
  • HN

Thursday, April 18, 2019

  • Exported my amazon data to google drive and ran some queries on it. Interesting.
  • Went to San Bernardino yesterday to hang out with Grandma and mom. Got Rosa Maria's. Called Eric for his bday.
  • PW: GoT and Python https://medium.freecodecamp.org/how-i-used-python-to-analyze-game-of-thrones-503a96028ce6.
  • Guy on jeopardy has now won 10 games straight and holds the top FOUR single-day winning totals (from ~90k-130k). Total is 700k over 10 games. He's got the second highest total now (non-tourney) after Ken.
  • Reapplied some thermal tape to the denali compressor. Noticed yesterday after the freeway riding that it was worn through.