This file contains hidden or 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
%define upstream_name Sphinx-Search | |
%define upstream_version 0.28 | |
Name: perl-%{upstream_name} | |
Version: 0.28 | |
Release: 2 | |
Summary: Sphinx search engine API Perl client | |
License: GPL+ or Artistic | |
Group: Development/Perl |
This file contains hidden or 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 | |
"""Replacement for htpasswd""" | |
# Original author: Eli Carter | |
# Inspired by https://gist.github.com/eculver/1420227 | |
import crypt | |
import os | |
import sys | |
import random | |
from optparse import OptionParser |
This file contains hidden or 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/perl | |
use warnings; | |
use strict; | |
use utf8; | |
use File::Basename; | |
#--------------------------------------------------------------------- |
This file contains hidden or 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/sh | |
case $1 in | |
config) | |
cat <<'EOM' | |
graph_title Sphinx index main stats | |
graph_vlabel docs count | |
graph_category sphinx | |
documents_count.label Documents count in index | |
graph_args --base 1000 -l 0" |
This file contains hidden or 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
# nginx | |
server { | |
listen 80; | |
listen 443; | |
ssl_certificate /etc/pki/tls/certs/example.crt; | |
ssl_certificate_key /etc/pki/tls/private/example.key; | |
server_name jira.example.com; |
This file contains hidden or 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
server { | |
listen 80; | |
server_name pma.example.com; | |
access_log /var/log/nginx/pma.example.com.access.log; | |
error_log /var/log/nginx/pma.example.com.error.log; | |
root /var/www/phpmyadmin/htdocs; | |
location / { | |
index index.php; |
This file contains hidden or 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
SetEnvIfNoCase Request_URI "^/status\.php" noauth | |
AuthType Basic | |
AuthName "Identify yourself" | |
AuthUserFile /path/to/.htpasswd | |
Require valid-user | |
Order Deny,Allow | |
Deny from all | |
Allow from env=noauth |
This file contains hidden or 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
import poplib,getpass | |
M = poplib.POP3('localhost') | |
M.user('username') | |
M.pass_('password') | |
numMessages = len(M.list()[1]) | |
for i in range(numMessages): | |
for j in M.retr(i+1)[1]: |
This file contains hidden or 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
>>> d = {'Canada': 513, 'Sao Tome and Principe': 3, 'Fiji': 1, 'Montenegro': 12, 'Lithuania': 47} | |
>>> sorted_list = sorted(d, key=d.get, reverse=True) | |
>>> for i in sorted_list: | |
... print i, d[i] | |
... | |
Canada 513 | |
Lithuania 47 | |
Montenegro 12 | |
Sao Tome and Principe 3 | |
Fiji 1 |
This file contains hidden or 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/perl -w | |
# Usage: check_sphinx_search.pl INDEX QUERY MIN-RESULTS | |
# Example: check_sphinx_search.pl products iphone 15000 | |
use strict; | |
my $cmd = "search --limit 0 --index ${ARGV[0]} ${ARGV[1]}"; | |
my $min = $ARGV[2]; | |
my $output = `$cmd`; | |
if($?) { | |
bark("search command failed"); | |
} |
OlderNewer