Skip to content

Instantly share code, notes, and snippets.

View SanariSan's full-sized avatar
😯
1 2 Fizz 4 Buzz

SanariSan

😯
1 2 Fizz 4 Buzz
  • krak.ai
  • Georgia, Tbilisi
View GitHub Profile
@SanariSan
SanariSan / ssh_key.sh
Last active July 25, 2023 19:50
ssh create user+key
# ssh to server
# ---
# add new user
sudo adduser user
# usermod -aG sudo user
# gpasswd -d user sudo
su - user
@SanariSan
SanariSan / BscRawTx.ts
Created February 10, 2023 14:26 — forked from WP-LKL/BscRawTx.ts
Binance Smart Chain transaction using web3 and ethereumjs with custom chain and commandline for python.
// Ex. $ npx ts-node BscRawTx.ts --txData=<txData>
// Consult: https://github.com/WP-LKL/bscValueDefi-Exploit, for python use-case
const Tx = require('ethereumjs-tx').Transaction;
const Web3 = require('web3');
import Common from 'ethereumjs-common';
import {parse} from 'ts-command-line-args';
interface input {
txData: string;
@SanariSan
SanariSan / curl.md
Created February 4, 2023 19:48 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@SanariSan
SanariSan / v2ray_setup_ubuntu.md
Last active July 8, 2023 11:11
v2ray hint ubuntu

crlf to lf

git ls-files -z | xargs -0 dos2unix

lf to crlf

git ls-files -z | xargs -0 unix2dos
git ls-files -z '*.sln' '*.bat' | xargs -0 unix2dos

This is a collection of Ubuntu fixes for Lenovo Legion 5i

Tested on: Lenovo Legion 5i with below specs:
AMD® Ryzen 7 4800h with radeon graphics × 16
NVIDIA Corporation / NVIDIA GeForce RTX 2060/PCIe/SSE2

1. GPU ISSUES for RTX 2060:

nvidia-driver-470 - HDMI doesn't have to work from the beggining
nvidia-driver-495 - HDMI works from the beginning, unstable (random reboots)\

@SanariSan
SanariSan / readme.md
Created September 29, 2022 20:40
Restart docker after Let's encrypt update
@SanariSan
SanariSan / ntp_hints_ru.txt
Last active February 9, 2024 05:01
ntp hints (ru)
Leap: normal - корректировка мирового времени между электромагнитыми атомическими часами и определяемыми по планетам, не важно
Version: 4 - версия ntp протокола, последняя 4, не важно
Stratum: 1 - номер сервера в иерархии серверов синхронизации, 0 = атомические часы, 1 = сервер подключенный к ним локально, 2 = сервер подключенный по сети (уже плохо), играет роль, 1 - хорошо
Reference: PPS - указывает ориджин времени, PPS = Generic pulse-per-second, атомические часы на пульсации электронов, не важно)
Precision: 4us (-18) - сколько требуется микросекунд для доступа к системному времени
@SanariSan
SanariSan / Every possible TypeScript type.md
Created August 20, 2022 17:58 — forked from laughinghan/Every possible TypeScript type.md
Diagram of every possible TypeScript type

Hasse diagram of every possible TypeScript type

  • any: magic, ill-behaved type that acts like a combination of never (the proper [bottom type]) and unknown (the proper [top type])
    • Anything except never is assignable to any, and any is assignable to anything at all.
    • Identities: any & AnyTypeExpression = any, any | AnyTypeExpression = any
    • Key TypeScript feature that allows for [gradual typing].
  • unknown: proper, well-behaved [top type]
    • Anything at all is assignable to unknown. unknown is only assignable to itself (unknown) and any.
    • Identities: unknown & AnyTypeExpression = AnyTypeExpression, unknown | AnyTypeExpression = unknown
  • Prefer over any whenever possible. Anywhere in well-typed code you're tempted to use any, you probably want unknown.

Generating Authy passwords on other authenticators


There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.

Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes for you to use on your favorite authenticator.

His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My guess is that Brian used the