Skip to content

Instantly share code, notes, and snippets.

@mymtw
mymtw / alacritty.yml
Created March 9, 2023 07:53
alacritty config
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Import additional configuration files
#
# Imports are loaded in order, skipping all missing files, with the importing
# file being loaded last. If a field is already present in a previous import, it
# will be replaced.
#
# All imports must either be absolute paths starting with `/`, or paths relative
# to the user's home directory starting with `~/`.
set $mod Mod4
font pango:monospace 8
exec "setxkbmap -layout us,ru"
exec "setxkbmap -option 'grp:alt_shift_toggle'"
exec --no-startup-id dex --autostart --environment i3
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
@mymtw
mymtw / torrc
Created August 16, 2022 13:18
torrc config with using bridges to get around ISP blocks
## Configuration file for a typical Tor user
## Last updated 28 February 2019 for Tor 0.3.5.1-alpha.
## (may or may not work for much older or much newer versions of Tor.)
##
## Lines that begin with "## " try to explain what's going on. Lines
## that begin with just "#" are disabled commands: you can enable them
## by removing the "#" symbol.
##
## See 'man tor', or https://www.torproject.org/docs/tor-manual.html,
## for more options you can use in this file.
package main
import (
"context"
"encoding/json"
"fmt"
"github.com/hashicorp/go-retryablehttp"
"io/ioutil"
"log"
"net/http"
pub const WEI_IN_ETHER: U256 = U256([0x0de0b6b3a7640000, 0x0, 0x0, 0x0]);
#[derive(Debug)]
pub enum ConversionError {
UnrecognizedUnits(String),
TextTooLong,
}
/// Common Ethereum unit types.
@mymtw
mymtw / queries at now
Created March 17, 2021 14:12
queries at now
crypto=# SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-[ RECORD 1 ]---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
pid | 24
age |
usename |
query |
-[ RECORD 2 ]-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
openapi: 3.0.0
info:
title: title
version: 1.0.0
servers:
- url: http://127.0.0.1:8080
paths:
/bad:
@mymtw
mymtw / createwif.go
Last active November 30, 2020 02:03
import (
"errors"
"fmt"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcutil"
"github.com/btcsuite/btcutil/hdkeychain"
"github.com/btcsuite/btcd/btcec"
@mymtw
mymtw / btc
Last active May 17, 2020 17:52
bitcoin
./bitcoin-cli -regtest -rpcwallet=wallet1 listunspent
[
{
"txid": "a9a39d9f388eb7d2d99f79d5f31f0e076a37061b1de5b104fa7500a481cba95b",
"vout": 0,
"address": "2N8RF8rrwxLKtRYLfpRkf9p65hpND3AAFwT",
"label": "",
"redeemScript": "0014dd47e79764938c67a961893b91c97f5cd67517a7",
"scriptPubKey": "a914a66f012b7489f2af076a2a6cebf18658d186080487",
"amount": 50.00000000,
[Unit]
Description=Backend flask webapp gunicorn daemon
Requires=backend.socket
After=network.target
[Service]
Environment="LANG=en_US.UTF-8"
PIDFile=/run/backend/pid
User=mtw