App-Cheats

 view release on metacpan or  search on metacpan

cheats.txt  view on Meta::CPAN

# During startup would see:
Reading ME failed.
# This fixed it:
sudo fwupdmgr reinstall
# Select 'Intel Management Engine' option.


#############################################################
## Ubuntu - Power
#############################################################

# Change Ubuntu from suspending when the lid is closed.
sudo vi /etc/systemd/logind.conf
#
# Do nothing (plus uncomment)
HandleLidSwitch=ignore
#
# Suspend
HandleLidSwitch=suspend
#
# Restart system daemon
sudo systemctl daemon-reload

# Check the battery charging threshold on Linux (Ubuntu)
cat /sys/class/power_supply/BAT0/charge_st*

# Ubuntu prevent auto suspend when closing the lid.
# Check default:
gsettings get org.gnome.settings-daemon.plugins.power lid-close-battery-action  # 'suspend'
gsettings get org.gnome.settings-daemon.plugins.power lid-close-ac-action       # 'suspend'
#
# Change default:
gsettings set org.gnome.settings-daemon.plugins.power lid-close-battery-action nothing
gsettings set org.gnome.settings-daemon.plugins.power lid-close-ac-action      nothing
#
# Didnt WORK!

# Ubuntu prevent auto suspend when closing the lid.
sudo apt install gnome-tweaks
# Start Tweaks -> General


#############################################################
## Ubuntu - X-Server
#############################################################

# On Ubuntu there are 2 X-Servers available during login:
   - Wayland
   - Xorg
# Wayland is newer and to use screen sharing (share,jitsi) in
   chrome enable this:
chrome://flags/#enable-webrtc-pipewire-capturer
# Xorg should be avoided since it can cause a black screen on lock screen
   (at least if an extra monitor is connected).


#############################################################
## Ubuntu - Desktop/Tasklist App
#############################################################

# Sample .desktop file to add xair as a favorite program.
cat xair.desktop
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=XAIR
# If file name is to be renamed, also probably need to update this class,
# (as is done now).
# Run:
#   xprop WM_CLASS      # WM_CLASS(STRING) = "X-AIR-Edit", "X-AIR-Edit"
StartupWMClass=X-AIR-Edit
Exec=/home/tim/git/xair/software/latest/RUN.sh
Icon=/home/tim/git/xair/software/latest/xair.png


#############################################################
## VBA Regex
#############################################################

# Regex for validating input on database
cat data | add_color -r '(?x) ^ (?! ^( (ALLENGINES|ASAPPLICABLE|PW\d+\w+-?\w+)(,|$))+ ((Except:)? (\d{6}-\d{6}|\d{6}) (,|$) )* $ ) .*'


#############################################################
## Vim Strings
#############################################################

# Example of using a multiline string in Vim
#
+ " Perl Data Dumper and other useful features all in one mapping.
+ function PerlDev()
+    let l:PERL_DEV = "
+       \\nuse v5.32;
+       \\nuse Mojo::Util qw(dumper);
+       \\nuse Carp       qw( croak confess carp cluck );
+       \\nsub WhoAmI { say '--> ' . (caller(1))[3] }
+       \\nsay 'var: ', dumper $var;
+       \\n$Self->HandleException('message'); # New    - Test/*
+       \\n$Selenium->HandleError('message'); # Legacy - script/*
+       \\n
+       \\n"
+
+    put =l:PERL_DEV
+ endfunction
+
+ nnoremap <leader>r :call PerlDev()<CR>


#############################################################
## Vim Quitting
#############################################################

# Exit, saving changes (Vim)
:x

# Exit as long as there have been no changes (Vim)
:q

# Exit and save changes if any have been made (Vim)
ZZ



( run in 1.510 second using v1.01-cache-2.11-cpan-2398b32b56e )