Skip to content

Instantly share code, notes, and snippets.

View anon5r's full-sized avatar

anon anon5r

View GitHub Profile
@anon5r
anon5r / anti_japanese_featurephone.conf
Last active August 29, 2015 13:56
ガラケー対応はこのApacheの設定だけで充分!
BrowserMatch "^DoCoMo/[1-2]\.0" Browser_FP=1
BrowserMatch "^UP\.Browser/[1-9]\.[0-9]" Browser_FP=1
BrowserMatch "^KDDI-[A-Z0-9]+ UP\.Browser/[1-9]\.[0-9]" Browser_FP=1
BrowserMatch "^J-PHONE/1\.0" Browser_FP=1
BrowserMatch "^Vodafone/[1-2]\.0" Browser_FP=1
BrowserMatch "^SoftBank/[1-9]\.0" Browser_FP=1
<If Browser_FP>
RewriteEngine On
RewriteRule /* /unsupported.html [L]
</If>
#!/usr/bin/env ruby
# iOS App Store Crawler by Nowa <nowazhu@gmail.com>
# 2010-08-04
require 'rubygems'
require 'hpricot'
require 'open-uri'
USERAGENT = 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.99 Safari/533.4'
LETTERS = %w{A B C D E F G H I J K L M N O P Q R S T U V W X Y Z *}
@anon5r
anon5r / nginx.conf
Last active August 29, 2015 13:58
Can not be browsing safety internet using Windows XP.
server {
set $browse_os "";
if ($uri !~ ^/support_for_windows_xp_has_ended){
set $browse_os "X";
}
if ($http_user_agent ~ "Windows NT 5\.[12]") {
set $browse_os "${browse_os}P";
}
if ($browse_os = "XP"){
return 302 /support_for_windows_xp_has_ended;
@anon5r
anon5r / randomString.js
Created November 27, 2014 03:10
Random strings generator
function randomString(length,numNumeric,numLCase,numUCase,numSymbols){
length=length||16;numNumeric=numNumeric||3,numLCase=numLCase||3,numUCase=numUCase||3,numSymbols=numSymbols||3;
var charsList = [
'0123456789',
'abcdefghijklmnopqrstuvwxyz',
'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
'!"#$%&\'()*+,-./\\:;<=>?@[]^_`{|}~'
],
charLength = [numNumeric,numLCase,numUCase,numSymbols],
str="",i=0;
@anon5r
anon5r / patchwork.py
Created February 25, 2010 03:38 — forked from oquno/patchwork.py
def create_cell():
cell =[]
for line in open('p.txt', 'r'):
line = list(line.rstrip())
cell.append(line)
return cell
def chaise(cell, x, y):
if cell[x][y] == 'c':
return False
@anon5r
anon5r / solr-searcher.sh
Created August 7, 2012 06:55
Start Daemon for Apache Solr Searcher
#!/bin/sh
#
# chkconfig: - 90 20
# description: apache-solr
#
if [ -f /etc/rc.d/init.d/functions ]; then
# Source function library.
. /etc/rc.d/init.d/functions
elif [ -f /etc/rc.status ]; then
@anon5r
anon5r / latestlog.sh
Created August 23, 2012 10:42
Show latest log for nginx (access.log or error.log)
#!/bin/sh
#
# args[1] : hostname
# args[2] : access | error
# args[3] : date[yyyy/mm]
#
filehost="*"
filetype="access"
#!/bin/bash
# for use with cron, eg:
# 0 3 * * * root /home/www/batch/bin/backup.sh /var/backup/www
if [[ -z "$1" ]]; then
echo "Usage: $0 <PATH>"
exit 1
fi
@anon5r
anon5r / transparent_checker.css
Created March 4, 2013 04:41
グラフィックソフトの透過背景を表すのに使われるチェック柄(市松模様)のアレをCSSだけで再現する
body {
margin: 0;
padding: 0;
background-color: #fff;
background-image: linear-gradient(45deg, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%, #ddd),
linear-gradient(45deg, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%, #ddd);
background-size: 18px 18px;
background-position: 0 0, 9px 9px;
overflow: hidden;
}
@anon5r
anon5r / gitlab_update.sh
Last active December 17, 2015 16:39
GitLab Auto Updater
#!/bin/sh
BRANCH=master
if [ $# -ge 1 ]; then
BRANCH=$1
fi
if [ "$SUDO_USER" != "" ] && [ "$SUDO_USER" != "git" ]; then
echo 'You are not user "git".'