Skip to content

Instantly share code, notes, and snippets.

@squarism
squarism / lockrebase_demo.md
Created December 5, 2023 19:31
lockrebase Demo

Creating a Merge Conflict on Purpose

For this demo, we will be using node/javascript and NPM, only because it is sort of a lingua franca.

Let's create a merge conflict. It's pretty easy to do.

  1. Fork a branch, add a dependency.
  2. On the main branch, add another dependency.
  3. Now the poor person on the feature branch will get a merge conflict on the lock file when they "catch up on main".
@squarism
squarism / preseed.txt
Last active November 2, 2023 20:18
A debian 12 preseed
#_preseed_V1
# <CHECK_THIS>
d-i debian-installer/locale string en_US
d-i keyboard-configuration/xkb-keymap select us
@squarism
squarism / elk_stack_install.md
Last active October 22, 2023 12:25
Quick Elasticsearch / Kibana / Logstash (ELK stack) Install (for your local mac dev box)

Elasticsearch / Kibana / Logstash Quick Install

Instructions for getting an ELK stack set up quick on Mac. Paths are opinionated. You'll have to infer and change. Sorry mate. 🍰

Install Homebrew if not already. You probably have. If not, you should.

brew install elasticsearch nginx

do yourself a favor and get a better services command than launchctl

@squarism
squarism / the_bikeshed_insight.md
Last active September 15, 2023 22:13
Insight, Advice and Quotables from The Bikeshed Podcast

Self Care

and it's this very interesting little post where he talks about at the end of your day; you want to close the book on it. I think this is especially pointed now that many of us are working from home. For me, this is a new thing. And so, I've been very intentional with trying to put walks at the beginning and end of my day.

But in this particular blog post, he describes a routine that he does where he tidies things up and makes his list for the next day. And then he has a particular phrase that he says, which is "schedule shut down, complete."

294

@squarism
squarism / machine_languages_touched.md
Last active September 15, 2023 16:26
Machine Languages Touched

update this


"There are hundreds of different computer languages. Most experienced programmers know a dozen or so." source


WTF!? A dozen? Know? What does know mean? I don't KNOW English. Do you know what "erinaceous" means? (of, preterning to or resembling a hedgehog) I don't KNOW twelve machine languages.

@squarism
squarism / linux_ksp.md
Last active September 15, 2023 16:23
Kerbal Space Program Linux Box

Kerbal Space Program on Linux

KSP is delaying the 64-bit windows port for a while, at least past 1.0. The 32-bit Windows KSP version is a bit cramped. You install too many mods and the game will crash. It's hard to work out the balance point. On the KSP forums and on reddit, sometime people suggest switching to Linux. Someone is having problems playing a game and someone basically suggests learning Unix. Then the thread dies.

Linux (even if you've used it for a decade) is hard. Especially getting all the things to work properly. I used three different distros until I got AMD video drivers to work correctly and even now I'm not sure. You can have an easy time installing Linux. Maybe you got lucky on your hardware. Having a bad time in Linux is crazy-pants-party-time. You have to know a lot of commands just to collect information on what is going on.

Try a sprinkle of empathy.

So I wrote down what I did since I'm wiping my Linux partition over and over again. I hope this helps someone. Maybe

@squarism
squarism / client.rb
Created September 14, 2023 16:35
Ruby DRB quicksummary
require 'drb/drb'
DRb.start_service
remote = DRbObject.new_with_uri("druby://localhost:8787")
remote.pid
# => <some pid>
# you can verify the PIDs with top and you can filter by process name like ruby or irb or something
@squarism
squarism / system_replacements.md
Last active August 15, 2023 02:37
Modern system utility replacements (Go / Rust or even just something new)

Interesting and Modern CLI Tools

The absolute requirement is that these must be binaries that could go into /usr/bin one day. No python, ruby or js stuff. Not that dynamic languages are bad/evil, but I think system utilities should be binaries. I also think it's interesting that people are writing replacements in Go/Rust/Other that rethink some unix legacy. Replacement doesn't mean better in all cases. I just think it's an interesting time but also a good measure of what these compiled languages can handle/tackle/address. Will we see larger and more impressive CLIs? Or will the feature sets be about the same but the quality/stability/safety be better?

It's going to be reductive to explain some of these tools in one line.

  • exa - ls replacement
  • caddy - HTTP server (better than python -m SimpleHTTPServer)
@squarism
squarism / postgres_15_prisma.sh
Last active July 31, 2023 18:15
Postgres 15.x development databases setup with Prisma
# Things have changed in postgres 15.x+
$ createdb -O <your shell uid> foo_dev
$ createuser foo
$ psql
psql> grant all privileges on database foo_dev to foo;
psql> alter user foo with encrypted password 'random-password';
# enter the database that you just created
@squarism
squarism / main.rs
Last active June 3, 2023 17:55
Railroad Error Handling in Rust
// User password resets could benefit from railroad error handling
// because there are so many things to go wrong along the way
//
// 1. I forgot my password, send me a link
// 2. I got the link, let me enter a new password
// 3. Password and confirmation must match
// 4. Password must be at least 8, etc
// 5. Password was saved successfully
//
// There are many things that can go wrong and having a transaction