Skip to content

Instantly share code, notes, and snippets.

View frugan-dev's full-sized avatar
🍎
VegDev

Frugan frugan-dev

🍎
VegDev
View GitHub Profile
@mahemoff
mahemoff / Ansible Disk Check
Last active February 6, 2024 23:33
Show disk space and warn about disk full in Ansible
* Shows a message while asserting like:
ok: [host] => {
"msg": "disk usage 4.2B of total 20.0GB (21.0%) (should be within limit 90.0%)"
}
* Note this only looks at first mount point on current node
* Fails if disk is near-full
* Last step pushes to a push-based monitoring service, which will alert us if it doesn't get there after some time
* Need to setup a variable `disk_limit`, which is the max acceptable usage ratio, e.g. set it to 0.8 if you want to keep disks within 80% of max size
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active July 22, 2024 06:03
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@roylee0704
roylee0704 / dockergrep.sh
Created December 9, 2016 08:24
how to grep docker log
docker logs nginx 2>&1 | grep "127."
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container
@BretFisher
BretFisher / docker-swarm-ports.md
Last active June 11, 2024 14:06
Docker Swarm Port Requirements, both Swarm Mode 1.12+ and Swarm Classic, plus AWS Security Group Style Tables

Docker Swarm Mode Ports

Starting with 1.12 in July 2016, Docker Swarm Mode is a built-in solution with built-in key/value store. Easier to get started, and fewer ports to configure.

Inbound Traffic for Swarm Management

  • TCP port 2377 for cluster management & raft sync communications
  • TCP and UDP port 7946 for "control plane" gossip discovery communication between all nodes
  • UDP port 4789 for "data plane" VXLAN overlay network traffic
  • IP Protocol 50 (ESP) if you plan on using overlay network with the encryption option

AWS Security Group Example

@rcubetrac
rcubetrac / rcabook-setup.sh
Created April 6, 2016 20:55
Roundcube LDAP Setup
#!/bin/bash
#------------configuration--------------------------------
# the url of the openldap server
server="ldap://localhost:389";
# the static config file of openldap
config="/etc/ldap/slapd.conf";
# the LDAP base suffix and admin rootdn
@Shaltz
Shaltz / gist:1d65a07a0901a36fb7f1
Created September 16, 2015 09:02
HOW TO fix openLDAP checksum error on config files
(source : http://injustfiveminutes.com/category/openldap)
How to fix “ldif_read_file: checksum error”
Posted on October 28, 2014
15
Well, in spite of you did read a banner saying “# AUTO-GENERATED FILE – DO NOT EDIT!! Use ldapmodify.” you ignored it and made some manual modifications in any of the LDIF files in /etc/ldap/slapd.d/.
Don’t worry it happened to me too :) When you need to quickly setup an openLDAP server for development it is pretty much easier to tweak these files although the recommended way is to use ldapmodify tool. But if you change the LDIF files in cn=config manually, their contents and checksums won’t match, which is not fatal, but is annoying when using tools such as slapcat:
@seanmcn
seanmcn / gist:62a021a765ad4f8e593b
Last active July 20, 2024 16:30
The Perfect Web Server - Nginx, Ajenti, Ubuntu
#Insall Ajenti
apt-get update
wget http://repo.ajenti.org/debian/key -O- | apt-key add -
echo "deb http://repo.ajenti.org/ng/debian main main ubuntu" >> /etc/apt/sources.list
apt-get update
apt-get install ajenti
service ajenti restart
# Uninstall Apache2
sudo apt-get autoremove && sudo apt-get remove apache2*
@janogarcia
janogarcia / email_coding_guidelines.md
Last active July 13, 2024 08:44
Email Coding Guidelines
@malias
malias / dnsbl_check_beta_lb.sh
Last active December 3, 2022 14:05
Check RBLs with multiple IPs -
#!/bin/sh
####
# Titel dnsbl_check
# Descritption This Script checks multiple ips and blacklist
####
# Mail recipients (multiple mail addresses separated by whitespace)
mail=''
# Logfiles
LogFile='/tmp/rbltemp.log'
LogRBLfile='/var/log/rblfound.log'