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

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

@SanariSan
SanariSan / util.js
Created April 17, 2022 17:47
JS utils
import { appendFileSync } from 'fs';
const log = (str) => console.log(str);
const debugLog = (p) => (process.env.NODE_ENV === 'development' ? console.log(p) : false);
const strError = (e, hint) =>
`Error : ${hint} : ${e.message}\n${e.stack.split('\n').slice(1, 3).join('\n')}`;
const dir = (p) => console.dir(p, { depth: 10 });
const debugDir = (p) =>
process.env.NODE_ENV === 'development'
? console.dir(p, { depth: 2 })
@SanariSan
SanariSan / cursor-position.js
Created April 12, 2022 11:15 — forked from lancejpollard/cursor-position.js
Get Cursor Position in Terminal with Node.js
module.exports = function(callback) {
require('child_process').exec('./cursor-position.sh', function(error, stdout, stderr) {
callback(error, JSON.parse(stdout));
});
}
@SanariSan
SanariSan / Shadowsocks-client.sh
Last active March 28, 2024 13:55
Shadowsocks+V2Ray | client+server (autodeploy) setup (bash)
############
# HOW TO CONNECT FROM LINUX?
# HERE IS THE SCRIPT TO SETUP YOUR PC
############
#
sudo apt install -y shadowsocks-libev wget
sudo wget -O- "https://github.com/shadowsocks/v2ray-plugin/releases/download/v1.3.1/v2ray-plugin-linux-amd64-v1.3.1.tar.gz" | tar -zxv
@SanariSan
SanariSan / readme.md
Last active April 13, 2024 07:15
Telegram HTTP bot API via CURL | Send text, photos, documents, etc.

Here are some examples on how to use Telegram bot api via CURL

Prerequisites

For getting messages in private chat with bot

  • Create a bot using @BotFather, get it's token
  • Start conversation with bot
  • Run following curl command
curl https://api.telegram.org/bot/getUpdates | grep -Po '"from":{"id":.+?,'
@SanariSan
SanariSan / telegramRestore.md
Created March 10, 2022 22:01 — forked from avivace/telegramRestore.md
Restore deleted Telegram messages from groups

Restore deleted Telegram messages, medias and files from groups

There's not telegram API method for this, we need to call MTProto methods to retrieve messages from the "Recent Actions" (Admin Log) since deleted messages (and medias) gets moved there for 48 hours before the permanent deletion.

from telethon import TelegramClient, events, sync
from telethon.tl.types import InputChannel, PeerChannel
from telethon.tl.types import Channel
import time
@SanariSan
SanariSan / fetch-timeout.js
Last active April 5, 2022 18:18
Fetch timeout using abort controller
// by https://stackoverflow.com/a/50101022/15516769
// more info https://developers.google.com/web/updates/2017/09/abortable-fetch
const controller = new AbortController();
const timeoutId = setTimeout(() => controller.abort(), 30 * 1000);
fetch(url, { signal: controller.signal })
.then((response) => {
// completed request before timeout fired
@SanariSan
SanariSan / socket.js
Created March 5, 2022 12:15
Nodejs socket
//_____________________
// Server + Client
// Server
require('net').createServer((socket) => {
console.log("connected");
socket.on('data', (data) => {
console.log(data.toString());
});
@SanariSan
SanariSan / reset.js
Created March 3, 2022 19:43 — forked from 19h/reset.js
Node.js — Clear Terminal / Console. Reset to initial state.
console.reset = function () {
return process.stdout.write('\033c');
}
@SanariSan
SanariSan / OVERVIEW.TXT
Created February 17, 2022 10:46
adb key moments
ORIGIN: https://android.googlesource.com/platform/system/core/+/android-2.3.4_r1/adb/OVERVIEW.TXT
Implementation notes regarding ADB.
I. General Overview:
The Android Debug Bridge (ADB) is used to:
- keep track of all Android devices and emulators instances
connected to or running on a given host developer machine
- implement various control commands (e.g. "adb shell", "adb pull", etc..)
for the benefit of clients (command-line users, or helper programs like
DDMS). These commands are what is called a 'service' in ADB.