Just a collection of various scripts.
List active zones: firewall-cmd --get-active-zones
Remove an interface from a zone: firewall-cmd --zone=zone-name --remove-interface=dev-name
Add an interface to a zone: firewall-cmd --zone=zone-name --add-interface=dev-name
If the interface is controlled by NetworkManager, use nm-connection-editor
to set the zone permanently.
List open services/ports/others: firewall-cmd --list-all
Allow a port in a zone: firewall-cmd --zone=zone-name --add-port=port-number/port-type
Removing a port is done analogously with --remove-port.
By default, the above changes are temporarily.
To make changes permanent, run firewall-cmd --runtime-to-permanent
python3 -m http.server 8080
Dynamic jump: ssh -J user1@host1:port1 user2@host2:port2
Over multiple machines: ssh -J user1@host1:port1,user2@host2:port2 user3@host3
Use the ProxyJump
directive in ~/.ssh/config to specify a jump host for a machine that is not directly reachable.
git rebase -p --onto SHA^ SHA
git config diff.gpg.textconv "gpg2 --decrypt -q"
echo "*.gpg filter=gpg diff=gpg" >> .gitattributes
echo "*.asc filter=gpg diff=gpg" >> .gitattributes
:let @" = expand("%:p")
Enter normal mode in the terminal window: Ctrl-w N
Now use usual vim commands for moving around, coying, pasting.
Exit normal mode as usual with 'i' or 'a'
Ctrl-b :setw synchronize-panes
- Run commands ...
Ctrl-b :setw synchronize-panes
- Copy ics content into mail body
- Before sending, use
ctrl+t
to change content-type totext/calendar
and addmethod=REQUEST
In mailcap file (see muttrc:
set mailcap_path = /path/to/mailcap
):
text/html; w3m -I %{charset} -T text/html; copiousoutput;
In muttrc
or on demand:
auto_view text/html
If you put in in muttrc
, also add
alternative_order text/plain text/enriched text/html
Easy, thanks to Rob Hoelz! See his blog post for details on this: https://hoelz.ro/blog/using-udev-to-disable-my-infrared-camera-on-linux.
Add /etc/udev/rules.d/99-disable-internal-webcam.rules
with content:
ACTION!="add|change", GOTO="camera_end"
ATTRS{idVendor}=="xxxx",ATTRS{idProduct}=="yyyy",ATTR{bConfigurationValue}="0"
LABEL="camera_end"
Restart an unresponsive and broken gnome-shell session:
killall -HUP gnome-shell
According to stackoverflow,
busctl --user call org.gnome.Shell /org/gnome/Shell org.gnome.Shell Eval s 'Meta.restart("Restarting…")'
should be equivalent to Alt+F2 restart
, but did not help in my case and just timeouted.
When dpkg handles a package, the scripts are temporarily stored in e.g., /var/lib/dpkg/info/mypkg.postrm
.
As a quick workaround, you can inspect them, change them, or simply remove them before re-executing the action.