A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

How to manage schema migrations (track database changes)

A list. Alternatives to the popular/enterprise options:

How to correctly use full screen notifications in Android

Developers, don't break UI guidelines, you insensitive clods!


Full-Screen Intent Notifications — Android | by Giorgos Neokleous | AndroidPub | Medium

https://medium.com/android-news/full-screen-intent-notifications-android-85ea2f5b5dc1


Notification.Builder  |  Android Developers

https://developer.android.com/reference/android/app/Notification.Builder#setFullScreenIntent(android.app.PendingIntent,%20boolean)



Display time-sensitive notifications  |  Android Developers

https://developer.android.com/guide/components/activities/background-starts

How to use mysqldump

 I heard you like mysqldump so I ran mysqldump:


Escape quotes correctly for looping over nested ssh commands

$ for server in $(cat servers); do echo $server $(ssh -A user@bastion "ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $server \"/bin/bash -c \\\"which mysqldump\\\"\" "); done

Output:
foo-2 /usr/bin/mysqldump
bar-4 /usr/bin/mysqldump
baz-12 /usr/bin/mysqldump
qux-3 /usr/bin/mysqldump
quxx-4 /usr/bin/mysqldump

MySQL explain plan cheat sheet

Explanation of explain output:

  • select_type: SIMPLE/SUBQUERY/UNION/DERIVED
  • partitions: NULL ??
  • type: (from worst to the best): ALL, index, range, ref, eq_ref, const, system
  • possible_keys: food,bar,baz,id (good)
  • key: foo(good)
  • key_len: 334 ??
  • ref: const,const,const ??
  • rows: 1 (lower is better. must be less than total rows)
  • filtered: 100.00 (lower is better, but only used if there's a join)
  • Extra: NULL
Bad extra values:
  • using where
  • using temporary
  • using filesort
Good extra values:
  • using index