This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ZABBIX_SENDER="/usr/local/sbin/zabbix_sender" | |
ZABBIX_TRAPPER="187.61.6.226" | |
ZABBIX_TRAPPER_PORT=10051 | |
ZABBIX_ITEM_KEY_PREFIX="memcached_" | |
ZABBIX_HOST="Memcached" | |
MEMCACHED_SERVER="localhost" | |
MEMCACHED_SERVER_PORT=11211 | |
STATS=`(sleep 1 ; echo "stats"; sleep 1; echo "quit") | telnet $MEMCACHED_SERVER $MEMCACHED_SERVER_PORT` | |
STAT //' | sed -e 's/ /:/g' | sed -e 's/:STAT:/\n/g') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""Kenneth Reitz's GitHub Syncer | |
This script uses the GitHub API to get a list of all forked, mirrored, public, and | |
private repos in your GitHub account. If the repo already exists locally, it will | |
update it via git-pull. Otherwise, it will properly clone the repo. | |
It will organize your repos into the following directory structure: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
DocumentRoot /var/www | |
<Directory /> | |
Options FollowSymLinks | |
AllowOverride None | |
Order deny,allow | |
Deny from All | |
</Directory> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DATABASE="benchmark_test_db" | |
TMP_DIR=/tmp | |
if [ ! -x "`which psql`" ]; then | |
echo "psql check failed: postgsql is needed" | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to create an RPM from source with spec file | |
# This is for Redhat versions of linux. Sometimes when you search for an rpm package, | |
# it is either outdated or not available. The only thing available is the source code. | |
# You can create a custom RPM package from source. | |
# | |
# For this example, I'll be using the latest version of Git, currently v.1.7.7.3 | |
# Step: 1 | |
# Install rpmbuild |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to create an RPM repository | |
# This is for Redhat 64 bit versions of Linux. You can create your own RPM repository # to host your custom RPM packages. | |
# | |
# See "How to create an RPM from source with spec file" for more information. | |
# https://gist.github.com/1376973 | |
# Step: 1 | |
# Install createrepo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@version: 3.0 | |
# For a description of syslog-ng configuration file directives, please read | |
# the syslog-ng Administrator's guide at: | |
# | |
# http://www.balabit.com/dl/html/syslog-ng-admin-guide_en.html/bk01-toc.html | |
# | |
# Source: https://wiki.archlinux.org/index.php/Syslog-ng | |
# | |
########################################################## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
VPN_SERVICENAME="l2tpd" | |
VPN_PSK="fuckgfw" | |
VPN_IPRANGE="10.1.100" | |
VPN_USERNAME="fill in your username" | |
VPN_PASSWORD="your password" | |
#L2TPD/IPSEC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.Collection.find({ | |
created_at : { | |
'$gte': new Timestamp(new Date(2012, 0, 21), 0), | |
'$lte': new Timestamp(new Date(2012, 0, 22), 0) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from urllib2 import urlopen | |
import json | |
import pysqlite2.dbapi2 as dbapi | |
s = urlopen('http://localhost:8888/sensor/3bf0b9c10449b96ab972425045e36106').read() | |
data = json.loads(s) |
OlderNewer