Skip to content

Instantly share code, notes, and snippets.

@abcdw
abcdw / nix vs guix.org
Last active February 17, 2024 14:21
nix vs guix.org

Nix vs Guix

These are notes to the stream: https://youtu.be/S9V-pcTrdL8

Some notes

  • We are not aware of a lot of GNU software available to us.
  • Seems that Guix more hacker-friendly/explorable.

General comparsion

DescriptionNixGuixComment
@anatol
anatol / qemucheatsheet
Created December 30, 2018 02:52
Install Arch in QEMU and run KTSAN
https://medium.com/@clem.boin/creating-a-minimal-kernel-development-setup-using-qemu-and-archlinux-987896954d84
# Install Arch system
qemu-image -f qcow2 kernel-dev-archlinux.img 4G
wget http://mirrors.edge.kernel.org/archlinux/iso/2018.12.01/archlinux-2018.12.01-x86_64.iso
# Note that ping does not work here
qemu-system-x86_64 -cdrom archlinux-2018.12.01-x86_64.iso -boot order=d -drive file=kernel-dev-archlinux.img,format=qcow2 -m 2G -enable-kvm -cpu host -smp 8 -net user,hostfwd=tcp::10022-:22 -net nic
@tinoji
tinoji / proxmox_lxc_pct_provisioner.sh
Created February 7, 2018 01:02
Create and provision Proxmox LXC by pct command
pct create <id> /var/lib/vz/template/cache/centos-7-default_20170504_amd64.tar.xz \
-arch amd64 \
-ostype <centos|ubuntu|etc> \
-hostname <hostname> \
-cores <cores> \
-memory <memory(MB)> \
-swap <swap(MB)> \
-storage local-lvm \
-password \
-net0 name=eth0,bridge=<bridge>,gw=<gateway>,ip=<cidr>,type=veth &&\
@dopey
dopey / main.go
Last active April 30, 2024 15:59 — forked from denisbrodbeck/main.go
How to generate secure random strings in golang with crypto/rand.
package main
import (
"crypto/rand"
"encoding/base64"
"fmt"
"io"
"math/big"
)
open FSharp.Quotations
let rec getMethodInfo = function
| Patterns.Call(_,``method``,_) -> ``method``
| Patterns.Lambda(_,body) -> getMethodInfo body
| _ -> failwith "Unexpected Form"
let getGenericMethodInfo functionExpression =
let methodInfo = getMethodInfo functionExpression
if methodInfo.IsGenericMethod then
@Tarmil
Tarmil / Counter.fs
Last active October 6, 2016 22:16
Port of the first example from https://github.com/evancz/elm-architecture-tutorial to WebSharper
namespace Example1
open WebSharper
open WebSharper.UI.Next
open WebSharper.UI.Next.Html
open WebSharper.UI.Next.Client
[<JavaScript>]
module Counter =
@adicirstei
adicirstei / WinForm.fsx
Last active April 4, 2022 17:17
Fully reactive UI in F# with observables
open System
open System.Windows.Forms
open System.Drawing
type Action =
| Increment
| Decrement
let form = new Form(Width= 400, Height = 300, Visible = true, Text = "Hello World")
@jeanlescure
jeanlescure / README.md
Last active March 25, 2024 19:08
Ubuntu/Debian Offline Repository Creation

Ubuntu/Debian Offline Repository Creation Gist

When I googled how to create my own offline repository of packages for use in an offline Ubuntu/Debian machine, the results were disheartening and the steps to be taken scattered all over the place.

The files within this gist will allow you to:

  • Download specific apt-get packages... with dependencies included!
  • Create a Packages.gz file so that you can add the repository folder you create to the target machine's /etc/apt/sources.list file.

Before using

@mokkabonna
mokkabonna / json_merge.coffee
Last active March 26, 2020 12:47 — forked from jphaas/json_merge.coffee
json auto merge
#To install:
#
#Requires coffe script installed globally: sudo npm install -g coffee-script
#
#In your git configuration (for instance, .git/config to do it at the project level), add:
#
#[merge "json_merge"]
# name = A custom merge driver for json files
# driver = coffee json_merge.coffee %O %A %B
# recursive = binary
@sphvn
sphvn / traverse.js
Last active October 26, 2023 21:49
Recursively traverse object javascript, recurse json js, loop and get key/value pair for JSON
var traverse = function(o, fn) {
for (var i in o) {
fn.apply(this,[i,o[i]]);
if (o[i] !== null && typeof(o[i])=="object") {
traverse(o[i], fn);
}
}
}
// usage