Skip to content

Instantly share code, notes, and snippets.

View ObjSal's full-sized avatar
🎯
Focusing

Salvador Guerrero ObjSal

🎯
Focusing
View GitHub Profile
@ObjSal
ObjSal / mail_postfix_config.md
Last active September 26, 2025 10:03
Mail Postfix Configuration on macOS

How to configure postfix mail for iCloud & GMail

Perfect to configure alertnotify in bitcoin.conf for bitcoind
i.e. alertnotify=echo %s | mail -a "From: Sender <sender@mail.com>" -s "Bitcoin Alert" MY_EMAIL@MAIL.COM

On Linux, Raspberry Pi, Debian, Ubuntu install:

$ sudo apt-get install postfix mailutils libsasl2-modules
@ObjSal
ObjSal / bitcoin.conf
Last active June 21, 2024 19:57
Instructions how to setup lightning network and tor in macOS
# For a full bitcoin.conf example see:
# https://github.com/bitcoin/bitcoin/blob/master/share/examples/bitcoin.conf
# File stored in the external drive i.e. /Volumes/SSD/bitcoin.conf
# Change the data directory when running bitcoind or bitcoin-qt to the external drive
# $ bitcoind -datadir=/Volumes/SSD
# Authentication credentials created with rpcauth.py
# https://github.com/bitcoin/bitcoin/blob/master/share/rpcauth/rpcauth.py
@ObjSal
ObjSal / EncodingUtil.js
Created April 19, 2020 23:08
Enable caching from Node.js
// Author: Salvador Guerrero
'use strict'
// https://nodejs.org/api/zlib.html
const zlib = require('zlib')
const kGzip = 'gzip'
const kDeflate = 'deflate'
const kBr = 'br'
@ObjSal
ObjSal / app.js
Last active February 22, 2024 13:29
Posting form data in 3 ways to a Node.js server without third-party libraries - application/json, application/x-www-form-urlencoded, and multipart/form-data
// Author: Salvador Guerrero
'use strict'
const fs = require('fs')
// Project modules
const { CreateServer } = require('./server')
const SecurityUtils = require('./security-utils')
@ObjSal
ObjSal / keybase.md
Created October 1, 2023 22:29
Keybase proof

Keybase proof

I hereby claim:

  • I am objsal on github.
  • I am objsal (https://keybase.io/objsal) on keybase.
  • I have a public key ASDnywB42uUAQPdRjYjtHarHL-Z3HoM--o8BZJcCCblanwo

To claim this, I am signing this object:

@ObjSal
ObjSal / index.js
Last active May 3, 2023 20:31
Upload files to Node.js without form or third-party frameworks
const http = require('http');
const fs = require('fs')
let port = 3000
http.createServer((req, response) => {
/**
* `/` loads index.html
*/
if (req.url == '/' && req.method.toLowerCase() == 'get') {
@ObjSal
ObjSal / index.js
Last active April 24, 2023 23:06
Upload an image from a website to a node.js server, then the node server is going to upload and then download the image from a FTP server and send it back as response to the website.
// Author: Salvador Guerrero
const http = require('http');
const fs = require('fs')
// Third-party modules
const ftp = require("basic-ftp")
var {Base64Encode} = require('base64-stream')
let port = 3000
@ObjSal
ObjSal / vanity-miner.cpp
Last active March 10, 2023 10:15
vanity-miners scripts to generate bitcoin addresses (p2pkh) based on a prefix
// Compile command:
// g++ -o vanity-miner vanity-miner.cpp -std=c++11 $(pkg-config) -I/path/to/libbitcoin/include -L/path/to/libbitcoin/lib -lbitcoin-system -lsecp256k1 -lboost_program_options -lboost_regex -lboost_thread -lgmp
// NOTE: After getting the secret use the following command to get the wif-compressed private key:
// $ bx base58check-encode <secret_key> --version 128
///////////////////////////////////////////////////
// DEPENDENCIES
// https://github.com/libbitcoin/libbitcoin-system
// - Follow instructions how to install mac, example:
@ObjSal
ObjSal / not-following-back.py
Created February 7, 2023 05:05
Print users not following back on twitter
#!/usr/bin/env python3
#####################################################################################
# WARNING: IF ACCOUNT HAVE MORE THAN 5K FOLLOWERS/FRIENDS THEN IT NEEDS TO BE TWEAKED
#####################################################################################
import math
import json
import requests
@ObjSal
ObjSal / hashcash.py
Created September 30, 2022 09:13
Hashcash
# https://en.wikipedia.org/wiki/Hashcash
# Author: https://twitter.com/ObjSal
import hashlib
import base64
from math import ceil
import re
import datetime
'''