Kerwen Blog

Stay Hungry Stay Foolish

搭建Squid代理服务器

Install Ubuntu 从官网上下载最新的Ubuntu,我下载的版本是 20.04.2.0 LTS https://ubuntu.com/download/desktop 用VM workstations安装 安装squid 运行Ubuntu 命令行工具Terminal, 执行以下命令 1 sudo apt-get install squid3 之后使用以下命令检查安装好的sq...

Python动态生成html页面

使用bottle的template生成 html页面,可以传入参数: 1 2 3 4 5 6 7 8 9 10 11 12 from bottle import template def WriteHtmlReport(htmlPath): template_demo=""" <html> <body> ...

VBScript拷贝长路径文件

在用VBScript进行文件拷贝时,发现文件路径太长导致拷贝失败。可以尝试使用文件的短路径进行解决。 1 2 3 4 5 6 7 8 Dim tempDir,soucerDir,fso,shortPath tempDir = "C:\toFolder" soucerDir = "\\server\looooongfilepath" set fso=CreateObject("Script...

找到指定端口占用程序

Run CMD, input netstat -ano|findstr "port_number", it will list the process using this port. Input command tasklist | find “process_id” to get the process name. 如何占用一个端口 这个听起来有点无厘头,更多的是用来测试...

Python指定third-party module安装目录

最近尝试用Python写个小程序,需要调用第三方的Module。第三方的Module正常情况下都需要先进行安装,才能使用。但是我不想在每个运行的机器上安装这个module。最终在StackOverflow上找到了解决方案: 1 pip install --target=d:\somewhere\other\than\the\default package_name 当引用第三方库时需要...

GitPython

GitPython是个开源的Python第三方库,我们可以用它方便的操作Git repository。 安装: 1 pip install gitpython 我们可以用GitPython直接调用Git的命令: git log: 1 2 3 g = git.Git("C:/path/to/your/repo") loginfo = g.log("--oneline", "f503...

Git 解决 would clobber existing tag 问题

在用Git去更新代码的时候有遇到下面的问题: 1 2 3 4 5 > git pull --tags origin master From https://github.com/MY/REPO * branch master -> FETCH_HEAD ! [rejected] latest -> latest (wo...

fetch

简介 ECMAScript 2015(ES6) 标准的发布已经三年有余,现代浏览器对ES6语法的支持趋于完善,用Promise对象处理异步请求被越来越多的开发者应用。为了更好地处理异步请求,作为对现有的XMLHttpRequest方法的替代,JavaScript引入了fetch方法,基于Promise处理异步请求。 Promise Promise 是异步编程的一种解决方案,比传统的解决方...

ES6 学习

https://es6.ruanyifeng.com/ let & const ES6 新增了let命令,用来声明变量。它的用法类似于var,但是所声明的变量,只在let命令所在的代码块内有效。 1 2 3 4 for (let i = 0; i < 10; i++) { // ... } console.log(i); // ReferenceError: ...

jQuery 学习

HTML CSS JS JS-下 jQuery Node.js + Gulp jQuery的官网 http://jquery.com/ jQuery就是一个js库,它把一些常用到的方法写到一个单独的js文件,使用的时候直接去引用这js文件就可以了. 使用jQuery的话,会比使用JavaScript更简单。 jquery的版本: 1.x版本:能够兼容IE678浏览器 ...