Skip to content

Instantly share code, notes, and snippets.

View gnuns's full-sized avatar
👽

Gabriel Nunes gnuns

👽
View GitHub Profile
@gnuns
gnuns / osinfo.md
Last active May 27, 2024 20:45
osinfo db

To update the osinfo database, which is actually just a collection of XML files, do the following:

1: Install package osinfo-db-tools to get the osinfo-db-import program (at least on Debian'ish distros):

apt update;apt install osinfo-db-tools

2: Download the newest osinfo-db file from [releases.pagure.org][1] example:

wget -O "/tmp/osinfo-db.tar.xz" "https://releases.pagure.org/libosinfo/osinfo-db-20240523.tar.xz"
@gnuns
gnuns / disable.sh
Created March 7, 2024 14:40
disable gnome-keyring to use keepassxc secret service integration
pkill gnome-keyring
pkill -f gnome-keyring-daemon
sudo systemctl stop gnome-keyring-daemon
sudo chmod -x /usr/bin/gnome-keyring*
@gnuns
gnuns / Makefile
Created March 11, 2020 21:55
Docker host.docker.internal on Linux
# IP do host
ifeq ($(UNAME), Linux)
HOST_IP := $(shell ip -o route get 1 | sed -e 's/.*src \([0-9\.]*\).*/\1/')
endif
ifeq ($(UNAME), Darwin)
HOST_IP := $(shell ifconfig | grep ^en0 -A15 | grep "inet " | tail -1 | awk '{print $$2}')
endif
echo "$(HOST_IP) host.docker.internal" | docker exec -i container_name /usr/bin/tee -a /etc/hosts
@gnuns
gnuns / best.sh
Created February 26, 2020 15:44
Arch linux reflector
sudo reflector --verbose --latest 50 -f 10 --sort rate --age 18 --connection-timeout 1 --save /etc/pacman.d/mirrorlist
@gnuns
gnuns / 📊 Weekly development breakdown
Last active October 29, 2020 00:08
Weekly development breakdown
JavaScript 9 hrs 7 mins ██████▏░░░░░░░░░░░░░░ 29.4%
TypeScript 5 hrs 22 mins ███▋░░░░░░░░░░░░░░░░░ 17.3%
SCSS 3 hrs 49 mins ██▌░░░░░░░░░░░░░░░░░░ 12.3%
Other 3 hrs 39 mins ██▍░░░░░░░░░░░░░░░░░░ 11.8%
HTML 2 hrs 44 mins █▊░░░░░░░░░░░░░░░░░░░ 8.8%
@gnuns
gnuns / regex.md
Created December 10, 2019 16:38
RegExp: Get first <=160 chars before ","
/(^.{1,160}[^,])\s/
@gnuns
gnuns / settings.json
Created November 25, 2019 16:07
cpp vscode
{
"C_Cpp.errorSquiggles": "Enabled",
"C_Cpp.default.cppStandard": "c++14",
"C_Cpp.clang_format_path": "/usr/bin/clang-format",
"C_Cpp.clang_format_fallbackStyle": "Chromium"
}

Keybase proof

I hereby claim:

  • I am gnuns on github.
  • I am gnuns (https://keybase.io/gnuns) on keybase.
  • I have a public key ASDIVZjmR6eaWlVGr1dnQ-Udk182jRtowFU_ZaZd_wOMXAo

To claim this, I am signing this object:

@gnuns
gnuns / isvalidurl.go
Last active October 1, 2019 11:08
Golang: IsValidURL
import (
"net/url"
"golang.org/x/net/publicsuffix"
)
func IsValidURL(s string) bool {
u, err := url.Parse(s)
if err != nil {
return false
}