Skip to content

Instantly share code, notes, and snippets.

@e7d
e7d / openfortigui.sh
Last active Oct 12, 2021 — forked from yoyosan/openfortigui.md
Build openfortigui in Fedora 34+
View openfortigui.sh
#!/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 Aug 30, 2021
Switch output device using PulseAudio sound server Control (pactl)
View switch-sink.sh
#!/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 Dec 4, 2020
DBeaver updater for Manjaro
View update-dbeaver-ce.sh
#!/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
View io-benchmark.sh
#!/bin/sh
maxBlockSize=1073741824 # 1 GB
maxBlockCount=1024
testSize=1073741824 # 1 GB
testDir=$1
if [ -z "$1" ]; then
testDir="/tmp"
fi
testFile="${testDir}/dd.dat"
@e7d
e7d / e7d-rsa-public
Created Feb 11, 2018
SSH Public Key
View e7d-rsa-public
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAABAEAvIqr0ppZfI1SO5+iVrCHv7nF9bz2vaOkkZC7pOZL64aYEaf/xcfP5WLupC7P/aazIIpzfspWdwVWlel6VBkpVqad69seUI6t8aqklQBMHGX7lCSIukhRi+Uo9yARoDxvGf4cgb1/evVv1U6V0GOb6i0gO1gti1bYJNPB0nkOVdtq1u9317xKmMVOqFriXhHJXlcWbZj53vxZLJ2YWEfS/k7sCpWolRzY2D1fzo/VoyIQvEFOnsSjTXtEwvi80DigTX/cx9HaYmlJmHklrHq4e93y5eWRULRg4BgwnokQwwODRVmkOJ1HSNsaaUrTPYLG/LimmgwNDNHFzxlDePGatfdpTbNzm+4Rby9c6gMu+ijUQMvOY7RLFC4tYcZ8E3xe21c82e5QWud0jkIcYRLhFumArUFk9Zp2ohBXxBFmr3bYpB3gOXYLpXIdwgid/txZk1aiZuFGDZDdE9kClpGIETTVLgV7oXjfP3Iknmt9Q5rZs6/jRINppw/Vo/lj9PiEUis/iaXzEQnoukGPMAXphc17/JR6I9SInPi0DszAlj4tzx1VtW2tYnahRYSSmINY+z3eCP2BHyjTzkeeuLiDQJQe1FhPRNxM4kqT8tvIGkfIMnAV7hj2T/kbbfXGnsmUAJNfXvIJe2ibjtx2ks9Y59TDy96QPWs60ZPj6cJ6nKuQVejZ/2x4lywWZ/KKhSLeZ9kHqi8wdz/MyXsm6cjvp7A0KoXmfPmtUSM+H5Sg1aFLdMCG9vbWuqXiPNr96DQCeGhHIba63aQ/WL6gok8lDhsh9UB6QRyflwU89XC6IjeFDpv7hOm/lrOJFmPRIw0mBBiDIt8rAEreaUQwz/m2ivMEI9XEZvuWKOC9xCdHK2oOpFA+jqeavAAdR9otrF/3HiMetZZnpghDJDFFEBJLz0FReqdPefkOT3PfnlN3eD9trBvX3RrONBdGA6V4YXIwWCDhnZuAJ9f8oHWAavdCk07YiqAN
@e7d
e7d / CIFS-auto-mount.md
Last active Apr 12, 2022
Auto-Mount Windows shared folders (CIFS) in Debian Stretch when network is ready
View CIFS-auto-mount.md

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 Aug 16, 2017
Visual Studio Code Personalizations (CSS and JS)
View custom.css
/**
* @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';
@e7d
e7d / tailn.bashrc
Created Jun 16, 2017
Tail with proper line breaks in log file
View tailn.bashrc
# Tail with proper line breaks in log files
function tail_linebreak() {
tail $@ | sed "s/\\\n/\\n/g"
}
alias tailn=tail_linebreak
@e7d
e7d / gen-self-cert.sh
Last active May 18, 2021
Generate self-signed certificate with OpenSSL
View gen-self-cert.sh
#!/bin/bash
# read input
domain=$1
if [ -z $domain ]; then
read -p "domain: " domain
fi
rsa=$2
if [ -z $rsa ]; then
rsa=2048 # 2048 bits by default
View gist:8e17d556921420c2a388ed10df7cdbba
### Keybase proof
I hereby claim:
* I am e7d on github.
* I am e7d (https://keybase.io/e7d) on keybase.
* I have a public key whose fingerprint is 6324 5E8E 75A6 2FA4 17C2 81D3 F320 BE00 7C0B 8881
To claim this, I am signing this object: