Skip to content

Instantly share code, notes, and snippets.

View itxx00's full-sized avatar
✈️
keep working

itxx00 itxx00

✈️
keep working
View GitHub Profile
@itxx00
itxx00 / dns.sql
Created May 14, 2014 15:16
dns bind mysql
-- MySQL dump 10.13 Distrib 5.1.61, for redhat-linux-gnu (x86_64)
--
-- Host: localhost Database: dnsdata
-- ------------------------------------------------------
-- Server version 5.1.61
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
@itxx00
itxx00 / php.ini
Last active August 29, 2015 14:01
kb5
; 找到其中
disable_functions =
; 替换为
disable_functions = fsockopen,pfsockopen,chgrp,chown,chroot,closelog,dl,exec,ini_alter,ini_restore,openlog,passthru,popen,popepassthru,posix_kill,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,putenv,readlink,scandir,shell_exec,stream_socket_server,symlink,sys_getloadavg,syslog,system,virtual
@itxx00
itxx00 / 2-setenv.sh
Created June 4, 2014 15:49
zabbix tomcat
CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=false"
<?
/**
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@itxx00
itxx00 / comjscss.py
Created July 24, 2014 06:06
a script for js/css compress
#!/usr/bin/env python
#coding:utf-8
'''Compress js and css file.
usage:
compjscss.py dir
will compress all css/js in dir and save to dir_min/
'''
import requests
@itxx00
itxx00 / hello.py
Created November 10, 2014 16:20
ansible hello world module
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, itxx00 <itxx00@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
@itxx00
itxx00 / mysql_bench.sh
Created December 18, 2014 06:54
mysql_bench.sh
#!/bin/bash
#
sync && sync
case $1 in
select)
echo 3 > /proc/sys/vm/drop_caches
mysqlslap --no-defaults --concurrency=50 --engine=innodb --auto-generate-sql --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=key --auto-generate-sql-write-number=100000 --number-of-queries=300000
echo 3 > /proc/sys/vm/drop_caches
;;
insert)
@itxx00
itxx00 / hosts_m.sh
Created January 9, 2015 03:57
manage /etc/hosts file
#!/bin/bash
# manage /etc/hosts
isIp() {
# test variable is an ip address or not
# true: return 0
# false: return 1
local ip=$1
local stat=1
if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
OIFS=$IFS
@itxx00
itxx00 / idig.sh
Created January 15, 2015 05:14
a wrapper for dig command
#!/bin/sh
[ -z $1 ] || dig +nocmd +noall +answer +stats $@ | grep 'IN\|Query time' | sed 's/;; Query time://' | sed ';N;s/\n//'
@itxx00
itxx00 / autoban.sh
Last active February 5, 2016 03:37
A simple script to protect system from DOS attack
#!/bin/bash
# A simple script to protect system from DOS attack
# create a crontab conf file /etc/cron.d/autoban like this:
# * * * * * root /sbin/autoban.sh ban >/dev/null 2>&1 &
# */10 * * * * root /sbin/autoban.sh unban - 5 >/dev/null 2>&1 &
# 01 * * * * root /sbin/autoban.sh unban 6 20 >/dev/null 2>&1 &
# 01 09 * * * root /sbin/autoban.sh unban 21 - >/dev/null 2>&1 &
#
PATH=/bin:/usr/bin:/usr/sbin:/sbin
export PATH