Skip to content

Instantly share code, notes, and snippets.

View fcbertoldi's full-sized avatar

Fernando Costa Bertoldi fcbertoldi

View GitHub Profile
@fcbertoldi
fcbertoldi / poormans-container-systemd.sh
Last active August 6, 2024 15:45
Experiment with containers from scratch
#!/bin/bash
set -eux
cleanup() {
if systemctl is-active $uuid; then
systemctl stop $uuid
fi
popd
mountpoint "$OVERLAY_UPPER_DIR/merged" && umount "$OVERLAY_UPPER_DIR/merged"
@fcbertoldi
fcbertoldi / shrink-pdf.sh
Last active June 4, 2024 20:05
Script to attempt to shrink a pdf
#!/usr/bin/env sh
# Based on the following StackOverflow answer:
# https://askubuntu.com/a/256449/1709130
usage() {
script_name=$(basename "$0")
echo ""
echo "Attempt to shrink the size of a PDF file."
@fcbertoldi
fcbertoldi / denvdir
Created December 23, 2023 14:20
denvdir: like direnv, but explicit, and without config
#!/usr/bin/env sh
set -eu
# denvdir [envfile]
#
# Load .env environment variables defined in a sub-shell. Like `direnv`, but explicit, and without config.
#
# I used the name `denvdir` because there already exists `envdir` from daemontools:
# https://cr.yp.to/daemontools/envdir.html
@fcbertoldi
fcbertoldi / workon
Last active November 2, 2023 12:17
workon: Activate virtual environment in a subshell.
#!/usr/bin/env sh
# workon [envname]
#
# Activate virtual environment <envname> located in $WORKON_HOME in a subshell.
#
# https://web.archive.org/web/20201111231240/https://datagrok.org/python/activate/
#
# If the project directory is configured, change to $PROJECT_DIR and source $PROJECT_DIR/.env, if present.
#
@fcbertoldi
fcbertoldi / dotenv-run
Last active July 30, 2023 15:26
dotenv-run: bash script to pass env variables defined from .env files into command
#!/usr/bin/env bash
# Examples:
#
# Pass variables defined in secrets.env to printenv:
# $ echo "FOO=foo" > .env
# $ dotenv-run -f .env printenv FOO
# foo
#
# Get variable definitions from stdin:
@fcbertoldi
fcbertoldi / tutorial_sicoobnet_empresarial.md
Created June 7, 2022 12:59
Sicoobnet Empresarial no Linux

Sicoobnet Empresarial no Linux

Este é um tutorial de como instalar o software Sicoobnet Empresarial no Linux. Ele foi testado com o Linux Mint 20.3 Una, e deve funcionar bem com distros baseadas em Debian.

1. Verifique as dependências

Abra um terminal e verifique se você tem os comandos java e javaws instalados

$ java --version