Skip to content

Instantly share code, notes, and snippets.

View sitedata's full-sized avatar
🎯
Focusing

Larry Johnson sitedata

🎯
Focusing
View GitHub Profile
@robinsmidsrod
robinsmidsrod / dhcpd.conf
Last active January 5, 2025 20:44
Trying to chainload iPXE with full feature set from a lesser featured one, whilst still being able to boot non-supported cards with UNDI
ddns-update-style none;
deny bootp; #default
authoritative;
include "/etc/dhcp/ipxe-option-space.conf";
# GREEN (private network)
subnet 10.1.1.0 netmask 255.255.255.0 {
range 10.1.1.100 10.1.1.199;
option subnet-mask 255.255.255.0;
@adriengibrat
adriengibrat / l.php
Last active January 22, 2024 14:45
Extreme minification of shortest possible PSR-0 compliant autoloader, 5 lines !
<?php
//set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__); // optional
spl_autoload_register(function ($class) {
$file = preg_replace('#\\\|_(?!.+\\\)#','/', $class) . '.php';
if (stream_resolve_include_path($file))
require $file;
});
@BenMorel
BenMorel / dbt2.patch
Last active November 17, 2023 22:00
Downloads and runs the DBT2 benchmark for MySQL.
From 664f364c5c08a4bcb51d8ebdda2f72b9e8f8d491 Mon Sep 17 00:00:00 2001
From: Benjamin Morel <[email protected]>
Date: Sun, 17 Sep 2023 14:50:28 +0200
Subject: [PATCH] Patch
---
scripts/mysql/mysql_load_db.sh | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/scripts/mysql/mysql_load_db.sh b/scripts/mysql/mysql_load_db.sh
@zmwangx
zmwangx / Postfix: relay to authenticated SMTP.md
Created August 3, 2014 18:28
Postfix: relay to authenticated SMTP.
  1. Taking Gmail as an example, put the following into /etc/postfix/main.cf.

     relayhost = [smtp.gmail.com]:587
     smtp_sasl_auth_enable = yes
     smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
     smtp_sasl_security_options = noanonymous
     smtp_sasl_mechanism_filter = plain
     smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt
     smtp_use_tls = yes
    

smtp_tls_security_level = encrypt

@tankbar
tankbar / wp-google-tag-manager
Last active January 23, 2024 11:17
Add Google Tag Manager in WordPress with hooks and actions
<?php
/* ADD GTM TO HEAD AND BELOW OPENING BODY */
add_action('wp_head', 'google_tag_manager_head', 20);
function google_tag_manager_head() { ?>
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
@jarek-przygodzki
jarek-przygodzki / iptables-reset.sh
Last active February 28, 2023 21:58
Reset iptables rules (IPv4, IPv6)
iptables -P INPUT ACCEPT && \
iptables -P FORWARD ACCEPT && \
iptables -P OUTPUT ACCEPT && \
iptables -F INPUT && \
iptables -F OUTPUT && \
iptables -F FORWARD && \
iptables -F && \
iptables -t nat -F && \
iptables -t mangle -F && \
iptables -X && \
@aedm
aedm / kickstart-ubuntu-docker-mongodb.sh
Last active November 17, 2022 11:57
Installs Docker & Nginx on Ubuntu 16.04, starts MongoDB container
#!/bin/sh
# curl {URL to this script} | sh -s
# install docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
apt-cache policy docker-ce
sudo apt-get install -y docker-ce
sudo systemctl status docker
#!/usr/bin/env bash -x
# Creates RAM disk.
#
# SYNOPSIS
# create_ramdisk [size [label]]
#
# OPTIONS
# size: RAM disk size in megabytes. Default: 1024
# label: RAM disk volume label. Default: UUID

Keybase proof

I hereby claim:

  • I am radwebhosting on github.
  • I am rwh (https://keybase.io/rwh) on keybase.
  • I have a public key whose fingerprint is 128B 45D5 13AE 66AA B2BC 28F0 A817 08EE 5E7B 1B60

To claim this, I am signing this object:

@sclaeys
sclaeys / request.txt
Created July 12, 2018 23:45
Premium URL Shortener API Request
GET http://webz.cc/api?key=APIKEY&url=THELONGURLTOBESHORTENED&custom=CUSTOMALIAS