Skip to content

Instantly share code, notes, and snippets.

View ghostsf's full-sized avatar
🎸
solo...

ghostsf ghostsf

🎸
solo...
View GitHub Profile
@ghostsf
ghostsf / git-commit-change.sh
Created December 26, 2019 02:33
git-commit-change
#!/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 07:21
auto-ssr-doubi
#!/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/
@ghostsf
ghostsf / keybase.md
Created April 1, 2019 01:32
Keybase proof

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:

@ghostsf
ghostsf / IPKit.java
Created November 14, 2016 09:12
IPKit
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)) {
@ghostsf
ghostsf / OpenldapUtil.php
Last active November 8, 2016 02:00
php openldap
<?php
/**
* simple class for LDAP authentification
*
* Created by ghostsf
* Date: 2016/4/9
*/
class openldap
{