Skip to content

Instantly share code, notes, and snippets.

@shdbwa
shdbwa / show_modules_config.sh
Last active April 25, 2020 10:38
Get module configuration
#!/bin/sh
# Searchable list showing kernel modules with (lsmod), piped (|) via (percol). Pipe (|) the output with (awk), filte for the first field (print $1). Grab the result (xargs -0) as argument for (echo) to write it to disk (>) as (/tmp/showmoduleconfig)
lsmod | percol | awk '{print $1}'|xargs -0 echo > /tmp/showmoduleconfig ;
# Display (cat) previousely selected module config (-m) in verbose mode (-v) with (systool). Remove (rm) the temporary file created (/tmp/showmoduleconfig). Colorize (pygmentize) output like a (linux-config) file with lexer (-l linux-config)
systool -v -m (cat /tmp/showmoduleconfig) & rm /tmp/showmoduleconfig | pygmentize -l linux-config ;
@shdbwa
shdbwa / nvidia-reset
Created May 8, 2020 15:02
Quick script to reload nvidia-uvm kernel module, failling after sleep.
#!/bin/sh
# Quick script to reload nvidia-uvm kernel module, failling after sleep.
#
# NVIDIA KERNEL
# 440.82 5.3.0-51
#
echo "# Quick script to reload nvidia-uvm kernel module, failling after sleep."
echo "#### RUN THIS AS ROOT! ####"
echo "#### Remove nvidia_uvm module ####"
sudo rmmod nvidia_uvm
@shdbwa
shdbwa / default.pa
Last active October 20, 2020 05:28
Split one 5.1 audio card with one 5.1 output in 3 virtual sound cards with stereo output mapped to : (front_left+front_right) AND (rear_left+rear_right) AND (center+LFE))
#!/usr/bin/pulseaudio -nF
#$HOME/.pulse/default.pa
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
@shdbwa
shdbwa / .asoundrc
Created October 20, 2020 05:25
$HOME/.asoundrc
pcm.NVidia { type hw; card NVidia; }
ctl.NVidia { type hw; card NVidia; }
pcm.Audigy { type hw; card Audigy; }
ctl.Audigy { type hw; card Audigy; }
pcm.!default pcm.Audigy
ctl.!default ctl.Audigy
@======== Fastboot command ========
@Get info :
@>>> fastboot oem gpt-info
@>>> fastboot oem isn-info
@>>> fastboot oem ssn-info
@>>> fastboot oem system-info
@>>> fastboot oem device-info
@Get ID :
@>>> fastboot oem get-prjid
@>>> fastboot oem get-hwid
@shdbwa
shdbwa / recoll_results_format.html
Last active June 10, 2021 12:16
Recoll config
<head>
<meta charset="UTF-8">
</head>
<table class="tg">
<tbody>
<tr>
<td class="tg-lboi" rowspan="3"><a href='%u'><img src='%I' width='96'></a></td>
<td class="tg-0pky"style="color:rgb(231, 159, 222);font-weight: bold;font-size: x-large;font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;">%T</td>
</tr>
<tr>
AA
AAS
ABACA
ABACAS
ABALONE
ABALONES
ABANDON
ABANDONS
ABATIS
ABATTIS
@shdbwa
shdbwa / Spaces_and_bash_scripts.sh
Last active July 31, 2021 15:17
Spaces and bash scripts _ IFS custom
#!/bin/bash
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
# set me
FILES=/data/*
for f in $FILES
do
echo "$f"
done
# restore $IFS
@shdbwa
shdbwa / termux-url-opener.sh
Last active August 30, 2021 15:33 — forked from LordH3lmchen/termux-url-opener
termux-url-opener
#!/data/data/com.termux/files/usr/bin/zsh
#
# This is a termux-url-opener script to do diffrent tasks on my Android phone
#
#
#
# How to use this script
#############################
# Create the bin directory
# ➜ ~ mkdir bin
@shdbwa
shdbwa / How-to_firefox-white-loading-switch-to-dark.css
Last active November 30, 2021 08:49
Firefox White Page Loading -> Dark page
/*
Go to about:config, set toolkit.legacyUserProfileCustomizations.stylesheets to true.
Create a userChrome.css file according to these instructions: https://www.userchrome.org/how-create-userchrome-css.html
Paste the following into userChrome.css
*/
/*No white flash on new tab opening in dark theme */
#browser vbox#appcontent tabbrowser, #content, #tabbrowser-tabpanels, browser[type=content-primary], browser[type=content] > html { background: #222 !important; }
/*