background picture of the home page

Think in Code

Linux添加虚拟网卡

添加虚拟网卡 临时添加删除 # 临时添加 ifconfig eth0:0 192.168.10.10 up # 删除 ifconfig eth0:0 down Ubuntu sudo vim /etc/network/interfaces # 增加内容 auto eth0:0 iface eth

thumbnail of the cover of the post

slice和string互转

slice和string互转 // StringToBytes converts string to byte slice without a memory allocation. func StringToBytes(s string) []byte { return *(*[]byte<

thumbnail of the cover of the post

Go调用C C++(cgo)

Go调用C/C++(cgo) 1. 直接调用代码 package main /* #include <stdio.h> // 结构体 typedef struct { char * name; int age; //double d; }Person; // 函数调用传参 void pr

thumbnail of the cover of the post

Linux设置samba共享目录

安装 samba sudo apt-get install samba 修改配置文件 sudo vi /etc/samba/smb.conf 在最下面添加共享目录 [home] #共享目录 path = /home/gwkang #有效用户 valid user = gwkang public =

thumbnail of the cover of the post

Linux 开机自启

以rclone为例 创建文件 vi etc/init.d/rclone.sh #! /bin/sh export RCLONE_DRIVE_ACKNOWLEDGE_ABUSE=true rclone mount GoogleDrive:/ /root/fileServer/GoogleDrive

thumbnail of the cover of the post