Skip to content

Instantly share code, notes, and snippets.

View DavidGoodwin's full-sized avatar
🐮

David Goodwin DavidGoodwin

🐮
View GitHub Profile
@timothyham
timothyham / ipv6guide.md
Last active November 14, 2024 21:08
A Short IPv6 Guide for Home IPv4 Admins

A Short IPv6 Guide for Home IPv4 Admins

This guide is for homelab admins who understand IPv4s well but find setting up IPv6 hard or annoying because things work differently. In some ways, managing an IPv6 network can be simpler than IPv4, one just needs to learn some new concepts and discard some old ones.

Let’s begin.

First of all, there are some concepts that one must unlearn from ipv4:

Concept 1

@yajrendrag
yajrendrag / README.md
Last active December 1, 2023 12:51
postfixadmin guide for ISPMail

Background

I first came across PostfixAdmin upon implementing my first mailserver using this guide - https://www.exratione.com/2016/05/a-mailserver-on-ubuntu-16-04-postfix-dovecot-mysql/ and it's successor on Ubuntu 18.04. With the release of Ubuntu 20.04.1, i began looking around for an update and came upon the ISPMail guide as it had a few things I had wanted to try out - namely, rspamd, and encryption. But i wanted to be able to continue to use PostfixAdmin as i wanted to preserve the GUI administration of the database. So i began to implement the guide and figure out how i could integrate PostfixAdmin into it. This is the result.

Assumptions

  1. PostfixAdmin sets up the database schema (ie, no need to manually create the database tables with SQL)
  2. Presumption in guide below is that the Apache document root is /var/www/html
  3. For support of encryption, part 2 of guide below shows how to modify PostfixAdmin (& roundcube) to generate / modify user encryption keys, so once a user's account is setup,
@mortenson
mortenson / notes.md
Last active August 26, 2023 03:35
Dell XPS 13 9300 Ubuntu setup notes

Random notes from woring with a new XPS 13 9300 with Ubuntu

Notes from when I was on the default Dell OEM Ubuntu

Disable trackpad middle click:

sudo vim /usr/share/X11/xorg.conf.d/40-libinput.conf

Add Option "ButtonMapping" "1 1 3 4 5" under

@ruanbekker
ruanbekker / cheatsheet-elasticsearch.md
Last active October 26, 2024 17:40
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
@koheyamada
koheyamada / エラー
Created August 3, 2017 06:41
Error 'Table 'mysql.rds_heartbeat2' doesn't exist' on query. Default database: 'mysql'. Query: 'INSERT INTO mysql.rds_heartbeat2(id, value) values (1,1493274809584) ON DUPLICATE KEY UPDATE value = 1493274809584' ref: http://qiita.com/kooohei/items/34beab9db6951938d6fd
Error 'Table 'mysql.rds_heartbeat2' doesn't exist' on query. Default database: 'mysql'. Query: 'INSERT INTO mysql.rds_heartbeat2(id, value) values (1,1493274809584) ON DUPLICATE KEY UPDATE value = 1493274809584'
@waja
waja / create_debian-sys-maint_for_mysqladmin.sh
Last active April 18, 2022 18:57
Create 'debian-sys-maint' MariaDB user for use of mysqladmin. Just in case you can't use 'root' via 'unix_socket' plugin.
#!/bin/sh
MYSQLADMIN_CFG="/etc/mysql/mariadb.conf.d/90-mysqladmin.cnf"
# generate password
PASS=$(perl -e 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..16)');
# adjust /etc/mysql/debian.cnf (used as defaults file by system scripts)
sed -i "s/^password =.*$/password = ${PASS}/" /etc/mysql/debian.cnf
sed -i "s/^user =.*$/user = debian-sys-maint/" /etc/mysql/debian.cnf
# create config file for mysqladmin itself (maybe not needed)
umask 066
cat > ${MYSQLADMIN_CFG} <<EOF
@avafloww
avafloww / PhpJava.java
Last active June 13, 2024 07:36
This snippet of code is syntactically valid in both PHP and Java, and produces the same output in both.
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
static function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();
@Manc
Manc / consul.service
Last active July 15, 2020 03:03 — forked from yunano/consul.service
/etc/systemd/system/consul.service
[Unit]
Description=Consul service discovery agent
Requires=network-online.target
After=network.target
[Service]
User=consul
Group=consul
PIDFile=/run/consul/consul.pid
Restart=on-failure
@nurtext
nurtext / .htaccess
Last active May 1, 2023 19:24
Tell apache we're on HTTPS if reverse proxy is serving the site using SSL
# Let apache know we're behind a SSL reverse proxy
SetEnvIf X-Forwarded-Proto "https" HTTPS=on
# Redirect to HTTPS
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP:X-Forwarded-Proto} !https [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IFModule>
@warewolf
warewolf / block_callers.md
Created May 11, 2015 14:51
How I block incoming calls in Asterisk

My incoming calls land in the context from-trunk

Config to block calls

/etc/asterisk/extensions.conf

[from-trunk]
...
 same =>    n,GotoIf($[${DB(blockcaller/${CALLERID(num)})} = 1 ]?blocked)
 same =&gt; n(blocked),Hangup