subtree(users/wpcarro): docking briefcase at '24f5a642'
git-subtree-dir: users/wpcarro git-subtree-mainline:464bbcb15cgit-subtree-split:24f5a642afChange-Id: I6105b3762b79126b3488359c95978cadb3efa789
This commit is contained in:
commit
019f8fd211
766 changed files with 175420 additions and 0 deletions
3
users/wpcarro/playbooks/README.md
Normal file
3
users/wpcarro/playbooks/README.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# playbooks
|
||||
|
||||
Here's the vision: playbooks for everything - not just software.
|
||||
13
users/wpcarro/playbooks/first-of-the-month.org
Normal file
13
users/wpcarro/playbooks/first-of-the-month.org
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# In total this should take one hour to complete. This is a substantial amount
|
||||
# of time, which may disincentivize me from completing it. This time is
|
||||
# amortized over the length of its usefulness (i.e. an entire month), so it
|
||||
# should be thought of instead as two-minutes worth of work per day that is all
|
||||
# being completed upfront.
|
||||
* Tasks
|
||||
** TODO [20m] Create habit template in journal.
|
||||
*** Spend time choosing a habit that you can accomplish giving known traveling constraints.
|
||||
** TODO [45m] Assess previous month's performance.
|
||||
** TODO [10m] Book massage for the month.
|
||||
** TODO [05m] Register for HotPodYoga classes.
|
||||
** TODO [10m] Plan one museum date in London.
|
||||
** TODO [20m] Plan each weekend for month.
|
||||
54
users/wpcarro/playbooks/habits.org
Normal file
54
users/wpcarro/playbooks/habits.org
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
* First of the year
|
||||
** [1hr] Write a post mortem for the previous year
|
||||
* First of the month
|
||||
** [20m] Create habit template in journal.
|
||||
** [45m] Assess previous month's performance.
|
||||
** [10m] Book massage for the month.
|
||||
** [05m] Register for HotPodYoga classes.
|
||||
** [10m] Plan one museum date in London.
|
||||
** [20m] Plan each weekend for month.
|
||||
* Payday
|
||||
** [10m] Audit Monzo expenses
|
||||
** [05m] Review "finances_2020" spreadsheet
|
||||
** [05m] Transfer GBP to USD account
|
||||
** [10m] Withdraw cash from ATM
|
||||
* Morning
|
||||
** [00m] Wake up at 7:00
|
||||
** [15m] Read
|
||||
** [02m] Brush teeth
|
||||
** [01m] Make bed
|
||||
** [01m] Water plants
|
||||
** [10m] 12 rounds of forward folds
|
||||
** [05m] 12 rounds Pranayama
|
||||
** [30m] Transcendental meditation
|
||||
** [10m] Shower
|
||||
** [05m] Put on clothes
|
||||
* Evening
|
||||
** [01m] Layout tomorrow's outfit
|
||||
** [01m] Floss
|
||||
** [02m] Brush teeth
|
||||
** [01m] Mouth wash
|
||||
** [30m] Read
|
||||
** [01m] Journal daily progress
|
||||
* Monday
|
||||
** [1hr] Jiu Jitsu
|
||||
* Tuesday
|
||||
** Work from 6PS
|
||||
** [1hr] Jiu Jitsu
|
||||
* Wednesday
|
||||
** [1hr] Hot Yoga
|
||||
** [10m] Shave
|
||||
** [15m] Clean apartment sinks
|
||||
* Thursday
|
||||
* Friday
|
||||
** [1hr] Hot Yoga
|
||||
* Saturday
|
||||
** [10m] Vacuum
|
||||
** [30m] Nap
|
||||
* Sunday
|
||||
** [1hr] Jiu Jitsu
|
||||
** [30m] Nap
|
||||
** [10m] Shave
|
||||
** [05m] Trim nails
|
||||
** [05m] Take out trash
|
||||
** [05m] Laundry
|
||||
BIN
users/wpcarro/playbooks/hip_opening_challenge/poses.pdf
Normal file
BIN
users/wpcarro/playbooks/hip_opening_challenge/poses.pdf
Normal file
Binary file not shown.
65
users/wpcarro/playbooks/hip_opening_challenge/progress.org
Normal file
65
users/wpcarro/playbooks/hip_opening_challenge/progress.org
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
# From Lucas Rockwood's 21-day hip challenge from yogabody.com
|
||||
* DONE day 1
|
||||
** pigeon
|
||||
** butterfly
|
||||
* DONE day 2
|
||||
** blaster
|
||||
** squat
|
||||
* DONE day 3
|
||||
** happy baby
|
||||
** thread the needle (supine)
|
||||
* DONE day 4
|
||||
** frog
|
||||
** jackknife blaster
|
||||
* DONE day 5
|
||||
** lightning bolt
|
||||
** scissors
|
||||
* DONE day 6
|
||||
** zorro
|
||||
** supine butterfly (w/ strap)
|
||||
* TODO day 7
|
||||
** thread the needle (wall)
|
||||
** prone butterfly
|
||||
* TODO day 8
|
||||
** ninja squat
|
||||
** chair scissors
|
||||
** lateral chain stretch
|
||||
* TODO day 9
|
||||
** psoas blaster (chair)
|
||||
** reclined scissors
|
||||
* DONE day 10
|
||||
** twisted blaster
|
||||
** twisted squat
|
||||
* TODO day 11
|
||||
** double pigeon
|
||||
** bound butterfly
|
||||
* TODO day 12
|
||||
** eagle fold
|
||||
** cross-thread
|
||||
* DONE day 13
|
||||
** swiss army knife
|
||||
** saddle
|
||||
* TODO day 14
|
||||
** butterfly squat
|
||||
** half lightning bolt
|
||||
* DONE day 15
|
||||
** fallen blaster
|
||||
** asymmetric baby
|
||||
* DONE day 16
|
||||
** standing psoas
|
||||
** standing pigeon
|
||||
* TODO day 17
|
||||
** marichi B
|
||||
** long butterfly
|
||||
* TODO day 18
|
||||
** eagle legs
|
||||
** chair squat
|
||||
* DONE day 19
|
||||
** twisted pigeon
|
||||
** bound baby
|
||||
* DONE day 20
|
||||
** seated pigeon
|
||||
** railroad squat
|
||||
* DONE day 21
|
||||
** thunderbolt
|
||||
** yogi squat
|
||||
62
users/wpcarro/playbooks/nix_gcr/README.md
Normal file
62
users/wpcarro/playbooks/nix_gcr/README.md
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
# Nix + Google Cloud Run (i.e. GCR)
|
||||
|
||||
I'm documenting how I currently deploy projects that I package with Nix on
|
||||
Google Cloud Run.
|
||||
|
||||
I'd like to automate this workflow as much as possible, and I intend to do just
|
||||
that. For now, I'm running things manually until I can design an generalization
|
||||
that appeals to me.
|
||||
|
||||
## Dependencies
|
||||
- `nix-build`
|
||||
- `docker`
|
||||
- `gcloud`
|
||||
|
||||
## Step-by-step
|
||||
|
||||
1. Use `nix-build` to create our Docker image for Cloud Run.
|
||||
|
||||
```shell
|
||||
> nix-build ./cloud_run.nix
|
||||
```
|
||||
|
||||
This outputs a Docker image at `./result`.
|
||||
|
||||
1. Load the built image (i.e. `./result`) into `docker` so that we can tag it
|
||||
and push it to the Google Container Registry (i.e. GCR).
|
||||
|
||||
```shell
|
||||
> sudo docker load <./result
|
||||
```
|
||||
|
||||
1. (Optionally) Run the image locally to verify its integrity.
|
||||
|
||||
```shell
|
||||
> sudo docker run -d -p 8080:4242 <name>:<tag>
|
||||
```
|
||||
|
||||
1. Tag and push the image to GCR.
|
||||
|
||||
```shell
|
||||
> sudo docker tag <name>:<label> gcr.io/<google-cloud-project-id>/<name>:<latest>
|
||||
```
|
||||
|
||||
1. Visit Google Cloud Run; create a new service with "Create Service"; select
|
||||
the uploaded Docker image from the "Container Image URL" field; click
|
||||
"Create" to deploy.
|
||||
|
||||
## Notes
|
||||
|
||||
You may need to authorize `gcloud` by running the following:
|
||||
|
||||
```shell
|
||||
> sudo gcloud auth login --no-launch-browser
|
||||
```
|
||||
|
||||
You must use `sudo` here since the `docker` invocations are prefixed with `sudo`
|
||||
as well.
|
||||
|
||||
## Todos
|
||||
|
||||
- If possible, prefer using a command line tool like `gcloud` to create the
|
||||
Cloud Run service.
|
||||
14
users/wpcarro/playbooks/nix_gcr/cloud_run.nix
Normal file
14
users/wpcarro/playbooks/nix_gcr/cloud_run.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{ pkgs, depot, ... }:
|
||||
|
||||
pkgs.dockerTools.buildLayeredImage {
|
||||
name = "gemma";
|
||||
tag = "latest";
|
||||
config.ExposedPorts = {
|
||||
"4242" = {};
|
||||
};
|
||||
config.Env = [
|
||||
"GEMMA_CONFIG=${./config.lisp}"
|
||||
];
|
||||
config.Cmd = [ "${depot.fun.gemma}/bin/gemma" ];
|
||||
maxLayers = 120;
|
||||
}
|
||||
21
users/wpcarro/playbooks/nix_gcr/config.lisp
Normal file
21
users/wpcarro/playbooks/nix_gcr/config.lisp
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
;; Example configuration file for Gemma
|
||||
|
||||
(config :port 4242
|
||||
:data-dir "/tmp/gemma/")
|
||||
|
||||
(deftask bathroom/wipe-mirror 7)
|
||||
(deftask bathroom/wipe-counter 7)
|
||||
|
||||
;; Bedroom tasks
|
||||
(deftask bedroom/change-sheets 7)
|
||||
(deftask bedroom/vacuum 10)
|
||||
|
||||
;; Kitchen tasks
|
||||
(deftask kitchen/normal-trash 3)
|
||||
(deftask kitchen/green-trash 5)
|
||||
(deftask kitchen/blue-trash 5)
|
||||
(deftask kitchen/wipe-counters 3)
|
||||
(deftask kitchen/vacuum 5 "Kitchen has more crumbs and such!")
|
||||
|
||||
;; Entire place
|
||||
(deftask clean-windows 60)
|
||||
12
users/wpcarro/playbooks/shell.md
Normal file
12
users/wpcarro/playbooks/shell.md
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Shell
|
||||
|
||||
I'm making this as an offline reference for some of the commands that I use
|
||||
often enough to need to remember but not often enough to *actually* remember.
|
||||
|
||||
## Reference
|
||||
|
||||
- To kill a process by its port number:
|
||||
|
||||
```shell
|
||||
$ fuser 8080/tcp
|
||||
```
|
||||
115
users/wpcarro/playbooks/sqlite3.md
Normal file
115
users/wpcarro/playbooks/sqlite3.md
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
# SQLite3
|
||||
|
||||
Creating a reference for SQLite that I can access when I'm offline
|
||||
(e.g. traveling in an airplane).
|
||||
|
||||
## Benefits
|
||||
|
||||
I enjoy using SQLite because it's lightweight and simple. Instead of networking
|
||||
microservices, I can oftentimes just create a simple `db.sqlite3` file and get
|
||||
significant mileage without much tooling overhead.
|
||||
|
||||
## Limitations
|
||||
|
||||
SQLite has some limitations; here are some of the limitations that I have encountered.
|
||||
|
||||
- SQLite **disables** support for `FOREIGN KEY` by default. Enable it with:
|
||||
|
||||
```
|
||||
sqlite> PRAGMA foreign_keys = ON;
|
||||
```
|
||||
|
||||
- SQLite has no `BOOLEAN` type; it uses 0 and 1 instead.
|
||||
|
||||
```
|
||||
sqlite> SELECT TRUE;
|
||||
TRUE
|
||||
----------
|
||||
1
|
||||
sqlite> SELECT FALSE;
|
||||
FALSE
|
||||
----------
|
||||
0
|
||||
```
|
||||
|
||||
- SQLite has no `DATETIME` type; it uses `TEXT` instead.
|
||||
|
||||
```
|
||||
sqlite> SELECT datetime('now');
|
||||
datetime('now')
|
||||
-------------------
|
||||
2020-07-26 09:52:32
|
||||
```
|
||||
|
||||
## Reference
|
||||
|
||||
The following should serve as a useful reference for working with SQLite.
|
||||
|
||||
### Schema
|
||||
|
||||
```sql
|
||||
CREATE TABLE IF NOT EXISTS Movies (
|
||||
title TEXT NOT NULL,
|
||||
year INTEGER,
|
||||
PRIMARY KEY (title)
|
||||
);
|
||||
|
||||
ALTER TABLE Movies ADD COLUMN rating DEFAULT 0.0;
|
||||
|
||||
DROP TABLE Movies;
|
||||
```
|
||||
|
||||
### Queries
|
||||
|
||||
The following queries should come in handy as a reference:
|
||||
|
||||
```
|
||||
sqlite> -- I'm using an intentionally incorrect date here for the subsequent UPDATE.
|
||||
sqlite> INSERT INTO Movies (title, year) VALUES ('Toy Story 3', 2100);
|
||||
sqlite> SELECT * FROM Movies WHERE year IS NULL;
|
||||
sqlite> UPDATE Movies SET year = 2010 WHERE title = 'Toy Story 3';
|
||||
sqlite> -- % is like .* in a regex
|
||||
sqlite> DELETE FROM Movies WHERE title LIKE 'Toy Story%';
|
||||
```
|
||||
|
||||
## Command Line
|
||||
|
||||
- Create a `~/.sqliterc` file with the following contents:
|
||||
|
||||
```
|
||||
.mode column
|
||||
.headers on
|
||||
```
|
||||
|
||||
- To start an interactive session:
|
||||
|
||||
```shell
|
||||
$ sqlite3 db.sqlite3
|
||||
```
|
||||
|
||||
- To create a SQLite database from a `.sql` file:
|
||||
|
||||
```shell
|
||||
$ sqlite3 db.sqlite3 <db.sql
|
||||
```
|
||||
|
||||
- To reload changes to a `.sql` file while in an interactive session:
|
||||
|
||||
```
|
||||
sqlite> .read db.sql
|
||||
```
|
||||
|
||||
## Miscellaneous
|
||||
|
||||
- For a web-browser-based SQLite viewer, run the following:
|
||||
|
||||
```shell
|
||||
$ sqlite_web db.sqlite3
|
||||
```
|
||||
|
||||
- To import a CSV:
|
||||
|
||||
```
|
||||
sqlite> .mode csv <table-name>
|
||||
sqlite> .import path/to/file.csv <table-name>
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue