Skip to content

Instantly share code, notes, and snippets.

git filter-branch --index-filter 'config rm -rf --cached --ignore-unmatch path_to_file' HEAD
@bqcuong
bqcuong / ankiconnect.py
Created April 1, 2025 14:13
Creating Anki Deck for learning German Vocabs (translations, examples, TTS are automatically generated thanks to OpenAI)
from pathlib import Path
from openai import OpenAI
import requests
import json
# AnkiConnect API endpoint
ANKI_CONNECT_URL = "http://127.0.0.1:8765"
# OpenAI Client initialization
client = OpenAI()
@bqcuong
bqcuong / autoexec.cfg
Last active January 1, 2025 20:59
Xbox One 2015 Controller configuration for Half Life (xash3d-fwgs engine) on R36S
// /roms/ports/Half-Life/value/autoexec.cfg
alias "+SelectHold" "bind L1_BUTTON load quick; bind R1_BUTTON save quick; bind X_BUTTON cancelselect"
alias "-SelectHold" "bind L1_BUTTON +duck; bind R1_BUTTON +attack; bind X_BUTTON impulse 100"
@bqcuong
bqcuong / ffmpeg_build.sh
Created December 7, 2024 10:34
Build ffmpeg for miyoo-j2me, supporting AMR conversion
------------------------------------
# Download opencore-amr-0.1.5, ffmpeg-2.4.14
------------------------------------
# build for armv7
# opencore-amr
export CC=arm-linux-gnueabihf-gcc
export CXX=arm-linux-gnueabihf-g++
export AR=arm-linux-gnueabihf-ar
@bqcuong
bqcuong / dotfiles_backup.sh
Created August 16, 2024 12:30
Git repository setup for dotfiles backup
# Source: https://news.ycombinator.com/item?id=11071754
git init --bare $HOME/.myconf
alias config='/usr/bin/git --git-dir=$HOME/.myconf/ --work-tree=$HOME'
config config status.showUntrackedFiles no
config status
config add .vimrc
config commit -m "Add vimrc"
config add .config/redshift.conf
console.log("---> Running scripts....");
let text = document.getElementById("main_content_container").getElementsByClassName("category semantic-no-styling")[0].innerText.trim();
//if ("Prime Seats" == text) {
if (text.startsWith("Category")) {
document.getElementById("book").click();
alert("Match found!!!");
}
else {
setTimeout(function(){history.go(0);}, Math.random() * (2000) + 3000);
#!/bin/bash
RUN TO_SEARCH="curl"; echo $(apt --installed list $(echo $TO_SEARCH) 2>/dev/null | grep installed | awk -F'[/| ]' '{print $1"="$3}' | tr '\n' ' ')
@bqcuong
bqcuong / clone.sh
Created August 31, 2022 07:59
Clone github project with token in url
git clone https://key@github.com/bqcuong/repo.git
@bqcuong
bqcuong / remove_dropbox_shared_links.txt
Created January 12, 2022 13:13
Remove all the links you have shared in your Dropbox
# print registers
info registers
# print buffer address
p &buffer
# print memory page, 12 words (1 word = 4 bytes) from buffer address
x/12x &buffer
https://www.rapidtables.com/convert/number/hex-to-decimal.html