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 / 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 / start_android_emulator_with_docker.md
Last active January 29, 2024 11:03
You may have a need of emulator in order to run AndroidTes with CI or other. To meet the needs, I start up an Android emulator with docker.
  1. preparation:
  1. run the command:
docker run -d \
  --network=host \
 -e ADBKEY="$(cat ~/.android/adbkey)" \
@BruceWind
BruceWind / create_http_file_system.md
Last active June 14, 2024 02:00
Establlish my media server with docker.

filebrowser

Here is the original software code: filebrowser.

But I'd like to use docker to establish that http file system due to the fact that docker would restart its containers.

Http protocol is compatible with all of platforms.

docker pull hurlenko/filebrowser
sudo mkdir /hls
@gjreasoner
gjreasoner / README.md
Last active April 25, 2024 01:42
Expand Ubuntu 20 Proxmox Disk
# Resize the file system in UI, under VM -> Hardware -> Click on the disk to resize, click "Resize disk" button

# Confirm increase in disk space (1TB in my case)
$ lsblk
NAME                      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                         8:0    0    1T  0 disk
├─sda1                      8:1    0    1M  0 part
├─sda2                      8:2    0    1G  0 part /boot
└─sda3                      8:3    0    1T  0 part
@hataiit9x
hataiit9x / swap.sh
Created October 8, 2019 15:08 — forked from Repox/swap.sh
Shell script for adding swap to Linux
#!/bin/sh
# size of swapfile in megabytes
swapsize=1024
# does the swap file already exist?
grep -q "swapfile" /etc/fstab
# if not then create it
if [ $? -ne 0 ]; then
openssl speed -elapsed aes-128-cbc aes-192-cbc aes-256-cbc aes-128-gcm aes-256-gcm chacha20-poly1305

OpenSSL 1.1.1c  28 May 2019
built on: Thu May 30 15:27:48 2019 UTC
options:bn(64,64) rc4(16x,int) des(int) aes(partial) blowfish(ptr)
compiler: gcc -fPIC -pthread -m64 -Wa,--noexecstack -Wall -Wa,--noexecstack -g -O2 -fdebug-prefix-map=/build/openssl-of5rlU/openssl-1.1.1c=. -fstack-protector-strong -Wformat -Werror=format-security -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2
aes-128 cbc      79488.08k    88101.27k    89086.72k   192756.39k   193074.52k   189848.24k
aes-192 cbc      66074.15k    73478.70k    74778.11k   166620.50k   166070.95k   165784.23k
aes-256 cbc      58555.02k    63211.73
@zoilomora
zoilomora / README.md
Last active May 13, 2024 16:49
How to disable systemd-resolved in Ubuntu

How to disable systemd-resolved in Ubuntu

Stages

  • Disable and stop the systemd-resolved service:

      sudo systemctl disable systemd-resolved.service
      sudo systemctl stop systemd-resolved
    
  • Then put the following line in the [main] section of your /etc/NetworkManager/NetworkManager.conf:

@imba-tjd
imba-tjd / .Cloud.md
Last active July 23, 2024 07:11
☁️ 一些免费的云资源

IaaS指提供系统(可以自己选)或者储存空间之类的硬件,软件要自己手动装;PaaS提供语言环境和框架(可以自己选);SaaS只能使用开发好的软件(卖软件本身);BaaS一般类似于非关系数据库,但各家不通用,有时还有一些其它东西。

其他人的集合

@dpmedeiros
dpmedeiros / AndroidMockUtil.java
Last active January 28, 2021 06:26
Mock main thread handler for use in Android unit tests (requires Mockito and PowerMock)
package com.dpmedeiros.androidtestsupportlibrary;
import android.os.Handler;
import android.os.Looper;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.powermock.api.mockito.PowerMockito;
import java.util.concurrent.Executors;