Loading

上一页 1 ··· 57 58 59 60 61 62 63 64 65 ··· 76 下一页
摘要: 背景 有时需要将git仓库从一个服务器迁往另一个 分析 最简单的方式是建立空白仓上传新代码 若要保留最新代码和历史提交则需要完整迁移 实现 在线迁移 通常有web前端的git服务都会提供在线迁移 输入github仓库地址xxxx.git和账号密码即可完成 本地迁移 对于本地文件夹或原始服务器已经不存 阅读全文
posted @ 2020-07-04 20:57 azureology 阅读(277) 评论(0) 推荐(0)
摘要: 需求 遇到Ubuntu编译程序报错缺少so文件 如何快速定位对应package名称? 解决 使用apt-file查找文件名 $ sudo apt install apt-file $ apt-file search libgstreamer-0.10.so.0 libgstreamer0.10-0: 阅读全文
posted @ 2020-07-04 15:33 azureology 阅读(118) 评论(0) 推荐(1)
摘要: 方法 Ubuntu系统修改hostname需要修改/etc/hostname和/etc/hosts两个文件 命令 脚本需要以root权限执行 read -p "Input hostname: " name sed -i "1c $name" /etc/hostname sed -i "2c 127. 阅读全文
posted @ 2020-07-04 15:10 azureology 阅读(773) 评论(0) 推荐(0)
摘要: 要求 希望通过console打印函数执行耗时 实现 通过date命令获取函数起止时间戳相减得到耗时 fcn(){ srt=$(date +%s) #do something end=$(date +%s) echo "It takes $[$end-$srt] sec." } 注意 调用$[$a - 阅读全文
posted @ 2020-07-02 11:27 azureology 阅读(766) 评论(0) 推荐(0)
摘要: 主要有两种方法: 使用if判断 read -p "Input a number(0-5): " num array=(0 1 2 3 4 5) if [[ "${array[*]}" =~ "${num}" ]]; then echo "You select $num" else echo "Inv 阅读全文
posted @ 2020-07-02 11:18 azureology 阅读(1864) 评论(0) 推荐(1)
上一页 1 ··· 57 58 59 60 61 62 63 64 65 ··· 76 下一页