Skip to content

Instantly share code, notes, and snippets.

@ismarsantos
ismarsantos / maps.txt
Created August 8, 2023 18:16 — forked from AmandaCarvalho-R/maps.txt
Google maps configuration
step 1
sudo nano /etc/hosts
add line
127.0.1.1 lvh.me
https://console.cloud.google.com/apis/credentials
Set an application restriction
Application restrictions limit an API key’s usage to specific websites, IP addresses, Android applications, or iOS applications. You can set one application restriction per key.
@ismarsantos
ismarsantos / README.md
Created August 14, 2023 01:11 — forked from hardiksondagar/README.md
Ubuntu: Bash history search, partial + up-arrow

Both methods below are almost equivalent, it just depends on which file you want to edit. I'd recommend .bashrc myself, as it doesn't involve editing a local copy of a system file.

If you experience any problems with this, please comment below so that it can be fixed.

Using ~/.bashrc

  1. Edit ~/.bashrc with this command:
gedit ~/.bashrc
@ismarsantos
ismarsantos / gist:defb63ea60904918bf6b804c30be94be
Created August 15, 2023 04:37
Ubuntu 22.04 nvidia drivers uninstall
I just used the nvidia-uninstall.
sudo nvidia-uninstall
In my case I got the driver directly from the nvidia website.
@ismarsantos
ismarsantos / DEPLOY_WITH_KAMAL_ON_DEDICATED_SERVER.md
Created November 8, 2023 17:55 — forked from n-studio/DEPLOY_WITH_KAMAL_ON_DEDICATED_SERVER.md
Deploy a web app on a dedicated server with Kamal

Warning

This gist is still a draft. At the moment it is not functional: see basecamp/kamal#257

Motivation

Kamal was designed with 1 service = 1 droplet/VPS in mind.
But I'm cheap and I want to be able to deploy multiple demo/poc apps apps on my $20/month dedicated server.
What the hell, I'll even host my private container registry on it.

SSL Certificate Option
There are many ways to obtain an SSL certificate. An easy and cheap way is to use LetsEncrypt. Setting up LetsEncrypt for a server that uses port 80 for a webserver is extremely easy. Since the Coturn server does use port 80, a manual request with a DNS challenge is easiest:
Install CertBot
sudo snap install core; sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
Request the certificate
@ismarsantos
ismarsantos / archlinux-qemu-kvm.md
Created December 7, 2023 05:29 — forked from tatumroaquin/archlinux-qemu-kvm.md
QEMU-KVM Installation for Arch Linux

Arch Linux QEMU-KVM

install all necessary packages

sudo pacman -S virt-manager virt-viewer qemu qemu-arch-extra \
edk2-ovmf vde2 ebtables dnsmasq bridge-utils openbsd-netcat libguestfs

enable libvirt daemon

@ismarsantos
ismarsantos / 9534-64-Core.txt
Created December 8, 2023 00:58
KVM QEMU CPU Pin AMD EPYC 9534 64-Core Processor
CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE MAXMHZ MINMHZ MHZ
0 0 0 0 0:0:0:0
64 0 0 0 0:0:0:0
1 0 0 1 1:1:1:0
65 0 0 1 1:1:1:0
2 0 0 2 2:2:2:0
66 0 0 2 2:2:2:0
@ismarsantos
ismarsantos / description.sh
Created February 8, 2024 08:09 — forked from sebyx07/description.sh
hatchbox restore postgres db
# cd into the backup
tar -xvf DATABASE.tar
cd DATABASE/databases
gunzip -k PostgreSQL.sql.gz
psql DATABASE_URL < Postgresql.sql
@ismarsantos
ismarsantos / gist:2cb5b147954fe3e1f4fa8a7517c8f418
Last active July 11, 2024 21:11
GRUB Linux Boot in lower resolution
vga=0x314
vga=784 nomodeset modeset=0 nouveau.modeset=0 modprobe.blacklist=nouveau,nvidia
vga=784 nomodeset modprobe.blacklist=nouveau,nvidia
GRUB VGA Modes
https://wiki.bqti.com.br/linux/grub-vga-modes/
@ismarsantos
ismarsantos / docker-compose.yaml
Created March 23, 2024 03:05 — forked from BlueHippoGithub/docker-compose.yaml
Remember to change the volumes for your own desired path
version: '3.3'
networks:
caddy:
services:
portainer:
image: portainer/portainer-ce:latest
container_name: portainer
restart: unless-stopped
security_opt:
- no-new-privileges:true