Skip to content

Instantly share code, notes, and snippets.

View soraxas's full-sized avatar
🎯
Focusing

Tin Lai soraxas

🎯
Focusing
View GitHub Profile
status is-interactive
or exit 0
if test -n "$XDG_RUNTIME_DIR"
set -g __starship_async_tmpdir "$XDG_RUNTIME_DIR"/fish-async-prompt
else
set -g __starship_async_tmpdir /tmp/fish-async-prompt
end
mkdir -p "$__starship_async_tmpdir"
set -g __starship_async_signal SIGUSR1
@hacker1024
hacker1024 / mygov_totp_storage.md
Last active September 22, 2024 09:20
Information about TOTP token storage in the myGov Code Generator app, as well as token extraction instructions.

This gist contains information about TOTP token storage in the myGov Code Generator app, along with instructions on how to extract tokens.

App data

Structure

/data/user/0/au.gov.dhs.centrelink.mygovauthenticator:
├───files
│ myGov.ks
@soraxas
soraxas / git-go_next
Last active July 1, 2020 16:46
Git utilities! :) It's now being tracked in a standalone repository https://github.com/soraxas/git-utils
#!/bin/bash
# test git is working in cwd
# git || exit 1
# declare a wrapper function for git
git() {
command git "$@" || exit 1
}
@maky-hnou
maky-hnou / Install CUDA 10.1 and Cudnn 7.6.5 on Ubuntu18.04
Last active April 29, 2022 18:16
Install cuda10.1 and cudnn 7.6.5 on Ubuntu 18.04
# Install Cuda 10.1 and Cudnn 7.6.5 on Ubuntu 18.04
## Start clean
sudo apt purge nvidia*
sudo apt remove nvidia-*
sudo rm /etc/apt/sources.list.d/cuda*
sudo apt autoremove && apt autoclean
sudo rm -rf /usr/local/cuda*

Rust Error Handling Cheatsheet - Result handling functions

Introduction to Rust error handling

Rust error handling is nice but obligatory. Which makes it sometimes plenty of code.

Functions return values of type Result that is "enumeration". In Rust enumeration means complex value that has alternatives and that alternative is shown with a tag.

Result is defined as Ok or Err. The definition is generic, and both alternatives have

@dmfigol
dmfigol / asyncio_loop_in_thread.py
Last active September 5, 2024 18:28
Python asyncio event loop in a separate thread
"""
This gist shows how to run asyncio loop in a separate thread.
It could be useful if you want to mix sync and async code together.
Python 3.7+
"""
import asyncio
from datetime import datetime
from threading import Thread
from typing import Tuple, List, Iterable
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active September 22, 2024 15:04 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export to tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.

@hwkr
hwkr / namecheap-synology-ddns.php
Created April 21, 2017 06:58
Add custom DDNS provider for Namecheap on Synology NAS - ( The horrors )
#!/usr/bin/php -d open_basedir=/usr/syno/bin/ddns
<?php
/*
Usage Instructions ( Obviously your domain has to be hosted on Namecheap )
1) Copy this file to /usr/syno/bin/ddns/namecheap.php
2) Add the following entry in /etc.defaults/ddns_provider.conf
[Custom - Namecheap]
modulepath=/usr/syno/bin/ddns/namecheap.php
@ClintLiddick
ClintLiddick / rust-robotics-libraries.md
Last active July 26, 2024 13:41
Rust Libraries for Robotics

Motivation

tl;dr I want to use Rust to program robots. Help me find the best core libraries to build on.

Robotic systems require high performance and reliability, but also have enormous complexity in terms of algorithms employed, number of subsystems, embedded hardware control, and other metrics. Development is mostly split between C++ for performance and safety critical components, and MatLab or Python for quick research or task iteration.

@tueda
tueda / gist+x.sh
Last active May 23, 2020 12:37
A script to give executable file permissions to files in a Gist.
#! /bin/sh
#
# @file gist+x.sh
#
# Gives executable file permissions to files in a Gist.
#
set -e
prog=`basename "$0"`
# Command line options.