Auto open apps on Mac

I poweroff my laptop every night. So I have to open some app I use everyday when I started the laptop. I use a script by Justin Hileman, to open news tabs in terminal. Save this script as init.sh, run sh init.sh in the terminal, and it will do several things: run wg.sh, setup wireguard tunnal open new tab, start a tmux session open new tab, using mosh to ssh a server open new tab, open a txt file using vim open github in chrome start vs code show a popup message #!/bin/bash # # Open new Terminal tabs from the command line # # Author: Justin Hileman (http://justinhileman.com) # # Installation: # Add the following function to your `.bashrc` or `....

December 21, 2023 · notsobad

Using Windows

最近开始用一台旧的XPS 13笔记本,之前被自动升级到了win 11,于是就开始了windows的体验,目前可以使用WSL2,里面安装了ubuntu 22.04, 然后发现了另外一个比较有意思的软件,就是winget, 这个之前一直没有用过,这次就体验了一下。...

December 1, 2023 · notsobad

vscode Tips

不同步某些配置项 参考:https://code.visualstudio.com/docs/editor/settings-sync#_configuring-synced-data 可以设置settingsSync.ignoredSetti...

November 20, 2023 · notsobad

Gitlab Ci Tips

调试ci 参考这篇文章: https://www.lullabot.com/articles/debugging-jobs-gitlab-ci 本地配置gitlab runner环境 在本地代码中操作,修改ci脚本使其在适当的位置sleep 本地提交改动过的代码,注意ci只会执行在git仓库中的代码 运行runner docker exec进入运行中的容器 本地运行runner,注...

October 8, 2023 · notsobad

Clickhouse Tips

投影projection 官方文档https://clickhouse.com/docs/en/sql-reference/statements/alter/projection 创建这个特性时的讨论:https://github.com/Cl...

September 14, 2023 · notsobad

ffmpeg Tips

安装 brew install ffmpeg --with-libvpx --with-libvorbis --with-ffplay ffmpeg -codecs ffmpeg -f avfoundation -list_devices true -i "" 查看文件信息 ffmpeg -i screen.mp4 录屏 ffmpeg -r 30 -f avfoundation -i 1 -vcodec vp8 -quality realtime screen2.webm ffmpeg -r 30 -f avfoundation -i 1 -vcodec h264 screen.mp4 视频转换为gif ffmpeg -ss 2 -t 4 -i screen.mp4 -s 240x180 screen.gif 视频转为图片 ffmpeg -i video.mp4 image%d.jpg 视频文件的前十秒,每一秒生成一张图片 ffmpeg -i Downloads/硅谷第5季第一集.mp4...

August 31, 2023 · notsobad

Archlinux Tips

使用archinstall进行安装,注意终端只有一个tty,错误输出会打印到这个tty里,可以临时禁用错误输出。 dmesg -n 1 另外archinstall中输入密码时如果发现无法回车确认,可以用ctrl + j来代替回车。 安装gnome pacman -S gnome systemctl enable gdm systemctl start gdm...

August 29, 2023 · notsobad

Golang Tips

快速的单个文件测试 # run without build go run main.go # 如果 main.go依赖test.go, 那就需要指定好依赖文件,或者用go build go run main.go test.go # or build it go build -o xxx main.go ./xxx godoc 文档: go install golang.org/x/tools/cmd/godoc@latest godoc -http :6060 # visit http://localhost:6060/ 使用protobuf,需要安装protoc-gen-go, 同时~/go/bin...

August 21, 2023 · notsobad

休假记录

最近休了个年假,一家三口去开车出去玩,没有计划,只是看着地图,按照一天能开的路程选目的地,最终去了贵州、广西、云南。 首站在贵州遵义,去看了个溶洞和底下裂缝景区,还是不错的,比较凉快,但是小孩太小,几乎全程抱着,很累。 然后就前往广西,在桂林去...

August 12, 2023 · notsobad

Docker Tips

docker 基础使用 docker build时会把Dockerfile目录下的所有东西发往docker daemon, 可以增加一个’.dockerignore’文件来排除某些目录或文件。 docker run -d -p 80:80 --name webserver nginx docker stop webserver docker start webserver docker rm -f webserver docker run ubuntu /bin/echo 'Hello world' docker run -it ubuntu /bin/bash docker run -it --rm...

July 20, 2023 · notsobad