Skip to content

Instantly share code, notes, and snippets.

@avoidik
avoidik / bookmark.txt
Created May 14, 2023 12:45
bookmarklet to get AWS account info
javascript:(function () { function fullDecode (input) { let decoded = decodeURIComponent(input); return (decoded == input ? decoded : fullDecode(decoded)) }; let userInfo = document.cookie.replace(/(?:(?:^|.*;\s*)aws-userInfo\s*\=\s*([^;]*).*$)|^.*$/, "$1"); alert(JSON.stringify(JSON.parse(fullDecode(userInfo)), null, 4)) })();
@avoidik
avoidik / ssh.sh
Created May 14, 2023 12:41
Autocompletion for SSH hosts
_ssh()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts=$(grep '^Host' ~/.ssh/config ~/.ssh/config.d/* 2>/dev/null | grep -v '[?*]' | cut -d ' ' -f 2-)
COMPREPLY=( $(compgen -W "$opts" -- ${cur}) )
return 0
@avoidik
avoidik / README.md
Last active July 23, 2023 11:53
Configure git, pass, docker and twine to use gpg

Install required tools first

$ # ubuntu
$ sudo apt-get install -y git gnupg pass pinentry-curses
$ # macos
$ brew install git gnupg2 docker-credential-helper pass pinentry-mac

There is no PPA for docker-credential-helper on Ubuntu, so install that directly

@avoidik
avoidik / install-fonts.ps1
Last active March 20, 2023 18:59
install fonts
# %localappdata%\Microsoft\Windows\Fonts
$FontFolder = "C:\Users\Gato\Downloads\Meslo-Win"
$FontItem = Get-Item -Path $FontFolder
$FontList = Get-ChildItem -Path "$FontItem\*" -Include ('*.fon','*.otf','*.ttc','*.ttf')
$FontRegistry = "HKCU:\Software\Microsoft\Windows NT\CurrentVersion\Fonts"
$Destination = Join-Path -Path (New-Object -ComObject Shell.Application).Namespace(0x1c).Self.Path -ChildPath "Microsoft\Windows\Fonts"
If (-Not (Test-Path $FontRegistry)) {
New-Item -Path $FontRegistry -Force | Out-Null
@avoidik
avoidik / README.md
Last active March 20, 2024 01:30
Build box86/box64 emulators on Raspberry Pi 400

Run wine on box86 and box64 on RPi 400

How to run Wine on RPi 400

Steps

Build box64

sudo apt install git cmake -y
@avoidik
avoidik / README.md
Last active November 2, 2022 13:39
Fix Raspberry Pi wireless driver issue

If you're getting such errors in dmesg output while facing wireless abnormal disconnects

[20718.137775] ieee80211 phy0: brcmf_proto_bcdc_query_dcmd: brcmf_proto_bcdc_msg failed w/status -110
[20720.697821] ieee80211 phy0: brcmf_proto_bcdc_query_dcmd: brcmf_proto_bcdc_msg failed w/status -110
[20720.697843] ieee80211 phy0: brcmf_cfg80211_get_station: GET STA INFO failed, -110

Update udev rules

@avoidik
avoidik / README.md
Created October 31, 2022 17:46
Build qalculate-gtk from source

Build libqalculate first

sudo apt-get install -y build-essential intltool libcurl4-openssl-dev libgtk-3-dev libxml2-dev
git clone https://github.com/Qalculate/libqalculate
cd libqalculate/
git checkout tags/v4.4.0
./autogen.sh
./configure --prefix=/opt/libqalculate
make
@avoidik
avoidik / README.md
Last active January 25, 2024 11:10
How to install Citrix Workspace app onto Raspbian or Ubuntu Arm64

Citrix Workspace

In this manual I assume that we'll be using usb audio handset instead of hdmi audio output

Step

Check available architectures first

$ dpkg --print-architecture
@avoidik
avoidik / README.md
Last active October 26, 2022 17:53
Register all available Plymouth themes

Due to a bug or just because of missing feature plymouth themes are not register after installation by dpkg. This way we will register them ad-hoc and in bulk.

Install some themes first

sudo apt-get install plymouth-theme-breeze plymouth-theme-hamara plymouth-themes -y

Register all themes

@avoidik
avoidik / README.md
Created October 20, 2022 14:40
Build dropbear on Ubuntu from source

Install all required packages

sudo apt-get install build-essential zlib1g-dev libssl-dev libcrypt-dev libpam-dev libtomcrypt-dev libtommath-dev git

Clone the repo

git clone --depth 1 https://github.com/mkj/dropbear.git -b DROPBEAR_2022.82