Posts
All the articles I've posted.
git github代理
Published: at 02:39 PM家里电脑下载github代码太慢只有几KB,临时使用免费的蓝灯来下载。 打开蓝灯的网页找到左上角点开菜单找到Settings然后ADVANCED SETTINGS找到http proxy地址,我的是:127.0.0.150705 打开命令行窗口执行如下脚本打开关闭github代理 opengithubproxy.sh /bi...
双击exe阻止程序启动
Published: at 09:22 AM有些程序不希望用户双击直接运行,而是由其他的程序调用启动。 根据main函数的传参可以简单的实现这个需求,用户双击运行的话参数argc为1,argv为程序运行的路径。 这里通过另外一种方法来实现,不依赖于传参。 在main函数里获取父进程的ID 判断父进程ID是否为expl...
device-mapper-libs安装docker失败
Published: at 05:22 AM在centos7上使用如下命令安装docker所需要的包失败了 sudo yum install -y yum-utils \ device-mapper-persistent-data \ lvm2 失败日志如下: Error Package 7device-mapper-libs-1.02.135-1.el73.4.x8664 (@updates) Requires devi...
go mod graph 图表
Published: at 11:43 AM我们知道通过go mod graph命令可以输出当前工程的模块依赖图,但是这个输出是纯文本的并且只是简单的一对一的关系。 很难看出所有模块之间的依赖关系,如果能用图的形式来显示就清晰多了。 Graphviz(https//www.ibm.com/developerworks/cn/aix/library/au-aix-graphv...
go 获取bing壁纸地址
Published: at 02:56 AM必应首页背景图片每天一更新,如果想把它作为桌面壁纸好像没那么简单,它没有提供直接下载的地方也不能右键保存,但是通过分析网页源代码可以拿到我们要的信息。 地址:https//ningto.com/bing(https//ningto.com/bing) 历史图片: https//ningto.com/bingimages...
golang Options可变参数接口设计
Published: at 05:23 AMgolang中发现不少第三方库使用...Options作为接口参数,说不上这种方式有多好但是了解下也是不错的。 如下代码新建一个exchange,一个必填参数其他的是可选参数。 cassandraql package main import "fmt" type Options struct { Name string Kind string D...
VritualBox centos NAT、Host-Only网络配置
Published: at 07:35 AM下面配置NAT和Host-Only这两种网卡可以实现外网访问,虚拟机之间互通 虚拟机安装 Snipaste2019-10-1013-35-061.png(https//www.ningto.com/upload/Snipaste2019-10-1013-35-061.png) Snipaste2019-10-1013-36-042.png(https//www.ningto.com/up...
centos rpm使用方法
Published: at 03:44 AM在 Linux 操作系统下,几乎所有的软件均通过RPM 进行安装、卸载及管理等操作。RPM 的全称为Redhat Package Manager ,是由Redhat 公司提出的,用于管理Linux 下软件包的软件。Linux 安装时,除了几个核心模块以外,其余几乎所有的模块均通过RPM 完成安装。RPM 有五种操作模式,分别...
centos基础环境准备
Published: at 08:10 AMifconfig发现没有网卡 vi /etc/sysconfig/network-scritps/ifcfg-eth0 修改ONBOOT=yes 启动网络卡 service network restart ifconfig检查一下,发现eth0存在 ping www.baidu.com是通的 crontab编辑 crontab -e hostname修改 vi /etc/syscon...
QNetworkAccessManager http请求
Published: at 09:04 AM使用QNetworkAccessManager可以发起http请求,下面列举三种常见的场景: get请求 这个很简单传一个url就可以了 QNetworkReply reply = manager->get(QNetworkRequest(QUrl(url))); post请求 这里post数据使用表单的形式 QUrl aurl(url); QNet...