Skip to content

Instantly share code, notes, and snippets.

View nick133's full-sized avatar
🎯
Focusing

Nick nick133

🎯
Focusing
View GitHub Profile
@nick133
nick133 / getucode.zsh
Last active June 19, 2023 14:27
Autodetects host CPU signature, download corresponding latest Intel microcode and cook initrd image from it
#!/bin/zsh
#
# Autodetect CPU signature, download corresponding Intel microcode
# and cook initrd image from it
#
# https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/secure-coding/loading-microcode-os.html
repo_url="https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files"
ucodes_url="$repo_url/raw/main/intel-ucode"
release_url="$repo_url/blob/main/intel-ucode"
fwimg="hostcpu-intel-ucode.img"
@nick133
nick133 / .bashrc
Created May 4, 2022 21:28
Excellent nnn filemanager related config from ~/.bashrc
# https://linux.101hacks.com/cd-command/cdpath/
export CDPATH=~/.config/nnn/bookmarks
if [[ "$XDG_SESSION_TYPE" == "tty" ]]
then
export GUI=0
export BROWSER=elinks
else
export GUI=1
export BROWSER=firefox
@nick133
nick133 / fumenu
Last active May 4, 2022 22:07
FuMenu - minimalists terminal and desktop menu based on fzf, designed primarily for sway
#!/usr/bin/env /usr/bin/bash
#
# FuMenu v0.2 (2022)
# Minimalistic fzf-powered terminal menu system
#
# Features:
# * title
# * submenus
# * configurable separators
# * source for use as function
@nick133
nick133 / sway-layout.sh
Created February 4, 2021 23:22
Sway (Wayland) waybar JSON data provider for custom/locale plugin
1 #!/bin/bash
2 #
3 # JSON data provider for waybar custom/locale plugin
4 #
5
6 makejson() {
7 sed $1 -e 's@^.*English.*$@{ "text": "En", "tooltip": "English (US)", "class": "lang_en", "percentage": 0 }@' \
8 ┊ -e 's@^.*Russian.*$@{ "text": "Ru", "tooltip": "Russian", "class": "lang_ru", "percentage": 0 }@' \
9 ┊ -e 's@^.*Ukrainian.*$@{ "text": "Uk", "tooltip": "Ukrainian", "class": "lang_uk", "percentage": 0 }@'
10 }
@nick133
nick133 / finder
Last active January 22, 2021 21:01
Advanced finder plugin for awesome NNN file manager (command selection and history)
#!/usr/bin/env bash
#
# Description: Advanced file finder plugin for awesome NNN file manager
#
# Features:
# - Predefined commands selection menu
# - History of unique commands
#
# Requires: bash, fzf, [fd]
#
@nick133
nick133 / gauth.py
Created June 28, 2020 13:39
GoogleAuthentificator (OTP-generator) for linux command line (python)
#!/usr/bin/python3
#
# Command line GoogleAuthentificator for linux
#
# pip3 install pyperclip
# pip3 install pyotp
#
import pyperclip
import pyotp
@nick133
nick133 / gm_aliexpress_fix.js
Last active July 6, 2022 08:33
Fix Aliexpress Country/Currency settings
///
/// !!! Outdated - Not working with current aliexpress version !!!
///
// ==UserScript==
// @name Aliexpress fix locale
// @description Fix Aliexpress country and currency settings
// @icon https://www.aliexpress.com/favicon.ico
// @version 1
// @grant none
// @match https://*.aliexpress.com/*