Skip to content

Instantly share code, notes, and snippets.

@miguelmota
miguelmota / notes.txt
Created April 20, 2023 20:01
Linux printer debugging
make sure `cups-browsed` is running
open cups with `open http://localhost:631/`
@miguelmota
miguelmota / blank.pdf
Created April 5, 2023 17:41
Linux create empty blank pdf
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@miguelmota
miguelmota / pdf_combine.sh
Created April 3, 2023 23:09
Linux combine merge pdfs into one pfd
# make sure to always include last pdf as output file otherwise it will overwrite input pdf
pdfunite input1.pdf input2.pdf input3.pdf output.pdf
@miguelmota
miguelmota / price.sh
Created March 28, 2023 22:43
CoinCodex api coin ticker price
curl "https://coincodex.com/api/coincodex/get_coin/eth"
@miguelmota
miguelmota / price.sh
Created March 28, 2023 22:35
Coinpaprika coin ticker api price
curl "https://api.coinpaprika.com/v1/tickers/usdc-ethereum"
@miguelmota
miguelmota / go_fix.sh
Created March 28, 2023 05:00
Go (golang) Fix error "compile: version "go1.16.2" does not match go tool version "go1.20.2""
# see order of binaires for go
echo $PATH
# remove local go
sudo rm -rf /usr/local/go
@miguelmota
miguelmota / package_info.sh
Created March 27, 2023 18:08
NPM rest api get package info
curl -s "https://registry.npmjs.org/merkletreejs/latest" | jq '.version'
@miguelmota
miguelmota / IpfsUpload.ts
Created March 15, 2023 04:54
JavaScript Pinata cloud IPFS upload example
import fs from 'fs'
import path from 'path'
import pinataSDK from '@pinata/sdk'
require('dotenv').config()
const pinataApiKey = process.env.PINATA_API_KEY
const pinataSecretApiKey = process.env.PINATA_SECRET_API_KEY
export class IpfsUpload {
pinata = pinataSDK(pinataApiKey, pinataSecretApiKey)
@miguelmota
miguelmota / Cloudflare.ts
Created March 15, 2023 04:48
JavaScript Cloudflare API update IPFS dnslink subdomain
import fetch from 'isomorphic-fetch'
require('dotenv').config()
const CLOUDFLARE_ZONE_ID = process.env.CLOUDFLARE_ZONE_ID
const CLOUDFLARE_TOKEN = process.env.CLOUDFLARE_TOKEN
export class Cloudflare {
async getRecordId(dnslinkDomain: string) {
const url = `https://api.cloudflare.com/client/v4/zones/${CLOUDFLARE_ZONE_ID}/dns_records?name=${dnslinkDomain}`
const res = await fetch(url, {
@miguelmota
miguelmota / timeout_url.txt
Created March 14, 2023 06:18
URL to test request timeouts
https://www.google.com:81/