Skip to content

Instantly share code, notes, and snippets.

View gartisk's full-sized avatar
🏠
Working from home

Guilherme Araujo gartisk

🏠
Working from home
View GitHub Profile
#!/bin/bash
####################################################################################
## ##
## Directory Replacer ##
## ##
## Description: Initially made with the intention of moving ##
## Umbrel apps to an external drive. ##
## ##
## Usage: ./dir-replacer.sh folder1 folder2 ... dest ##
#!/bin/bash
# sudo curl -fsSL <this_script_raw_path> | bash
# Change to latest version from https://github.com/docker/compose/releases
DOCKER_COMPOSE_VERSION="v2.23.0"
# Check if Docker Compose is already installed
if [ -x "$(command -v docker-compose)" ]; then
echo "Docker Compose is already installed."
exit 1;
#!/bin/bash
# sudo curl -fsSL <this_script_raw_path> | bash
apt update
apt install uidmap
sudo -k
curl -sSH "https://raw.githubusercontent.com/docker/docker-install/master/rootless-install.sh" | bash
cat >> ~/.bashrc <<EOL
@gartisk
gartisk / utils.py
Last active April 26, 2023 11:27
Python Snippets
def unpack_text(text, separator, expected_length = 0, begin = 0, default = None):
"""
Unpacks a text into a list of words separated by a separator,
with a given expected length, and a given beginning.
Returns a list of words, limited by the expected length and beginning,
with a default value if the length is shorter than expected.
Parameters:
text: string to unpack
function getDocumentProperties(){
return PropertiesService.getDocumentProperties() ? PropertiesService.getDocumentProperties() : PropertiesService.getUserProperties();
}