Skip to content

Instantly share code, notes, and snippets.

View anselmobattisti's full-sized avatar
🇧🇷
Aqui é Brasil!

Anselmo Battisti anselmobattisti

🇧🇷
Aqui é Brasil!
View GitHub Profile
# To run the latexdiff in a Docker environment
# 1 - Download the image
docker pull iphoneintosh/latex-docker:latest
# 2 - Run the latexdiff
docker run --rm -v .:/data iphoneintosh/latex-docker:latest latexdiff original.tex rev.tex > diff.tex
@anselmobattisti
anselmobattisti / base64.sh
Created November 22, 2023 18:30
Send image api curl base64
# --wrap=0 will convert the base64 texto into only one line
curl -X POST -H "Content-Type: application/json" -d '{"image" : "'"$( base64 --wrap=0 ./imgs/knative.png)"'"}' http://127.0.0.1:8080
from collections import OrderedDict
msg = ""
positions = OrderedDict([
("Start_Bit", 2),
("Packet_Length", 1),
("Protocol_Number", 1),
("Location_Source_Type", 1),
("Terminal_ID", 8),
# Aumentar o tamanho do disco
virt-filesystems --long -h --all -a olddisk.qcow2
qemu-img create -f qcow2 -o preallocation=metadata newdisk.qcow2 50G
# /dev/sda3 é o nome da partição do disco antigo que vai ser alterado
virt-resize --expand /dev/sda3 olddisk newdisk.qcow2
# os dados são copiados para o disco novo, mova o disco novo sobre o antigo
@article{mijumbi_network_2016,
title = {Network function virtualization: {State}-of-the-art and research challenges},
volume = {18},
issn = {1553877X},
doi = {10.1109/COMST.2015.2477041},
number = {1},
journal = {IEEE Communications Surveys and Tutorials},
author = {Mijumbi, Rashid and Serrat, Joan and Gorricho, Juan Luis and Bouten, Niels and De Turck, Filip and Boutaba, Raouf},
year = {2016},
#!/bin/bash
rm /etc/netplan/00-installer-config.yaml
echo "
network:
version: 2
renderer: networkd
ethernets:
enp0s3:
dhcp4: false
@anselmobattisti
anselmobattisti / Caddyfile
Created March 8, 2022 20:29
Configuration of gitlab to use an e-email hosted in a cPanel account. Also use SSL via Caddy
:443 {
tls internal {
on_demand
}
reverse_proxy localhost:8929 {
header_up Host {host}
header_up X-Real-IP {remote}
header_up X-Forwarded-For {remote}
header_up X-Forwarded-Port {server_port}
FROM ubuntu:21.04
LABEL maintainer="Taylor Otwell"
ARG WWWGROUP
ARG NODE_VERSION=16
WORKDIR /var/www/html
ENV DEBIAN_FRONTEND noninteractive
# How to adjust brightness for HD Pro Webcam C920 on ubuntu 20.04
#
# Install the v4l2-ctl
apt-get install v4l2-ctl
# list the decives
v4l2-ctl --list-devices
###
HD Pro Webcam C920 (usb-0000:00:14.0-1.2):
@anselmobattisti
anselmobattisti / gist:44987dcab84ffe8aef83b1332d9259d5
Created August 14, 2021 17:41
Allow expired ssl certificate for git repository
# If you already downloaded the repo, inside de folder run in the folder
git config http.sslVerify false
# If you will download the repo, checkout the repo using -c http.sslVerify=false like
git -c http.sslVerify=false clone repo_url/git