Skip to content

Instantly share code, notes, and snippets.

Avatar
defer/ mañana

gocs gocs

defer/ mañana
View GitHub Profile
@gocs
gocs / .md
Last active Nov 1, 2022
dayz deer isle alcatraz trap
View .md
@gocs
gocs / setup.md
Last active Oct 28, 2022
Linux setups after initial os boot
View setup.md

update os (DO THIS FIRST)

sudo apt update
sudo apt upgrade -y

enable password authentication for ssh

@gocs
gocs / icann-tld.sh
Created Jul 29, 2022
print for available tlds
View icann-tld.sh
#!/usr/bin/env bash
curl -SsfL https://data.iana.org/TLD/tlds-alpha-by-domain.txt | sed '/^#/d' - | awk '{print tolower($0)}'
@gocs
gocs / .md
Created Jul 19, 2022
golang time.Time zero value
View .md

What should be the time.Time's zero value?

It should be time.Now()

@gocs
gocs / baud.go
Last active Jul 19, 2022
why does usb serial prints unreadable �? identify your usb's BAUD `stty -F /dev/ttyUSB0`
View baud.go
package main
import (
"bufio"
"fmt"
"github.com/tarm/serial"
)
func main() {
@gocs
gocs / README.md
Last active Jul 17, 2022
signal cancel and timeout on an infinite loop go golang
View README.md

golang program to gracefully terminate on SIGTERM signal or timeout in a loop

ctrl + c gracefully terminates the app using the current terminal

terminate app from different terminal

the program output its pid

@gocs
gocs / glyph_test.sh
Created Jun 27, 2022
enable UTF-8 support in the Linux console?
View glyph_test.sh
#!/bin/sh
# https://unix.stackexchange.com/a/303713
# send character-string to enable UTF-8 mode
if test ".$1" = ".off" ; then
printf '\033%%@'
else
printf '\033%%G'
fi
@gocs
gocs / golang raspi.md
Created Jun 27, 2022
golang for raspi 4 model b
View golang raspi.md

question

what release should I use for my raspberry pi 4 model b?

$ uname -m
arm7l

answer

@gocs
gocs / support for password authentication was removed.md
Last active Jul 2, 2022
remote: Support for password authentication was removed
View support for password authentication was removed.md

got this error when using gh?

remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: Authentication failed for 'https://github.com/<user>/<repo>/'

my approach is to re-authenticate gh