Skip to content

Instantly share code, notes, and snippets.

View milosdjakonovic's full-sized avatar

Miloš Đakonović milosdjakonovic

  • Belgrade, Republic of Serbia
View GitHub Profile
@ElliotNB
ElliotNB / notify.sh
Last active December 5, 2023 02:35
Email sysadmin on every login from a new IP address
#!/bin/bash
##
## New IP login notification script
## 2009-11-20 00:28 Samuele ~redShadow~ Santi
## 2018-06-04 12:53 ElliotNB
## 2018-10-17 17:55 ElliotNB - bug fixes for non-interactive sessions and `sudo su` commands
## Licensed under GPL
##
## This script will email the contact specified below whenever
## a user logs into the system from a new IP address. The email will contain the
/* Usage: $.selectorCache('#element')
* or to refresh cache: $.selectorCache('#element', true)
*
* Credit: https://ttmm.io/tech/selector-caching-jquery/
*/
(function($){
var debug = false;
function SelectorCache() {
var collection = {};
@odan
odan / xampp_php7_xdebug.md
Last active April 17, 2024 05:36
Installing Xdebug for XAMPP
@haisum
haisum / postfix-dovecot-ubuntu14.04.sh
Last active February 7, 2024 08:37
Automated bash script to setup dovecot postfix mysql email server on ubuntu 14.04
#!/usr/bin/env bash
#####
# Script to install postfix
#####
DOMAIN="example.com"
EMAIL="haisum@example.com"
PASSWORD="example.com1*"
@plepe
plepe / gist:52ecc9f18efb32c68d18
Last active October 23, 2023 08:50
MDADM and LVM cheat sheet

mdadm

Glossary:

  • md: multiple devices
command description
cat /proc/mdstat show status of all raids
mdadm --detail /dev/md0 detailed status of raid md0
@heijmerikx
heijmerikx / Installing and configuring Postfix Dovecot Spamassasin.md
Last active June 5, 2018 00:33
Postfix Dovecot Spamassassin Roundcube installation/configuration

#Installing configuring Postfix/Dovecot/Spamassassin/Roundcube

I've documented the steps in short to help me reproduce all the steps. Published it here for improvement and as a reference for others. Of course feel free to comment to improve this document.

This Gist is quite big and not all details are fully explained. But if you're going to run a mailserver you should be able to fill in the missing parts. The most important are covered. But be sure to read up to understand the meaning of all the stuff you configure. Since I used a lot of references of other sources (See at the end) I left out a lot of explanation in this document.

Don't forget that I'm not a Postfix/Dovecot/Spamassasin pro either. I just got it working the way I wanted to.

  • Used Ubuntu 12.04 LTS.
  • Set a root password.
@Spea
Spea / README.md
Created May 10, 2012 20:49
Script to auto reply emails.

General

This script can be used in conjunction with the ISPmail tutorial and the Roundcube autoreply plugin

Installation

Database setup

Create the following table in the database where you created the tables from the ISPmail tutorial.

@eikes
eikes / getElementsByClassName.polyfill.js
Created April 4, 2012 08:04
Polyfill for getElementsByClassName
// Add a getElementsByClassName function if the browser doesn't have one
// Limitation: only works with one class name
// Copyright: Eike Send http://eike.se/nd
// License: MIT License
if (!document.getElementsByClassName) {
document.getElementsByClassName = function(search) {
var d = document, elements, pattern, i, results = [];
if (d.querySelectorAll) { // IE8
return d.querySelectorAll("." + search);
@mathiasbynens
mathiasbynens / jquery.fluid-youtube-videos-original.js
Created June 8, 2011 13:07
Fluid width YouTube videos of different aspect ratios, by Chris Coyier
// Original code from http://css-tricks.com/examples/FluidWidthYouTube/iframe.php
$(function() {
// find all videos
var allVideos = $("iframe[src^='http://www.youtube.com']"),
// The thing that is fluid width
body = $("body"),
@ded
ded / domready.js
Created February 24, 2011 08:46
Smallest x-browser DOM Ready, ever
function r(f){/in/(document.readyState)?setTimeout(r,9,f):f()}