Skip to content

Instantly share code, notes, and snippets.

View dcchambers's full-sized avatar
🚀
happy engineers == productive engineers

Dakota Chambers dcchambers

🚀
happy engineers == productive engineers
View GitHub Profile
@n3r0-ch
n3r0-ch / docker-nuke
Last active August 23, 2019 16:44
docker-nuke exists to do one thing; clean up your Docker environment. It's not called docker-carefully-and-nicely-spritz-up. Be carefully!
#!/bin/bash
#Check if user is root
if [ $UID != 0 ]; then
echo "You need to be root to use this script."
exit 1
fi
echo "docker-nuke exists to do one thing; clean up your Docker environment. It's not called docker-carefully-and-nicely-spritz-up. Be carefully!"
echo
@dcchambers
dcchambers / docker-nuke-safely
Last active December 6, 2019 19:58 — forked from n3r0-ch/docker-nuke
Docker Nuke (Safely) 🐳💣- Clean up your Docker environment in a (sort of) safe way!
#!/bin/bash
#Check if user is root
if [ $UID != 0 ]; then
echo "You need to be root to use this script."
exit 1
fi
echo "docker-nuke-safely exists to do one thing; clean up your Docker environment. It's not called docker-carefully-and-nicely-spritz-up. Be careful!"
echo
(incomplete)
This question comes up often here. As a Windows systems engineer that transitioned into a "DevOps" systems engineer (this is a very contentious title, but "systems engineer that IS DevOps" doesn't have the same ring to it) over about a year, I'd like to start a living FAQ/guide on how to get into this game.
I'm also posting it on Gist [here](https://gist.github.com/carlosonunez/83312c12f884444620a495ef60882945). I presume that I'll update that one more frequently.
# Materials Required
* A healthy love for learning (DevOps is very young and is evolving almost daily)
* Patience with being the "dumb guy in the room"
@dansimco
dansimco / app.rb
Created May 29, 2012 15:09
Concise Sinatra Amazon S3 Upload Example
require "rubygems"
require 'sinatra'
require "aws/s3"
get '/' do
return %Q{
<form action="upload" method="post" accept-charset="utf-8" enctype="multipart/form-data">
<div>
<input type="file" name="file" value="" id="file">
</div>
@dcchambers
dcchambers / cli.md
Last active April 23, 2020 18:37
Commonly used Linux/Unix commands and programs one should be vaguely familiar with. Not an exhaustive list of all tools - just a list of the essentials.

File/Directory Management

  • touch
  • ls
  • ln
  • cp
  • mkdir
  • mv
  • rm
  • rmdir
  • which
@gullyn
gullyn / flappy.html
Last active November 28, 2023 18:23
Flappy bird in 205 bytes (improved!)
<body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c>
@thekeenant
thekeenant / cs-resources.md
Last active December 26, 2023 17:50
My CS bookmarks.

Cheatsheets

Learning & Practice

  • Pramp: Free forever peer-to-peer technical interview practice.
  • InterviewBit: Gamified practice for typical coding interview questions.
  • Project Euler: Math/CS related challenge problems. Try them and complete them at your own pace.
# Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html
Hi everyone, I'm Chris Wanstrath.
When Jeremy asked me to come talk, I said yes. Hell yes. Immediately. But
then I took a few moments and thought, Wait, why? Why me? What am I supposed
to say that's interesting? Something about Ruby, perhaps. Maybe the
future of it. The future of something, at least. That sounds
keynote-y.
@brendanhay
brendanhay / tmux-copy-mode-osx.md
Created February 8, 2012 14:15
Tmux, copy-mode, and OSX shenanigans.

Copy, with line wrapping!

If you've been trying to copy/paste text from a multi-pane tmux session with the mouse, you've probably been pretty pissed at the blissful ignorance a terminal application has of the rodent in your hand.

The alternative, which is quote-unqoute native copy/pasting using copy-mode takes a bit to get used to. So this is one solution for copying and pasting lines from a session with correct line wrapping behaviour, albeit keyboard only.

Disclaimer

Since copy-mode has similar concepts of marks, regions, and temp buffers to Emacs .. you'll probably find it straight forward if you're familar with Emacsen. For people using vi-mode in tmux, the same still applies but obviously the default key bindings will differ alot from what I show below.

@mcrumm
mcrumm / phx_sqlite_fly_launch.md
Last active January 15, 2024 07:49
Phoenix + SQLite Deployment tips

Deploying to Fly.io with SQLite

Deploying a Phoenix app to Fly.io is a breeze...is what everyone kept telling me. In fairness, I imagine the process would have been breezier had I just used postgres, but all the sqlite and litestream talk has been far too intriguing to ignore. "Wait", you say. "It is just a flat file. How much harder can it be?"

It is easy to make something harder than it should be. It is hard to take something complex and make it truly simple. flyctl launch does an amazing job at providing a simple interface to the utterly complex task of generating deployment resources, especially now that we are living in a containerd (erm, firecracker) world.

This gist is for anyone who, like me, thinks they know better than to read all of the documentation and therefore necessari