Skip to content

Instantly share code, notes, and snippets.

View DavidGoodwin's full-sized avatar
🐮

David Goodwin DavidGoodwin

🐮
View GitHub Profile
@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 March 20, 2024 02:45
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 October 16, 2022 18:50
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
@okulik
okulik / elastic-ec2.md
Created April 4, 2015 11:55
ElasticSearch installation, EC2 instance provisioning, logstash configuration etc.

Provisioning EC2 instance for ElasticSearch

EC2 instance type

Use c3.xlarge instance or c3.2xlarge instance to store ElasticSearch server. We need a fair bit of RAM and computing power, as well as 2 SSD disks for storage. We need to choose exising IAM role or create a new one so that ElasticSearch can seamlessly discover other cluster nodes hosted on EC2. Also, don't forget to add both SSDs to the list of devices (/dev/sdb and /dev/sdc).

Linux system modification

Increase number of open file handles

First we need to increase system-wide file descriptor limits. To make it work temporary (will reset on the next reboot) execute from bash: