Skip to content

Instantly share code, notes, and snippets.

View petervansark's full-sized avatar

Peter van Sark petervansark

View GitHub Profile
@Cojad
Cojad / fpm_get_status_with_auth.php
Last active June 2, 2025 13:56 — forked from EhsanCh/fpm_get_status.php
PHP-FPM real-time status page (Single file without the need for web server configuration) with simple auth
<?php
// Use HTTP Basic Authentication for verification
$username = 'admin';
$password = 'Passw0rd!'; // Please use your own password!!
// Check if the client has provided correct credentials
if (!isset($_SERVER['PHP_AUTH_USER']) || $_SERVER['PHP_AUTH_USER'] !== $username || $_SERVER['PHP_AUTH_PW'] !== $password) {
// Send authentication request headers
header('WWW-Authenticate: Basic realm="Restricted Area"');
header('HTTP/1.0 401 Unauthorized');
@bacoords
bacoords / twitter-font-awesome-4.css
Last active July 16, 2025 08:04
Update the Twitter / X Icon in Font Awesome 4
.fa.fa-twitter{
font-family:sans-serif;
}
.fa.fa-twitter::before{
content:"𝕏";
font-size:1.2em;
}
@saiful7
saiful7 / imapsync.md
Created January 11, 2023 20:44 — forked from nosmall/imapsync.md
Imapsync on Ubuntu 20.04 (lazy guide)

Imapsync on Ubuntu 20.04 (lazy guide)

sudo apt install -y libauthen-ntlm-perl libclass-load-perl libcrypt-ssleay-perl libdata-uniqid-perl libdigest-hmac-perl libdist-checkconflicts-perl libencode-imaputf7-perl libfile-copy-recursive-perl libfile-tail-perl libio-compress-perl libio-socket-inet6-perl libio-socket-ssl-perl libio-tee-perl libmail-imapclient-perl libmodule-scandeps-perl libnet-dbus-perl libnet-ssleay-perl libpar-packer-perl libreadonly-perl libregexp-common-perl libsys-meminfo-perl libterm-readkey-perl libtest-fatal-perl libtest-mock-guard-perl libtest-mockobject-perl libtest-pod-perl libtest-requires-perl libtest-simple-perl libunicode-string-perl liburi-perl libtest-nowarnings-perl libtest-deep-perl libtest-warn-perl make cpanminus && \
cd ~/ && \
git clone https://github.com/imapsync/imapsync.git && \
cd ~/imapsync/ && \
sudo ln -s ~/imapsync/imapsync /usr/bin/imapsync && \
imapsync --testslive

Estimation

This document is an attempt to pin down all the things you don't think about when quoting for a project, and hopefully provide a starting point for some kind of framework to make quoting, working and delivering small-medium jobs more predictable and less stressful.

Contents

@davecoutts
davecoutts / unifi_ubuntu_2004.sh
Last active April 3, 2025 03:41
Install Ubiquiti Unifi Controller on Ubuntu 20.04
# Install Ubiquiti Unifi Controller on Ubuntu 20.04.
# As tested on a fresh install of ubuntu-20.04.1-live-server, August 22nd 2020.
# Thanks to https://gist.github.com/tmuncks for posting the updated install steps.
sudo apt update
sudo apt install --yes apt-transport-https
echo 'deb https://www.ui.com/downloads/unifi/debian stable ubiquiti' | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.list
sudo wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ui.com/unifi/unifi-repo.gpg
@chrisdavidmiles
chrisdavidmiles / bulk_dig.sh
Last active September 9, 2024 16:48
Bulk DNS Lookup bash script
#!/bin/bash
# Bulk DNS Lookup
# Generates a CSV of DNS lookups from a list of domains.
#
# File name/path of domain list:
domain_list='domains.txt' # One FQDN per line in file.
#
# IP address of the nameserver used for lookups:
ns_ip='1.1.1.1' # Is using Cloudflare's 1.1.1.1.
#
@jartes
jartes / wc-add-button-cart-item.php
Created March 25, 2014 17:58
WooCommerce - Add "update cart" button on all cart items . Props igmoweb
<?php
function fanatic_add_update_cart_item( $product_quantity, $cart_item_key ) {
global $woocommerce;
$cart = $woocommerce->cart->get_cart();
$product = $cart[ $cart_item_key ]['data'];
$product_id = $product->id;
if ( $product->is_sold_individually() === false ) {
$product_quantity .= '<input type="submit" class="update-qty" name="update_cart" value="'.__( 'Update Cart', 'woocommerce' ).'" />';
}
return $product_quantity;
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a