Skip to content

Instantly share code, notes, and snippets.

@caryoscelus
caryoscelus / shell.nix
Created September 21, 2023 12:51
run games in nixos shell.nix
{ pkgs ? import <nixpkgs> {} }:
(pkgs.buildFHSEnv {
name = "launch-env";
targetPkgs = pkgs: (with pkgs; [
udev
alsa-lib
fontconfig
libxkbcommon
libGL
@MatrixManAtYrService
MatrixManAtYrService / Dockerfile
Last active June 23, 2024 10:51
tini vs dumb init
FROM ubuntu
RUN apt update
RUN apt install -y tini dumb-init python3-pip
RUN pip install apache-airflow
# place the entrypoint script
COPY entrypoint.sh /entrypoint
RUN chmod +x /entrypoint
# a script that calls airflow (and does test-relevant things too)
@majodev
majodev / Dockerfile
Created December 4, 2018 09:11
netdata daemonset on kubernetes
FROM netdata/netdata:latest
MAINTAINER YOUR_EMAIL
# add netdata user to root group (access volumne mounts from host)
RUN apk --no-cache add shadow
RUN usermod -a -G root netdata
ENTRYPOINT ["/usr/sbin/run.sh"]
@kauffmanes
kauffmanes / install_anaconda.md
Last active July 18, 2024 21:15
Install Anaconda on Windows Subsystem for Linux (WSL)

Thanks everyone for commenting/contributing! I made this in college for a class and I no longer really use the technology. I encourage you all to help each other, but I probably won't be answering questions anymore.

This article is also on my blog: https://emilykauffman.com/blog/install-anaconda-on-wsl

Note: $ denotes the start of a command. Don't actually type this.

Steps to Install Anaconda on Windows Ubuntu Terminal

  1. Install WSL (Ubuntu for Windows - can be found in Windows Store). I recommend the latest version (I'm using 18.04) because there are some bugs they worked out during 14/16 (microsoft/WSL#785)
  2. Go to https://repo.continuum.io/archive to find the list of Anaconda releases
  3. Select the release you want. I have a 64-bit computer, so I chose the latest release ending in x86_64.sh. If I had a 32-bit computer, I'd select the x86.sh version. If you accidentally try to install the wrong one, you'll get a warning in the terminal. I chose `Anaconda3-5.2.0-Li
@xsot
xsot / instructions.md
Last active March 3, 2024 13:42
sed maze solver

Usage

sed -E -f solver.sed input where input is a file containing the maze.

For best results, resize your terminal to match the height of the maze. To disable animations, delete the lines containing p.

Maze format

The solver assumes the following:

  • The maze only contains the characters # \nSE
  • Every line has the same number of characters
  • There is only one start (S) and end (E)
@StevenACoffman
StevenACoffman / Docker Best Practices.md
Last active June 23, 2024 10:51
Docker Best Practices

Mistakes to Avoid: Docker Antipatterns

Whichever route you take to implementing containers, you’ll want to steer clear of common pitfalls that can undermine the efficiency of your Docker stack.

Don’t run too many processes inside a single container

The beauty of containers—and an advantage of containers over virtual machines—is that it is easy to make multiple containers interact with one another in order to compose a complete application. There is no need to run a full application inside a single container. Instead, break your application down as much as possible into discrete services, and distribute services across multiple containers. This maximizes flexibility and reliability.

Don’t install operating systems inside Docker containers

It is possible to install a complete Linux operating system inside a container. In most cases, however, this is not necessary. If your goal is to host just a single application or part of an application in the container, you need to install only the essential

function! RandomNumber(limit)
let components = split(reltimestr(reltime()), '\.')
let microseconds = components[-1] + 0
return microseconds % a:limit
endfunction
function! RandomScheme()
let choices = []
for fname in split(globpath(&runtimepath, 'colors/*.vim'), '\n')
let name = fnamemodify(fname, ':t:r')
@mikeash
mikeash / gist:1132620
Created August 8, 2011 20:17
Namespaced constants in C
#import <Foundation/Foundation.h>
// .h file
struct MyConstantsStruct
{
NSString *foo;
NSString *bar;