Skip to content

Instantly share code, notes, and snippets.

View thstarshine's full-sized avatar
🏔️

starshine thstarshine

🏔️
  • Taipei, Taiwan
View GitHub Profile
@thstarshine
thstarshine / AuthyToOtherAuthenticator.md
Created February 14, 2024 10:00 — forked from gboudreau/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Generating Authy passwords on other authenticators


*update: This might affect how easy it is to use this technique past August 2024: https://www.theverge.com/2024/1/8/24030477/authy-desktop-app-shutting-down


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.

@thstarshine
thstarshine / Dockerfile
Created November 25, 2021 06:48 — forked from majodev/Dockerfile
netdata daemonset on kubernetes
FROM netdata/netdata:latest
MAINTAINER YOUR_EMAIL
# add netdata user to root group (access volumne mounts from host)
RUN apk --no-cache add shadow
RUN usermod -a -G root netdata
ENTRYPOINT ["/usr/sbin/run.sh"]
@thstarshine
thstarshine / pritunl-server-custom-ssl_manually
Created June 27, 2021 04:22 — forked from phiberoptick/pritunl-server-custom-ssl_manually
Use custom SSL cert in Pritunl Server Community
Ignore all that craziness below. These can be set from the cli with the "pritunl" command.
The commands below can be used to get/set the values of the cert, key, port and if the :80 -> "app.server_port" redirect is active.
# Get current SSL server cert:
pritunl get app.server_cert
# Get current SSL server key:
pritunl get app.server_key
@thstarshine
thstarshine / pritunl_mongo_audit_query.py
Last active September 6, 2021 08:04 — forked from jonathanhle/pritunl_mongo_audit_query.py
pritunl mongodb query for user info
# https://gist.github.com/jonathanhle/4bb44d2e5d3ace8a62928ec2cb3e39a7
# Requires pymongo 3.6.0+
from datetime import datetime, timedelta
from pymongo import MongoClient
from bson.tz_util import FixedOffset
from bson.son import SON
from collections import OrderedDict
# Setup logger
import logging
@thstarshine
thstarshine / locustfile.py
Created June 30, 2020 02:44 — forked from yamionp/locustfile.py
Websocket Locust Sample. locustfile and Echo/Chat Server
# -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
import json
import uuid
import time
import gevent
@thstarshine
thstarshine / encrypt_decrypt_example.js
Created October 29, 2018 08:14 — forked from erans/encrypt_decrypt_example.js
Example of encryption and decryption in node.js
var crypto = require("crypto")
function encrypt(key, data) {
var cipher = crypto.createCipher('aes-256-cbc', key);
var crypted = cipher.update(text, 'utf-8', 'hex');
crypted += cipher.final('hex');
return crypted;
}
@thstarshine
thstarshine / mongodb_collection_sizes.js
Created December 28, 2017 08:00 — forked from joeyAghion/mongodb_collection_sizes.js
List mongodb collections in descending order of size. Helpful for finding largest collections. First number is "size," second is "storageSize."
var collectionNames = db.getCollectionNames(), stats = [];
collectionNames.forEach(function (n) { stats.push(db[n].stats()); });
stats = stats.sort(function(a, b) { return b['size'] - a['size']; });
for (var c in stats) { print(stats[c]['ns'] + ": " + stats[c]['size'] + " (" + stats[c]['storageSize'] + ")"); }