Skip to content

Instantly share code, notes, and snippets.

View macmladen's full-sized avatar

Mladen Đurić macmladen

View GitHub Profile
# Ignore configuration files that may contain sensitive information.
sites/*/settings*.php
# Ignore paths that contain user-generated content.
sites/*/files
sites/*/private
# Ignore .htaccess
# changed for server security, Options +SymLinksifOwnerMatch
#.htaccess
@macmladen
macmladen / no-ghost.sh
Last active February 17, 2016 21:53
Script that will check your system for GHOST vulerability and act upon. The code is tailored for Debian,Ubuntu and CentOS and need developer tools although, without binary it can also let you update. It will selfdestruct and clean behind. Use this in terminal: wget -q https://gist.github.com/macmladen/1c5a6fdc57bf184b24d6/raw/no-ghost.sh ; bash …
#!/bin/bash
#
# Usage:
# Just copy the following line to your terminal and it will autostart and
# remove itself afterwards
#
# wget -q https://gist.github.com/macmladen/1c5a6fdc57bf184b24d6/raw/no-ghost.sh ; bash no-ghost.sh
#
# Author: MacMladen @MacMladen (macmladen@gmail.com)
# 2015.01.28
// Find events on element http://stackoverflow.com/a/2519061/1099667
// initially with alert() but changed to console.log()
// jQuery 1.8+
$.each($("#element").data("events"), function(i, e) {
alert(i);
});
//jQuery 1.4+
$.each($("#element").data("events"), function(i, event) {
console.log(i);
$.each(event, function(j, h) {
@macmladen
macmladen / IPtables and csf.md
Last active June 28, 2022 06:35
Handling firewall blocking and unblocking, iptables, csf
@macmladen
macmladen / rsync.sh
Last active August 11, 2023 22:43
rsync exclude patterns
# /dir/ means exclude the root folder /dir
# /dir/* means get the root folder /dir but not the contents
# dir/ means exclude any folder anywhere where the name contains dir/
# Examples excluded: /dir/, /usr/share/mydir/, /var/spool/dir/
# /dir means exclude any folder anywhere where the name contains /dir
# Examples excluded: /dir/, /usr/share/directory/, /var/spool/dir/
# /var/spool/lpd//cf means skip files that start with cf within any folder within /var/spool/lpd
#
# include, +
# exclude, -
@macmladen
macmladen / Solr.md
Last active September 25, 2015 18:22
Installing Apache Solr search engine on server and integrating with Drupal
@macmladen
macmladen / Guardfile
Last active August 29, 2015 14:06
Guard file sample. This may work for any project you just need to add/customize commands for your guards. It may help to generate guard init which will create samle file first and then merge with this one (not literally!). Under comments there are some samples to give you ideas what may be done and how. You will need guard gem and plugins you ne…
# A sample Guardfile based on Omega 4.x and init result
# More info at https://github.com/guard/guard#readme
# for this file to work you need some gem-s
# copy the following without hashtag to Gemfile:
# source 'https://rubygems.org'
#
# group :development do
#
# # Sass, Compass and extensions.
Barracuda [Mon Jul 28 13:03:10 UTC 2014] ==> BOA Skynet welcomes you aboard!
Barracuda [Mon Jul 28 13:03:15 UTC 2014] ==> INFO: UPGRADE
Barracuda [Mon Jul 28 13:03:15 UTC 2014] ==> INFO: Reading your /root/.barracuda.cnf config file
Barracuda [Mon Jul 28 13:03:16 UTC 2014] ==> NOTE! Please review all config options displayed below
Barracuda [Mon Jul 28 13:03:16 UTC 2014] ==> NOTE! It will *override* all settings in the Barracuda script
Barracuda [Mon Jul 28 13:03:16 UTC 2014] ==> Legacy PHP-CLI 5.2 is not used on this system
Barracuda [Mon Jul 28 13:03:16 UTC 2014] ==> Legacy PHP-FPM 5.2 is not used on this system
@macmladen
macmladen / apache
Created April 7, 2014 08:23
Apache
# .htaccess:
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /home/gamasup/.htpasswd
AuthGroupFile /dev/null
require valid-user
# .htpasswd:
a:fNU9ioFLlnGn6
<?php
/**
* You can easily parse command line arguments into the
* $_GET variable by using the parse_str() function.
*/
parse_str(implode('&', array_slice($argv, 1)), $_GET);
/**
* PHP error reporting activation
*/