技术宅
shawncheer
这个作者很懒,什么都没留下…
展开
-
callback 的一个简单示例
//回调函数的简单理解//例子温度计显示温度。//有两种方式// 1. 睡眠5秒,查看一下温度计读数函数,如果度数改变则更新显示。// 2. 把显示接口暴露给温度计度数函数,由温度计来显示,这样不用一直去访问,浪费切换时间。// ====== method 1. 轮训 ======float read(){ return get_temperature();}void display(){ float f = read(); print(f); retu原创 2020-06-02 21:24:46 · 587 阅读 · 0 评论 -
统计文件夹下的语音文件总时长(按秒计算)
直接上命令行:soxi -D * | awk '{total +=$0};END{print total}'其中的 END表示在最后的时候打印,而不是每一行都打印出来。原创 2020-01-21 10:05:53 · 2112 阅读 · 0 评论 -
linux监控gpu使用状况(NVIDIA)
一、nvidia-smi是查看gpu现存使用情况的命令行工具。其命令行显示例子如下:二、watch命令用于周期性的执行一个程序,并且全屏显示输出结果,我们可以通过每隔 1s 执行一次nvidia-smi来查看gpu内存动态使用情况:watch -n 1 nvidia-smi...原创 2020-01-20 11:02:19 · 2044 阅读 · 0 评论 -
知识集合拓展示意图
上面图像的含义是:1、首先要对未知或者容易弄混亦或者是模棱两可对事物进行直击式对研究;2、待研究透彻之后形成对关联问题对片区进行理解;3、最后,和原有知识进行深度融合,作为下一次循环的基础。...原创 2020-01-19 14:54:35 · 211 阅读 · 0 评论 -
查看so文件的细节。
一、readelf命令:https://man.linuxde.net/readelf二、strings命令:https://blog.csdn.net/xinqi53/article/details/9126475原创 2019-12-17 10:32:35 · 659 阅读 · 0 评论 -
一个不错的git教程
https://www.liaoxuefeng.com/wiki/896043488029600来自廖雪峰的文章,讲的很细,循循善诱。原创 2019-12-06 17:34:10 · 109 阅读 · 0 评论 -
linux远程明密执行命令
sshpass -p "passwd" ssh [email protected] "ls"其中sshpass 如果没安装则需要安装。参考:https://www.cnblogs.com/gaoxing/p/4311746.html原创 2019-10-31 14:34:03 · 116 阅读 · 0 评论 -
G C root login method
1、进入root账户。然后passwd root设置root密码。2、修改SSH配置文件/etc/ssh/sshd_configvim /etc/ssh/sshd_config找到PermitRootLogin和PasswordAuthentication# Authentication:LoginGraceTime 120PermitRootLogin yes //默...原创 2019-10-14 13:38:09 · 283 阅读 · 0 评论 -
ftp服务器的创建以及命令行使用
搭建ftp服务器,参考腾讯云的教程: https://cloud.tencent.com/developer/labs/lab/10123但是在后面连接的几种方法不能用,所有两个替代方案:1)ftp ip 然后使用get和mget来获取remote端文件。2)使用直接命令行方法:参考https://superuser.com/questions/532130/how-to-do...原创 2019-10-12 13:03:51 · 1640 阅读 · 0 评论 -
内网穿透实践
本文主要参照:https://wsonh.com/article/126.html原理可以参考:https://cao0507.github.io/2018/09/14/frp%E5%86%85%E7%BD%91%E7%A9%BF%E9%80%8F%E5%AE%9E%E7%8E%B0ssh%E8%AE%BF%E9%97%AE%E5%86%85%E7%BD%91%E6%9C%BA%E5%99...原创 2019-04-04 10:01:51 · 507 阅读 · 0 评论 -
在文件夹内递归搜索关键字,并在出现关键字的结尾加上一个字符串。
2019/4/23更新:增加替换的举例:grep -rnl "\-O2" ./ | while read line; do sed -i "s/\-O2/\-O3/g" $line; done参考:https://blog.csdn.net/songyu0120/article/details/46697261https://www.cnblogs.com/iloveyouc...原创 2019-04-04 14:12:57 · 496 阅读 · 0 评论 -
connect google cloud machine from xshell.
References:https://blog.csdn.net/timothy93bp/article/details/77679000andhttps://www.youtube.com/watch?v=K7fhJS8G4Sg&t=333s1. Get public key from xshell.2. put your google linux name to ...原创 2019-04-02 16:24:13 · 143 阅读 · 0 评论 -
一个可以取代curl和wget的多线程下载命令axel
axel -n 20 http://www.openslr.org/resources/18/data_thchs30.tgz原创 2019-05-15 10:06:13 · 3184 阅读 · 0 评论 -
centos 7 非管理员权限安装软件
rpm2cpio ctags-5.8-2.el6.x86_64.rpm |cpio -idvm首先模仿上面的语句做一下程序解压,后面把可执行文件放在$PATH里面。参考:https://blog.csdn.net/sdcxyz/article/details/47094221...原创 2019-06-04 14:25:03 · 3600 阅读 · 0 评论 -
linux挂载samba共享目录方法
1、术语说明: 本地服务器:local 共享文件服务器:server2、首先在server上查看/etc/samba/smb.conf 文件,里面有samba对外共享的文件夹,这一步非常重要,直接关系到后面挂载成功与否。3、挂载命令:mount.cifs //serverip/<在第二步conf里面看到的server共享文件夹> /<挂载在local...原创 2019-07-09 17:36:25 · 13450 阅读 · 0 评论 -
关于编程的一点理解
编程不是与编程语言的语法进行交流,而是与编译器进行交流,与解释器进行交流。最终是与编译器或解释器的作者进行交流。原创 2019-08-13 15:55:27 · 122 阅读 · 0 评论 -
用-i指定pip源,在docker中非常好用
for example:pip install moduleName-i https://pypi.douban.com/simple原创 2019-08-14 10:42:19 · 915 阅读 · 0 评论 -
linux alias using function to accomplishment the the arguments
参考文档:https://www.zhihu.com/question/23137414https://superuser.com/questions/704493/ffmpeg-convert-m4a-files-to-mp3-without-significant-loss-of-information-quali音乐格式转换:alias m4a2mp3='_m4a2mp3(...原创 2019-03-29 23:44:04 · 127 阅读 · 0 评论 -
ffmpeg merge video and audio in command line
Method 1:ffmpeg -i videoplayback.webm -i videoplayback.m4a -c:v copy -c:a copy merged.mp4 -threads 128Method 2:ffmpeg -i videoplayback.webm -i videoplayback.m4a -c:v copy -c:a aac -strict expe...原创 2019-03-11 19:45:08 · 872 阅读 · 0 评论 -
lynx and socks5
reference 1: https://www.linuxquestions.org/questions/linux-networking-3/proxy-setting-in-lynx-230111/#post3869237export http_proxy=http://10.1.68.253:3128 && lynx http://www.cplusplus.com/...原创 2019-03-15 16:21:05 · 929 阅读 · 0 评论 -
电脑故障及解决实战
计算机出现的问题解决方案。原创 2015-06-17 11:04:40 · 617 阅读 · 0 评论 -
英语单词解辞集
风哥精解析:abide:a-=pro- bide=wait 表现为一直在等,表现为遵守 ,abide by the law守株待兔,等待,意味着守在一个地方等某人。遵守法律,就是一直呆在法律规定的范围内Abolish:ab-表示 ,第一,ol-= grow 生长, 比如old 就是,ish是动词后缀 第二,Ollyme-也作ol-=d...原创 2015-06-17 10:24:54 · 1492 阅读 · 0 评论 -
各种数学符号的英文读法
'exclam'='!' 'at'='@' 'numbersign'='#' 'dollar'='$' 'percent'='%' 'caret'='^' 'ampersand'='&' 'asterisk'='*' 'parenleft'='(' 'parenright'=')' 'minus'='-' 'underscore'='_' 'equa原创 2016-03-14 15:50:22 · 627 阅读 · 0 评论 -
安装Microsoft office2010出现需要msxml文件问题
第一步:我的注册表里面没有6.0,所以我首先用记事本输入:Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\TypeLib\{F5078F18-C551-11D3-89B9-0000F81FE221}\6.0]@="Microsoft XML, v6.0" [HKEY_CLASSES_ROOT\TypeLib\{F5078原创 2016-05-24 19:39:33 · 4096 阅读 · 0 评论 -
GitHub使用方法
新建项目:点击下面的New repository按钮。下面是一个模版:下面单词commit意思是做一个版本,当名词讲就是版本:原创 2016-05-05 22:34:47 · 467 阅读 · 0 评论 -
ubuntu使用命令行下载文件
首先安装axel这个命令 sudo apt-get install axel然后使用这个命令下载文件 例如: axel http://soft.vpser.net/lnmp/lnmp0.8-full.tar.gz 就会自动下载文件了原创 2016-11-23 13:24:05 · 10277 阅读 · 1 评论 -
Ubuntu服务器用百度云看电影
具体方法实现经过google,找到了一个神器 – bypy!这是一个百度云\百度网盘的python客户端,其主要目的和功能,就是为Linux使用者提供一种在命令行下,使用百度云盘中2T存储空间的方法。它提供文件列表、下载、上传、比较、向上同步、向下同步,等操作。其github主页地址为:bypy在github的主页地址 ,安装可以用下面命令。apt-get install pyt原创 2016-11-19 06:54:27 · 2111 阅读 · 0 评论 -
ubuntu配置网站
相关阅读:Ubuntu下NFS服务器的配置 http://www.linuxidc.com/Linux/2012-12/75235.htmUbuntu下ftp服务器的配置 http://www.linuxidc.com/Linux/2012-12/75233.htm1:Apache介绍Apache是世界使用排名第一的web服务器软件,它可以运行在几乎所有广泛使用的计算机平台上由于其原创 2016-12-14 14:51:46 · 835 阅读 · 0 评论 -
using bypy to download files on baiduyunpan in linux
For there haven't baiduyunpan client on linux, so the follow step should be taken for it.On the head fo the post, we should hanks to houtianze who developed this application.First, install the byp...原创 2019-01-05 23:22:08 · 581 阅读 · 0 评论 -
保持Virtualbox同时上网和用主机ssh连接的方法
参考1(install ssh server):https://tendcode.com/article/virtualbox-install-centos7/参考2 (setup net transform):http://ubuntuhandbook.org/index.php/2016/04/enable-ssh-ubuntu-16-04-lts/参考3 (lrzsz 使用软件):h...原创 2019-02-16 17:36:12 · 379 阅读 · 0 评论 -
Linux使用doxygen绘制函数调用图(Call Graph)
参考:https://blog.csdn.net/benkaoya/article/details/79763668参考:http://www.doxygen.nl/一、安装doxygen和graphvizUbuntu16以上的系统直接安装:sudo apt install doxygen graphviz -y二、生成默认的configure文件命令行执行:dox...原创 2019-02-12 23:04:31 · 2360 阅读 · 0 评论 -
做一个vimrc的备份。
这是基于vim自带的轻量级插件管理器,可以取代bundle的插件管理。这个配置如下:set nocompatiblesyntax onset cursorlineset number"set relativenumberset wrapset rulerset incsearchset showcmdset showmatchset tabstop=4 "setup 4 ...原创 2019-02-13 17:19:53 · 128 阅读 · 0 评论 -
linux using proxy from commend line
First, you can find a instrument by type line below.man google-chromeAnd then, follow the instrument to use proxy, there is an example.google-chrome --proxy-server="socks5://127.0.0.1:1080"D...原创 2019-03-09 10:47:29 · 172 阅读 · 0 评论 -
谷歌浏览器定位从某一行开始分享
1、右键某一个网页元素,点击检查选项。2、复制该元素的id的内容。3、修改原始网页为原始”原始网页网址#id“的格式。就是这一行开始的内容。例子:https://wiki.gentoo.org/wiki/Project:Alpha/Porting_guide#IEEE_floating_point_numbers...原创 2019-03-04 12:09:21 · 691 阅读 · 0 评论 -
Linux拷贝文件到当前目录的所有子文件夹中
find ./ -maxdepth 1 -type d -exec cp -r filename {} \;其中,-maxdepth 1 #表示只到第一层子目录。-type d #表示是目录directory。-exec #表示执行后面命令。cp -r filename {} \; #这里的{}表示子目录下的目录名,\;这个表示命令结尾。参考:https:...原创 2019-03-07 09:56:49 · 5910 阅读 · 0 评论 -
VS2013调试实践
VS2013调试实践一、生成map文件:项目属性–>链接器–>生成映射文件–>是(/MAP)。二、调用内存,在调试过程中可以用Alt+Ctrl+M,2来调用内存。也可以按以下键来使用: 调试.内存1 Alt + 6 Ctrl + Alt + M,1 显示“内存 1”窗口,查看在“监视”或“变量”窗口中不能清楚地显示的大缓冲区、字符串和其他数据。 调试.内存2 Ctrl + A原创 2016-01-20 12:34:14 · 641 阅读 · 0 评论