- 博客(50)
- 收藏
- 关注
原创 win10 获取vmware Ubuntu1804的共享文件夹
在Ubuntu804中安装sambasudo apt-get install samba修改samba配置vim /etc/samba/smb.conf在最下面添加[share] comment = sxf path = /home/sxf available = yes browseable = no public = yes writable = yes create mask = 0644 directory mask = 0777 f
2022-02-07 17:32:11 791
原创 git 添加代理
git config --global http.proxy “127.0.0.1:1080”git config --global https.proxy “127.0.0.1:1080”
2022-02-07 17:23:59 737
原创 c++ string类型内存分配
#include <iostream>#include <cstdlib>#include <string>using std::string;using std::cout;using std::endl;//重写string类的new操作符,添加一个可以识别malloc操作的输出void* operator new(std::size_t n){ cout<<"分配"<<n<<"字节"<<end
2021-12-30 21:04:09 2827 2
原创 gcc动态库和静态库的使用
-Wl选项告诉编译器将后面的参数传递给链接器。-rpath使得execute记住链接库的位置.-W -rpath=./调用当前文件中的.so文件动态库#include <stdio.h>#include"test2.h"int main(void){ func_a(); struct St *s= func_b(); printf("hello\n"); // printf("%s\n",s.name); return 0;}#incl
2021-12-27 20:05:58 421
原创 gcc编译
gcc -o :指定输出的可执行文件的名称,不指定时为a.outgcc -c:只编译不链接,生成.o文件。这时出现未定义的函数,即在其他文件里的函数并不会报错。如果是结构体定义在其他文件里,则会发生报错。gcc -g,是为了gdb用。如下//test1.c#include <stdio.h>void func_a(){ printf("FUNC_A\n");}//test2.c#include <stdio.h>int main(void){
2021-12-27 18:37:16 410
转载 ubuntu1804 root sshd登录
设置root密码sudo passwd rootvim /etc/ssh/sshd_config把PermitRootLogin Prohibit-password #注释掉添加:PermitRootLogin yes重启sshd sudo service ssh restart
2021-12-09 10:42:22 232
原创 skynet vscode ubuntu1804 调试
下载编译skynet源码vscode 安装用vscode打开skynet 工程目录新建.vscode文件夹launch.json{ // 使用 IntelliSense 了解相关属性。 // 悬停以查看现有属性的描述。 // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ {
2021-12-07 17:26:16 702
原创 Ubuntu docker + k8s+ dashboard安装
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -sudo apt-key fingerprint 0EBFCD88sudo add-apt-repository \> "deb [arch=amd64] https://download.docker.com/linux/ubuntu \> $(lsb_release -cs) \> stable"设置
2021-12-07 17:18:38 968
原创 mongodb高可用集群的搭建
shard,mongodb的分片集合,将一个shard部署在不同的机器上。当一台机器宕机后,可以从另一台机器上获取数据config servers 用于给router分配合适的shard.
2021-11-28 17:00:45 1130
原创 c/c++编译动态链接库&linux vscode c 引入本地头文件
gcc addlib.c -fPIC -shared -o addlib.sog++ addlib.c -fPIC -shared -o addlib.solinux vscode c 引入本地头文件在项目名称下新建.vscode文件夹c_cpp_properties.json{ "configurations": [ { "name": "Linux", "includePath": [ "${wor
2021-11-19 15:13:22 673
原创 docker 指定mongodb版本
docker pull mongo:4.2.17拉取mongodb4.2.17sudo docker run --name mymongo -v /home/sxf/sxf/mymongo/data:/data/db -p 27017:27017 -d mongo:4.2.17启动mongodb4.2.17–name 容器名字-v 冒号前:宿主机位置,冒号后docker中的位置,在关闭mongodb容器后也能在宿主机中查看数据-p 27017:27017将主机和宿主机27017端口绑定-d
2021-11-02 09:53:00 681
原创 ubuntu 新增用户
cat /etc/group 查看用户组sudo useradd username -m 新建用户sudo passwd username 设置密码su username 切换用户sudo userdel -r username 删除用户
2021-10-28 16:08:34 94
原创 vscode win10 ssh 连接ubuntu出现 websocket status code 1006
将/etc/ssh/sshd_config 中的#AllowTcpForwarding yes改为AllowTcpForwarding yes
2021-10-20 16:33:21 2011
原创 iptables跳板机连接远端mongodb redis
A 本地ubuntu虚拟机,能上外网 ip192.168.200.128B 能上外网的跳板机 ip 121.40.153.136 /172.16.54.226C 装有mongodb的服务器1 ip 172.16.54.82D 装有mongodb的服务器2 ip 172.16.54.83E装有redis的服务器3 ip 172.16.54.103目的:A通过B连接CDE服务器在B上将/etc/sysctl.conf中的 #net.ipv4.conf.all.log_martians =
2021-10-07 14:55:49 304
原创 iptables 端口映射
将/etc/sysctl.conf中的 #net.ipv4.conf.all.log_martians = 1改为 net.ipv4.conf.all.log_martians = 1sysctl -p 使数据转发功能生效sudo iptables -t nat -A OUTPUT -p tcp -d 127.0.0.1 --dport 5555 -j DNAT --to 127.0.0.1:8888将本地端口5555转发到8888清空 nat 表sudo iptables -F -t nat
2021-10-06 18:12:13 795
原创 rinetd实现端口转发
下载wget http://www.boutell.com/rinetd/http/rinetd.tar.gz安装tar -zxvf rinetd.tar.gz -C /usr/srccd /usr/src/rinetdcd /usr/src/rinetdsed -i 's/65536/65535/g' rinetd.c (修改端口范围,否则会报错)mkdir /usr/manmake && make install配置创建 /etc/rinetd.conf写入
2021-10-06 11:15:37 128
原创 c执行shell命令并返回进程pid
主要通过posix_spawn实现#include <stdio.h>#include <string.h> #include <unistd.h>#include <spawn.h>#include <sys/wait.h> extern char **environ; void run_cmd(char *cmd){ pid_t pid; char *argv[] = {"sh", "-c", cmd, N
2021-10-02 13:20:43 698
原创 ubuntu nohup输出位置
nohup /mnt/c/Ubuntu/xxx.sh >/mnt/c/Ubuntu/XXX.log 2>&1 &/mnt/c/Ubuntu/XXX.log 日志输出位置2>&1 & 将错误日志重定向到正确日志的位置, 最后一个&表示在后台运行
2021-10-02 12:28:44 379
原创 wsl1804 阿里源设置
复制 /etc/apt/sources.list 到某一文件夹下全部注释添加以下内容deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ bi
2021-09-23 11:13:50 134
原创 git指令
git 上传git add .git commit -m “2021.09.22上传”git push --set-upstream http://xxx.xxx.xxx.git
2021-09-22 11:27:56 93
原创 c#中get set 的使用
class Help{ public String Topic { get { return Topic; } private set { Topic = value; } } private string topic;}Help h = new Help();h.Topic="topic";//调用失败string s=h.Topic; class Help2{ public String Topic { get { return Topic;
2021-05-20 16:51:11 267
原创 Comparable和Comparator区别
Comparable : ComparaTo(Object o)Comparator: Compare(T o1,T o2)Comparable 多用于比较比较大小Comparator 多用于数组排序
2020-09-11 11:00:38 178
原创 用信号量实现循环打印ABC
package com.company;import java.util.concurrent.*;public class PrintABCSemaphore { Semaphore s1=new Semaphore(0); Semaphore s2=new Semaphore(0); Semaphore s3=new Semaphore(1); public void PirntA()throws InterruptedException {
2020-09-11 09:59:18 286
原创 ubuntu llv numba
pip install -i https://pypi.anaconda.org/sklam/simple llvmlitepip install numba==0.40.0
2020-09-02 10:41:36 133
原创 异步与同步阻塞与非阻塞
作者:Yi Lu链接:https://www.zhihu.com/question/19732473/answer/20851256来源:知乎著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。“阻塞”与"非阻塞"与"同步"与“异步"不能简单的从字面理解,提供一个从分布式系统角度的回答。1.同步与异步同步和异步关注的是消息通信机制 (synchronous communication/ asynchronous communication)所谓同步,就是在发出一个调用时,在没有得到
2020-08-31 22:01:58 75
原创 fashion ai 关键点检测
环境python3.6 pytorch1.0.0 cuda9.0数据集说明:https://tianchi.aliyun.com/competition/entrance/231648/information数据集下载链接:https://pan.baidu.com/s/1ZXzHCdbfTuegjSv8IFewOQ 密码:lhx5只需下载 train1.rar和tarain2.rar下载后解压 把两个文件夹里融合,命名为Image如图下载标注信息下载完成后在train/train
2020-08-03 17:58:36 400 6
原创 springboot2.2.7版本中sec:authorize无效解决
springboot 版本2.2.7.release在build.gradle中设置thymeleaf-extras-springsecurity为 compile(‘org.thymeleaf.extras:thymeleaf-extras-springsecurity5’)同时在html中设置 xmlns:sec=“http://www.thymeleaf.org/thymeleaf-extras-springsecurity5”详见https://segmentfault.com/a/119
2020-06-21 14:15:46 308
原创 springboot @RequestParam
@RequestParam 用于接收path中传递的参数@GetMapping("/{username}/blogs") public String listBlogsByOrder(@PathVariable("username") String username, @RequestParam(value="order",required=false,defaultValue="new...
2020-04-07 22:46:05 324
原创 springboot @PathVariable
@PathVariable用于接收路径中包含的参数@GetMapping("/{username}/blogs") public String listBlogsByOrder(@PathVariable("username") String username, @RequestParam(value="order",required=false,defaultValue="new")...
2020-04-07 22:41:54 364
原创 win10 java多版本切换
下载安装jdk13和jdk8修改系统变量,新建JAVA_HOME 对应jdk13,JAVA_HOME对应jdk1.8在系统变量path里添加%JAVA8_HOME%\bin 为jdk8,改为%JAVA_HOME%\bin时为jdk13
2020-03-15 10:07:11 1084
原创 apapche 安装
下载https://www.apachehaus.com/cgi-bin/download.plxcd Apache24/bin/httpd.exe -k install
2020-02-24 14:49:57 214 1
原创 HDU2197本原串
Problem Description由0和1组成的串中,不能表示为由几个相同的较小的串连接成的串,称为本原串,有多少个长为n(n<=100000000)的本原串?答案mod2008.例如,100100不是本原串,因为他是由两个100组成,而1101是本原串。Input输入包括多个数据,每个数据一行,包括一个整数n,代表串的长度。Output对于每个测试数据,输出一行,代表有多...
2019-11-28 15:09:11 135
转载 ubuntu 显卡驱动
sudo vim /etc/modprobe.d/blacklist.conf在文件最后部分插入以下两行内容blacklist nouveauoptions nouveau modeset=0更新系统sudo update-initramfs -u重启系统验证nouveau是否已禁用lsmod | grep nouveau没有信息显示,说明nouveau已被禁用,接下来可以安装...
2019-10-25 12:17:28 209
原创 pytorch 加载部分权重
pytorch加载部分权重state_list=['rpn.anchor_generator.cell_anchors.0', 'rpn.anchor_generator.cell_anchors.1', 'rpn.anchor_generator.cell_anchors.2', 'rpn.anchor_generator.cell_anchors.3', ...
2019-08-22 20:36:15 3143
转载 马尔可夫随机场 MRF 个人理解
参考:http://blog.csdn.net/pipisorry/article/details/78396503马尔可夫网马尔科夫网是使用无向图描述的图模型,是刻画X上联合分布的一种方法,表示一个分解方式,也表示一组条件独立关系。马尔科夫随机场( Markov random field , MRF),也被称为马尔科夫网络( Markov network )或者无向图模型( undirect...
2019-07-15 15:41:15 1962
转载 rcnn 步骤
通过selective search实现 region proposals用卷积网络提取特征用SVM进行分类其中对选取的region需要进行扭曲缩放并使用NMS来对最后的bbox进行修正主要流程NMS说明,原文: https://www.cnblogs.com/makefile/p/nms.html © 康行天下定位一个车辆,最后算法就找出了一堆的方框,我们需要判别哪些矩形...
2019-06-24 14:55:11 727
原创 安装win10maskrcnn-benchmark
GitHub: https://github.com/facebookresearch/maskrcnn-benchmark环境vs2015 pytorch1.0.0 cuda9.0this installs the right pip and dependencies for the fresh pythonconda install ipythonmaskrcnn_benchmark ...
2019-06-20 12:31:37 1722
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人