Skip to content

Instantly share code, notes, and snippets.

View danilogco's full-sized avatar

Danilo Carolino danilogco

  • QFlash
  • Rio Claro-SP, Brasil
  • 09:50 (UTC -03:00)
View GitHub Profile
@danilogco
danilogco / check_dir_exists.py
Created February 27, 2025 19:52
s3 check directory exists script
import boto3
aws_access_key_id = "XXXXXXXXXXX"
aws_secret_access_key = "XXXXXXXXXXX"
aws_session_token = None
region_name = "us-east-1"
s3_client = boto3.client(
"s3",
aws_access_key_id=aws_access_key_id,
@danilogco
danilogco / settings.json
Created January 28, 2025 16:53
Disable Discord update requirement to access
// ~/.config/discord/settings.json
{
"SKIP_HOST_UPDATE": true
}
@danilogco
danilogco / palworld-backup.sh
Last active January 22, 2025 13:04
Palworld dedicated server backup script - Ubuntu Server
# crontab -e
# 0 3 * * * /home/steam/backup.sh
# 30 3 * * * /home/steam/clean.sh
# 0 4 * * * /sbin/shutdown -r now
#!/bin/bash
# Caminho para o diretório de saves do Palworld
SAVE_DIR="/home/steam/.steam/steam/steamapps/common/PalServer/Pal/Saved"
@danilogco
danilogco / template.yml
Created December 30, 2024 19:46
AWS SAM CLI deploy IAM Role Permissions
Statement:
- Effect: "Allow"
Action:
- "cloudformation:CreateChangeSet"
- "cloudformation:DescribeStackEvents"
- "cloudformation:DescribeStacks"
- "cloudformation:DescribeChangeSet"
- "cloudformation:ExecuteChangeSet"
- "cloudformation:GetTemplate"
- "cloudformation:GetTemplateSummary"
@danilogco
danilogco / dbeaver_installer.sh
Created December 24, 2024 16:41
DBeaver installer script for Linux (no JDK)
#!/bin/bash
APP_FOLDER=/opt
TMP_FOLDER=/tmp
rm -rf $APP_FOLDER/dbeaver*
wget "https://dbeaver.io/files/dbeaver-ce-latest-linux.gtk.x86_64-nojdk.tar.gz" -P $TMP_FOLDER/
tar -xvzf $TMP_FOLDER/dbeaver-ce-latest-linux.gtk.x86_64-nojdk.tar.gz -C $APP_FOLDER/
rm -rf $TMP_FOLDER/dbeaver-ce-latest-linux.gtk.x86_64-nojdk.tar.gz
@danilogco
danilogco / awscli_update.sh
Created December 23, 2024 19:48
AWS CLI v2 installer script (or update)
#!/bin/bash
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o /tmp/awscliv2.zip
unzip /tmp/awscliv2.zip -d /tmp/awscli
sudo /tmp/awscli/aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli
# to update:
# sudo /tmp/awscli/aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli --update
rm -rf /tmp/awscliv2.zip /tmp/awscli
@danilogco
danilogco / discord_installer.py
Created November 19, 2024 17:46
Discord Install / Update script for Linux (tar file)
import os
import requests
import tarfile
import shutil
def download_and_extract_discord():
# URL of the Discord tar.gz file
discord_url = "https://discord.com/api/download?platform=linux&format=tar.gz"
# Set paths
@danilogco
danilogco / awscli-manjaro-install.md
Created November 14, 2024 14:22
Installing AWS CLI v2 - Manjaro

Download the latest release:

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"

Unzip the file:

unzip awscliv2.zip

Install the cli with sudo:

gem update --system --no-document
gem uninstall -aIx
gem install bundler
@danilogco
danilogco / poetry-upgrade.py
Last active September 24, 2024 20:14
Script to update and organize all poetry dependencies at once
import requests
import tomlkit
def get_latest_version(package_name):
response = requests.get(f"https://pypi.org/pypi/{package_name}/json")
if response.status_code == 200:
data = response.json()
return data['info']['version']
else:
print(f"Failed to fetch latest version for {package_name}")