Google Translate

2025年5月1日星期四

Mount smb network shared folder

sudo apt update

sudo apt install cifs-utils

sudo mkdir /mnt/local_folder


sudo vi ~/.smbcredentials

username=xxx

password=xxx


sudo vi /etc/fstab

# add to last line:

//192.168.xx.xx/shared_folder /mnt/local_foler cifs credentials=/home/your_local_username/.smbcredentials,uid=1000,gid=1000,_netdev,vers=3.0 0 0

(uid = id -u your_local_username)

(gid = id -g your_local_username)

sudo systemctl daemon-reload

# test mount

sudo mount -a

2025年3月26日星期三

Ubuntu Tricks

Copy with speed and progress:

 rsync -r -v --info=progress2 ssh user@remote-system:/address/to/remote/file /home/user/


Clear cache / buffer:

sudo sync && sudo sysctl vm.drop_caches = 1|2|3

or

echo 3 | sudo tee /proc/sys/vm/drop_caches


Periodically clear cache / buffer:

sudo crontab -e
0 * * * * /usr/bin/sync; /usr/sbin/sysctl vm.drop_caches=3


vfs cache threshold:

sudo sysctl vm.vfs_cache_pressure=100