Skip to content

Instantly share code, notes, and snippets.

View tavinus's full-sized avatar

Gustavo Arnosti Neves tavinus

View GitHub Profile
@tavinus
tavinus / Fix-NetworkManager-VPN-DNS.md
Last active December 7, 2022 12:35
Make Linux NetworkManager apply DNS from VPN

The Problem

Injecting a DNS server from a VPN can be troublesome in Linux.

If you are not using Network Manager, you can fix this issue by adding the resolvconf script to your VPN config.

script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf
@tavinus
tavinus / GTK_Thicker_ScrollBars.md
Last active December 6, 2022 00:49
Yes! We have scroll bars (POP!_OS)

Stop Hiding

First add to /etc/environment (needs sudo)

GTK_OVERLAY_SCROLLING=0

This will make the scroll bars always visible (thank God)

Stop being thin

Then we make them thicker, by editing the local user config

@tavinus
tavinus / rebuildSSHKeys.sh
Created November 7, 2022 22:20
Delete and rebuild SSH keys for an instance
#!/bin/bash
# This will delete and rebuild the SSH Keys of an instance
# Usefull if you clone CTs and VMs
sudo rm -v /etc/ssh/ssh_host_*
sudo dpkg-reconfigure openssh-server
sudo systemctl restart ssh
# You may need to reboot to fix weird issues
@tavinus
tavinus / onlyofficeInstall.sh
Last active February 25, 2024 02:54
Install OnlyOffice 7.2.4 on Debian 11 Bullseye
#!/bin/bash
##########################################################################
# Tavinus Nov 2022
#
# https://gist.github.com/tavinus/64b89730e8deb5253e66cce3b5a6b21f
# This is a work in progress, use at your own risk
#
# The POSTGRES password is 'onlyoffice' and
# it will be asked during install
@tavinus
tavinus / signedDebianRepo.md
Created October 29, 2022 04:30
Create Signed Debian Repository

Signed Debian Repository

This guide will not go about how to create .deb files or how to configure a webserver.

The basic idea is to add your .deb files to a folder where your webserver will serve.

Then run a script to generate the needed files (Packages, Release, etc).

Idea based on this response on askubuntu.com

@tavinus
tavinus / onlyoffice-rm-example.md
Created December 7, 2021 19:51
Disable Onlyoffice Docs Example

Stop services

sudo supervisorctl stop all

Remove or move example folder

sudo mv /etc/onlyoffice/documentserver-example /etc/onlyoffice/documentserver-example-disabled
## OR

Embelezado

data: {
    "object_id": "d7c9d0c2-1947-11eb-85da-fbd6b93222e6",
    "datetime": "2021-05-27T22:15:20.000Z",
    "trip_type": "NONE",
    "ignition_status": "OFF",
    "position": {
        "latitude": -22.7291333,
@tavinus
tavinus / find-chmod.md
Last active February 25, 2024 02:54
find-chmod

First, cd into the folder that permissions will be changed.

No Sudo

Files 644 / Folders 755

find . -type d -exec chmod 0755 {} \; && find . -type f -exec chmod 0644 {} \;
@tavinus
tavinus / menu-template.bat
Last active September 21, 2024 04:29
Template de programa .bat com menu
:: Fonte original: https://www.youtube.com/watch?v=Rb4-Ff55-YI
::
:: Modificado para não fechar a janela do CMD ao final
:: Se abrir do explorer ainda fecha, se abrir do prompt não
::
:: Desativadas as opções 1, 2 e 3 (seguro contra idiotas)
::
:: tavinus @ 17/12/2020
::
:: v0.0.4