2023-08-19
Recycle Bin, Trash Can Cli Alternative

trash-cli (with python binding) may work cross-platform, but manage its own recycle bin instead of the system if using windows or macos.

empty-trash-cli

windows

cmdutils which has recycle and bin commands

cmd-recycle

nircmd

1
2
nircmd moverecyclebin *.tmp

macos

do this manually:

1
2
3
4
# i don't trust this.
#rm -rf ~/.Trash/*
osascript -e 'tell app "Finder" to empty'

trash

rmtrash in nightproductions’s cli tools

Read More

2022-08-11
Copy Symlink Itself To Change Pyjom'S Location, Install Easyd Services For Macos Local Pyjom Watchdog

1
2
3
cd /media/root/parrot
cp -R -P /media/root/help1/pyjom .

because of the qqChatBot task, pyjom on kali may be syncing too often. need to check the watchdog logs.

turned out it is the __pycache__ dirs to be blamed

disable all sync related services on macos for debug:

main issue happens after local vscode launched.

the issue is such that the proxy setting not right.

to debug the service:

1
2
sudo launchctl debug gui/501/pyjom_local_syncdog --stdout --stderr

1
2
3
4
5
6
# to be succint:
launchctl list | grep syncdog | awk '{print $1}' | xargs -I abc kill -s TERM abc
# instead of:
#launchctl list | grep pyjom_local_syncdog # to get process pid
#kill -s TERM <service_pid>

we need to add some code for it. consider adding something alike to that to kali?

1
2
3
os.environ["http_proxy"]="http://localhost:7930"
os.environ["https_proxy"]="http://localhost:7930"

1
2
3
4
5
6
7
8
9
10
11
launchctl stop gui/501/pyjom_local_watchdog;
launchctl kill TERM gui/501/pyjom_local_watchdog;
launchctl unload gui/501/pyjom_local_watchdog;
launchctl disable gui/501/pyjom_local_watchdog;
launchctl remove gui/501/pyjom_local_watchdog;
launchctl stop gui/501/pyjom_local_syncdog;
launchctl kill TERM gui/501/pyjom_local_syncdog;
launchctl unload gui/501/pyjom_local_syncdog;
launchctl disable gui/501/pyjom_local_syncdog;
launchctl remove gui/501/pyjom_local_syncdog

install macos pyjom watchdog (local):

1
2
easyd -l pyjom_local_watchdog -w /Users/jamesbrown/Desktop/works/sync_git_repos -- /usr/bin/python3 /Users/jamesbrown/Desktop/works/sync_git_repos/watchdog_macos.py

install macos pyjom syncdog (local):

1
2
easyd -l pyjom_local_syncdog -w /Users/jamesbrown/Desktop/works/sync_git_repos -- /usr/bin/python3 /Users/jamesbrown/Desktop/works/sync_git_repos/syncdog_macos.py

Read More

2022-08-08
Macos Mount Ntfs Volumes

macos mount ntfs read-only by default.

code from mounty.app

mounty is somehow not working so manual remount is needed.

one needs to click the remount button to mount it again under /Users/jamesbrown/.mounty/Toshiba3000

1
2
3
sudo umount /Volumes/Toshiba3000
sudo mkdir /Volumes/Toshiba3000; sudo mount -t ntfs -o rw,auto,nobrowse /dev/<diskIdentifier> /Volumes/Toshiba3000

Read More

2022-08-07
Macos Locate Fix And Alternative

the fix

to enable the service:

1
2
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist

to update locate db:

1
2
sudo /usr/libexec/locate.updatedb

or, more conveniently:

1
2
3
sudo ln -s /usr/libexec/locate.updatedb /usr/local/sbin/updatedb
sudo updatedb

alternative

use mdfind

Read More

2022-07-28
Time Machine Nas Macos

use rclone to periodically commit files to NAS (incremental only, do not delete things), or use rclone to copy files to external SSD

buy airport extreme as wireless router and backup device


when in doubt, delete files under GUI instead of terminal

check out commands for moving files into trash bin instead of direct removal on different OSes


my data under ~/works is lost. fuck.

buy me some ssd 512GB at least to do time machine backup.

buy m.2 ssd to reduce the size.

use usb-c cables to prevent inconvenience.


the filesystem will be formatted as APFS.

need a dedicated usb storage for it.

do not know if it is incremental backup.

Read More

2022-07-27
Macos Window Click-Through

use cmd-click to operate the inactive window without activating it.

linux/windows not having this feature. might need custom hot key for this.

Read More

2022-07-27
Macbook M1 Create Macos Recovery Usb

Read More
â–˛