Skip to content

Instantly share code, notes, and snippets.

View djvdorp's full-sized avatar

Daniel van Dorp djvdorp

View GitHub Profile
@djvdorp
djvdorp / i3-gaps_installation_guide.md
Created April 10, 2019 11:48 — forked from boreycutts/i3-gaps_installation_guide.md
A simple installation guide for i3-gaps

Installing i3-gaps

Dependencies

i3-gaps has some packages that are required for it to work so install these things:

sudo apt install libxcb1-dev libxcb-keysyms1-dev libpango1.0-dev libxcb-util0-dev libxcb-icccm4-dev libyajl-dev libstartup-notification0-dev libxcb-randr0-dev libev-dev libxcb-cursor-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev autoconf xutils-dev libtool automake

You also need to install libxcb-xrm-dev, but I got Unable to locate package libxcb-xrm-dev when trying to install from the apt repositories on Ubuntu 16.04. If this happens to you, just install it from source using these commands:

mkdir tmp
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Remove Yoast SEO Title From All Pages
* Credit: Yoast Team
* Last Tested: Aug 11 2017 using Yoast SEO 5.2 on WordPress 4.8.1
*/
add_filter( 'wpseo_title', '__return_false' );
@djvdorp
djvdorp / MacBookNetworkAliveOnSleep.md
Created January 2, 2024 15:18 — forked from jyore/MacBookNetworkAliveOnSleep.md
Keep Your MacBook Network Connections Alive As It Sleeps!

MacBookNetworkAliveOnSleep

As someone that regularly has multiple SSH/VPN sessions open, it can be a huge inconvience to lose all the connections when I lock my screen to get up to go to a meeting, lunch, etc. This is especially true for those connections that require two factor authentication. So, how can I tell my MacBook to keep those connections alive, even though my screen is locked?

Well, turns out that it is pretty simple. All that is needed is to run the following command.

cd /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources
sudo ./airport en0 prefs DisconnectOnLogout=NO
@djvdorp
djvdorp / restart-php-fpm.sh
Last active July 15, 2024 15:52 — forked from zeuxisoo/restart-php-fpm.sh
Auto Restart PHP-FPM when LoadAvg15 under 1
#/bin/bash
# the load average for the last 1, 5, and 15 minutes. we get the third one:
LOAD=$(awk '{print $3}' /proc/loadavg)
if [ $(echo "$LOAD < 1" | bc) = 1 ]; then
/usr/bin/systemctl restart php-fpm
else
echo "All seems well, moving on"