Skip to content

Instantly share code, notes, and snippets.

@Flashwalker
Flashwalker / Disable Ryzen turboboost.md
Created March 5, 2024 12:29
Disable Ryzen turboboost

Disable Ryzen turboboost

Tests first

Check if turboboost is active

$ sudo cpupower frequency-info | grep 'boost state support' -A2 | grep Active

Active: yes ❌

Check the current driver

@Flashwalker
Flashwalker / switch-preset-mxmaster3s
Last active January 7, 2024 20:40
Switch input-remapper presets
#!/bin/bash
# Cycle through input-remapper presets
# https://github.com/sezanzeb/input-remapper
######### Customize this config #######
configdir=~/'.config/input-remapper-2'
device='Logitech USB Receiver'
defaultpreset='copypaste'
#######################################
@Flashwalker
Flashwalker / yandex-dzen-dark-theme.user.js
Last active April 2, 2023 06:47
Set the dark theme on Yandex dzen
// ==UserScript==
// @name Yandex dzen dark theme
// @namespace http://tampermonkey.net/
// @version 0.0.3
// @description Set the dark theme on Yandex dzen
// @author You
// @match http*://dzen.ru/*
// @match http*://*.dzen.ru/*
// @match http*://*.*.dzen.ru/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=dzen.ru
@Flashwalker
Flashwalker / open-url-prompt.user.js
Last active May 2, 2023 15:10
Open url alert prompt userscript
// ==UserScript==
// @name Open url prompt
// @version 0.0.3
// @match *://*/*
// @author Flashwalker
// @description Press Ctrl+Shift+: or Ctrl+Shift+' to open location prompt
// @updateURL https://gist.githubusercontent.com/Flashwalker/c02e28809a897c4955f34e271db0e427/raw/open-url-prompt.user.js
// @downloadURL https://gist.githubusercontent.com/Flashwalker/c02e28809a897c4955f34e271db0e427/raw/open-url-prompt.user.js
// @homepage https://gist.github.com/Flashwalker/c02e28809a897c4955f34e271db0e427
// ==/UserScript==
@Flashwalker
Flashwalker / flatpak-theme-takeover.sh
Last active January 16, 2023 01:27
Copy and set your current GTK3 theme over another's Flatpak theme
#!/bin/bash
# Copy and set your current GTK3 theme over another's Flatpak theme.
# It's like a raider takeover of some Flatpak theme 😁 🙃.
# NOTICE: some Flatpak theme must be already installed.
#
# What if you set your custom GTK3 theme for your desktop and want it for Flatpak?
# Use this script to takeover of another's Flatpak theme and set it!
USAGE(){
@Flashwalker
Flashwalker / obsidian-webclip-as-markdown.user.js
Last active June 4, 2023 04:21
Obsidian web clipper. Send selected content to Obsidian as markdown
// ==UserScript==
// @name Send selected content to Obsidian as markdown
// @version 0.6.8
// @match *://*/*
// @author Flashwalker
// @description Gareth Stretton https://medium.com/@gareth.stretton/obsidian-create-your-own-web-clipper-add83c7662d0 + StackOverflow https://stackoverflow.com/questions/4176923/html-of-selected-text/4177234#4177234
// @updateURL https://gist.github.com/Flashwalker/40f23e01942cc72a47df61bb86821714/raw/obsidian-webclip-as-markdown.user.js
// @downloadURL https://gist.github.com/Flashwalker/40f23e01942cc72a47df61bb86821714/raw/obsidian-webclip-as-markdown.user.js
// @homepage https://gist.github.com/Flashwalker/40f23e01942cc72a47df61bb86821714
// @require https://unpkg.com/turndown/dist/turndown.js
@Flashwalker
Flashwalker / bitmap2svg.sh
Created November 23, 2022 20:38
Convert image to svg (wrap image with svg) (embed image to svg) (jpg, png, gif... etc)
#!/bin/bash
# Wrap image with svg and output the svg file
#### Options
svgwidth=''
svgheight=''
imgwidth=''
imgheight=''
############
@Flashwalker
Flashwalker / Lo-Fi Fullscreen 🎵️ (Chilled Cow) (Chromium) (YouTube Music)
Last active September 12, 2022 08:31
Lo-Fi Music Radio Fullscreen 🎵️ (Chilled Cow) (YouTube Music) (Chromium) (Linux)
## Listen Lo-Fi redio from YouTube Music in Chromium fullscreen popup window on Linux
--------------------------------------------------------------------------------------
Run install.sh in terminal to install
@Flashwalker
Flashwalker / WPS-Office-block.bat
Created September 9, 2021 15:27
Block WPS Office internet connections
:: Replace all 11.2.0.9967 with yours installed version
netsh advfirewall firewall add rule name="WPS Office" dir=in action=block program="C:\Program Files\WPS Office\11.2.0.9967\utility\config.exe" enable=yes
netsh advfirewall firewall add rule name="WPS Office" dir=in action=block program="C:\Program Files\WPS Office\11.2.0.9967\office6\mui\default\resource\ksee\EqnEdit.exe" enable=yes
netsh advfirewall firewall add rule name="WPS Office" dir=in action=block program="C:\Program Files\WPS Office\11.2.0.9967\office6\et.exe" enable=yes
netsh advfirewall firewall add rule name="WPS Office" dir=in action=block program="C:\Program Files\WPS Office\11.2.0.9967\office6\kcrashdumper.exe" enable=yes
netsh advfirewall firewall add rule name="WPS Office" dir=in action=block program="C:\Program Files\WPS Office\11.2.0.9967\office6\kcrashdumper64.exe" enable=yes
netsh advfirewall firewall add rule name="WPS Office" dir=in action=block program="C:\Program Files\WPS Office\11.2.0.9967\office6\ksolaunch.exe" enable=yes
net
@Flashwalker
Flashwalker / smb-local-subnet-only.bat
Created September 9, 2021 15:23
Block remote smb network in connections on Windows
::Set firewall on
netsh advfirewall set currentprofile state on
::Block in connections from all
netsh advfirewall firewall add rule name="blockSMBforeign_TCP-139" action=block protocol=TCP dir=in localport=139 remoteip=any
netsh advfirewall firewall add rule name="blockSMBforeign_TCP-445" action=block protocol=TCP dir=in localport=445 remoteip=any
::Allow only local connections from 192.16.0.0/16 subnet
netsh advfirewall firewall add rule name="allowSMB_0_0_16_TCP-139" action=allow protocol=TCP dir=in localport=139 remoteip=192.168.0.0/16
netsh advfirewall firewall add rule name="allowSMB_0_0_16_TCP-445" action=allow protocol=TCP dir=in localport=445 remoteip=192.168.0.0/16