Skip to content

Instantly share code, notes, and snippets.

View zhfnjust's full-sized avatar
💭
bitcoin sv is everything

hh zhfnjust

💭
bitcoin sv is everything
View GitHub Profile

##路径截断与合并##

PathRemoveArgs 去除路径的参数

PathRemoveBackslash 去除路径最后的反斜杠 ""

PathAddBackslash 在路径最后加上反斜杠 ""

PathRemoveBlanks 去除路径前后的空格

@zhfnjust
zhfnjust / asynchttp.cpp
Created February 19, 2014 07:12
wininet 异步下载demo
#include<windows.h>
#include<wininet.h>
#include<iostream>
using namespace std;
HANDLE hConnectedEvent, hRequestOpenedEvent, hRequestCompleteEvent;
HINTERNET hInstance, hConnect, hRequest;
char *lpszUrl, *lpszServer;
BOOL bAllDone = FALSE;
@zhfnjust
zhfnjust / installmysql
Created March 9, 2014 12:13
install mysql from source
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install build-essential checkinstall libncurses5-dev curl
curl --o mysql-4.1.24.tar.gz http://mirror.provenscaling.com/mysql/community/source/4.1/mysql-4.1.24.tar.gz
sudo tar -xvzf mysql-4.1.24.tar.gz --directory=/usr/local/src
cd /usr/local/src/mysql-4.1.24/
sudo groupadd mysql
sudo useradd -g mysql mysql
sudo apt-get install
sudo ./configure --prefix=/usr/local/mysql
sudo make
@zhfnjust
zhfnjust / gist:9929115
Created April 2, 2014 06:53
获取图片高宽
bool GetImageSize(const char *fn, int *x,int *y)
{
FILE *f=fopen(fn,"rb");
if (f==0) return false;
fseek(f,0,SEEK_END);
long len=ftell(f);
fseek(f,0,SEEK_SET);
if (len<24) {
fclose(f);
return false;
@zhfnjust
zhfnjust / proxy.pac
Last active August 29, 2015 14:12
自动切换代理
// Generated by gfwlist2pac
// https://github.com/clowwindy/gfwlist2pac
var domains = {
"gimpshop.com": 1,
"directcreative.com": 1,
"speedpluss.org": 1,
"mingpaovan.com": 1,
"wikinews.org": 1,
"joachims.org": 1,
@zhfnjust
zhfnjust / statusbar.java
Last active September 7, 2015 04:02
设置标题栏透明度
//设置标题栏透明度
Window window = getWindow();
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
| WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
@zhfnjust
zhfnjust / nodeJs.crypto.calculatingHash.js
Created December 7, 2018 12:46 — forked from GuillermoPena/nodeJs.crypto.calculatingHash.js
NodeJS - CRYPTO : How to calculate a hash from file or string
var crypto = require('crypto')
, fs = require('fs')
// Algorithm depends on availability of OpenSSL on platform
// Another algorithms: 'sha1', 'md5', 'sha256', 'sha512' ...
var algorithm = 'sha1'
, shasum = crypto.createHash(algorithm)
// Updating shasum with file content
var filename = __dirname + "/anything.txt"
@zhfnjust
zhfnjust / testclient.js
Created May 9, 2019 13:15
testclient.js
/**
* 构建TCP客户端
*/
const fs = require('fs');
/* 引入net模块 */
var net = require("net");
/* 创建TCP客户端 */
var client = net.Socket();
/**
* 构建TCP客户端
*/
const fs = require('fs');
/* 引入net模块 */
var net = require("net");
const uuidv1 = require('uuid/v1');
async function main(){

Window 通过cmd查看端口占用、相应进程、杀死进程等的命令

一、 查看所有进程占用的端口  在开始-运行-cmd,输入:netstat –ano 可以查看所有进程

 

二、查看占用指定端口的程序  当你在用tomcat发布程序时,经常会遇到端口被占用的情况,我们想知道是哪个程序或进程占用了端口,可以用该命令 netstat –ano|findstr [指定端口号]