Skip to content

Instantly share code, notes, and snippets.

Avatar
🎸
solo...

ghostsf ghostsf

🎸
solo...
View GitHub Profile
View git-commit-change.sh
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
@ghostsf
ghostsf / ssr.sh
Created May 16, 2019
auto-ssr-doubi
View ssr.sh
#!/usr/bin/env bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#=================================================
# System Required: CentOS 6+/Debian 6+/Ubuntu 14.04+
# Description: Install the ShadowsocksR server
# Version: 2.0.38
# Author: Toyo
# Blog: https://doub.io/ss-jc42/
View keybase.md

Keybase proof

I hereby claim:

  • I am ghostsf on github.
  • I am ghostsf (https://keybase.io/ghostsf) on keybase.
  • I have a public key ASAbLRQUGHQJ7gkcyqlaCN80LQ8zBBjccPny06EmdPkM5Qo

To claim this, I am signing this object:

View IPKit.java
import javax.servlet.http.HttpServletRequest;
public class IpKit {
public static String getRealIp(HttpServletRequest request) {
String ip = request.getHeader("x-forwarded-for");
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
View OpenldapUtil.php
<?php
/**
* simple class for LDAP authentification
*
* Created by ghostsf
* Date: 2016/4/9
*/
class openldap
{