Skip to content

Instantly share code, notes, and snippets.

View quaintdev's full-sized avatar
🏠
Working from home

quaintdev

🏠
Working from home
View GitHub Profile
@willurd
willurd / web-servers.md
Last active November 5, 2025 20:58
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@michaljemala
michaljemala / tls-client.go
Last active September 5, 2025 07:30
SSL Client Authentication Golang sample
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io/ioutil"
"log"
"net/http"
)
@josephspurrier
josephspurrier / aescmd.go
Created December 23, 2014 07:11
Golang - Encrypt, Decrypt, File Read, File Write, Readline
package main
import (
"bufio"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"fmt"
"io"
"io/ioutil"
sudo apt-get install connman
After connman was successfully installed trying to scan wifi you will get:
connmanctl> enable wifi
Enabled wifi
connmanctl> scan wifi
Error /net/connman/technology/wifi: No carrier.
Solution is remove wpa_supplicant.conf
@teknoraver
teknoraver / unixhttpc.go
Last active September 30, 2025 08:41
HTTP over Unix domain sockets in golang
package main
import (
"context"
"flag"
"fmt"
"io"
"net"
"net/http"
"os"
@aka-mj
aka-mj / unixsock_ex.go
Created February 9, 2017 19:32
Unix Socket Example in Go
package main
import (
"fmt"
"net"
"os"
"time"
)
func listen(end chan<- bool) {
@rushilgupta
rushilgupta / GoConcurrency.md
Last active May 9, 2025 10:20
Concurrency in golang and a mini Load-balancer

INTRO

Concurrency is a domain I have wanted to explore for a long time because the locks and the race conditions have always intimidated me. I recall somebody suggesting concurrency patterns in golang because they said "you share the data and not the variables".

Amused by that, I searched for "concurrency in golang" and bumped into this awesome slide by Rob Pike: https://talks.golang.org/2012/waza.slide#1 which does a great job of explaining channels, concurrency patterns and a mini-architecture of load-balancer (also explains the above one-liner).

Let's dig in:

Goroutines

@7415963987456321
7415963987456321 / config
Last active August 16, 2025 15:57
Sway config
##################
# sway config file
##################
set $lock ~/.config/sway/scripts/lock.sh
set $grim ~/.config/sway/scripts/grim.sh
set $slurp ~/.config/sway/scripts/slurp.sh
set $mod Mod4
set $left h
set $down j
set $up k
@PhilMurwin
PhilMurwin / RasPiNamecheapDNS.md
Last active October 24, 2024 03:49
How to setup DDclient on Raspberry Pi for use with Namecheap DynDNS

How to use Namecheap DynDNS service with ddclient on the Raspberry Pi

Log into your Raspberry Pi (by ssh for example) or open a terminal window if you are working directly on Pi. In the first step we have to install ddclient, a DynDNS software, on the Pi. For this purpose, the following two commands are necessary.

sudo apt-get update
sudo apt-get install ddclient

Note: During installation an installation wizard opens and wants to know some things from you. Here you can safely enter what you want, because we have to adjust the configuration file manually either way, because the wizard does not support the Namecheap.com interface.

@iqbalmineraltown
iqbalmineraltown / sprintf.dart
Last active March 15, 2022 04:40
Simple string pattern replacement function in dartlang. I use this for Flutter localization
/**
* MIT License
*
* Copyright (c) 2019 Muhammad Iqbal
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is