Skip to content

Instantly share code, notes, and snippets.

View lytsing's full-sized avatar

Lytsing Huang lytsing

View GitHub Profile
@RexKang
RexKang / apache_log_analyze.sh
Last active August 29, 2015 14:00
Apache日志统计脚本
# 统计访问次数最多的前十名IP
awk '$0 !~/::1/&&$0 !~/127.0.0.1/{ip[$1]++}END{for(i in ip){print ip[i],i}}' access_log|sort -rn|head
# 统计访问次数最多的URL
awk '$0 !~/::1/&&$0 !~/127.0.0.1/{a[$7]++}END{for(i in a){print a[i]":"i }}' access_log|sort -rn|head
@parzonka
parzonka / install-gradle-centos.sh
Last active July 4, 2024 05:28
Install gradle on redhat/centos linux
# installs to /opt/gradle
# existing versions are not overwritten/deleted
# seamless upgrades/downgrades
# $GRADLE_HOME points to latest *installed* (not released)
gradle_version=2.9
wget -N https://services.gradle.org/distributions/gradle-${gradle_version}-all.zip
sudo unzip -foq gradle-${gradle_version}-all.zip -d /opt/gradle
sudo ln -sfn gradle-${gradle_version} /opt/gradle/latest
sudo printf "export GRADLE_HOME=/opt/gradle/latest\nexport PATH=\$PATH:\$GRADLE_HOME/bin" > /etc/profile.d/gradle.sh
. /etc/profile.d/gradle.sh
@lnickers2004
lnickers2004 / gist:8386632
Last active January 3, 2016 00:59
Bootstrap: Dialog Please Wait
<div class="modal hide" id="pleaseWaitDialog" data-backdrop="static" data-keyboard="false">
<div class="modal-header">
<h1>Processing...</h1>
</div>
<div class="modal-body">
<div class="progress progress-striped active">
<div class="bar" style="width: 100%;"></div>
</div>
</div>
@nightire
nightire / Changes in Rails 4_1.md
Last active May 11, 2022 04:50
拥抱 Rails 4 —— 详述 Rails 4 的新变化

Routes

小心地使用 Match(Rails 3 已实现)

Rails 3 提供了 match 方法供我们自定义 routes,然而我们要小心使用它以避免“跨站脚本攻击”(XSS Attack)。比如像这样的 routes:

注:(r3 代表 Rails 3,r4 代表 Rails 4)

# routes.rb
@nazgob
nazgob / ctags.setup
Created January 6, 2012 13:44
ctags setup on mac
# you have ctags but it does not work...
$ ctags -R --exclude=.git --exclude=log *
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
#you need to get new ctags, i recommend homebrew but anything will work
$ brew install ctags
#alias ctags if you used homebrew
$ alias ctags="`brew --prefix`/bin/ctags"
@fredgrott
fredgrott / eclipse-checkstyle-android-best-practices
Created April 29, 2011 14:57
eclipse checkstyle checks for android
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<!--
Checkstyle-Configuration: Android checkstyle by Enea
Description: none
-->