Skip to content

Instantly share code, notes, and snippets.

/usr/bin/rclone mount alist:/ /volume2/CloudDrive/alist --config /volume1/homes/admin/.config/rclone/rclone.conf --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000 --use-mmap --network-mode --cache-dir /volume2/CloudNAS/cache --vfs-cache-mode full --header "Referer:" --dir-cache-time 24h --buffer-size 512M --vfs-read-chunk-size 16M --vfs-read-chunk-size-limit 64M --vfs-cache-max-size 10G
# Unmount
fusermount -u /volume2/CloudDrive/alist
@goooooouwa
goooooouwa / dsm-6-usb-exfat-mount.sh
Last active March 14, 2024 09:29
DSM 6.0 6.2.3 不安装exfat access套件支持exFAT读写
# 来源:https://blog.csdn.net/weixin_49393427/article/details/113805570?utm_source=pocket_saves
# 打开DSM的SSH管理
# SSH连接,并使用管理员账户登录
# 执行:
wget -P /tmp/ http://mirrors.kernel.org/ubuntu/pool/universe/f/fuse-exfat/exfat-fuse_1.2.3-1_amd64.deb
dpkg -x /tmp/exfat-fuse_1.2.3-1_amd64.deb /tmp/exfat-fuse/
cp /tmp/exfat-fuse/sbin/mount.exfat-fuse /usr/bin/
# 注意:所有命令如果提示权限不够用sudo执行
@goooooouwa
goooooouwa / cp-local-folders.sh
Created March 10, 2024 01:50
Rsync & CP sync local folders
# copy --archive --recursive --update-only --verbose
cp -aRuv /from/local/* /to/local/
@goooooouwa
goooooouwa / fix-chrome-remote-desktop-audio.sh
Last active March 4, 2024 00:30
start the following script on login to fix ubuntu chrome remote desktop audio issue
# chmod +x fix-chrome-remote-desktop-audio.sh
# add script to auto start on login
systemctl --user restart pulseaudio
@goooooouwa
goooooouwa / config.txt
Created March 3, 2024 13:44
Raspberry Pi 3/4 official 7 inch touchscreen display rotation fix
# in /boot/config.txt
# https://community.octoprint.org/t/raspberry-pi-4-4gb-with-official-7-touch-screen-will-not-rotate/29915/3
# Blocked out the line for "dtoverlay=vc4-fkms-v3d" in the /boot/config.txt worked a treat. I guess that line blocks the screen rotation codes as they cannot both work in tandem
lcd_rotate=2
@goooooouwa
goooooouwa / s905-armbian-fix-libc-bin.sh
Created February 28, 2024 12:42
s905l3a CM311-1a Armbian Jammy libc-bin issue fix: https://github.com/microsoft/WSL/issues/4760
sudo mv /var/lib/dpkg/info/libc-bin.* /tmp/
sudo dpkg --remove --force-remove-reinstreq libc-bin
sudo dpkg --purge libc-bin
sudo apt install libc-bin
sudo mv /tmp/libc-bin.* /var/lib/dpkg/info/
# if above not works
sudo apt-get --fix-broken install
@goooooouwa
goooooouwa / pveperf.sh
Created February 28, 2024 01:03
pve节点性能测试
pveperf /mnt/pve/local-hdd/
#CPU BOGOMIPS: 15974.40
#REGEX/SECOND: 1455734
#HD SIZE: 228.17 GB (/dev/sdb1)
#BUFFERED READS: 67.31 MB/sec
#AVERAGE SEEK TIME: 20.83 ms
#FSYNCS/SECOND: 39.18
#DNS EXT: 83.78 ms

I tried so many things after the upgrade to 22.04 and nothing seemed to work, and what I noticed (in my case), is that the kernel was not using the snd_hda_intel driver and therefor couldn't see/load the soundcard while lspci was still showing the soundcard.

I tried several of the options found and what did work for me what eventually the last option found on this page:

https://itsfoss.com/fix-sound-ubuntu-1304-quick-tip/

which was actually saying to add the following to the alsa-base.conf (/etc/modprobe.d/alsa-base.conf) and reboot:

options snd-hda-intel dmic_detect=0 after the reboot I finally had audio again!

@goooooouwa
goooooouwa / backup-pg-dump.sql
Last active December 9, 2023 01:44
how to backup & restore a pg dump in postgres docker container
sudo docker exec -t e564422f1f57 pg_dumpall -c -U postgres > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
@goooooouwa
goooooouwa / daily-bash-script-samples.sh
Last active August 25, 2023 06:21
daily bash script samples
#!/bin/bash
# For loop to exeute some task multiple times
for i in Item1 Item2 ItemN; do
bash ~/task.sh ${i}
done
for i in {1..10}
do
wget https://static.generated.photos/vue-static/human-generator/poses/female/00$i.png