IT漫步

技术生活札记©Yaohui

博客

Gitlab pages throws 502

Intermittent 502 errors or after a few days If you run Pages on a system that uses systemd and tmpfiles.d, you may encounter intermittent 502 errors trying to serve Pages with an error similar to: dial tcp: lookup gitlab.example.com on [::1]:53: dial udp [::1]:53: connect: no route to host” GitLab Pages creates a bind mount …

0 comments

Powershell: Copy-Item doesn’t work when file name contains square bracket ([]) characters

I have a file whose name contains square bracket characters, and I want to copy the file to another location via Powershell. So I use the Copy-Item founcation to do this. like this: Copy-Item -Path “C:\FileTest\1\[Control]Test.txt” -Destination “C:\FileTest\2\[Control]Update.txt” No errors occurred when executing the script, but the target file was not copied either. After looking …

0 comments

Follow the official document to install docker on debian/jessie meets an error

Update the apt package index and install packages to allow apt to use repository over HTTPS: apt-get update apt-get install \ ca-certificates \ curl \ gnupg \ lsb-release Add Docker’s official GPG key: curl -fsSL https://download.docker.com/linux/debian/gpg | gpg –dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg Use the following command to set up the stable repository echo \ “deb [arch=$(dpkg …

0 comments

Powershell does not support pass Boolean parameter when -File parameter is used

Let’s say there is a Powershell script file named test.ps1 with the following content: param ([Boolean] $FromSchTask) if ($FromSchTask) { echo Yes } else { echo No } When I run this script with -File parameter in command prompt by powershell.exe, for example: C:\>powershell.exe -ExecutionPolicy bypass -File ./test.ps1 -FromSchTask $True It will throw the following …

0 comments

iBus not working on Ubuntu 20.04.4 LTS, 无法在Ubuntu中输入中文

问题现象 Ubuntu 20.04.4 LTS 添加汉语语言 安装完iBus及相关的输入法 (ibus-pinyin, ibus-table-wubi)后,就算是切换到zh语言也无法输入中文字符 换成fcitx后解决: 安装fcitx: $ sudo apt install fcitx 打开工具 Language Support/语言支持, 把Keyboard input method system改成fcitx 安装五笔输入法 $ sudo apt install fcitx-table-wubi 按Ctrl + Space或Left Shift在中英文之间切换 按Ctrl + Shift在不同的中文输入法之间切换

0 comments

USB specifications and aliases of USB3

Specification Previous Term Technical Term Marketing Term USB 3.2 N/A USB 3.2 Gen 2×2 SuperSpeed USB 20Gbps USB 3.1 USB 3.1 Gen 2 USB 3.2 Gen 2 SuperSpeed USB 10Gbps USB 3.0 USB 3.1 Gen 1 USB 3.2 Gen 1 SuperSpeed USB References: Forget USB 3.0 & USB 3.1: USB 3.2 Moving Forward USB 4.0:支援 …

0 comments

Aliyun SLS 日志加工高级参数

1. system.control.filter_pack_id 控制数据加工后是否过滤掉pack_id字段, 该字段用于日志条目的上下文查询 – 默认值: true – 如果日志加工后想保留pack_id字段, 把该字段设置为false

0 comments

Two methods to resolve StackExchange.Redis.RedisTimeoutException in C#

StackExchange.Redis.RedisTimeoutException: Timeout performing SETEX (5000ms), next: SETEX AutoOps:PodLauncher:2109:LWSY:75:85001:IsMainServerRunning, inst: 0, qu: 0, qs: 1, aw: False, rs: ReadAsync, ws: Idle, in: 0, in-pipe: 0, out-pipe: 0, serverEndpoint: r-bp1je5yrr7ctdzwhmk.redis.rds.aliyuncs.com:6379, mc: 1/1/0, mgr: 10 of 10 available, clientName: 2109-85001-0, IOCP: (Busy=1,Free=999,Min=4,Max=1000), WORKER: (Busy=2,Free=32765,Min=32,Max=32767), v: 2.1.28.64774 (Please take a look at this article for some common client-side issues …

0 comments

[Powershell]Clear docker images by Invoke-RestMethod to docker api

# Clear expired docker images with in specific namespace (30 days ago) (Invoke-RestMethod http://localhost:2375/images/json) | Where-Object { $_.RepoTags -Like ‘*/q1game/*’ -And ((New-TimeSpan -Start (Get-Date ‘1970-1-1’) -End (Get-Date).ToUniversalTime()).TotalSeconds – $_.Created) -GT (30 * 24 * 60 * 60)} | ForEach-Object{ docker.exe rmi $_.RepoTags }

0 comments

[Powershell] Create folder, copy file and verify file hash, regex usage

Method #1: $hashPattern = “^MD5\s+(\w+)\s+”; $sourceFile = “C:\temp\6372241e-591e-4063-b15d-8aa34ae1ac63.txt”; $destFolder = “C:\app\social space\data\scp”; $destFileName = “test.txt”; $destFile = Join-Path -Path $destFolder -ChildPath $destFileName; New-Item -ItemType Directory -Force -Path $destFolder | Out-Null; Copy-Item $sourceFile -Destination $destFile -Force | Out-Null; Get-FileHash $destFile -Algorithm MD5 | Out-String -Stream | Select-String -Pattern $hashPattern | % {$_.matches.Groups[1]} | % {$_.Value}; Key …

0 comments
Proudly powered by WordPress