How to find files modified more than X days ago


Find files modified more than 48 hours ago:

$ find /path -mtime +1

Find files modified more than n=90 days ago (cutoff by the hour, not the day).

$ find /path -mtime +89

Note the +(n-1) in command. Many online articles got this wrong by simply putting +90.



—— 印順法師《般若經講記》 (Source)




—— 昭慧法師 · 無常、無我,大悲、大願——佛指舍利的啟發 (Source)

WOT probes my web access history

I loaded a private web address using Chromium with the extension WOT v2.6.0 (by www [dot] mywot [dot] com).

Hours later, some unknown IP probed my private address.

I repeated the same test with another unique private URL, and hours later, the same ec2 IP loaded that private URL again.

Then I disabled the WOT extension in Chromium and repeated the same test with a new unique private URL. No more probes.

Bad WOT! You should just be checking whether a link has bad reputation instead of loading the web addresses I’ve visited.


How to change sshd default port on firewalld

Instead of messing around with the ports directly with RHEL7/CentOS7 firewall-cmd, I’ve decided to update the port number in the ssh.xml service file instead. Think it’s cleaner this way.

For example, here are the steps to change sshd port from the default 22 to 9876:

1. Make a copy of the default ssh service file:
cp /usr/lib/firewalld/services/ssh.xml /etc/firewalld/services/

2. Inspect current firewall settings
iptables -nL | grep -e 22 -e 9876
ACCEPT     tcp  —              tcp dpt:22 ctstate NEW

3. Edit /etc/firewalld/services/ssh.xml to change port number
From: <port protocol=”tcp” port=”22″/>
To: <port protocol=”tcp” port=”9876″/>

4. Change /etc/ssh/sshd_config port to 9876

5. Restart sshd
systemctl restart sshd

6. Notice that sshd now listens on new port
netstat -punta

7. Reload firewalld, which will pick up the new port in ssh.xml
firewall-cmd –reload

8. Inspect new firewall settings, notice port changed
iptables -nL | grep -e 22 -e 9876
ACCEPT     tcp  —              tcp dpt:9876 ctstate NEW

9. Test

How to reset lost root password on Raspberry Pi running Arch Linux

Assumption: SD is not encrypted

Plug SD onto another working computer, look for the “cmdline.txt” file and edit it by appending “init=/bin/sh” after “rootwait”. Save the file, remove the SD and plug it back to the RPi and boot.

You’ll be dropped into a shell. Change your passwd, then hit CTRL-ALT-DEL to trigger a reboot. Switch off the RPi when the shutdown completes, just before the boot starts. Unplug the SD and plug it onto the other working computer. Remove “init=/bin/sh” from “cmdline.txt” file.

Plug the SD back onto the RPi, boot and you can now login with the newly reset password.