Author Archives: jinweijie

Docker Proxy Configuration

There are a lot of places to configure the proxy for Docker. Two major scenarios: If you want to configure the proxy for the containers (like apt install inside container), you need to config in ~/.docker/config.json. If you want to use proxy for Docker itself, like docker pull , configure the systemd: https://medium.com/@bennyh/docker-and-proxy-88148a3f35f7 Or edit… Read More »

Create reverse tunnel with autossh and systemd

Install autossh with sudo apt install autossh Create autossh.service in /etc/systemd/system/ folder The content of autossh.service: [Unit] Description=AutoSSH service for a reverse tunnel from SERVER to localhost After=network-online.target # start after DNS ready, but seems no difference with network-online.target #After=nss-lookup.target [Service] ExecStart=autossh -M [LOCAL_PORT] -N -D [YOUR_LOCAL_IP]:[LOCAL_PORT] -i [YOUR_PRIVATE_KEY] [REMOTE_USER]@[REMOTE_USERVER] RestartSec=5 Restart=always [Install] WantedBy=multi-user.target Execute… Read More »

Docker Image Cleanup

Here is a bash script to cleanup images on a build server: #!/bin/bash sudo docker image rm -f $(sudo docker image ls | grep ‘your_image_name’ | awk ‘{ print $3 }’) sudo docker images -q -f dangling=true | xargs -r sudo docker rmi -f Hope it helps. 🙂

Bluetooth mouse won’t connect after reboot/sleep on Ubuntu 18.04

System & hardware: OS: Ubuntu 18.04 LTS Mouse: Logitech M337 Symptom: After reboot/sleep, Bluetooth mouse won’t get connected again. Need to remove and pair again to make it work again. Steps to solve this problem: 1. Update bluez. sudo add-apt-repository ppa:bluetooth/bluez sudo apt install bluez 2. Remove paired mouse. (If it is paired before) 3.… Read More »

Open in Visual Studio Code in Finder with Automator

Here’s how to add “Open in Visual Studio Code” in Finder in MacOS: Open Automator. Choose Quick Action. Change Workflow receives current with files and folders, and in with Finder.app and Path Finder.app (if you have) Add an action Run Shell Script, enter open -n -b “com.microsoft.VSCode” –args “$*” And it’s done.  

Category: mac

Display Azure Container Registry as Table

The docker image display of Azure Container Registry is horrible: From the Azure UI, you don’t know the relation of each tag and time. So I wrote a shell script to display it in a table using Azure Cli: The result will be like this: Much nicer. 🙂

Migrate from Vue Cli 2 to 3

Vue Cli 3 is officially released so it’s a great time to upgrade because it brings a bunch of new features like plugin system, hiding the complexity of webpack and the very nice UI for the Cli. It make the Vue development experience even more fun. I spent around 30 mins to migrate an complete… Read More »

Category: vue