Skip to content

Instantly share code, notes, and snippets.

carestad /
Last active Dec 16, 2021
Build DisplayLink docking driver for newer kernel verions
View useFocus.ts
export const useFocus = () => {
const htmlElRef = useRef<HTMLElement>()
const setFocus = () => {
const currentEl = htmlElRef.current
currentEl && currentEl.focus()
return [setFocus, htmlElRef] as const
brutella /
Last active Jun 9, 2022
How to enable the camera module on a Raspberry Pi

Enable camera module

Edit your /boot/config.txt file and make sure the following lines look like this:

start_x=1             # essential
gpu_mem=128           # at least, or maybe more if you wish
disable_camera_led=1  # optional, if you don't want the led to glow

Load bcm2835-v4l2 module

enricofoltran / main.go
Last active Aug 15, 2022
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
View main.go
package main
import (
Prasad9 / annotation.xml
Created Nov 6, 2017
A sample XML annotation file based on Pascal VOC format.
View annotation.xml
douglasrizzo /
Last active Dec 28, 2021
TensorFlow Object Detection Model Training
wangruohui / Install NVIDIA Driver and
Last active Aug 18, 2022
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS
View Install NVIDIA Driver and
ammario / ipint.go
Created Jun 5, 2016
Golang ip <-> int conversion
View ipint.go
func ip2int(ip net.IP) uint32 {
if len(ip) == 16 {
return binary.BigEndian.Uint32(ip[12:16])
return binary.BigEndian.Uint32(ip)
func int2ip(nn uint32) net.IP {
ip := make(net.IP, 4)
binary.BigEndian.PutUint32(ip, nn)
tpokorra / lxc-pi
Created Jan 20, 2016
lxc container Raspberry Pi
View lxc-pi
# lxc: linux Container library
# Authors:
# Original Debian:
# Daniel Lezcano <>
# Changes for Raspberry Pi by:
# Oliver Heller <>
austinjp /
Last active Oct 9, 2020
An *unprivileged* LXC container dedicated to running Wordpress

What and why

Create an unprivileged Linux container (LXC) dedicated to running Wordpress websites.

If you install Wordpress regularly on Linux you can instead simply clone this container.

The Wordpress installation is nothing fancy. It's not multi-site, it's not SSL enabled by default, or anything like that. Just a plain bog-standard Wordpress installation serving a single domain.