Skip to content

Instantly share code, notes, and snippets.

View PortNumber53's full-sized avatar
😃
clicking the things

Mauricio S Otta PortNumber53

😃
clicking the things
View GitHub Profile
@PortNumber53
PortNumber53 / .env.sample
Last active February 12, 2024 18:36
Some of my notes on using neonbjb/tortoise-tts
RABBITMQ_HOST=192.168.68.100
RABBITMQ_PORT=5672
RABBITMQ_USER=bugbunny
RABBITMQ_PASSWORD=whats_up_doc
RABBITMQ_VHOST=anything_you_want
@PortNumber53
PortNumber53 / download-model.py
Last active January 19, 2024 18:20
Downloads HuggingFace models.
import argparse
import os
from dotenv import load_dotenv
from huggingface_hub import snapshot_download
load_dotenv()
def download_model(repo_id, use_auth_token=True):
models_base_folder = os.getenv("MODELS_BASE_FOLDER")
models_cache_folder = os.getenv("MODELS_CACHE_FOLDER")
@PortNumber53
PortNumber53 / convert1.sh
Created December 8, 2022 07:55 — forked from zengxinhui/convert2arch_arm.sh
Replace Oracle Cloud Linux with Arch Linux ARM remotely
Refs:
1. http://os.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz
2. https://dl-cdn.alpinelinux.org/alpine/v3.13/releases/aarch64/alpine-virt-3.13.5-aarch64.iso
3. https://wiki.alpinelinux.org/wiki/Replacing_non-Alpine_Linux_with_Alpine_remotely
4. https://wiki.archlinux.org/index.php/installation_guide#Configure_the_system
5. https://archlinuxarm.org/platforms/armv8/generic
Requirement:
Console access.
@PortNumber53
PortNumber53 / journalctl.log
Created August 24, 2022 19:32
Lenovo Ideapad 5 pro 16" AMD 6800H on Archlinux - kernel 6.0.0-rc2
Aug 24 12:02:07 devbox kernel: [Hardware Error]: Corrected error, no action required.
Aug 24 12:02:07 devbox kernel: [Hardware Error]: CPU:0 (19:44:1) MC15_STATUS[Over|CE|MiscV|AddrV|-|-|SyndV|CECC|-|-|-]: 0xdc204000000c011b
Aug 24 12:02:07 devbox kernel: [Hardware Error]: Error Addr: 0x00000000ff901a40
Aug 24 12:02:07 devbox kernel: [Hardware Error]: IPID: 0x0000009600050f00, Syndrome: 0x000001ff0a240700
Aug 24 12:02:07 devbox kernel: [Hardware Error]: Unified Memory Controller Ext. Error Code: 12
Aug 24 12:02:07 devbox kernel: [Hardware Error]: cache level: L3/GEN, tx: GEN, mem-tx: RD
Aug 24 12:02:07 devbox kernel: mce: [Hardware Error]: Machine check events logged
Aug 24 12:02:07 devbox kernel: [Hardware Error]: Corrected error, no action required.
Aug 24 12:02:07 devbox kernel: [Hardware Error]: CPU:0 (19:44:1) MC16_STATUS[Over|CE|MiscV|AddrV|-|-|SyndV|CECC|-|-|-]: 0xdc204000000c011b
Aug 24 12:02:07 devbox kernel: [Hardware Error]: Error Addr: 0x00000000ff901a40
@PortNumber53
PortNumber53 / postfix-as-gmail-relay.md
Last active April 11, 2022 04:31
ArchlinuxArm postfix relay setup

Setting up Postfix as a mail relay to Gmail (Archlinux)

sudo pacman -S postfix mailutils mailx

Edit /etc/postfix/main.cf

relayhost = [smtp.gmail.com]:587

Keybase proof

I hereby claim:

  • I am portnumber53 on github.
  • I am ab_motta (https://keybase.io/ab_motta) on keybase.
  • I have a public key ASC52DmIKDLXfb2PSO9RLDOT5xr2-YYPjWdhyDXOgsc0JQo

To claim this, I am signing this object:

@PortNumber53
PortNumber53 / dc.sh
Last active February 24, 2019 18:56
docker-compose function
function dc() {
COMMAND="docker-compose"
if [ -e ./docker-compose.yml ]; then
COMMAND="${COMMAND} -f docker-compose.yml"
fi
if [[ -a ./docker-compose.dev.yml ]]; then
COMMAND="${COMMAND} -f docker-compose.dev.yml"
fi
@PortNumber53
PortNumber53 / pre-commit
Created December 20, 2018 17:30
Run docker-compose inside a git pre-commit hook
#!/bin/sh
rc=0
behat=0
phpunit=0
EXEC_BEHAT='docker-compose exec phpfpm sh -c "cd /app && vendor/bin/behat"'
script -q --return -c "${EXEC_BEHAT}" /dev/null
behat=$?
@PortNumber53
PortNumber53 / remove-pii.sql
Last active May 31, 2017 21:41
BB: remove PII
UPDATE customer SET
first_name = CONCAT('f', customer_id),
last_name = CONCAT('l', customer_id),
home_phone = SUBSTR( CONCAT(customer_id * 95427, customer_id * 3841, customer_id * 7664), 1, 10),
fax_phone ='',
mobile_phone = SUBSTR( CONCAT(customer_id * 89435, customer_id * 3725, customer_id * 49325), 1, 10),
other_phone = '',
address1 = CONCAT(customer_id, ' street'),
address2 = '',
address3 = '',
@PortNumber53
PortNumber53 / url_slug.php
Created November 27, 2015 20:35 — forked from sgmurphy/url_slug.php
URL Slugs in PHP (with UTF-8 and Transliteration Support)
<?php
/**
* Create a web friendly URL slug from a string.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
* @author Sean Murphy <[email protected]>
* @copyright Copyright 2012 Sean Murphy. All rights reserved.