Skip to content

Instantly share code, notes, and snippets.

View nibocn's full-sized avatar

RichardNee nibocn

View GitHub Profile
public class SHA256 {
private static byte[] getHash(String password) {
MessageDigest digest;
try {
digest = MessageDigest.getInstance("SHA-256");
digest.reset();
return digest.digest(password.getBytes());
} catch (NoSuchAlgorithmException e1) {
e1.printStackTrace();
# Grab the current date (%D) and time (%T) wrapped in {}: {%D %T}
DALLAS_CURRENT_TIME_="%{$fg[white]%}[%{$fg[yellow]%}%T%{$fg[white]%}]%{$reset_color%}"
# Grab the current machine name: muscato
DALLAS_CURRENT_MACH_="%{$fg[green]%}%m%{$fg[white]%}:%{$reset_color%}"
# Grab the current filepath, use shortcuts: ~/Desktop
# Append the current git branch, if in a git repository: ~aw@master
DALLAS_CURRENT_LOCA_="%{$fg[cyan]%}%~\$(git_prompt_info)%{$reset_color%}"
# Grab the current username: dallas
DALLAS_CURRENT_USER_="%{$fg[green]%}%n%{$fg[white]%}: %{$reset_color%}"
#Grab the current username and machine name
@nibocn
nibocn / msys-zsh
Last active February 14, 2016 07:24
/etc/zsh/zprofile
emulate sh -c 'source /etc/profile'
# 在MSYS中不设置此变量打软连直接变成了复制,很关键
export MSYS="winsymlinks:lnk"
# 解决MSYS中时间显示不正常的问题
export TZ=CET-8CEST
@nibocn
nibocn / msys-win
Last active February 18, 2016 06:48
msys 中文乱码 /bin/win
#!/bin/bash
$@ |iconv -f gbk -t utf-8
@nibocn
nibocn / cmder-aliases
Created February 26, 2016 16:34
Cmder/config/aliases
ls=ls --show-control-chars -F --color $*
l=ls --show-control-chars -F --color $*
la=ls -aF --show-control-chars -F --color $*
ll=ls -alF --show-control-chars -F --color $*
@nibocn
nibocn / adblock.txt
Created February 28, 2016 14:25
adblock 自定义过滤规则
! 隐藏 inoreader 广告
inoreader.com##div#sinner_container
@nibocn
nibocn / reportMyIp.py
Created March 29, 2016 09:30 — forked from mike-zhang/reportMyIp.py
检测动态域名并上报IP
#!/usr/bin/python
import smtplib,re,urllib2,time
import socket
from subprocess import Popen, PIPE
smtpServer='smtp.163.com'
smtpPort='25'
sender = '[email protected]'
senderPasswd = "XXXXX"
@nibocn
nibocn / xiamp4.js
Created May 15, 2016 05:57
http://www.xiamp4.com/ 站点资源 url 下载
var jq = document.createElement('script');
jq.src = "//cdn.bootcss.com/jquery/1.11.3/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// ... give time for script to load, then type.
jQuery.noConflict();
function print_download_url() {
var text = '\n';
$('div.ndownlist>ul>li input').each(function () {
text += $(this).val() + '\n'
@nibocn
nibocn / mirrorlist.mingw32
Created June 10, 2016 10:46 — forked from elvisw/mirrorlist.mingw32
MSYS2国内源
##
## 32-bit Mingw-w64 repository mirrorlist
## Changed on 2014-11-15
##
##中国科学技术大学开源软件镜像
Server = http://mirrors.ustc.edu.cn/msys2/REPOS/MINGW/i686
##北京理工大学镜像
Server = http://mirror.bit.edu.cn/msys2/REPOS/MINGW/i686
##日本北陆先端科学技术大学院大学 sourceforge 镜像
Server = http://jaist.dl.sourceforge.net/project/msys2/REPOS/MINGW/i686
*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear