个人觉得很好用的maven命令

maven 常用命令 创建一个简单的maven项目 mvn archetype:generate \ -DarchetypeGroupId=org.apache.maven.archetypes \ -DarchetypeArtifactId=maven-archetype-site \ -DgroupId=com.mycompany.app \ -DartifactId=my-app-site

Published
Categorized as tool

gcc 编译基础与make

gcc 编译基础 gcc common variable -l/path 是加入某个library,库的前缀lib和扩展名(.a或.so)不需要写 -I/path 后面接的路径就是设置要去搜索相关的include文件的目录. -Wall 编译的时候输出警告信息 -O 在编译的时候,依据操作系统环境,对程序进行优化 gcc default linux 默认是将函数库放置在/lib与/usr/lib当中.gcc默认会链接这两个路径下的函数库. 同理,gcc编译会默认会搜索/usr/include目录下的头文件. 通常称-Wall或者-O这些非必要的参数为标志FLAGS,当使用c语言的时候,也可能简称这些标志为CFLAGS

Published
Categorized as tool

my usual vim command

command 常用的命令 shortcuts J 将下一行拼接到当前行 i + ctrl + j 分割成两行 y 复制到寄存器 p 从寄存器粘贴 yy 复制当前行到寄存器 n+yy 复制从当前行开始的n行到寄存器 x del X del before dd 删除当前行 ^ 光标移动到行首 $ 光标移动到行末 gg 光标移动到文件头 GG 光标移动到文件末行 u undo ctrl+r redo :q quit :q! quit forcely :wq save and quit ZZ save and quit . replace last command… Continue reading my usual vim command

Published
Categorized as tool

工具使用shadowsocks代理接口

一般使用代理的时候,一个是为了资料,另一个是为了下载。 用的系统是osx,经常会使用brew安装软件。但是很多软件的源或者它们的依赖库是被墙了。配置代理后,就方便了,不用到处去找替代源 brew 下载软件是基于curl,vim的管理软件Vim Bundle下载是基于wget的。 curl cat ~/.curlrc socks5=127.0.0.1:1080 polipo #Via ~/.polipoc file: logSyslog = true logFile = ~/log/polipo/polipo.log socksParentProxy = “127.0.0.1:1080” socksProxyType = socks5 proxyAddress = “127.0.0.1” proxyPort = 8123 shadowsocks使用的是socket代理,可以使用polipo转化为http代理,方便一些没有办法直接配置socket代理的工具:wget wget Via ~/.wgetrc file: use_proxy=yes http_proxy=127.0.0.1:8123 https_proxy=127.0.0.1:8123 git #git use http proxy git config –global https.proxy http://127.0.0.1:1080 #git use https proxy git config… Continue reading 工具使用shadowsocks代理接口

Published
Categorized as tool, vps

如何搭梯子

这里介绍一下搭梯子用到的网站 centos7一监安装脚本:来自老高博客 这个脚本配置了自动启动和自动重启。 yum update -y yum install -y python-setuptools net-tools easy_install pip pip install –upgrade pip shadowsocks cat>/etc/systemd/system/shadowsocks-server.service<<EOF [Unit] Description=Shadowsocks Server After=network.target [Service] ExecStart=/usr/bin/ssserver -c /etc/ss-config.json Restart=always [Install] WantedBy=multi-user.target EOF num=$((30000 + RANDOM)) pass=`date +%s | sha256sum | base64 | head -c 12` cat>/etc/ss-config.json<<EOF { “server_port”:$num, “password”:”$pass”, “timeout”:60, “method”:”rc4-md5″ } EOF systemctl daemon-reload systemctl… Continue reading 如何搭梯子

Published
Categorized as tool, vps