Skip to content

Instantly share code, notes, and snippets.

@sorki
sorki / libvirt.nix
Created May 11, 2022 13:13
libvirt with statically configured bridge
# Module for configuring libvirt with static NixOS networking
# instead of using libvirt managed bridge.
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.virtualisation.libvirtd.networking;
v6Enabled = cfg.ipv6.network != null;
v6PLen = toInt (elemAt (splitString "/" cfg.ipv6.network) 1);
@pdalpra
pdalpra / starship.nix
Created February 23, 2022 16:48
fun with configuring starship in Nix home-manager
{ pkgs, lib, ... }:
with lib;
with builtins;
let
isRustFile = path: type:
hasSuffix ".rs" path && type == "regular" && path != "mod.rs";
mergeAllAttrSets = attrsSets:
foldl' (recursiveUpdate) {} attrsSets;
# Install these packages (use your favorite AUR tool here)
yay -S minikube kubectl docker-machine-driver-kvm2 libvirt qemu-headless ebtables
# Get libvirt going
sudo systemctl enable libvirtd.service
sudo usermod -a -G libvirt $(whoami)
# This fix thanks to http://blog.programmableproduction.com/2018/03/08/Archlinux-Setup-Minikube-using-KVM/
sudo virsh net-autostart default
@mtds
mtds / lvn.md
Last active May 7, 2025 14:52
Linux Virtual Networking

Virtual Networking on Linux

In the Linux Kernel, support for networking hardware and the methods to interact with these devices is standardized by the socket API:

                +----------------+
                |   Socket API   |
                +-------+--------+
                        |
User space              |
@TeknoVenus
TeknoVenus / Useful Programs.md
Last active December 17, 2024 16:17
Useful programs

My useful utilities and favourite programs to make everyday life that bit easier

Most of these are Windows based, but some are cross-platform. They are mainly free tools, but paid ones have been marked accordingly. Freemium tools have a free version but have a full version for a price. Tools are in no particular order

Utilities

@chrismccord
chrismccord / upgrade.md
Last active April 7, 2023 12:03
Phoenix 1.2.x to 1.3.0 Upgrade Instructions

If you want a run-down of the 1.3 changes and the design decisions behidn those changes, check out the LonestarElixir Phoenix 1.3 keynote: https://www.youtube.com/watch?v=tMO28ar0lW8

To use the new phx.new project generator, you can install the archive with the following command:

$ mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez

Bump your phoenix dep

Phoenix v1.3.0 is a backwards compatible release with v1.2.x. To upgrade your existing 1.2.x project, simply bump your phoenix dependency in mix.exs:

@ixqbar
ixqbar / openssl.md
Last active September 10, 2018 01:48
openssl使用

###产生1024位RSA私匙,用3DES加密它,口令为trousers,输出到文件rsaprivatekey.pem

openssl genrsa -out rsaprivatekey.pem -passout pass:trousers -des3 1024

###从文件rsaprivatekey.pem生成的公钥匙输出到文件rsapublickey.pem

openssl rsa -in rsaprivatekey.pem -passin pass:trousers -pubout -out rsapubckey.pem
@grfiv
grfiv / convert_mysql_to_sqlite3.sh
Created September 4, 2016 19:29
convert a mysql database to sqlite3
#!/bin/bash
#
# convert a mysql database to sqlite3
#
#see https://stackoverflow.com/questions/5164033/
# export-a-mysql-database-to-sqlite-database
mysql_host=localhost
mysql_user=george
#mysql_passwd=****************

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@olih
olih / jq-cheetsheet.md
Last active May 9, 2025 03:13
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq