git: does not have a commit checked out
当根目录下没有.git文件夹时使用git命令报错:does not have a commit checked out原因:可能是子目录下仍然有.git文件;我们只需要删除子目录下的.git文件夹即可。
参考:https://blog.csdn.net/weixin_47503016/article/details/111713147
docker技巧
运行中的docker容器获取docker runhttps://stackoverflow.com/questions/32758793/how-to-show-the-run-command-of-a-docker-container
docker 配置代理https://www.lfhacks.com/tech/pull-docker-images-behind-proxy/
vim "/etc/systemd/system/docker.service.d/http-proxy.conf"
1234567# 注释状态#[Service]#Environment="http_proxy=socks5://127.0.0.1:10808"#Environment="https_proxy=socks5://127.0.0.1:10808"#Environment="ftp_proxy=socks5://127.0.0.1:10808"#Environment="no_proxy="17 ...
浏览器ERR_UNSAFE_PORT
前言在一次部署gitlab使用10080端口,始终无法通过浏览器访问,困惑了很久。
缘由:chromium 中做了限制https://github.com/chromium/chromium/blob/805f50e9d42cf0ac5e3108ae2c6b36baa0ea5a90/net/base/port_util.cc#L64-L147
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485// The general list of blocked ports. Will be blocked unless a specific// protocol overrides it. (Ex: ftp can use port 21)// When adding a port to the list, consider ...
linux用户设置默认shell
123456789[sstutu@localhost ~]$ cat /etc/shells | grep zsh/usr/bin/zsh/bin/zsh[sstutu@localhost ~]$ chsh -s /bin/zsh sstutu正在更改 sstutu 的 shell。密码:shell 已更改。# 开启用户新会话,可以发现已经完成了用户默认shell的设置
mysql的coalesce函数
MySQL COALESCE() Function方法含义返回列表中第一个非空值
Return the first non-null value in a list:
SELECT COALESCE(NULL, NULL, NULL, ‘W3Schools.com’, NULL, ‘Example.com’);
Definition and UsageThe COALESCE() function returns the first non-null value in a list.
SyntaxCOALESCE(val1, val2, …., val_n)
Parameter Values
Parameter
Description
val1, val2, val_n
Required. The values to test
用途在写统计数据sql时,常会用到聚合函数,当表中没有数据时 sql 标准返回值将是null , 这并不是我们想要的 0 ,该函数将对null 结果做你想要的转换,提示:当只有一个字段时 ifnul 函数也能达到效果,
openwrt安装git
安装1234567891011121314151617181920$ opkg update$ opkg install git$ git config --global user.name "sstutu"$ git config --global user.email "[email protected]"$ git clone https://github.com/abi/screenshot-to-code.gitCloning into 'screenshot-to-code'...git: 'remote-https' is not a git command. See 'git --help'.$ git clone https://github.com/abi/screenshot-to-code.gitCloning into 'screenshot-to-code'...git: 'remote-https' is not ...
docker安装wg-easy
对于自建服务,大部分时间我们都是内网访问,我们可能更希望何时何地都能用内网ip 访问 以下假定你是动态公网:如果要远程访问内网服务时,你可能是需要逐一配置端口映射。 wg-easy 是可以让你只开放两个端口 例如下文的 51820/udp 51821/tcp 两个端口,自由访问内网提醒: wg-easy ~~~在ipv6 环境的机器上出现过以下错误,查看是否启用了ipv6 可以通过 ifconfig 看是否有 ipv6 的分配,如果可以关闭ipv6 ,可以参考底下对centos 关闭ipv6 的介绍~~~如果启动出现 问题,按1.2 使用modprobe工具来加载或重新加载名为ip_tables的Linux内核模块
12345678910111213141516[#] ip -4 address add 10.8.0.1/24 dev wg0 [#] ip link set mtu 1420 up dev wg0 [#] iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERA ...
基于证书的身份验证
参考文章:OpenSSH/Cookbook/Certificate-based AuthenticationSteps for Working with SSH User Certificates1. Creating a Certificate Authority123456789101112131415161718192021222324252627282930313233343536373839404142434445 # em ssh-keygen -t ed25519 -f ~/.ssh/user_ca_key \ -C 'User Certificate Authority for *.example.com'Generating public/private ed25519 key pair.Enter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in /home/ ...
jenkins vue nginx部署
1. 安装jenkins2. 安装nginx123456789101112131415# centosyum install -y epel-release yum update yum install -y nginx# 查看版本是否安装成功nginx -v# ubuntu/debian➜ ~ apt update -y && apt upgrade -y➜ ~ apt install nginx -y➜ ~ nginx -tnginx: the configuration file /etc/nginx/nginx.conf syntax is oknginx: configuration file /etc/nginx/nginx.conf test is successful
1mkdir -p /opt/webapps/ruoyi-ui/
3. jenkins配置这里我找了一个开源项目来部署 ruoyi-vue,这个项目比较喜欢。
安装nodejs 插件安装后重启
docker安装jenkins
docker-compose.yml
1234567891011121314services: docker_jenkins: user: root restart: always image: jenkins/jenkins:lts container_name: jenkins ports: - 8099:8080 - 50000:50000 volumes: - ./jenkins_home/:/var/jenkins_home - /var/run/docker.sock:/var/run/docker.sock - /usr/bin/docker:/usr/bin/docker #容器内使用docker - /usr/local/bin/docker-compose:/usr/local/bin/docker-compose
启动
1docker-compose up -d
查看admin密码
1❯ docker exec -it jenkins cat /var/je ...
