Skip to content

Instantly share code, notes, and snippets.

@e7d
e7d / ubuntu-24.04-asdf-php-deps.sh
Last active November 11, 2024 09:56
PHP dependencies for ASDF install on Ubuntu 24.04
#!/bin/bash
sudo apt install autoconf \
bison \
libcurl4-openssl-dev \
libgd-dev \
libonig-dev \
libpq-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
@e7d
e7d / find-container-by-pid.sh
Created June 26, 2023 13:43
Find a PID running container name
#!/bin/bash
set -e
error() {
echo "Error: $1"
exit 1
}
trap 'error "An unexpected error occurred. Exiting."' ERR
@e7d
e7d / remove-obsolete-gpg-key-from-dnf.md
Last active November 12, 2024 20:57
Remove obsolete GPG key from DNF (Fedora)
@e7d
e7d / openfortigui.sh
Last active October 12, 2021 13:38 — forked from yoyosan/openfortigui.md
Build openfortigui in Fedora 34+
#!/bin/sh
# install required packages:
sudo dnf install qt5-qtbase-devel openssl-devel qtkeychain-qt5-devel -y
# create a symlink to /usr/bin/qmake, if needed
sudo ln -s /usr/lib64/qt5/bin/qmake /usr/bin/qmake
# build openfortigui code
git clone https://github.com/theinvisible/openfortigui.git /tmp/openfortigui
@e7d
e7d / switch-sink.sh
Last active August 30, 2021 10:14
Switch output device using PulseAudio sound server Control (pactl)
#!/bin/bash
if [ ! -x "$(command -v pactl)" ]; then
cat <<EOL >&2
$(basename $0): missing pactl
The PulseAudio "pactl" binary is required to use this program.
EOL
exit 1
fi
@e7d
e7d / update-dbeaver-ce.sh
Created December 4, 2020 08:29
DBeaver updater for Manjaro
#!/bin/sh
# Ensure dpkg availability
if ! command -v dpkg &> /dev/null; then
sudo pacman -Syy dpkg
fi
# Download and update DBeaver with latest deb file
TMP_DIR="$(mktemp -d)"
wget -qO $TMP_DIR/dbeaver-ce_latest_amd64.deb https://dbeaver.io/files/dbeaver-ce_latest_amd64.deb
#!/bin/sh
maxBlockSize=1073741824 # 1 GB
maxBlockCount=1024
testSize=1073741824 # 1 GB
testDir=$1
if [ -z "$1" ]; then
testDir="/tmp"
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YiqAN
@e7d
e7d / CIFS-auto-mount.md
Last active April 12, 2022 14:04
Auto-Mount Windows shared folders (CIFS) in Debian Stretch when network is ready

Ensure necessary dependencies are installed:

sudo apt-get update
sudo apt-get install cifs-utils

Add post-up /etc/network/if-up.d/cifs-mount to your interface (here eth0) in /etc/network/interfaces file:

# This file describes the network interfaces available on your system
@e7d
e7d / custom.css
Last active August 16, 2017 10:13
Visual Studio Code Personalizations (CSS and JS)
/**
* @author Michaël "e7d" Ferrand
* @description custom style for Visual Studio Code
* @see https://gist.githubusercontent.com/e7d/34cf097cd1fc3a7bbb7300b8fcd70d1c
*/
/***** RESOURCES *****/
@font-face {
font-family: 'Font Awesome';