Skip to content

Instantly share code, notes, and snippets.

View aristipp's full-sized avatar

Christian Glasmeyer aristipp

View GitHub Profile
@angela-d
angela-d / README.md
Last active October 14, 2023 23:24
Allow Non-root users acess to Apache logs

Non-root user access to Apache logs

Instructions applicable for Debian or Debian deriatives like Ubuntu. To use for other distros or directories, simply switch the affected directories in the steps.

In this example, the user group is "angela," change that to whatever group you wish to grant access, like "devs"

As root, set the acl:

setfacl -m g:angela:rx /var/log/apache2/*
@lzhengqc
lzhengqc / ubuntu-webmin.yml
Last active March 16, 2024 15:55 — forked from LTGIV/ubuntu-webmin.yml
Ansible playbook: install Webmin on Ubuntu
---
#
# Ansible playbook: Webmin for Ubuntu v201501302302
# Louis T. Getterman IV (@LTGIV)
# www.GotGetLLC.com / www.opensour.cc
#
# Example Usage:
# [user@host ~$] ansible-playbook /etc/ansible/playbooks/webmin.yml --extra-vars 'target=nameFromHostsFile'
#
- hosts: '{{ target }}'
@Kovah
Kovah / mysql-levenshtein.sql
Created February 22, 2017 21:29
Levenshtein function for MySQL
-- Levenshtein function
-- Source: https://openquery.com.au/blog/levenshtein-mysql-stored-function
-- Levenshtein reference: http://en.wikipedia.org/wiki/Levenshtein_distance
-- Arjen note: because the levenshtein value is encoded in a byte array, distance cannot exceed 255;
-- thus the maximum string length this implementation can handle is also limited to 255 characters.
DELIMITER $$
DROP FUNCTION IF EXISTS LEVENSHTEIN $$
CREATE FUNCTION LEVENSHTEIN(s1 VARCHAR(255) CHARACTER SET utf8, s2 VARCHAR(255) CHARACTER SET utf8)
@vivianspencer
vivianspencer / server_hardening.md
Last active February 17, 2022 13:29
Debian 8 Hardening

Debian 8 Hardening

  1. Update root's mail recipient. Open /etc/aliases replacing administrator@example.tld with an administrator's email address. This is where logs will be emailed.

    root:     administrator@example.tld
    
  2. Update the the default umask to 027. Edit the file /etc/init.d/rc and change the following setting:

umask 027

@jlazic
jlazic / haconfig.sh
Created March 9, 2015 20:02
Split monolithic HAProxy configuration
#!/bin/bash
#Requirements: etckeeper, diffcolor
#This script concatenates multiple files of haproxy configuration into
#one file, and than checks if monolithic config contains errors. If everything is
#OK with new config script will write new config to $CURRENTCFG and reload haproxy
#Also, script will commit changes to etckeeper, if you don't use etckeeper you
#should start using it.
#Script assumes following directory structure:
#/etc/haproxy/conf.d/
@jamesmacwhite
jamesmacwhite / hiding-content-outlook-webmail.html
Last active October 12, 2023 11:05
Hiding content with mso-hide:all; to be more friendly with Outlook.com
<!--
Example 1: Using IF ELSE logic
Works with Outlook (Desktop)?: Yes
Works with Outlook.com?: No
When using IF ELSE logic, Outlook.com will remove content in both conditionals, which is problematic.
-->
<!--[if mso]>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
@garrettreid
garrettreid / SSHA512_gen.py
Created January 9, 2014 05:26
Create a salted SHA512 password hash for use with Dovecot
#!/usr/bin/python
import os
import hashlib
import getpass
import base64
password1 = None
password2 = None
@hindol
hindol / sudoers
Last active January 30, 2024 00:27
How to setup proxy for `sudo` environment. Tested for `Ubuntu` and `Linux Mint`.
# The following should be in `/etc/sudoers`. To edit `/etc/suoders` use the command `sudo visudo` in a terminal.
# *Do NOT attempt to modify the file directly*
Defaults env_reset
Defaults mail_badpass
Defaults env_keep+="http_proxy ftp_proxy all_proxy https_proxy no_proxy" # Add this line
...