Skip to content

Instantly share code, notes, and snippets.

@candlerb
candlerb / go-project-layout.md
Last active April 24, 2024 19:22
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 24, 2023 01:18
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 July 7, 2023 07:07
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 July 19, 2024 05:59
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 July 13, 2024 09:51
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
@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.

@kieetnvt
kieetnvt / Crying with NGINX Regex, IF statement, and module http rewrite.md
Last active October 6, 2020 09:15
Crying with NGINX Regex matching, IF statement and module http rewrite $1 $2 meaning

If Statement and common condition

Syntax:	if (condition) { ... }
Default:	—
Context:	server, location

A condition may be any of the following: