Skip to content

Instantly share code, notes, and snippets.

View Fahl-Design's full-sized avatar

Ben Fahl-Design

View GitHub Profile
@Fahl-Design
Fahl-Design / tunnelPlumber.sh
Last active May 2, 2023 11:04
fix tunsnx interfaces created with linux kernel 5.9 or later Usage: [dry_run=1] [debug=1] [interface=tunsnx] tunnelPlumber.sh
#!/usr/bin/env bash
#
# Usage: [dry_run=1] [debug=1] [interface=tunsnx] docker-fix-snx
#
# Credits to: https://github.com/docker/for-linwux/issues/288#issuecomment-825580160
#
# Env Variables:
# interface - Defaults to tunsnx
# dry_run - Set to 1 to have a dry run, just printing out the iptables command
# debug - Set to 1 to see bash substitutions
@breml
breml / script-template.sh
Last active January 8, 2021 21:49 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-d] [--no-color] [-f] -p param_value arg1 [arg2...]
@m-radzikowski
m-radzikowski / script-template.sh
Last active May 4, 2024 04:13
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@bittner
bittner / 60-jetbrains.conf
Created September 25, 2015 07:57
Inotify configuration for IntelliJ IDEA (PhpStorm, PyCharm, RubyMine, WebStorm). Create this file with e.g. `sudo vim /etc/sysctl.d/60-jetbrains.conf`
# Set inotify watch limit high enough for IntelliJ IDEA (PhpStorm, PyCharm, RubyMine, WebStorm).
# Create this file as /etc/sysctl.d/60-jetbrains.conf (Debian, Ubuntu), and
# run `sudo service procps start` or reboot.
# Source: https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit
#
# More information resources:
# -$ man inotify # manpage
# -$ man sysctl.conf # manpage
# -$ cat /proc/sys/fs/inotify/max_user_watches # print current value in use
@edwardbeckett
edwardbeckett / idea64.exe.vmoptions
Last active March 22, 2024 20:18
Java 8 Intellij 64 JVM Options
-server
-Xms2g
-Xmx2g
-Xss16m
-XX:+UseConcMarkSweepGC
-XX:+CMSParallelRemarkEnabled
-XX:ConcGCThreads=4
-XX:ReservedCodeCacheSize=128m
-XX:+AlwaysPreTouch
-XX:+TieredCompilation
@dnozay
dnozay / _Jenkins+Script+Console.md
Last active June 5, 2024 17:43
jenkins groovy scripts collection.
@ericchen
ericchen / auto_zoom_markers.js
Created July 5, 2013 09:53
Auto Zoom To Fit All Markers on Google Maps API v3
var LatLngList = new Array (new google.maps.LatLng (52.537,-2.061), new google.maps.LatLng (52.564,-2.017));
// Create a new viewpoint bound
var bounds = new google.maps.LatLngBounds ();
// Go through each...
for (var i = 0, LtLgLen = LatLngList.length; i < LtLgLen; i++) {
// And increase the bounds to take this point
bounds.extend (LatLngList[i]);
}
// Fit these bounds to the map
map.fitBounds (bounds);
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 21, 2024 01:45
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname