Skip to content

Instantly share code, notes, and snippets.

#Qubes OS - Asus Zephyrus or other similar PC that can't see Ledger since no default sys-usb Qube
#https://www.qubes-os.org/doc/how-to-use-usb-devices/#finding-the-right-usb-controller
#list devices
lsusb
#find ledger in list, shows on Bus 003
readlink /sys/bus/usb/devices/usb3
#look at ending 04:00.4/usb3
#use dom0:04_00.4
qvm-pci attach --persistent personal dom0:04_00.4
#If that doesn't work, go into Qube Personal appVM Qube Settings, advanced tab -> uncheck include in memory balancing, change Mode to HVM, Devices tab -> right arrow on the 04:00.4 USB controller
#unifi controller installer for Proxmox Focal Ubuntu 20.04 Template Container
#https://help.ui.com/hc/en-us/articles/220066768-UniFi-How-to-Install-and-Update-via-APT-on-Debian-or-Ubuntu
#https://github.com/linuxserver/docker-unifi-controller/blob/master/Dockerfile
#Install
sudo apt-get update && sudo apt-get install ca-certificates apt-transport-https mongodb-server openjdk-8-jre-headless
echo 'deb https://www.ui.com/downloads/unifi/debian stable ubiquiti' | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.list
sudo wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ui.com/unifi/unifi-repo.gpg
sudo apt-mark hold openjdk-11-*
@buzzkillb
buzzkillb / getAnchorBalance.js
Created April 30, 2022 04:59 — forked from tstachl/getAnchorBalance.js
Google App Script to get Anchor Protocol Earn balance for a terra wallet address.
function getAnchorBalance(addr) {
const contract = 'terra1hzh9vpxhsk8253se0vv5jj6etdvxu3nv8z07zu';
const aUstBalance = JSON.parse(JSON.parse(UrlFetchApp.fetch("https://mantle.terra.dev/?cw20--balance=" + contract, {
method: 'post',
headers: { 'Accept-Encoding': 'gzip, deflate, br', 'Content-Type': 'application/json', 'Accept': 'application/json' },
payload: JSON.stringify({
operationName: null,
variables: {},
query: `{\n ${contract}: WasmContractsContractAddressStore(ContractAddress: \"${contract}\", QueryMsg: \"{\\\"balance\\\":{\\\"address\\\":\\\"${addr}\\\"}}\") {\n Height\n Result\n __typename\n }\n}\n`
})
echo "kill -9 denariusd"
ps -ef | grep 'denariusd' | grep -v grep | awk '{print $2}' | xargs -r kill -9
echo "sleep 2 seconds"
sleep 2
@buzzkillb
buzzkillb / installnode.txt
Last active April 28, 2023 00:25
install nodejs ubuntu ez
wget https://nodejs.org/dist/v20.0.0/node-v20.0.0-linux-x64.tar.xz
sudo apt-get install xz-utils
sudo tar -C /usr/local --strip-components 1 -xJf node-v20.0.0-linux-x64.tar.xz
const Discord = require("discord.js");
const config = require("./config.json");
//global.theTime = 0;
const client = new Discord.Client();
const prefix = "!";
client.on('ready', () => {
ps -ef | grep 'denariusd' | grep -v grep | awk '{print $2}' | xargs -r kill -9
#########
# denariusd daemon addnode ban with port, or switch denariusd to denarius.daemon for snap
#########
#!/bin/bash
#. config.conf
#. rpc.sh
wallet_ip=$(denariusd getpeerinfo | jq -r '.[].addr' | awk '!seen[$0]++')
while IFS= read -r
@buzzkillb
buzzkillb / geth_rpc_server.md
Created April 22, 2021 20:32 — forked from akaron/geth_rpc_server.md
create private geth rpc server using ssh port forwarding

note: create private geth rpc server using ssh port forwarding

In short, user provide ssh key to rpc server manager. Once the manager configured, then everytime the user need to type folowing commands to access to the geth rpc server:

  1. ssh -N -L 9545:localhost:8545 geth@machine_A_addr
  2. ... and set the rpc to http://localhost:9545

For convenienve, in the following I use these abbreviations:

  • machine A: run geth full node with RPC server
  • machine B: using the geth RPC from machine A
from denariusrpc.authproxy import AuthServiceProxy, JSONRPCException
import urllib
import json
import requests
#DDNS to push API data to name
ddns_update_name = 'api:python_example'
ddns_update_expiration = 9999