Skip to content

Instantly share code, notes, and snippets.

@rbdcti
rbdcti / firewall.sh
Created April 5, 2012 18:25
iptables firewall script
# Drop ICMP echo-request messages sent to broadcast or multicast addresses
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
# Drop source routed packets
echo 0 > /proc/sys/net/ipv4/conf/all/accept_source_route
# Enable TCP SYN cookie protection from SYN floods
echo 1 > /proc/sys/net/ipv4/tcp_syncookies
# Don't accept ICMP redirect messages
@rbdcti
rbdcti / gist:2275369
Created April 1, 2012 13:41
Fixed mikoomi mongodb
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export version="1.0" date="19.10.10" time="17.35">
<hosts>
<host name="Template_MongoDB">
<proxy_hostid>0</proxy_hostid>
<useip>1</useip>
<dns></dns>
<ip>127.0.0.1</ip>
<port>10050</port>
<status>3</status>
@rbdcti
rbdcti / gist:1723790
Created February 2, 2012 14:46
mongoengine reconnect
from pymongo.cursor import Cursor
from pymongo.connection import Connection
from pymongo.errors import AutoReconnect
import pymongo
import time
import functools
import logging
MAX_AUTO_RECONNECT_ATTEMPTS = 5
@rbdcti
rbdcti / excludeFromGA.html
Created January 27, 2012 13:42
Exclude multiple sites from Google Analytics
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- See http://www.alwaysgoingnorth.com/exclude-your-visits-from-google-analytics-even-if-you-have-a-dynamic-ip/ for how to use this -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Environment:
Request Method: GET
Request URL: http://d01.apptend.com/m/pages
Django Version: 1.3
Python Version: 2.7.1
Installed Applications:
['django.contrib.auth',
@rbdcti
rbdcti / gist:1120342
Created August 2, 2011 14:50 — forked from yuribossa/gist:716577
Simple Popup Message based on jQuery Mobile - supports modal windows optionally (requires jqModal)
function jqmSimpleMessageRemove(dialogID) {
/* optionally call this function to destroy a window made with jqmSimpleMessage
* especially useful if your timeout val is long and the window is shown modally
*/
var dialog = $('#' + dialogID);
if(!dialog)
return;
if(dialog.attr('_type') == 'modal') {