Skip to content

Instantly share code, notes, and snippets.

View bcdonadio's full-sized avatar
🌴
On vacation

Bernardo Donadio bcdonadio

🌴
On vacation
View GitHub Profile

Keybase proof

I hereby claim:

  • I am bcdonadio on github.
  • I am bcdonadio (https://keybase.io/bcdonadio) on keybase.
  • I have a public key whose fingerprint is D6F5 6A78 FF53 9A35 C425 35EA A016 0768 C300 5604

To claim this, I am signing this object:

@bcdonadio
bcdonadio / netbox-inventory_test-results.out
Last active June 14, 2023 19:22
Unit test results of netbox-3.5.3 + netbox-inventory-1.3.2
| Found 5797 test(s).
| Creating test database for alias 'default'...
| System check identified no issues (0 silenced).
| .....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................FF.................................................................................................................................................................FF......................................FF..........................................................FF........................................
@bcdonadio
bcdonadio / link_multiple_devices.yaml
Last active May 30, 2023 04:45 — forked from aderusha/link_multiple_devices.yaml
Select multiple entities to link their on/off state. If any selected entity is turned on or off, the other selected entities will be sent a matching on or off command.
@bcdonadio
bcdonadio / static_cgo.md
Last active January 27, 2023 13:50 — forked from zmb3/static_cgo.md
Compile static binaries for Go programs that leverage Cgo.

In order to compile a fully static binary when using Cgo you'll need to use another standard C library like musl instead of the GNU libc, because Canonical and others simply decided that most of the whole damn point of using Golang, which is having a multi-platform and almost universal build toolchain, is simply not to their tastes.

A solution then is to do this messy thingy:

apt update && apt build-dep -y musl
MUSL_VER=2.2.2 # Matches Ubuntu 22.04 "Jammy" as of 2023-01-06
DIR=$(mktemp -d)
pushd $DIR
wget https://www.musl-libc.org/releases/musl-${MUSL_VER}.tar.gz -O musl.tar.gz
@bcdonadio
bcdonadio / nhs_install.sh
Created August 26, 2019 02:18
Install the NHS (https://www.nhs.com.br) UPS server software on Raspbian using qemu-user to emulate i386 arch on armv7l
#!/bin/bash
# Install the NHS (https://www.nhs.com.br) UPS server software on Raspbian
# using qemu-user to emulate i386 arch on armv7l
debRelease="stretch"
targetArch="i386"
serviceUser="nhsups"
zipURL="https://nhs.com.br/wp-content/uploads/2018/05/nhsups_3.1.36_x86_eGLIBC_2.11.zip"
installDir="/usr/local/nhs"
"""Test a tsuru deploy"""
from subprocess import Popen, PIPE, run
from tempfile import NamedTemporaryFile
import os
import yaml
CONFIGFILE = "config.yml"
TARGETFILE = os.environ["HOME"] + "/.tsuru/target"
class Tsuru(object):

Keybase proof

I hereby claim:

  • I am bcdonadio on github.
  • I am bcdonadio (https://keybase.io/bcdonadio) on keybase.
  • I have a public key whose fingerprint is 254F 71E4 49AA 7674 F91F 6D3D BE60 3DF6 5126 DD90

To claim this, I am signing this object:

####INICIO rsync_dhcp.te####
module rsync_dhcp 1.1;
require {
type rsync_t;
type dhcp_etc_t;
class dir { getattr search };
class file { read getattr open };
}
allow rsync_t dhcp_etc_t:dir { getattr search };
@bcdonadio
bcdonadio / Install ABNTex2
Created February 26, 2016 10:48
Command to install ABNTex2 and dependencies for the models
dnf install texlive-abntex2 texlive-babel-portuges texlive-babel-french texlive-hyphen-portuguese texlive-hyphen-french texlive-multirow texlive-lipsum
@bcdonadio
bcdonadio / vim_pluginstall.sh
Last active August 2, 2016 00:51
Vim plugins installer
#!/bin/bash
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
git clone https://github.com/Valloric/YouCompleteMe ~/.vim/bundle/YouCompleteMe
cd ~/.vim/bundle/YouCompleteMe
git submodule update --init --recursive
rm -rf ~/.ycm_build
mkdir ~/.ycm_build
cd ~/.ycm_build
cmake -G "Unix Makefiles" -DUSE_SYSTEM_LIBCLANG=ON . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp