Misc Note

Show password in web

1
document.querySelector("input[type=password]").value;

Show IP address

public:

1
curl ifconfig.me

private:

1
ipconfig

Download file and unzip

1
2
wget https://training.linuxfoundation.org/cm/LFS258/LFS258V2021-09-20SOLUTIONS.tar.xz --user=xxx --password=xxx
tar -xvf LFS258V2021-09-20SOLUTIONS.tar.xz

Send email from gmail

Reference:

Note:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import smtplib
from email.mime.text import MIMEText
import ssl

port = 465
password = input("your password")
context = ssl.create_default_context()

msg = MIMEText("The body of the email is here")
msg['Subject'] = "An Email Alert"
msg['From'] = "my@gmail.com"
msg['To'] = "other@xxx.xxx"

with smtplib.SMTP_SSL("smtp.gmail.com", port, context=context) as server:
server.login("my@gmail.com", password)
server.send_message(msg)

Check the quality of a website

Setup personal PC as SSH server

Get started with OpenSSH for Windows

related commands:

1
2
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled
True -Direction Inbound -Protocol TCP -Action Allow -Local Port 22
1
icacls.exe "C:\Users\<username>\.ssh\authorized_keys" /inheritance:r /grant "Administrators:F" /grant "SYSTEM:F"
1
Test-NetConnection -ComputerName 192.168.1.67 -Port 57859