Skip to content

Instantly share code, notes, and snippets.

@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
@TeknoVenus
TeknoVenus / Useful Programs.md
Last active December 1, 2023 16:03
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 June 20, 2024 16:22
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

@Fusl
Fusl / gist:3a708b8c32c9d5264fa0
Last active May 30, 2024 15:47
Streaming audio output from Linux (Pulseaudio) to Windows
# Windows (receiver) side:
.\ffplay.exe -nodisp -ac 2 -acodec pcm_u8 -ar 48000 -analyzeduration 0 -probesize 32 -f u8 -i udp://0.0.0.0:18181?listen=1
# Linux (transmitter) side:
pactl load-module module-null-sink sink_name=remote
ffmpeg -f pulse -i "remote.monitor" -ac 2 -acodec pcm_u8 -ar 48000 -f u8 "udp://RECEIVER:18181"
pavucontrol # Change the default output to the Null sink or move single applications to this "output" device.
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE