Skip to content

Instantly share code, notes, and snippets.

View paulofreitas's full-sized avatar

Paulo Freitas paulofreitas

  • I'm my own boss
  • Brazil
  • 08:01 (UTC -03:00)
View GitHub Profile
@paulofreitas
paulofreitas / consolidating-xlm.md
Last active October 14, 2025 21:23
Consolidating XLM wallets

Consolidating XLM wallets

Ever wanted to get rid of extra XLM wallets without losing your reserved balance? You can do it.

First, remove all offers and trustlines from the account using StellarTerm. You'll need your secret key to log in there. Each trustline and exchange offer locks 0.5 XLM in addition to the default 1 to 1.5 XLM reserved minimum balance.

Once you've moved all assets and removed every offer and trustline, you're ready to use LOBSTR Merge Tool. There you'll enter the recipient address and MEMO (if required). In the next step, you'll provide your public key (sender address) and secret key to merge the balance into the recipient account. The merge costs 10% of your reserved balance (typically around 1 to 1.5 XLM).

@paulofreitas
paulofreitas / backlog.md
Last active October 12, 2025 01:40
tip.cc backlog

backlog

@paulofreitas
paulofreitas / tipcc-api.json
Last active April 2, 2024 21:49
tip.cc API v0.1.1 proposal: `/api/v0/currencies/fiats` should use `def-1` schema for `code`and `/api/v0/currencies/rates` should use an `oneOf` struct with `def-0` and `def-1` schemas for `code`
{
"openapi": "3.0.0",
"info": {
"title": "tip.cc API",
"description": "API for tip.cc",
"version": "0.1.1"
},
"components": {
"securitySchemes": {
"apiKey": {
@paulofreitas
paulofreitas / trivia-db.yaml
Last active November 15, 2023 11:48
Open Trivia DB cloning
This file has been truncated, but you can view the full file.
- category: general
type: boolean
difficulty: easy
question: '"27 Club" is a term used to refer to a list of famous actors, musicians, and artists who died at the age of 27.'
correct_answer: 'True'
incorrect_answers:
- 'False'
- category: music
type: multiple
difficulty: hard

Keybase proof

I hereby claim:

  • I am paulofreitas on github.
  • I am paulofreitass (https://keybase.io/paulofreitass) on keybase.
  • I have a public key ASB7AILhT0J-sojxvGL7WGx81WH-wBn9xCWDeA3Euy5e-Qo

To claim this, I am signing this object:

class Singleton(type):
_instances = {}
def __call__(cls, *args, **kwargs):
key = (cls, args, str(kwargs))
if key not in cls._instances:
cls._instances[key] = super(Singleton, cls).__call__(*args, **kwargs)
return cls._instances[key]
@paulofreitas
paulofreitas / totp.py
Last active September 25, 2018 18:22
#!/usr/bin/env python3
import argparse
from pyotp import totp # pip3 install pytotp
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('key')
args = parser.parse_args()
print(totp.TOTP(args.key).now())
server {
listen 80;
server_name domain.com www.domain.com;
root /home/username/domain.com/public;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
index index.html index.htm index.php;
charset utf-8;
@paulofreitas
paulofreitas / chroot-jail.md
Created October 15, 2017 02:26
Chroot Jail 101

Instructions

Install SSH server

sudo apt-get install openssh-server

Create SFTP group

groupadd sftp
<?php
class TimeoutException extends RuntimeException
{
//
}
function wait_until(callable $callback, $seconds)
{
declare(ticks = 1);