Skip to content

Instantly share code, notes, and snippets.

View erasmas's full-sized avatar
🇺🇦

Dmytro Kobza erasmas

🇺🇦
View GitHub Profile
@cdepillabout
cdepillabout / shell.nix
Last active May 7, 2024 13:49
shell.nix for Python development using virtualenv and pip
let
nixpkgs-src = builtins.fetchTarball {
# master of 2021-01-05.
url = "https://github.com/NixOS/nixpkgs/archive/1a57d96edd156958b12782e8c8b6a374142a7248.tar.gz";
sha256 = "1qdh457apmw2yxbpi1biwl5x5ygaw158ppff4al8rx7gncgl10rd";
};
pkgs = import nixpkgs-src {
config = {
# allowUnfree may be necessary for some packages, but in general you should not need it.
@sdushantha
sdushantha / instructions.md
Last active November 17, 2023 10:12
ncmpcpp + mpd + mpc on macOS

Install the required packages

brew install ncmpcpp mpd mpc

Make the.mpd directory in your home directory

mkdir ~/.mpd
@insdavm
insdavm / WireGuard-site-to-site.md
Last active May 3, 2024 21:19
Accessing a subnet that is behind a WireGuard client using a site-to-site setup

WireGuard Site-to-Site

Accessing a subnet that is behind a WireGuard client using a site-to-site setup

Problem Summary

We want to access a local subnet remotely, but it is behind a NAT firewall and we can't setup port forwarding. Outgoing connections work, but all incoming connections get DROPPED by the ISP's routing policy.

Solution Summary

@maacl
maacl / core.clj
Last active January 29, 2023 07:07
Domain Modelling using Clojure
(ns pms.core
(:require [clojure.spec.alpha :as s]
[clojure.spec.gen.alpha :as gen]
[clojure.spec.test.alpha :as stest]))
(comment "This is a small experiment inspired by Oskar Wickströms
excellent work at
https://haskell-at-work.com/episodes/2018-01-19-domain-modelling-with-haskell-data-structures.html. I
wanted to see what would be involved in building the equivalent
functionality in reasonably ideomatic Clojure. It is also my first
@alfonsogarciacaro
alfonsogarciacaro / Deploy.md
Last active March 3, 2023 09:50
Deploying an F# ASP.NET Core app (Giraffe) to Azure

Deploying an F# ASP.NET Core app to Azure

Last week I spent a lot of time trying to deploy an F# ASP.NET Core app (a Giraffe app, specifically) to Azure because the information to complete all the steps was scattered in several places. So I'm writing this hopefully it will save the pain to others :)

Preparation

The following steps are mostly taken from this guide and it's only necessary to do them once:

  1. Create an account in Azure (or use an existing one)
  2. Create a resource group (or use an existing one)

Getting Started in Scala

This is my attempt to give Scala newcomers a quick-and-easy rundown to the prerequisite steps they need to a) try Scala, and b) get a standard project up and running on their machine. I'm not going to talk about the language at all; there are plenty of better resources a google search away. This is just focused on the prerequisite tooling and machine setup. I will not be assuming you have any background in JVM languages. So if you're coming from Python, Ruby, JavaScript, Haskell, or anywhere…  I hope to present the information you need without assuming anything.

Disclaimer It has been over a decade since I was new to Scala, and when I was new to Scala, I was coming from a Java and Ruby background. This has probably caused me to unknowingly make some assumptions. Please feel free to call me out in comments/tweets!

One assumption I'm knowingly making is that you're on a Unix-like platform. Sorry, Windows users.

Getting the JVM

@ralph-tice
ralph-tice / gist:bc8f66c4fe1d4238ce54c54272fc4ba2
Last active April 1, 2020 10:03
Resizing a Kafka cluster via bash
#!/bin/bash -xe
# requires jq and 3 brokers to start
which jq || echo 'no jq found, bye!' && exit 1
ZK_HOST=zkhost1:2181/kafka
# record all topics
/usr/local/kafka/bin/kafka-topics.sh --zookeeper $ZK_HOST --list > all_topics
# generate json for listing which topics to reassign
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@jmglov
jmglov / cli.pxi
Created December 10, 2015 09:41
Basic command-line arguments parser for Pixie
#!/usr/bin/env pxi
(ns cli
"pxi cli.pxi --verbose --bar 42 --hello 'world!'
{:verbose true, :bar 42, :hello world!}"
(:require [pixie.string :as string]))
(defn- arg?
"Returns true if the string is an argument to an option"
[s]