2023-09-21
Introducing Ntfy: A Service For Publishing Messages And Monitoring Statuses On A Dashboard

message publishing, message queue, status viewer, dashboard

ntfy

Read More

2022-08-11
The Kali Command On Macos

debugging

when kali is off, this mac will go crazy and hang everything.

need to scan for kali existance on demand, not all the time.

developing

should we use p2p networks to speed up remote connections like n2n or tinc?

would it be interesting to run all our kali connectors ranged from vscode-ssh-connect, rclone mount and direct ssh connection via kali command dynamically by our kali discovery service, if we can reload the nginx daemon on demand.

using redis to store some daemon reported values.

how about we set the workding directory of redis-server to /tmp so that the dump.rdb file will never take space after reboot?

we need to know if this will successifully launch after reboot since /tmp may not exist by that time

default redis server port: 6379

install redis-server service:

1
2
easyd -w /tmp -l redis_server -- /opt/homebrew/bin/redis-server

first value is online.

next value is kali_ip.

using both value to determine whether to connect to kali or not, and the exact address.

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-09
Systemd On Linux, Maintainence Details

view full logs

1
2
journalctl -u <serviceName>.service

create, install, restart, reload

1
2
3
4
5
6
cd /etc/systemd/system
create <serviceName>.service
systemctl enable <serviceName>.service
systemctl daemon-reload
systemctl start <serviceName>.service

sample systemd service config files

maybe we should add some autorestart configs at it?

frpc_service.service

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[Unit]
Description=frpc service, expose ssh, webdav and code-server ports
Wants=network.target
After=syslog.target network-online.target
[Service]
Type=simple
User=root
ExecStart=/root/frp_client_linux/frp_0.36.2_linux_amd64/frpc -c frpc.ini
WorkingDirectory=/root/frp_client_linux/frp_0.36.2_linux_amd64
Restart=on-failure
RestartSec=10
KillMode=process
[Install]
WantedBy=multi-user.target

pyjom_webdav_rclone_service.service

1
2
3
4
5
6
7
8
9
[Unit]
Description=rclone webdav served on pyjom, after the disk is mounted
[Service]
User=root
ExecStart=/usr/bin/python3 mount_help_and_serve_pyjom.py
WorkingDirectory=/root/Desktop/works/restore_sessions
[Install]
WantedBy=multi-user.target

tempthrottle.service

1
2
3
4
5
6
7
8
9
[Unit]
Description=temperature control, cpu temperature under 60 celsius
[Service]
User=root
ExecStart=/usr/bin/python3 tempthrottle_daemon.py
WorkingDirectory=/root/Desktop/works/restore_sessions
[Install]
WantedBy=multi-user.target

clash_fastgithub.service

1
2
3
4
5
6
7
8
9
10
[Unit]
Description=Clash Fastgithub Proxy
After=network.target
[Service]
Type=simple
Restart=always
ExecStart=/usr/bin/clash -d /etc/clash
[Install]
WantedBy=multi-user.target

tujia_scraper_qq_bot.service

1
2
3
4
5
6
7
8
9
10
11
12
13
[Unit]
Description=two crucial services: tujia scraper, qq bot
Wants=network.target
After=syslog.target network-online.target
[Service]
Environment="DISPLAY=:1"
Environment="XAUTHORITY=/root/.Xauthority"
User=root
ExecStart=/usr/bin/python3 main_daemon.py
WorkingDirectory=/root/Desktop/works/restore_sessions
[Install]
WantedBy=graphical.target

sync_git_repos_syncdog.service

1
2
3
4
5
6
7
8
9
10
11
[Unit]
Description=syncdog (server), to sync things to the cloud (github)
Wants=sshd.service
Wants=network.target
[Service]
User=root
ExecStart=/usr/bin/python3 syncdog_test.py
WorkingDirectory=/root/Desktop/works/sync_git_repos
[Install]
WantedBy=multi-user.target

Read More

2022-07-27
Linux Restore Window Sessions

to relaunch app in given workspace

tools:

wmctrl

devilspie

launch_on_workspace

references:

https://unix.stackexchange.com/questions/27050/how-to-start-an-application-on-a-different-workspace

https://askubuntu.com/questions/89946/open-application-in-specific-workspace

npm install -g linux-window-session-manager

restore session manually

dconf-editor

org.gnome.gnome-session

auto-save-session -> on

Read More