Skip to content

Instantly share code, notes, and snippets.

View BruceWind's full-sized avatar
🏠
Working from home

Bruce BruceWind

🏠
Working from home
View GitHub Profile
@BruceWind
BruceWind / ReduceMemoryUsage4PVEHost.md
Last active March 11, 2024 08:52
Tricks to reduce memory usage in Proxmox Virtual Environment (PVE).

let VM(linux) flush the memory cache

switch to root user, and add an interval task into crontab in linux VM:

0 */3 * * * /bin/sh -c 'echo 1 > /proc/sys/vm/drop_caches'

controls the tendency of the kernel to swap out memory pages to the swap

@BruceWind
BruceWind / ForgetUbuntuPassword.md
Last active January 20, 2024 08:39
reset Ubuntu password with live USB drive.

To make this method work, we need to have bootable media created from the Ubuntu ISO. Download the Ubuntu ISO. In my case, I'm running Ubuntu 20.04.1 LTS.

Create a bootable USB flash drive. Refer to the instructions on how to create a bootable USB drive.

Boot into the Ubuntu bootable media. When prompted, select "Try Ubuntu". This will start the Ubuntu live session.

Once in the live session, launch the terminal.

We need to identify the root file system partition. The following command will list all the partitions in the system. The important part of the output is the last section, which contains a short partition table.

@BruceWind
BruceWind / node_subscription_from_cloudflare_workers.md
Last active January 8, 2024 04:13
For Chinese developers, there is a nice way to subscribe your proxy nodes on Cloudlfare.

Subscribing Nodes from Cloudflare Worker to Bypass GFW for Chinese Developers

This document aims to introduce a method for Chinese developers to bypass the GFW by subscribing proxy nodes on Cloudflare Worker.

The GFW is a network firewall implemented by the Chinese government that restricts access to certain international websites and services.

Every Chinese developer need proxy nodes to access development resource. When you have many proxy nodes, some of them is copied from friends, or some nodes are shared on the internet.

@BruceWind
BruceWind / wordpress_trickys.md
Last active December 5, 2023 08:56
sharing my tricks which I use to manage wordpress.
@BruceWind
BruceWind / setup_openwrt_within_x86_docker.md
Last active December 5, 2023 08:57
run openwrt in docker

Ive looked at https://www.ahsup.top/post/linux/openwrt/ . and I established with these commands, which are different from setting on a raspberry pi. This is because my docker host is x86 ABI.

ip link set enp1s0 promisc on


docker network prune
@BruceWind
BruceWind / Axt1800-setup.md
Last active October 1, 2023 13:11
Axt1800 setup

set the threshold of fan

vi /etc/config/glfan

to enlarge /overlay with a sdcard:

@BruceWind
BruceWind / translate_all_Chinese_to_En_in_one_key.md
Last active December 12, 2023 15:03
One-key shell to convert all Chinese text in a repository to English.

One-key shell to convert all Chinese text in a repository to English.

I use it to translation Chinese text in my project. I share this to help so many people's time on translate their project.

# A shell, which is utilised to match all Chinese texts.

########################################################################
# Usage:
@BruceWind
BruceWind / establish-VPN-by-replit.md
Last active December 29, 2022 09:27
Use Replit to establish a VPN server
@BruceWind
BruceWind / image-operation-on-macos.md
Last active December 21, 2022 10:00
Some trickies about image operation on Mac OS.

handle HEIC format

# brew install magick, at first
# convert a single image
magick convert foo.HEIC foo.jpg

# bulk convert multiple images
magick mogrify -monitor -format jpg *.HEIC
@BruceWind
BruceWind / obtaining-events-from-google-calendar.md
Last active September 6, 2022 03:03
A JavaScript to get events in this month from Google calendar.

Background

I use Google calendar for managing my schedule. But there is no approach to getting all events in text format. So I wrote this for obtaining events from Google Calendar.

How to use

  1. open Google Calendar within chrome.
  2. press F12 to open dev tool.
  3. click console tab.
  4. copy and paste this code below.