Since it was a lot of work to figure all this out i figured i'd let others know: So I have an assortment of machines on various OS'es now at home, macs, windows, linux. I needed a way to (ideally) back everything up the same way. Also, Apple's Time Machine, as easy as it is to use, was starting to piss me off, at least over a network (taking forever, causing the computer to lag terribly, often saying it had to rebuild the entire backup from scratch, that sort of thing... It always worked fine to a local disk, but I wanted reliable network backup) I decided early on to stick to using S3 protocol to a FreeNAS Mini I already own since pretty much all the backup software I was evaluating was able to speak S3, from all the OS'es. This would also make it easy to switch to actual cloud down the line if that made sense. S3 support provided by Minio http://www.min.io/ was recently added to my FreeNAS and it turns out, Minio is also easily installable on OS X (via Homebrew) and Linux, which meant that I could use my Ma
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 1993 until 1997 I served as AFSC 2A636 (aircraft electrical and environmental systems specialist) in the USAF on the KC-10 aircraft. | |
I was stationed at March AFB from 1993-1995, it was subsequently closed to active duty by Pres. Clinton and they shipped us all north to Travis AFB, where I served until 1997. | |
The following happened while I was at March (which was a lovely base, btw... possibly one of the best times in my life was spent there). | |
It was an activity-free Friday afternoon- all missions were done, we were sitting around. | |
Erik Anderson (who outranked me) suggested we take the downtime to catch up on some OJT (on the job training) to sign off some stuff. | |
So we go to the flightline, which is completely dead at this point, and we pick any old available jet, the one we picked happened to | |
be 02-0191 (tail number; we just called it 2191). I remember this because of a reason you will learn shortly. | |
We board the jet and since it was so dead, Erik did not bother tagging the battery switch (which normally |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bash>> ls -@l PeterMBP | |
... | |
drwxr-xr-x@ 13 root wheel 442 Nov 6 05:23 2019-11-06-052333 | |
com.apple.backup.SnapshotNumber 5 | |
com.apple.backup.SnapshotVersion 1 | |
com.apple.backupd.SnapshotCompletionDate 16 | |
com.apple.backupd.SnapshotStartDate 16 | |
com.apple.backupd.SnapshotState 1 | |
com.apple.backupd.SnapshotTotalBytesCopied 8 | |
com.apple.backupd.SnapshotType 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
$ mix deps.tree | |
mpnetwork | |
├── eliver ~> 2.0 (Hex package) | |
│ └── enquirer ~> 0.1.0 (Hex package) | |
├── ecto_sql ~> 3.1.6 (Hex package) | |
├── gettext ~> 0.13 (Hex package) | |
├── lz4 ~> 0.2.2 (Hex package) | |
├── briefly ~> 0.3 (Hex package) | |
├── number ~> 0.5 (Hex package) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Mpnetwork.Ecto.CompressedTerm do | |
@behaviour Ecto.Type | |
# The functionality below depends on the lz4_erl module. | |
# Note that pack/unpack stores the decompressed data length as the first 4 bytes | |
# or assumes those bytes are that value | |
defp compress(txt) when is_binary(txt) do | |
{:ok, comp} = :lz4.pack(txt, [:high]) | |
comp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TRACEROUTE: | |
traceroute to 74.101.192.61 (74.101.192.61), 15 hops max, 60 byte packets | |
1 Blizzard Blizzard 0.370 ms 0.358 ms 0.356 ms | |
2 24.105.18.131 (24.105.18.131) 1.086 ms 1.092 ms 1.093 ms | |
3 137.221.105.16 (137.221.105.16) 1.047 ms 1.055 ms 1.037 ms | |
4 137.221.66.18 (137.221.66.18) 2.566 ms 2.592 ms 2.592 ms | |
5 137.221.83.66 (137.221.83.66) 6.869 ms 6.894 ms 6.894 ms | |
6 137.221.65.68 (137.221.65.68) 167.385 ms 166.230 ms 166.208 ms | |
7 137.221.68.32 (137.221.68.32) 6.012 ms 6.013 ms 6.041 ms | |
8 las-b21-link.telia.net (62.115.178.200) 5.651 ms 6.125 ms 6.150 ms |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for %%F in (*.zip) do ( "C:\Program Files\7-Zip\7z.exe" x -y -o"%%F_tmp" "%%F" * & pushd %%F_tmp & "C:\Program Files\7-Zip\7z.exe" a -y -r -m0=lzma2 -mx=9 -t7z ..\"%%~nF".7z * & popd & rmdir /s /q "%%F_tmp" ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use this one-liner: | |
for %i in (*.*) do "c:\Program Files\7-Zip\7z.exe" a -m0=lzma2 -mx=9 "%~ni.7z" "%i" |
A word of warning to anyone building web apps: Be careful about requirements around “emails coming from the web app”. Here’s an example of why:
- I agreed that (on my open source real estate listing site) people could email listings to any recipient. Didn’t sound too hard, get an email provider, create an unauthenticated link to the listing, send it off! Right?
- First problem I noticed is that many domains won’t even accept email from new domains, they get flagged. There is no procedural way to get your new domain’s email accepted by all other domains in some rigorous fashion; it seems to be a combination of crafting the “right” MX record at the domain level and/or adding some other private key/value pairs, an obscure art form, and literally calling domain admins up or filing obscure tech support requests via some dusty automated system. Blame spammers, I guess.
- Then, they wanted custom body and signature, so I built in a rich-text editor for the body and added
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule OutcomesProcedural do | |
def partitions(cards, subtotal) do | |
Enum.sum( | |
for i <- 0..9, elem(cards,i)>0 do | |
case subtotal+i+1 do | |
x when x > 21 -> 0 | |
x when x==21 -> 1 | |
x when x < 21 -> 1+partitions(put_elem(cards, i, elem(cards,i)-1), x) | |
end | |
end |