Skip to content

Instantly share code, notes, and snippets.

@sebastiancarlos
sebastiancarlos / show_notifications.bash
Last active July 8, 2024 03:49
Show notifications in your terminal
# All my gist code is licensed under the terms of the MIT license.
# Video demo: https://www.youtube.com/shorts/WVyqVkGYb4k
# Add this somewhere in ~/.bashrc
# write_message
# - write a message on the lower right corner of the terminal
function write_message () {
if [[ "$#" -eq 0 ]]; then
@d-513
d-513 / arch-ovh.md
Last active June 10, 2024 16:28
Arch Linux on OVH VPS

Install Arch on OVH VPS

This guide will show you how to install Arch Linux on an OVH VPS.
As you may have noticed, OVH does not have an Arch image, which is a problem. Follow these instructions to install Arch using recovery mode.

Conventions

Assume anything reffered to as low ram vps in the guide to be a VPS with <8gb ram

This guide assumes the following:

  • Your VPS has one drive
@jaygooby
jaygooby / log4j-jndi.conf
Last active February 2, 2022 12:04
fail2ban filter rule for the log4j CVE-2021-44228 exploit
# log4j jndi exploit CVE-2021-44228 filter
# Save this file as /etc/fail2ban/filter.d/log4j-jndi.conf
# then copy and uncomment the [log4j-jndi] section
# to /etc/fail2ban/jail.local
#
# jay@gooby.org
# https://jay.gooby.org/2021/12/13/a-fail2ban-filter-for-the-log4j-cve-2021-44228
# https://gist.github.com/jaygooby/3502143639e09bb694e9c0f3c6203949
# Thanks to https://gist.github.com/kocour for a better regex
#
@arunvelsriram
arunvelsriram / anvim.sh
Last active December 16, 2021 22:07
Bash function for opening NeovIm in a separte Alacritty window providing GUI like feel. Actually a TUI (Terminal UI).
# USAGE:
# anvim [path]
anvim() {
local target="${PWD}"
if [ -n "${1}" ]; then
target=$(realpath "$1")
fi
local wdir="${target}"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Gavinok
Gavinok / chem.rec
Last active January 21, 2024 00:28
Example code used in a video on GNU recutils ( includes both chem.rec and chem.sh)
%rec: periodic_table
%sort: AtomicNumber
# all values came from
# https://pubchem.ncbi.nlm.nih.gov/periodic-table/
AtomicNumber: 1
Symbol: H
Name: Hydrogen
AtomicMass: 1.0080
@weslleyspereira
weslleyspereira / switchHeadphones.py
Created August 4, 2020 13:29
Tkinter toggle button to switch microphone On/Off using a script
#! /usr/bin/python
''' switchHeadphones.py
Tkinter toggle button to switch microphone On/Off using a script
Modification of the solution proposed in
https://www.daniweb.com/posts/jump/1909448
for the Mic On/Off script from
https://gist.github.com/OndraZizka/2724d353f695dacd73a50883dfdf0fc6
'''
@luukvbaal
luukvbaal / cacheremove.hook
Last active June 23, 2024 15:17
yay paccache hooks
[Trigger]
Operation = Remove
Type = Package
Target = *
[Action]
Description = Clearing cache...
When = PostTransaction
Exec = /home/<user>/.local/bin/tools/removehook
@t3easy
t3easy / .gitlab-ci.yml
Last active June 14, 2024 11:45
Build and deploy docker containers with GitLab CI
image: an-image-with-docker-and-docker-compose
variables:
DOCKER_TLS_VERIFY: "1"
DOCKER_CERT_PATH: ".docker"
before_script:
- mkdir -p $DOCKER_CERT_PATH
- echo "$DOCKER_CA" > $DOCKER_CERT_PATH/ca.pem
- echo "$DOCKER_CERT" > $DOCKER_CERT_PATH/cert.pem
@OndraZizka
OndraZizka / switchHeadphones.sh
Last active May 29, 2024 13:43
Bluetooth headset - switch between quality sound + no mic (A2DP) and crappy sound and mic (HSP/HFP)
#!/bin/bash
#### Restart Bluetooth
if [ "$1" == "resetBT" ] ; then
sudo rfkill block bluetooth && sleep 0.1 && sudo rfkill unblock bluetooth;
exit;
fi;
#### Toggle listen/speak
if [ "$1" == "" -o "$1" == "toggle" ] ; then