Skip to content

Instantly share code, notes, and snippets.

@candlerb
candlerb / go-project-layout.md
Last active October 1, 2024 08:33
Suggestions for go project layout

If someone asked me the question "what layout should I use for my Go code repository?", I'd start by asking back "what are you building: an executable, or a library?"

Single executable

Stage 1: single source file

Create a directory named however you want your final executable to be called (e.g. "mycommand"), change into that directory, and create the following files:

@robin-a-meade
robin-a-meade / 'Minimal config for shell and vim.md
Last active February 15, 2025 06:50
Minimal config for shell and vim

Quick minimal config for shell and vim

For when a full dotfiles setup is overkill.

Installation Instructions

curl https://gist.githubusercontent.com/robin-a-meade/b83dd635076993c4c25b7115d0b5da32/raw/install.sh | bash
@sgnn7
sgnn7 / go_deps.go
Last active September 3, 2021 07:37
Golang deps enumeration
package main
import (
"bufio"
"bytes"
"context"
"fmt"
"io"
"os"
"os/exec"
@BorysVrublevskyi
BorysVrublevskyi / ClearLinux-KDE.md
Last active May 14, 2024 18:26
ClearLinux Workstation with KDE

ClearLinux. Install OS and Apps

This is a guide how to setup fast and stable workstation based on ClearLinux with KDE enwironment

Before you begin

Read System requirements, Check Processor Compatibility, get familiar with swupd package manager.

Install Clear OS Server, add KDE Plasma and flatpak

Download ClearLinux, make bootable USB drive with Rufus, boot from it and follow the instructions.

@ribice
ribice / caller.go
Last active January 6, 2025 07:14
A robust rabbitmq client for Go
go func() {
for {
err = rmq.Stream(cancelCtx)
if errors.Is(err, rabbitmq.ErrDisconnected) {
continue
}
break
}
}()
@kacole2
kacole2 / harbor.sh
Last active January 15, 2025 09:55
Quick Start Harbor Installation Script on Ubuntu 18.04
#!/bin/bash
#Harbor on Ubuntu 18.04
#Prompt for the user to ask if the install should use the IP Address or Fully Qualified Domain Name of the Harbor Server
PS3='Would you like to install Harbor based on IP or FQDN? '
select option in IP FQDN
do
case $option in
IP)
@KatelynHaworth
KatelynHaworth / README.md
Created November 2, 2019 16:48
Reproduction code for golang/go#35314

Reproduction code for golang/go#35314

This gist contains example code to reproduce golang/go#35314, due to the privilege requirements of DuplicateTokenEx the code is designed to run as a service which then spawns a child process and logs the output of the child process to the Windows event log.

Written for go 1.13.4

Running the code

@billti
billti / arm64-on-Win10.md
Last active March 13, 2025 20:04
ARM64 Linux on Win10

Below are the steps to get an ARM64 version of Ubuntu running in the QEMU emulator on Windows 10.

Install QEMU

Install for Windows from https://qemu.weilnetz.de/w64/ (I used qemu-w64-setup-20181211.exe)

Put C:\Program Files\qemu on your PATH, and run the below to check it's working (which will list out the CPUs the AArch64 emulator can emulate):

qemu-system-aarch64 -M virt -cpu help
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active May 16, 2025 13:07
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@GregRos
GregRos / more-about-pretty-and-usable-wsl-terminals.md
Last active May 3, 2021 15:58
Some notes on "Configuring a pretty and usable terminal emulator for WSL"

These comments are based on a few years of experience working with WSL. It's based on this tutorial:

https://blog.ropnop.com/configuring-a-pretty-and-usable-terminal-emulator-for-wsl/

And are basically updates to make it more relevant.

Opening a shell

In the past, to make the WSL run a command from cmd or somewhere else, you had to run the bash.exe program from windows, which fired up bash (and always bash) in the WSL and made it execute a command.