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 / 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 / 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 / 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 / mail_postfix_config.md
Last active February 21, 2024 21:01
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 / 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
'''
@ObjSal
ObjSal / bitcoin.conf
Last active October 13, 2023 22:34
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 / AguilaCoin.sol
Created December 1, 2020 02:41
Implementation of AguilaCoin (a Chore Coin) an ERC-20 Token
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.8.0;
contract AguilaCoin {
uint256 private _totalSupply;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
@ObjSal
ObjSal / AccountsDemo.sol
Created October 17, 2020 17:33
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.12+commit.27d51765.js&optimize=false&gist=
// Code snippet from Blockchain in Action
pragma solidity ^0.6.0;
contract AccountsDemo {
address public whoDeposited;
uint public depositAmount;
uint public accountBalance;
function deposit() public payable {
whoDeposited = msg.sender;
@ObjSal
ObjSal / app.js
Created May 20, 2020 08:02
JWT authentication in Node.js
// Author: Salvador Guerrero
'use strict'
const fs = require('fs')
const crypto = require('crypto')
// Third-Party Modules
const {MongoClient, ObjectId} = require('mongodb')
const jwt = require('jsonwebtoken')
@ObjSal
ObjSal / app.js
Created May 7, 2020 09:03
Secure Salted Password Hashing on client and server side
// Author: Salvador Guerrero
'use strict'
const fs = require('fs')
const crypto = require('crypto')
// Project modules
const { CreateServer } = require('./server')
const SecurityUtils = require('./security-utils')