[{"content":"Quickly locate large files to free up disk space\n$ du -k * | sort -nr | cut -f2 | xargs -d \u0026#39;\\n\u0026#39; du -sh | more Oracle Database Connection Tracing\nQuerying Client IP by Oracle SID\n$ netstat -anpT | grep oracleSID | awk \u0026#39;{print $5}\u0026#39; | grep -o -E \u0026#39;1.*:\u0026#39; | awk -F \u0026#39;:\u0026#39; \u0026#39;{print $1}\u0026#39; | sort Query the client IP by listening port 1521\n$ netstat -anpT | grep 1521 | awk \u0026#39;{print $5}\u0026#39; | grep -o -E \u0026#39;1.*:\u0026#39; | awk -F \u0026#39;:\u0026#39; \u0026#39;{print $1}\u0026#39; | sort Disconnecting a non-locally connected Oracle session\n$ kill -9 `ps -ef | grep oracleSID | grep LOCAL=NO | grep -v grep | awk \u0026#39;{print $2}\u0026#39;` Monitor the number of network connections\nQuery the number of processes connected to port 1521\n$ netstat -pan | grep 1521 | wc -l Query the number of processes connected from a server 192.168.1.1\n$ netstat -pan | grep 192.168.1.1 | wc -l Analyze the connection frequency of each client\n$ netstat -apnT | grep 1521 | awk \u0026#39;{print $5}\u0026#39; | sort -u | grep -v 1521 | grep -v \u0026#39;*\u0026#39; | awk -F \u0026#39;:\u0026#39; \u0026#39;{print $4}\u0026#39; | uniq -c | sort -nr Show files or directories that take up the most space\n$ du -s * | sort -nr | head Calculates the total size of the file for the specified date\n$ ls --full-time `find ./* -name \u0026#34;log_*.bak\u0026#34;` | grep \u0026#39;2024-04-09\u0026#39; | awk \u0026#39;{print $9}\u0026#39; | xargs du -ck Document cleanup\nDelete all .trc files in the /oracle directory\n$ find /oracle -name \u0026#34;*trc\u0026#34; -print | xargs rm -rf Delete all .log files in the /oracle directory 3 days ago\n$ find /oracle -name \u0026#34;*.log\u0026#34; -mtime +3 -print | xargs rm -rf Process resource utilization analysis\nTop 10 processes with the highest CPU usage\n$ ps auxw | head -1; ps auxw | sort -rn -k3 | head -10 Top 10 processes with the highest memory consumption\n$ ps auxw | head -1; ps auxw | sort -rn -k4 | head -10 Top 10 processes that use the most virtual memory\n$ ps auxw | head -1; ps auxw | sort -rn -k5 | head -10 Real-time monitoring of I/O performance\n$ iostat -d -x -m 1 3 Audit CPU utilization\n$ sar -s 08:00:00 -e 10:00:00 ","date":"2025-01-08T22:35:57-05:00","permalink":"/p/oracle-dba/","title":"Oracle DBA"},{"content":"$ docker pull delron/fastdfs $ docker run -d --name fastdfs-tracker \\\r--restart=always \\\r--network=host \\\r-p 22122:22122 \\\rdelron/fastdfs tracker mkdir -p /data/fastdfs/storage\rdocker run -d --name fastdfs-storage \\ --link fastdfs-tracker:tracker \\\r--restart=always \\\r--network=host \\\r-e TRACKER_SERVER=tracker:22122 \\\r-v /data/fastdfs/storage:/var/fdfs \\\r-p 23000:23000 -p 8080:8080 -p 8888:8888 \\\rdelron/fastdfs storage $ docker exec -it fastdfs-storage /bin/bash\rcd /etc/fdfs/\rvi storage.conf firewall-cmd --zone=public --permanent --add-port=8888/tcp\rfirewall-cmd --zone=public --permanent --add-port=22122/tcp\rfirewall-cmd --zone=public --permanent --add-port=23000/tcp # systemctl restart firewalld\r$ sudo docker ps $ docker exec -it fastdfs-storage /bin/bash\rcd /var/fdfs/\recho hello testdoc\u0026gt;b.txt\r/usr/bin/fdfs_upload_file /etc/fdfs/client.conf b.txt\rgroup1/M00/00/00/rBEABWdHM8iAGXyhAAAAFy0dlFI076.txt Accessed through a browser\nMaven References\n\u0026lt;dependency\u0026gt;\r\u0026lt;groupId\u0026gt;com.github.tobato\u0026lt;/groupId\u0026gt;\r\u0026lt;artifactId\u0026gt;fastdfs-client\u0026lt;/artifactId\u0026gt;\r\u0026lt;version\u0026gt;1.27.2\u0026lt;/version\u0026gt;\r\u0026lt;/dependency\u0026gt; Specify the FastDFS configuration in the project\u0026rsquo;s configuration file, application.properties\nfdfs.so-timeout=1500\rfdfs.connect-timeout=600\r#thumbImage param\rfdfs.thumb-image.height=150\rfdfs.thumb-image.width=150\r#TrackerList参数,支持多个\rfdfs.tracker-list=192.168.157.129:22122 File upload and download\npackage com.lm.shop.shopeureka.util;\rimport com.github.tobato.fastdfs.domain.fdfs.StorePath;\rimport com.github.tobato.fastdfs.domain.proto.storage.DownloadByteArray;\rimport com.github.tobato.fastdfs.service.FastFileStorageClient;\rimport org.slf4j.Logger;\rimport org.slf4j.LoggerFactory;\rimport org.springframework.beans.factory.annotation.Autowired;\rimport org.springframework.stereotype.Component;\rimport org.springframework.web.multipart.MultipartFile;\rimport java.io.ByteArrayInputStream;\rimport java.io.IOException;\r@Component\rpublic class FastDFSUtil {\rprivate final Logger logger = LoggerFactory.getLogger(FastDFSUtil.class);\r@Autowired\rprivate FastFileStorageClient fileStorageClient;\r/**\r* 文件上传\r*\r* @param multipartFile 附件上传\r* @return fastDfs路径\r*/ public String uploadFile(MultipartFile multipartFile) throws Exception{\rString originalFilename = multipartFile.getOriginalFilename().\rsubstring(multipartFile.getOriginalFilename().\rlastIndexOf(\u0026#34;.\u0026#34;) + 1);\rStorePath storePath = this.fileStorageClient.uploadImageAndCrtThumbImage(\rmultipartFile.getInputStream(),\rmultipartFile.getSize(),originalFilename , null);\rreturn storePath.getFullPath() ;\r}\r/** * 删除文件\r* * @param filePath 附件路径\r* @return void\r*/\rpublic void delFile(String filePath) {\rthis.fileStorageClient.deleteFile(filePath);\r}\r/**\r* 文件上传\r*\r* @param bytes 文件字节\r* @param fileSize 文件大小\r* @param extension 文件扩展名\r* @return fastDfs路径\r*/ public String uploadFile(byte[] bytes, long fileSize, String extension) {\rByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes);\rStorePath storePath = fileStorageClient.uploadFile(byteArrayInputStream, fileSize, extension, null);\rlogger.info(storePath.getGroup() + \u0026#34;===\u0026#34; + storePath.getPath() + \u0026#34;======\u0026#34; + storePath.getFullPath());\rreturn storePath.getFullPath();\r}\r/**\r* 下载文件\r*\r* @param fileUrl 文件URL\r* @return 文件字节\r* @throws IOException\r*/\rpublic byte[] downloadFile(String fileUrl) throws IOException {\rString group = fileUrl.substring(0, fileUrl.indexOf(\u0026#34;/\u0026#34;));\rString path = fileUrl.substring(fileUrl.indexOf(\u0026#34;/\u0026#34;) + 1);\rDownloadByteArray downloadByteArray = new DownloadByteArray();\rbyte[] bytes = fileStorageClient.downloadFile(group, path, downloadByteArray);\rreturn bytes;\r}\r} ","date":"2025-01-03T17:14:35-05:00","permalink":"/p/fastdfs/","title":"FastDFS"},{"content":"$ nmap -p- 192.168.2.4 $ netstat -tuln $ sudo tcpdump -i eth0 $ find / -perm /6000 -type f 2\u0026gt;/dev/null $ grep PASS /etc/login.defs $ ssh-vulnkey -a $ sudo apt install chkrootkit\r$ chkrootkit $ lsof -i -P -n $ nikto -h http://192.168.1.10 $ grep -r \u0026#34;password\u0026#34; /etc/ ","date":"2025-01-02T01:05:13-05:00","permalink":"/p/cybersecurity-on-linux/","title":"Cybersecurity on Linux"},{"content":"The right way to check the weather https://wttr.in/\rhttps://wttr.in/montreal\r$ curl wttr.in $ curl wttr.in/Beijing\r$ curl wttr.in/Beijing?format=1\r$ curl wttr.in/Beijing?format=3\r$ curl wttr.in/Beijing?lang=zh $ curl wttr.in/London\r$ curl wttr.in/Moscow\r$ curl wttr.in/Salt+Lake+City $ curl wttr.in/muc # Weather for IATA: muc, Munich International Airport, Germany\r$ curl wttr.in/ham # Weather for IATA: ham, Hamburg Airport, Germany $ curl wttr.in/~Vostok+Station\r$ curl wttr.in/~Eiffel+Tower\r$ curl wttr.in/~Kilimanjaro $ curl wttr.in/Amsterdam?u # USCS (used by default in US)\r$ curl wttr.in/Amsterdam?m # metric (SI) (used by default everywhere except US)\r$ curl wttr.in/Amsterdam?M # metric (SI), but show wind speed in m/s You can add the following command to your .bashrc or .zshrc file to automatically display the weather each time you open the terminal:\necho \u0026#34;Today\u0026#39;s weather:\u0026#34;\rcurl -s wttr.in/?format=3 Integrate weather information in scripts to facilitate automated tasks.\n#!/bin/bash\rWEATHER=$(curl -s wttr.in?format=\u0026#34;%C\u0026#34;)\rif [[ $WEATHER == *Rain* ]]; then\recho \u0026#34;It may rain today, remember to bring an umbrella!\u0026#34;\relse\recho \u0026#34;It\u0026#39;s a nice day!\u0026#34;\rfi ","date":"2024-12-26T10:26:35-05:00","permalink":"/p/check-the-weather/","title":"Check the Weather"},{"content":"$ su - # echo \u0026#39;network: {config: disabled}\u0026#39; \u0026gt; /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg # sudo vim /etc/netplan/50-cloud-init.yaml # This file is generated from information provided by the datasource. Changes # to it will not persist across an instance reboot. To disable cloud-init\u0026#39;s # network configuration capabilities, write a file # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following: # network: {config: disabled} network: ethernets: ens35: dhcp4: true version: 2 wifis: {} # netplan generate # netplan apply # systemctl stop cloud-init.service # systemctl disable cloud-init.service # systemctl status cloud-init.service ","date":"2024-12-01T17:19:24-05:00","permalink":"/p/disable-cloud-init-on-ubuntu/","title":"Disable Cloud-init on Ubuntu"},{"content":"Use Registry Editor to turn on automatic logon\rSelect Start , and then select Run .\nIn the Open box, type Regedit.exe , and then press Enter.\nLocate the HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon subkey in the registry.\nOn the Edit menu, select New , and then point to String Value .\nType AutoAdminLogon , and then press Enter.\nDouble-click AutoAdminLogon .\nIn the Edit String dialog box, type 1 and then select OK .\nDouble-click the DefaultUserName entry, type your user name, and then select OK .\nDouble-click the DefaultPassword entry, type your password, and then select OK . If the DefaultPassword value doesn\u0026rsquo;t exist, it must be added. To add the value, follow these steps:\nOn the Edit menu, select New , and then point to String Value . Type DefaultPassword , and then press Enter. Double-click DefaultPassword . In the Edit String dialog, type your password and then select OK . If no DefaultPassword string is specified, Windows automatically changes the value of the AutoAdminLogon key from 1 (true) to 0 (false), disabling the AutoAdminLogon feature. If you have joined the computer to a domain, you should add the DefaultDomainName value, and the data for the value should be set as the fully qualified domain name (FQDN) of the domain, for example contoso.com..\nExit Registry Editor.\nSelect Start , select Shutdown , and then type a reason in the Comment text box.\nSelect OK to turn off your computer.\nRestart your computer. You can now log on automatically.\nUse Sysinternals tool Autologon to configure AutoAdminLogon\rFor download and usage details, see Autologon - Sysinternals.After AutoAdminLogon is configured by using the tool, the password will be stored in a Local Security Authority (LSA) secret instead of the Winlogon key.\n","date":"2024-11-03T09:00:24-05:00","permalink":"/p/windows-autologon/","title":"Windows Autologon"},{"content":"$ ip addr\r$ ip route $ sudo ip addr add 192.168.2.5/29 dev eno1\r$ sudo ip link set eno1 up/down\r$ sudo ip route add default via 192.168.2.1 List all PCI devices\r$ lspci\r$ lspci -vvv Display Available Network Interfaces\r$ ls /sys/class/net NetworkManager or networkd?\r$ sudo service systemd-networkd status\t# Ubuntu V20.04\r$ sudo service network-manager status\t# before Ubuntu V21.10\r$ sudo service NetworkManager status\t# after Ubuntu V21.10 $ netplan status\rOnline state: online\rDNS Addresses: 127.0.0.53 (stub)\rDNS Search: \u0026lt;redacted\u0026gt;\r● 1: lo ethernet UNKNOWN/UP (unmanaged)\rMAC Address: 00:00:00:00:00:00\rAddresses: 127.0.0.1/8\r::1/128\rRoutes: ::1 metric 256\r● 2: enp0s1 ethernet UP (networkd: enp0s1)\rMAC Address: \u0026lt;redacted\u0026gt; (\u0026lt;redacted\u0026gt;)\rAddresses: 192.168.64.2/24 (dhcp)\rfd88:4b93:b031:f03e:80f0:d4ff:fe4f:15d3/64\rfe80::80f0:d4ff:fe4f:15d3/64 (link)\rDNS Addresses: 192.168.64.1\rfe80::6c7e:67ff:fe8c:8364\rDNS Search: \u0026lt;redacted\u0026gt;\rRoutes: default via 192.168.64.1 from 192.168.64.2 metric 100 (dhcp)\r192.168.64.0/24 from 192.168.64.2 metric 100 (link)\r192.168.64.1 from 192.168.64.2 metric 100 (dhcp, link)\rfd88:4b93:b031:f03e::/64 metric 100 (ra)\rfe80::/64 metric 256 You can see that the main NIC enp0s1 is being managed by networkd.\nAfter installing the network-manager package and setting the default renderer to NetworkManager, this is the only line that makes a difference in netplan status:\n● 2: enp0s1 ethernet UP (unmanaged)\nThe main NIC enp0s1 is being managed by NetworkManager now.\n$ sudo cat /run/systemd/network/10-netplan-enp0s3.network ifconfig\r$ sudo apt install net-tools\r$ ifconfig\r$ sudo ifconfig ens35 up/down iwconfig\r$ sudo apt install wireless-tools\r$ iwconfig\r$ sudo ifconfig wls34 up/down $ sudo iwlist wls34 scan | grep ESSID\r$ sudo apt install wpasupplicant\r$ wpa_passphrase \u0026#34;ssid_name\u0026#34; \u0026#34;******\u0026#34; | sudo tee /etc/wpa_supplicant.conf\r$ sudo wpa_supplicant -c /etc/wpa_supplicant.conf -i wls34 resolvectl\r$ sudo resolvectl flush-caches nmcli\r$ sudo apt network-mamager\r$ nmcli -v\r$ nmcli d\r$ sudo nmcli connection up/down ens33\r$ sudo nmcli connection reload\r$ sudo nmcli device show/status\r$ sudo nmcli c / nmcli connection show\r$ sudo nmcli c show --active networkctl\r$ networkctl\r$ networkctl status\r$ networkctl list netplan\r$ netplan status\r$ sudo netplan generate\t# Generating network configuration files.\r$ sudo netplan --debug generate\r$ sudo netplan apply\r$ sudo netplan --debug apply\r$ sudo netplan try\t# Failure to roll back the previous configuration. Ubuntu 22.04 LTS\r$ sudo vim /etc/network/00-installer-config.yaml\r$ sudo vim /etc/netplan/01-network-manager-all.yaml network:\rethernets:\rens35:\rdhcp4: true\rversion: 2 wifis:\rwls34:\rdhcp4: true\raccess-points:\r\u0026#34;ssid_name\u0026#34;:\rpassword: \u0026#34;******\u0026#34; network:\rversion: 2\rrenderer: networkd\rethernets:\rens35:\rdhcp4: no\rdhcp6: no\roptional: true\raddresses: [192.168.2.4/29]\rroutes:\r- to: default\rvia: 192.168.2.1\rmetric: 50\rnameservers:\raddresses: [1.1.1.1,45.90.28.0]\rwifis:\rwls34:\rdhcp4: no\rdhcp6: no\roptional: true\raddresses: [192.168.3.34/24]\rroutes:\r- to: default\rvia: 192.168.3.1\rmetric: 100\rnameservers:\raddresses: [1.1.1.1,45.90.28.0]\raccess-points:\r\u0026#34;ssid_name\u0026#34;:\rpassword: \u0026#34;******\u0026#34; Netplan documentation\nUbuntu 24.04 LTS\r$ sudo vim /etc/netplan/50-cloud-init.yaml Notes\rWARNING\rPermissions for /etc/netplan/00-installer-config.yaml are too open. Netplan configuration should NOT be accessible by others.\r$ sudo chmod 600 /etc/netplan/your_config_file.yaml YAML file\rThere's a good reference full of practical examples\nOne other tip, yamllint can save you a lot of trouble.\n$ sudo apt install yamllint\r$ sudo dnf install yamllint\r$ sudo pacman -S yamllint\r$ yamllint /etc/netplan/01-netplan.yaml ","date":"2024-10-26T19:44:15-05:00","permalink":"/p/network-configuration-on-linux/","title":"Network Configuration on Linux"},{"content":"\u0026gt; net user \u0026gt; net share \u0026gt; netsh wlan show \u0026gt; ipconfig | clip\t# Command copies the output to the Windows clipboard. Release and Renew IP Address\r\u0026gt; ipconfig /release \u0026amp;\u0026amp; ipconifg /renew # To release and renew your IP address on a Windows. \u0026gt; ipconfig /registerdns\t# To manually update a computer\u0026#39;s DNS records and resolver cache. Refresh hosts file without rebooting\redit C:\\Windows\\System32\\drivers\\etc\\hosts\n\u0026gt; ipconfig /displaydns\t# The contents of the DNS client resolver cache, local Hosts files, and resource records for name lookups. \u0026gt; ipconfig /flushdns\t# Flushes and resets the contents of the DNS client resolver cache \u0026gt; dnscmd /clearcache\t# CClears the DNS cache memory of resource records on a specified DNS server. \u0026gt; tracert www.google.com Find the WiFi Password\r\u0026gt; netsh wlan show profile \u0026gt; netsh wlan show profile name=\u0026#34;WiFi name\u0026#34; key=clear \u0026gt; ipconfig /release \u0026gt; ipconfig /renew \u0026gt; ipconfig /all \u0026gt; tracert dillonxu.ddns.net \u0026gt; tracert 10.20.30.40 ","date":"2024-10-20T12:28:34-04:00","permalink":"/p/network-configuration-on-windows/","title":"Network Configuration on Windows"},{"content":"Empty File Content by Redirecting to Null\r# \u0026gt; access.log Empty File Using ‘true’ Command Redirection\r# : \u0026gt; access.log # true \u0026gt; access.log Empty File Using cat/cp/dd utilities with /dev/null\r# cat /dev/null \u0026gt; access.log # cp /dev/null access.log # dd if=/dev/null of=access.log Empty File Using echo Command\r# echo \u0026#34;\u0026#34; \u0026gt; access.log # echo -n \u0026#34;\u0026#34; \u0026gt; access.log # echo \u0026gt; access.log Empty File Using truncate Command\r# truncate -s 0 access.log ","date":"2024-09-18T22:09:14-05:00","permalink":"/p/empty-or-delete-a-large-file-content-on-linux/","title":"Empty or Delete a Large File Content on Linux"},{"content":"Linux\r$ fallocate -l 10G gentoo_root.img $ dd if=/dev/zero of=./gentoo_root.img bs=4k iflag=fullblock,count_bytes count=10G $ truncate -s 10G gentoo_root.img OS X, Solaris, SunOS and probably other UNIXes\r# mkfile 10240m 10Gigfile HP-UX\r# prealloc 10Gigfile 10737418240 ","date":"2024-09-16T22:09:14-05:00","permalink":"/p/create-a-large-file-on-linux/","title":"Create a Large File on Linux"},{"content":"Erasing Disk Using shred Command\r$ sudo shred -v /dev/sdb $ sudo shred -v -n 1 /dev/sdb $ sudo shred -v -n 1 --random-source=/dev/urandom -z /dev/sdb -v --verbose\n-n --iterations=\nErasing Disk Using wipe Command\r$ sudo wipe /dev/sdb Erasing Disk Using dd Command\r$ sudo dd if=/dev/urandom of=/dev/sdb bs=512 status=progress $ sudo dd if=/dev/urandom of=/dev/sdb bs=4096 status=progress ","date":"2024-09-12T22:09:14-05:00","permalink":"/p/securely-wipe-disk-on-linux/","title":"Securely Wipe Disk on Linux"},{"content":"$ fuser -V $ fuser View Processes Running in a Directory\n$ fuser -v . Find Processes Using Network Sockets\n$ fuser -v -n tcp 8000 $ fuser /path/to/file $ fuser -n tcp 80 $ fuser -k /path/to/file $ fuser -ki -n tcp 8080 $ fuser -u /path/to/file $ fuser -m /mnt/my_mount $ fuser -v /path/to/file ","date":"2024-09-10T08:40:07-05:00","permalink":"/p/psmisc/","title":"Psmisc"},{"content":"firewalld\nCentOS 7\r# cd /usr/lib/firewalld/services/ # cp /usr/lib/firewalld/services/ssh.xml /etc/firewalld/services/ # systemctl start/stop/restart/status firewalld # systemctl enable/disable firewalld # firewall-cmd --list-all # firewall-cmd --list-ports # firewall-cmd --state # firewall-cmd --complete-reload # firewall-cmd --reload # firewall-cmd --list-all # firewall-cmd --info-service samba # firewall-cmd --add-service=ftp --permanent samba # firewall-cmd --remove-service=ftp --permanent samba # firewall-cmd --list-all-zone # firewall-cmd --get-default-zone # firewall-cmd --get-active-zone # firewall-cmd --delete-zone=syncthing --permanent # firewall-cmd --zone=external --list-all # firewall-cmd --zone=internal --change-interface=ens33 # firewall-cmd --get-services # firewall-cmd --zone=external --permanent --add-service=http # firewall-cmd --zone=external --permanent --remove-service=http # firewall-cmd --zone=internal --permanent --add-service={pop3,pop3s,http,https,dns,ftp,snmp,smtp,squid} # firewall-cmd --zone=public --add-port=21964/tcp --permanent # firewall-cmd --zone=public --remove-port=21964/tcp --permanent # firewall-cmd --zone=public --add-port=2121-2221/tcp --permanent # firewall-cmd --zone=public --add-port={2121/tcp,2221/tcp} --permanent # firewall-cmd --permanent --delete-zone=xrdp Notes\rPort forwarding and masquerading\r# firewall-cmd --query-masquerade # 检查是否允许伪装IP # firewall-cmd --add-masquerade # 允许防火墙伪装IP # firewall-cmd --remove-masquerade # 禁止防火墙伪装IP # firewall-cmd --direct --permanent --add-rule ipv4 nat POSTROUTING 0 -o external -j MASQUERADE # firewall-cmd --direct --permanent --add-rule ipv4 filter FORWARD 0 -i internal -o external -j ACCEPT # firewall-cmd --direct --permanent --add-rule ipv4 filter FORWARD 0 -i external -o internal -m state --state RELATED,ESTABLISHED -j ACCEPT ","date":"2024-09-06T20:33:10-05:00","permalink":"/p/firewalld/","title":"Firewalld"},{"content":"# yum install tuned\r# service tuned start\r# service tuned status # tuned-adm list\r# tuned-adm profile latency-performance\r# tuned-adm active\r# tuned-adm off\r# tuned-adm recommend Profile\r# mkdir /etc/tuned/myprofile\r# ls /usr/lib/tuned/\r# cp /usr/lib/tuned/...profile /etc/tuned/myprofile/ # tuned-adm list ","date":"2024-08-26T11:05:04-05:00","permalink":"/p/tuned/","title":"tuned"},{"content":" 在线google Hacking小工具 intitle：搜索网页标题中包含有特定字符的网页。\n例如 intitle: 后台，这样网页标题中带有‘后台’的网页都会被搜索出来。\ninurl：搜索包含有特定字符的URL。\n例如 inurl:admin，可以用来查找网站后台。\nintext: 搜索网页正文内容中的指定字符。\n例如 intext:操作系统。可以搜索含有‘操作系统’的页面\nFiletype: 搜索指定类型的文件。\n例如 操作系统 filetype:pdf，就可以找到关于操作系统的pdf文档。\nSite：找到与指定网站有联系的URL。\n例如 Site：baidu.com。所有和这个网站有联系的URL都会被显示。\n","date":"2024-07-29T23:01:16-05:00","permalink":"/p/google-hacking/","title":"Google Hacking"},{"content":"\u0026gt; dir \u0026gt; cd \u0026gt; md / rd \u0026gt; copy / xcopy \u0026gt; cls\t# Clears all information and returning to a blank window. \u0026gt; tasklist \u0026gt; taskkill /f /im Skype.exe \u0026gt; logoff\t# To sign out of your account. \u0026gt; shutdown -s\t# Shut down the system instantly. \u0026gt; shutdown -s -t 36\t# Would set a timer for windows to shut down after 3600 seconds. \u0026gt; shutdown /r /m \\\\cloud-3ga3if09g /t 90 cipher\r\u0026gt; format d:/P:3\t# Zero every sector on the volume and overwritten 3 times using a different random number each time. \u0026gt; cipher /w:d:\\\t# overwrites deleted data on \u0026#34;D\u0026#34; volume using the Cipher security tool. \u0026gt; cipher /w:e:\\download\t# overwrites deleted data on \u0026#34;E\u0026#34; volume \u0026#34;download\u0026#34; directory using the Cipher security tool. \u0026gt; cipher /E \\download\t# Encrypts the specified files or directories. \u0026gt; cipher /E demo.txt \u0026gt; cipher \\download\t# displays the encryption state of the current directory and any files it contains. \u0026gt; cipher /D \\download\t# Decrypts the specified files or directories. \u0026gt; cipher /D demo.txt Local Group Policy Editor\r\u0026gt; gpedit.msc \u0026gt; gpupdate /force Query port usage\r\u0026gt; netstat -aon | findstr 2000\t# Find the process occupied by the corresponding port and find the PID number of the process. \u0026gt; tasklist | findstr 10232\t# Find the corresponding program name according to the PID number. \u0026gt; taskkill -f -t -im syncthing.exe\t# Kill the process. Restart the Windows Explorer.exe Process and Rebuild Icon Cache\r\u0026gt; taskkill /IM explorer.exe /F \u0026gt; ie4uinit.exe -show \u0026gt; del \u0026#34;%localAppData%\\IconCache.db\u0026#34; /a \u0026gt; del \u0026#34;%localAppData%\\Microsoft\\Windows\\Explorer\u0026#34; /q /f \u0026gt; start \u0026#34;\u0026#34; \u0026#34;C:\\Windows\\explorer.exe\u0026#34; \u0026gt; exit Notes\r\u0026gt; ipconfig \u0026gt; ping \u0026gt; tracert \u0026gt; nslookup \u0026gt; netstat \u0026gt; arp \u0026gt; route \u0026gt; attrib \u0026gt; chkdsk \u0026gt; diskpart \u0026gt; del \u0026gt; format \u0026gt; sfc \u0026gt; systeminfo \u0026gt; wmic \u0026gt; drivequery \u0026gt; echo \u0026gt; for \u0026gt; pause \u0026gt; call ","date":"2024-04-21T09:21:16-05:00","permalink":"/p/commands-of-windows/","title":"Commands of Windows"},{"content":"\r","date":"2024-04-19T10:47:52-05:00","permalink":"/p/brine-pork-liver/","title":"Brine Pork Liver"},{"content":"The following command lists all operating system loader boot entries.\n\u0026gt; bcdedit /enum OSLOADER The following command lists all boot manager entries.\n\u0026gt; bcdedit /enum BOOTMGR The following command lists only the default boot entry.\n\u0026gt; bcdedit /enum {default} ","date":"2024-04-08T21:28:53-05:00","permalink":"/p/efi/uefi-or-legacy-bios/","title":"EFI/UEFI or Legacy BIOS"},{"content":"Linux\rdd\rSequential write\n$ sudo dd if=/dev/zero of=test.img bs=1G count=1 oflag=direct status=progress Sequential read\n$ sudo dd if=test.img of=/dev/null bs=1G iflag=direct status=progress directbypasses cache for more realistic results\nhdparm\r$ sudo hdparm -Tt /dev/sda -T cached read\n-t disk read\nfio\rioping\r","date":"2024-02-05T11:22:01-05:00","permalink":"/p/disk-performance/","title":"Disk Performance"},{"content":"$ apt search language-pack- $ sudo apt install language-pack-zh-hans language-pack-zh-hans-base\r$ sudo apt install language-pack-en language-pack-en-base $ localectl\t# display current settings\r$ localectl list-locales\t# display the list of locale $ sudo localectl set-locale LANG=en_US.UTF-8\r$ sudo localectl set-keymap us\r$ sudo localectl set-x11-keymap us ","date":"2023-11-16T23:17:53-05:00","permalink":"/p/change-keyboard-layout/","title":"Change Keyboard Layout"},{"content":"$ hostnamectl\r$ sudo hostnamectl set-hostname acer $ sudo hostnamectl set-hostname \u0026#34;Lennart\u0026#39;s Laptop\u0026#34; --pretty The high-level \u0026ldquo;pretty\u0026rdquo; hostname which might include all kinds of special characters (e.g. \u0026ldquo;Lennart\u0026rsquo;s Laptop\u0026rdquo;)\n$ sudo hostnamectl set-hostname \u0026#34;lennarts-laptop\u0026#34; --static The \u0026ldquo;static\u0026rdquo; hostname which is the user-configured hostname (e.g. \u0026ldquo;lennarts-laptop\u0026rdquo;)\n$ sudo hostnamectl set-hostname \u0026#34;node12345678\u0026#34; --transient The transient hostname which is a fallback value received from network configuration (e.g. \u0026ldquo;node12345678\u0026rdquo;). If a static hostname is set to a valid value, then the transient hostname is not used.\n","date":"2023-11-15T12:03:33-05:00","permalink":"/p/configure-hostname/","title":"Configure hostname"},{"content":"timedatectl\r$ sudo timedatectl\r$ sudo timedatectl list-timezones $ sudo timedatectl set-timezone Asia/Shanghai\r$ sudo timedatectl set-timezone America/Montreal $ sudo rm -rf /etc/localtime\r$ sudo ln -s /usr/share/zoneinfo/America/Montreal /etc/localtime $ sudo timedatectl set-timezone EST\t# Timezone as EST\r$ sudo timedatectl set-timezone UTC\t# Timezone as UTC\r$ sudo timedatectl set-ntp yes\r$ sudo timedatectl set-ntp no\r$ sudo timedatectl set-time YYYY-MM-DD\r$ sudo timedatectl set-time HH:MM:SS timesyncd\r$ systemctl status systemd-timesyncd $ sudo vim /etc/systemd/timesyncd.conf\rOR\r$ cd /etc/systemd/timesyncd.conf.d/ ","date":"2023-11-10T11:18:33-05:00","permalink":"/p/synchronise-time/","title":"Synchronise time"},{"content":"\r","date":"2023-11-07T10:47:52-05:00","permalink":"/p/sugar-caramel/","title":"Sugar Caramel"},{"content":"$ loginctl list-sessions\r$ loginctl list-users\r$ loginctl show-user aaron ","date":"2023-11-05T23:40:54-05:00","permalink":"/p/systemd-login-manager/","title":"Systemd Login Manager"},{"content":"du\r$ sudo du -ah / | sort -rh | head -n 9 This command will show the 9 biggest files on your system, sorted by size. The “du -ah /” part of the command tells “du” to show the size of all files and directories starting from the root directory (“/”). The “sort -rh” part of the command sorts the output in reverse numerical order, so the largest files appear at the top.\n$ sudo du -h -d 2|grep [GT] |sort -nr $ sudo du -h --max-depth=2|grep [GT] |sort -nr $ sudo du -h / --max-depth=1 | sort -hr | head -n 9 $ du -sh $ du -lh --max-depth=3 $ du -sh * | sort -n $ du -sk *.mkv find\r$ sudo find $HOME -type f -printf \u0026#39;%s %p\\n\u0026#39; | sort -nr | head -9 $ sudo find / -type f -size +1G -exec du -h {} \\; ","date":"2023-10-29T09:17:08-04:00","permalink":"/p/find-the-largest-files/","title":"Find The Largest Files"},{"content":"\r","date":"2023-10-27T10:47:52-05:00","permalink":"/p/chinese-braised-pork/","title":"Chinese Braised Pork"},{"content":"All txt files in the current directory\r# find ./ -name \u0026#39;*.log\u0026#39; # find ./ -type f -name \u0026#39;*.log\u0026#39; Files accessed in the last 20 minutes \u0026amp; before 25 minutes \u0026amp; in 28 minutes\n# find ./ -name \u0026#39;*.log\u0026#39; -amin -20 ls # find ./ -name \u0026#39;*.log\u0026#39; -amin +25 ls # find ./ -name \u0026#39;*.log\u0026#39; -amin 28 ls Files accessed in the last 2 day\n# find ./ -name ‘*.txt’ -atime -1 -ls Files modified in the last 30 minutes\n# find ./ -name ‘*.txt’ -mmin -30 -ls Files modified in the last 3 day\n# find ./ -name ‘*.txt’ -mtime -3 -ls Files whose status changed in the last 40 minutes\n# find ./ -name ‘*.txt’ -cmin -40 -ls Files whose status has changed in the last 4 days\n# find ./ -name ‘*.txt’ -ctime -4 -ls Deletel selected files\r# find ./ -name \u0026#39;*.txt\u0026#39; -amin -20 -ls -exec rm {} \\; # find . -ctime +40 -type f | xargs rm -rf Crontab\r# vim ./clear.sh #!/bin/sh find /opt/bak -mtime +6 -name \u0026#34;*.log\u0026#34; -exec rm {} \\; find /opt/bak -mtime +6 -name \u0026#34;*.dmp\u0026#34; -exec rm {} \\; # chmod +x ./clear.sh # vim /etc/crontab 00 2 * * * root /opt/sh/clear.sh # systemctl restart crond ","date":"2023-10-27T09:17:08-04:00","permalink":"/p/find-files-on-a-specific-date/","title":"Find Files on A Specific Date"},{"content":"Ubuntu 22.04.5 LTS\r$ sudo apt install traceroute # version 1:2.1.0-2, or\r$ sudo apt install inetutils-traceroute # version 2:2.2-2ubuntu0.1\r$ traceroute --version $ traceroute www.google.com\r$ traceroute -n www.google.com\t# Hiding Device Names.\r$ traceroute -w 7.0 www.google.com\t# Setting the traceroute Timeout Value.\r$ traceroute -q 1 www.google.com\t# Setting the Number of Tests.\r$ traceroute -f 11 www.google.com\t# Setting the Initial TTL Value. windows 11\r\u0026gt; tracert www.google.com\r\u0026gt; tracert 8.8.8.8\r\u0026gt; tracert /d www.microsoft.com\t# Hiding Device Names. ","date":"2023-10-09T00:00:49-05:00","permalink":"/p/traceroute/","title":"traceroute"},{"content":"\u0026gt; nslookup\t# The information displayed will be the local DNS server and its IP address.\r\u0026gt; nslookup dixu.ddns.net\t# Return the A record for a domain. \u0026gt; nslookup -type=a dixu.ddns.net\t# Return the A record for a domain.\r\u0026gt; nslookup -type=MX dixu.ddns.net\t# MX records for the email exchange.\r\u0026gt; nslookup -type=NS dixu.ddns.net\t# NS records of a domain.\r\u0026gt; nslookup -query=a google.com\r\u0026gt; nslookup -query=mx google.com\r\u0026gt; nslookup -query=ns google.com \u0026gt; nslookup -type=soa sayboy.ddns.net\t# SOA record of a domain.\r\u0026gt; nslookup -type=any dixu.ddns.net\t# All of the available DNS records.\r\u0026gt; nslookup example.com ns1.nsexample.com\t# Using of a specific DNS Server.\r\u0026gt; nslookup 10.20.30.40\t# Check the Reverse DNS Lookup. \u0026gt; nslookup -type=ptr 96.96.136.185.in-addr.arpa\t# Check for a PTR record.\r\u0026gt; nslookup -timeout=20 example.com\t# Change the timeout interval.\r\u0026gt; nslookup -debug example.com\t# Enable debug mode. ","date":"2023-10-07T00:28:21-05:00","permalink":"/p/nslookup/","title":"nslookup"},{"content":"$ dig dixu.ddns.net\r$ dig yahoo.com A +noall +answer\t# This must be a domain and not a host\r$ dig yahoo.com MX +noall +answer\r$ dig yahoo.com NS +noall +answer\r$ dig yahoo.com ANY +noall +answer\t# Query all records\r$ dig dixu.ddns.net +short\t# Getting streamlined answers $ dig gentoo.de +trace\r$ dig cse.ogi.edu +nssearch\r$ dig cse.ogi.edu +nssearch | cut -d\u0026#39; \u0026#39; -f4,11 ","date":"2023-10-06T12:37:24-05:00","permalink":"/p/dig/","title":"dig"},{"content":"Ubuntu 22.04.5 LTS\r$ sudo apt update \u0026amp;\u0026amp; sudo apt upgrade\r$ sudo apt install nmap\r$ nmap --version $ nmap dixu.ddns.net\r$ nmap 192.168.2.5 $ nmap -p 8080 192.168.2.5\r$ nmap -p 22,21,80 192.168.2.5\r$ nmap -p 22,21,80 192.168.2.5-253 $ nmap -sV 192.168.2.5 -p 8080\t# Detecting server-side software version information\r$ sudo nmap -O 192.168.2.5\t# Identify the operating system of the target host\r$ sudo nmap -sU 192.168.2.5 -p 53,161 ","date":"2023-10-05T12:56:35-05:00","permalink":"/p/nmap/","title":"nmap"},{"content":"\r","date":"2023-09-10T10:47:52-05:00","permalink":"/p/chinese-roasted-pork/","title":"Chinese Roasted Pork"},{"content":"$ sudo apt update \u0026amp;\u0026amp; sudo apt upgrade\r$ sudo apt install iftop $ sudo iftop ","date":"2023-08-11T15:02:35-05:00","permalink":"/p/iftop/","title":"iftop"},{"content":"$ sudo apt update \u0026amp;\u0026amp; sudo apt upgrade\r$ sudo apt install nload $ nload\r$ ifconfig\r$ nload ens35 Left and Right arrow keys or Tab and **Enter **keys: By using these keys we can switch to other network devices. F2 key: To see the option window F5 key: To save current settings to the user’s config file. F6 key: To reload settings from the config files. q or Ctrl+C : To quit nload $ nload -m\t# To see multiple network devices at the same time\r$ nload -a 400\t# The time window in seconds for the average calculation. The default value is 300.\r$ nload -t 400\t# The displayed St and refresh interval in milliseconds. The default value is 500. $ nload -u M wlo1 Use -u option to set the type of unit used for display of traffic number.\nh/H = auto, b = Bit/s B = Byte/s , k = kBit/s , K = KByte/s , m = MBit/s , M = MByte/s , g = GBit/s, G = GByte/s\n","date":"2023-08-09T13:35:14-05:00","permalink":"/p/nload/","title":"nload"},{"content":"$ which iostat $ whereis iostat $ sudo apt update \u0026amp;\u0026amp; sudo apt upgrade\r$ sudo apt install plocate\r$ locate iostat\r$ locate example.txt\r$ locate [example]\t# Search partial matches\r$ locate -i [Example]\t# Case-insensitive\r$ locate -n 5 filename\r$ locate --regex -i \u0026#34;(\\.mp4|\\.avi)\u0026#34;\r$ locate [filename] | wc -l\r$ locate -c [filename]\r$sudo updatedb\r$locate [example] | grep \u0026#34;$(date +%Y-%m-%d)\u0026#34; $ sudo find / -name iostat $ command -v ssh Display information about the command type\r$ type ssh\r$ type sleep head\r$ type -p pwd\r$ type -a pwd\r$ type -t grep alias (shell alias) function (shell function) builtin (shell builtin) file (disk file) keyword (shell reserved word) Determine the exact path that these links point to\r$ readlink --version\r$ readlink --help $ readlink -f $(which ssh)\r$ readlink -e desk\r$ readlink -m desk3\r$ readlink -n desk4\r$ readlink -q desk\r$ readlink -s desk5\r$ readlink -s desk5\r$ readlink -z desk2 ","date":"2023-07-01T23:47:01-05:00","permalink":"/p/locate-a-command/","title":"Locate a Command"},{"content":"\r","date":"2023-06-05T10:47:52-05:00","permalink":"/p/fried-bean-sauce/","title":"Fried Bean Sauce"},{"content":"涮羊肉小料\r","date":"2023-05-05T10:47:52-05:00","permalink":"/p/instant-boiled-mutton/","title":"Instant Boiled Mutton"},{"content":"\r","date":"2023-04-21T10:47:52-05:00","permalink":"/p/spicy-smoked-chicken-legs/","title":"Spicy Smoked Chicken Legs"},{"content":"\r","date":"2023-04-17T10:47:52-05:00","permalink":"/p/lamb-spine-stew/","title":"Lamb Spine Stew"},{"content":"\r","date":"2023-04-12T10:47:52-05:00","permalink":"/p/roasted-pork-ribs/","title":"Roasted Pork Ribs"},{"content":" Salt 40G Paprika 60G Black Pepper 20G White Pepper 20G Onion Powder 20G Garlic Powder 40G Cayenne Pepper 20G Sugar 60G MSG 10G Baking Powder 2G For every 500g chicken, you need 30g of the above mixed powder and 70g oil. Bake at 205C(400F) for 20 minutes. Coat the baked wings with a layer of honey. Put them 15CM below the broil, Broil on low for 2-3 mintes on each side. ","date":"2023-04-05T10:47:52-05:00","permalink":"/p/kfc-new-orleans-roasted-chicken-wings/","title":"KFC New Orleans Roasted Chicken Wings"},{"content":"\r","date":"2023-03-05T10:47:52-05:00","permalink":"/p/spiced-beef/","title":"Spiced Beef"},{"content":"\r","date":"2023-02-03T10:47:52-05:00","permalink":"/p/stewed-potatoes-with-ribs-and-beans/","title":"Stewed Potatoes With Ribs And Beans"},{"content":"nohup\r$ nohup sh ./test.sh \u0026amp; $ nohup test.sh \u0026amp; $ nohup test.sh \u0026gt; test.log 2\u0026gt;\u0026amp;1 \u0026amp; 0 - stdin (standard input) 1 - stdout (standard output) 2 - stderr (standard error) $ nohup python -u test.py \u0026gt; test.log 2\u0026gt;\u0026amp;1 \u0026amp; Sometimes I find that nohup.out does not show what is printed in the python program. This is because python\u0026rsquo;s output is buffered, so nohup.out doesn\u0026rsquo;t see the output right away. python has a -u parameter that makes python not enable buffering. Change it to the following command and you\u0026rsquo;re good to go!\nsetid\r# setsid sh ./test.sh This method makes the running process run as root, which is somewhat of a security risk.\ntrap\r#!/bin/bash trap \u0026#34;\u0026#34; HUP while true;do date \u0026gt;\u0026gt; /root/test.txt sleep 1 done screen\r$ screen sh test.sh ","date":"2023-01-06T12:09:28-05:00","permalink":"/p/commands-in-backgroud/","title":"Commands in Backgroud"},{"content":"dmidecode\r$ sudo apt install dmidecode\r$ sudo dmidecode\t# Displays information available for the DMI.\r$ sudo dmidecode -t bios\t# Showing information about the BIOS.\r$ sudo dmidecode -t system\t# Display detailed information about the system.\r$ sudo dmidecode -t processor\t# Show the processor information.\r$ sudo dmidecode -t cache\t# Display the CPU cache information.\r$ sudo dmidecode -t memory\t# Retrieve information about the system memory.\r$ sudo dmidecode -t baseboard\t# Retrieve the baseboard (motherboard) information. Searching Using the -s Option\r$ sudo dmidecode -s bios-vendor\r$ sudo dmidecode -s system-product-name\r$ sudo dmidecode -s system-manufacturer\r$ sudo dmidecode -s system-serial-number Advanced Filtering With grep\r$ sudo dmidecode -t bios | grep -i F.31\r$ sudo dmidecode -t system | grep -i Hewlett-Packard ethtool\r$ ethtool eno1\r$ sudo ethtool -P eno1\t# View mac address lspci\r$ lspci | grep Eth lscpu\r$ lscpu\r$ cat /proc/cpuinfo $ cpupower frequency-set -g performance\r$ cpupower frequency-info lsblk\r$ lsblk ipmitool\r$ sudo apt install ipmitool\r$ ipmitool lan set 1 ipsrc static\r$ ipmitool lan set 1 ipaddr x.x.x.x\r$ ipmitool lan set 1 netmask x.x.x.x\r$ ipmitool user set password 2\r$ ipmitool lan set 1 access on\r$ ipmitool lan print 1\r$ ipmitool lan set 1 defgw ipaddr x.x.x.x\t# Add Gateway\r$ ipmitool user list 1\t# View ipmi username sensors\r$ sudo apt install lm-sensors\r$ sensors ","date":"2022-12-21T09:30:12-05:00","permalink":"/p/hardware-infomation-for-linux/","title":"Hardware Infomation for Linux"},{"content":"\r","date":"2022-12-20T10:47:52-05:00","permalink":"/p/chinese-sugarcoated-haws-on-a-stick/","title":"Chinese Sugarcoated Haws on A Stick"},{"content":"茶叶蛋\r煙熏溏心蛋\r","date":"2022-12-19T10:47:52-05:00","permalink":"/p/eggs/","title":"Eggs"},{"content":"Cut fish up into 1.5 CM thick pieces.\nPrepare the seasoning for fish:\r4 Tbsp say sauce, 4 Tbsp cooking wine, 2 tsp white pepper powder, 1 tsp salt, ginger slices. Mix well and let it 1 hour.\nPrepare the sauce:\r1 cup water, 0.5 cup of sugar, 6 Tbsp soy sauce, 4Tbsp cooking wine, 1 tsp salt, 2 tsp five spices powder(optional), 8 ginger slices, scallion piedes cut from 2 scallions.\nTurn the stove heat on high, about 3 minutes later, the sauce starts boiling, turn the heat down to low, cover with lid and simmer for 10 minutes.\nPrepare fish meat：\rFrying: Put enough oil and heat the oil on high heat until the temperature reaches 180 degrees Celsius.\nBaking: Brush the fish with another coat of oil, reheat the oven to 350 degrees F, and place the fish on the tray. This will take about 1 hour.\nAir fryer: Put it on the air fryer rack, fry in an air fryer at 400 degrees F for about 25 minutes.\n","date":"2022-12-16T10:47:52-05:00","permalink":"/p/smoked-fish/","title":"Smoked Fish"},{"content":"live tilapia or any other fish 600g\ngreen onion 1\nginger 1 piece small\nSichuan peppercorn 2g 1 teaspoon\nstar anise 2\nsalt 25g 1 tablespoon\nregular soy sauce 15g 1 tablespoon\nwater 800g 3 cups + 1/4 cup\nmarinate in the fridge overnight\noil as needed, mainly with cumin powder and chili pepper powder, add little bit with coriander seed powder and Sichuan peppercorn powder, pinch of salt\npreheated oven 475°F/245°C bake for 25 minutes\nthen add the top layer of spices\nsame temperature bake for an additional 5 minutes\nbefore take it out from the oven, turn on the broiler for 2-3 minutes, to give it a BBQ flavor\n","date":"2022-12-15T10:47:52-05:00","permalink":"/p/bbq-fish/","title":"BBQ Fish"},{"content":"\r","date":"2022-11-03T10:47:52-05:00","permalink":"/p/dough-drop-and-vegetable-soup/","title":"Dough Drop And Vegetable Soup"},{"content":"$ ls -lR |grep -v ^d|awk \u0026#39;{print $9}\u0026#39; $ ls -lR |grep -v ^d|awk \u0026#39;{print $9}\u0026#39; |tr -s \u0026#39;\\n\u0026#39; -v ^d Subdirectories not included. tr -s '\\n' Remove empty lines. ","date":"2022-10-03T22:09:14-05:00","permalink":"/p/list-all-the-file-names-in-a-directory/","title":"List all the File Names in a Directory"},{"content":"$ ls -lR ./collection | grep \u0026#34;^-\u0026#34; | wc -l $ ls -lR ./collection | grep \u0026#34;^d\u0026#34; | wc -l $ ls -l ./collection | grep \u0026#34;^-\u0026#34; | wc -l R Recursive subdirectory. ^- Indicates a file. ^d Indicates a directory. wc -l Count the number of lines of output information. ","date":"2022-10-02T22:09:14-05:00","permalink":"/p/count-files-in-a-directory/","title":"Count Files in a Directory"},{"content":"$ sudo lsof -i:80 $ sudo netstat -nltp | grep 80 $ ps aux |grep nginx ","date":"2022-09-09T22:09:14-05:00","permalink":"/p/check-process-running-on-port/","title":"Check Process Running on Port"},{"content":"Any luck?\tIt\u0026rsquo;s slow.\nHow did you make it out there?\tIt\u0026rsquo;s\u0026rsquo; so so.\tIt\u0026rsquo;s ok.\tI caught a few.\nbig\u0026rsquo;un\tbig mama\ttrophy\tfish of a life time\tmonster\tpig / hawg\nJigheads\rDrop Shot Rig\rCarolina\rSpinnerbait\rSplitshort rig\r","date":"2022-09-03T07:40:11-05:00","permalink":"/p/fishing-near-montreal/","title":"Fishing Near Montreal"},{"content":"\r","date":"2022-08-09T10:47:52-05:00","permalink":"/p/braised-chicken-with-rice-wine/","title":"Braised Chicken With Rice Wine"},{"content":"Teriyaki chicken\r酱油 1 味淋 1 清酒 1 蜂蜜 2 蚝油 2 料酒 2 姜蒜 鸡肉去骨，先煎鸡皮那面，煎至金黄。 放入酱汁，盖上锅盖煮7分钟，翻面。 大火收汁。 Teriyaki Sauce\r酱油 Soy Sauce 80ml 糖 Sugar 40ml 芝麻油 Sesame Oil 5ml 米醋 Rice Vinegar 5ml 淀粉 Starch 3ml 水 30ml 黑芝麻 Black Sesame 2.5ml 白芝麻 White Sesame 2.5ml 日本米酒 Sake 20ml 日本米酒料酒 Mirin 20ml 植物油 Oil 5ml ","date":"2022-08-03T10:47:52-05:00","permalink":"/p/teryaki-chicken/","title":"Teryaki Chicken"},{"content":"Largemouth bass\nSmallmouth bass\nStriped bass\nWalleye\nAmerican shad\nNorthern pike\nRiver redhorse\nchannel catfish\nblue catfish\nflathead catfish\ncommon carp\nasian carp\ngrass carp\nsilver carp\nbighead carp\nrainbow trout\nbrown trout\nlake trout\nbluegill\ncrappie\nmuskie\ngar\n","date":"2022-06-04T07:40:11-05:00","permalink":"/p/what-kind-of-fish-are-in-montreal/","title":"What Kind of Fish Are in Montreal"},{"content":" docker dockerhub docker [ info | version] docker [ run | start | stop | restart | kill | rm | pause | unpause ] docker [ ps | inspect | exec | logs | export | import | port ] docker [ commit | cp | diff ] docker [ images | rmi | tag | build | history | save | import ] docker [ login | pull | push | search ] Images\r$ docker search hello-world $ docker images $ docker image ls $ docker image list $ docker pull hello-world $ docker pull hello-world:latest $ docker pull --all-tags hello-world $ docker rmi -f image-id $ docker rmi hello-world:latest $ docker images -a | grep \u0026#34;hello-world\u0026#34; | awk \u0026#39;{print $3}\u0026#39; | xargs docker rmi $ docker rmi $(docker images -a -q) $ docker images hello-world:* | xargs docker rmi $ docker run --rm hello-world $ docker ps -a -f status=exited $ docker rm $(docker ps -a -f status=exited -q) $ docker ps -a -f status=exited -f status=created $ docker rm $(docker ps -a -f status=exited -f status=created -q) ","date":"2022-03-25T15:35:34-04:00","permalink":"/p/docker/","title":"Docker"},{"content":" docker dockerhub Ubuntu 24.04 LTS\rDocker install\r$ sudo apt update \u0026amp;\u0026amp; sudo apt upgrade $ sudo apt install curl apt-transport-https ca-certificates software-properties-common $ sudo apt install docker.io $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg $ echo \u0026#34;deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\u0026#34; | sudo tee /etc/apt/sources.list.d/docker.list \u0026gt; /dev/null $ sudo apt update $ sudo apt install docker-ce -y $ sudo systemctl status docker $ docker version Docker compose plugin\r$ sudo apt update \u0026amp;\u0026amp; sudo apt upgrade $ sudo apt install docker-compose-plugin $ mkdir -p ~/.docker/cli-plugins/ $ curl -SL https://github.com/docker/compose/releases/download/v2.2.27/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose $ ls -lh ~/.docker/cli-plugins $ chmod +x ~/.docker/cli-plugins/docker-compose $ docker compose version Run Docker compose\r$ docker compose up -d docker compose pause docker compose unpause docker compose stop docker compose down Add user to Docker group\r$ sudo usermod -aG docker $USER $ newgrp $ groups cherry Centos 7\r$ sudo yum install docker $ sudo systemctl start docker $ sudo systemctl enable docker $ docker version $ docker info Configure the source\r$ sudo vim /etc/docker/daemon.json { \u0026#34;registry-mirrors\u0026#34;: [\u0026#34;https://registry.docker-cn.com\u0026#34;] } $ sudo systemctl daemon-reload $ sudo systemctl restart docker Configure\r$ cd /var/lib/docker Docker hub\r# docker loging # docker logout ","date":"2022-03-25T13:35:20-04:00","permalink":"/p/docker-and-docker-compose/","title":"Docker and Docker Compose"},{"content":"烤烤腰子\r","date":"2022-03-23T10:47:52-05:00","permalink":"/p/roasted-lamb-kidney/","title":"Roasted Lamb Kidney"},{"content":"烤五花肉\r","date":"2022-03-21T10:47:52-05:00","permalink":"/p/roasted-pork-belly/","title":"Roasted Pork Belly"},{"content":"\r","date":"2022-03-18T10:47:52-05:00","permalink":"/p/roasted-lamb-ribs/","title":"Roasted Lamb Ribs"},{"content":"\r","date":"2022-03-16T10:47:52-05:00","permalink":"/p/cumin-lamb-stir-fry/","title":"Cumin Lamb Stir Fry"},{"content":"\r","date":"2022-03-12T10:47:52-05:00","permalink":"/p/smoked-lamb-bones/","title":"Smoked Lamb Bones"},{"content":"卤鸡腿\r红烧鸡腿\r","date":"2022-02-15T10:47:52-05:00","permalink":"/p/braised-chicken-legs/","title":"Braised Chicken Legs"},{"content":"\r","date":"2022-02-09T10:47:52-05:00","permalink":"/p/braised-pigs-feet/","title":"Braised Pig's Feet"},{"content":" Smartmontools Smartmontools on Ubuntu Wiki QDiskInfo Ubuntu 20.04 LTS\rsmartctl\r$ sudo apt update \u0026amp;\u0026amp; sudo apt upgrade $ sudo apt install smartmontools $ sudo smartctl -V $ sudo smartctl -h $ lsblk |grep -v ^loop\t# Tells to exclude any with keyword \u0026#39;loop\u0026#39;. $ sudo smartctl --info /dev/sda $ sudo smartctl --all /dev/sda $ sudo smartctl --health /dev/sda $ sudo smartctl -s on /dev/sda\t# Turn on SMART features on your hard drive. $ sudo smartctl -i /dev/sda\t# Show identity information for device. $ sudo smartctl -t short -a /dev/sda # Run a short test on the drive. $ sudo smartctl -t long -a /dev/sda\t# Run a short test on the drive. $ sudo smartctl -c /dev/sda\t# Show device SMART capabilities. $ sudo smartctl -X /dev/sda\t# Abort any non-captive test on devic. $ sudo smartctl -d ata -H /dev/sda\t# To test the overall health of the drive. $ sudo smartctl -l selftest /dev/sda\t# Print the self-test result. $ sudo smartctl -l error /dev/sda\t# To print only the error log. smartd\r$ sudo systemctl enable/disable smartd $ sudo systemctl start/stop/restart/status smartd $ sudo vim /etc/default/smartmontools smartd_opts=\u0026#34;--interval=7200\u0026#34;\t# Specify intervals in seconds $ sudo vim/etc/smartd.conf /dev/sda -m admin@example.com -M test /dev/sda { -d sat -m admin@example.com -M exec \u0026#34;/usr/bin/logger -t smartd -p daemon.warning\u0026#34; } QDiskinfo\rQDiskInfo is a frontend for smartctl (part of the smartmontools package). It provides a user experience similar to CrystalDiskInfo. It shows the SMART (Self-Monitoring, Analysis, and Reporting Technology) data of modern hard disk drives.\nCentOS 7\r# yum -y install smartmontools # smartctl --version # smartctl -i /dev/sda\t#This will give you brief information about your drive. # smartctl -H /dev/sda # smartctl -A /dev/sda # smartctl -a /dev/sda # smartctl –smart=on –offlineauto=on –saveauto=on /dev/sda # badblocks -v -s /dev/sdl \u0026gt; resultl.txt # mount -o remount rw / # vi /etc/fstab # mount -a ","date":"2021-11-01T16:56:28-04:00","permalink":"/p/smartmontools/","title":"Smartmontools"},{"content":"# killall mozilla-bin # pkill mozilla # fuser -k /dev/dsp # ps aux | grep mozilla | awk \u0026#39;{print $2}\u0026#39; | xargs kill $ sudo ps -ef | grep flask | grep -v grep | awk \u0026#39;{print $2}\u0026#39; | xargs kill -9 ps -ef | grep flask Find all flask processes. grep -v grep Filter process lines containing grep. awk '{print $2}' The parameter in the second column of the extracted process row record is the process number of the flask. xargs kill -9 Pass all the preceding arguments to the following command kill -9. ","date":"2021-10-03T22:09:14-05:00","permalink":"/p/killing-processes/","title":"Killing Processes"},{"content":"\r","date":"2021-09-06T10:47:52-05:00","permalink":"/p/braised-beef/","title":"Braised Beef"},{"content":"Microsoft Deployment Toolkit (MDT)\nWindows ADK\nADKPE\n","date":"2021-08-05T16:47:12-05:00","permalink":"/p/microsoft-deployment-toolkit/","title":"Microsoft Deployment Toolkit"},{"content":"System Preparation Window\n\u0026gt; %WINDIR%\\system32\\sysprep\\sysprep.exe Sysprep command\n\u0026gt; %WINDIR%\\system32\\sysprep\\sysprep.exe /generalize /shutdown /oobe ","date":"2021-08-03T16:35:35-05:00","permalink":"/p/sysprep/","title":"sysprep"},{"content":"cp\rscp\r$ scp -r ./sayboy sayboy@sayboy.com:/tmp $ scp -r sayboy@sayboy.com:/tmp/sayboy . $ rsync sayboy.txt sayboy@sayboy.com:/tmp $ rsync sayboy@sayboy.com:/tmp/sayboy.txt . $ rsync -avz root@sayboy.com:/opt/pkg /opt/pkg rsync\rRsync with the function of renewal transmission.\n","date":"2021-06-15T11:43:42-04:00","permalink":"/p/copy-files-with-scp-and-rsync/","title":"Copy Files With SCP And Rsync"},{"content":"$ sudo vim /etc/ssh/sshd_config $ sudo vim /var/log/secure Port 65531 # ssh port to modify the default 22 ListenAddress 192.168.1.X # ssh allows the IP address of the login PermitRootLogin no # root prohibited via ssh AllowUsers test@192.168.1.* # allows the user to test the IP 192.168.1. * Client Access Login Compression no Compression delayed LoginGraceTime 6 MaxAuthTries 3 MaxSessions 6 PrintLastLog yes ClientAliveInterval 900 ClientAliveCountMax 0 $ sudo ls -l /etc/ssh/*key $ sudo chmod 0600 /etc/ssh/*key $ sudo grep -i hostkey /etc/ssh/sshd_config $ sudo ls -l /etc/ssh/*pub $ sudo chmod 0644 /etc/ssh/*pub ","date":"2021-05-29T12:02:19-04:00","permalink":"/p/ssh-security-reinforcement/","title":"SSH Security Reinforcement"},{"content":"$sudo vim /etc/hosts.allow $sudo vim /etc/hosts.deny ","date":"2021-05-27T13:28:22-04:00","permalink":"/p/tcp-wrappers/","title":"TCP Wrappers"},{"content":" Fail2Ban Centos 8\rInstall\r$ sudo service iptables stop $ sudo systemctl start firewalld $ sudo systemctl enable firewalld.service $ sudo dnf install epel-release $ sudo dnf install firewalld $ sudo dnf install fail2ban Configure\r$ sudo cp /etc/fail2ban/jail.{conf,local} $ sudo vim /etc/fail2ban/jail.local [DEFAULT] ignoreip = 1.2.3.4/24 bantime = 1d findtime = 1h maxretry = 5 banaction = firewallcmd-ipset [sshd] enabled = true [nginx-botsearch] enabled = true filter = nginx-botsearch logpath = /var/log/nginx/error.log /var/log/nginx/aaa.error.log /var/log/nginx/bbb.error.log /var/log/nginx/ccc.error.log [nginx-botsearch] enabled = true filter = nginx-botsearch logpath = /var/log/nginx/*error.log $ sudo systemctl start fail2ban $ sudo systemctl enable fail2ban $ sudo systemctl status fail2ban $ sudo fail2ban-client version $ sudo tail -f /var/log/fail2ban.log $ fail2ban-client -h $ sudo fail2ban-client status $ sudo fail2ban-client status sshd $ sudo fail2ban-client set sshd unbanip 23.34.45.56 $ sudo fail2ban-client set sshd banip 23.34.45.56 nginx-botsearch nginx-http-auth nginx-limit-req ","date":"2021-05-26T19:49:44-04:00","permalink":"/p/fail2ban/","title":"Fail2ban"},{"content":"Infomation\r\u0026gt; systeminfo \u0026gt; ver \u0026gt; diskpart \u0026gt; format \u0026gt; chkdsk /f Changes the active console code page\r\u0026gt; chcp \u0026gt; chcp 936 Code page Country/region or language 437 United States 850 Multilingual (Latin I) 852 Slavic (Latin II) 855 Cyrillic (Russian) 857 Turkish 860 Portuguese 861 Icelandic 863 Canadian-French 865 Nordic 866 Russian 869 Modern Greek 936 Chinese ","date":"2021-05-25T14:33:59-04:00","permalink":"/p/tips-of-windows-configuration-command/","title":"Tips of Windows Configuration Command"},{"content":"Make system disk\r$ dd if=ubuntu-server-amd64.iso of=/dev/sdb View the running time of a process\r$ ps aux $ ps -p 10167 -o etimes,etime $ ps -p 10167 -o rss Dynamically view logs in real time\r$ tail -f test.log $ tail -f test.log | sed \u0026#39;/Failed/ q\u0026#39; Conversion of timestamp\r$ date -d@1234567890 +\u0026#34;%Y-%m-%d %H:%M:%S\u0026#34; $ date +%s Calculate the running time of the program\r$ time ./test View ascii code\r$ man ascii Delete garbled files\r$ ls -i $ find . -inum 123456 -exec rm {} \\; Download web resources in batches\r$ wget -r -nd -np --accept=pdf http://fast.dpdk.org/doc/pdf-guides/ ","date":"2021-05-23T14:33:59-04:00","permalink":"/p/commands-of-linux/","title":"Commands of Linux"},{"content":"git init git config --global user.name \u0026#34;Di Xu\u0026#34; git config --global user.email\u0026#34;dixu@nbai.io\u0026#34; git remote add origin https://github.com/sayboy/tutorial.git git remote -v git add readme.md git add . git add --all git restore --staged \u0026lt;file\u0026gt; git commit -m \u0026#34;added readme.md\u0026#34; git push origin master -u git push git clone https://github.com/sayboy/tutorial.git tutorial-demo git pull origin master git pull git branch -a git branch feature1 git checkout feature1 git checkout -b feature3 git checkout -d feature3 git checkout -D feature3 git merge feature4 git merge f1 git merge f1 --no-ff *git rebase git mergetool git reset master^ git reset master^^ git reset master~5 git status git reset [id] git revert^ git revert^^ git revert~5 git push origin feature1 git push origin :feature1 git log git log --oneline git log --oneline -3/-5 git show [id] git log --all --decorate --oneline --graph touch .gitignore https://www.gitignore.io git remote add upstream https://github.com/YerongAI/Office-Tool.git git fetch upstream git fetch upstream dev git branch git branch -r git rebase upstream/main 无贡献使用 git merge upstream/main 有贡献使用 git log git clone https://github.com/YerongAI/Office-Tool.git git clone git@github.com:YerongAI/Office-Tool.git $ ssh-keygen -t ed25519 -C \u0026#34;sayboy@outlook.com\u0026#34; $ eval \u0026#34;$(ssh-agent -s)\u0026#34; $ ssh-add ~/.ssh/id_ed25519 git clone git@github.com:sayboy/tutorial.git tutuaial-ssh ","date":"2021-05-19T17:40:04-04:00","permalink":"/p/git/","title":"Git"},{"content":"Windows Server 2016/2019\rWindows Key + R to open the Run dialog, type “ regedit ”, and press Enter.\n[Computer\u0026gt;HKEY_LOCAL_MACHINE\u0026gt;SYSTEM\u0026gt;CurrentControlSet\u0026gt;Services\u0026gt;W32Time\u0026gt;TimeProviders\u0026gt;NtpServer]\rEnabled=1 [Computer\u0026gt;HKEY_LOCAL_MACHINE\u0026gt;SYSTEM\u0026gt;CurrentControlSet\u0026gt;Services\u0026gt;W32Time\u0026gt;Config]\rAnnounceFlags=5 0 –Timeserv_Announce_No, Reliable_Timeserv_Announce_No: Domain controllers do not publish time services\n1 –Timeserv_Announce_Yes: Domain controllers always advertise time services\n2–Timeserv_Announce_Auto: Domain controller automatically determines whether it should broadcast the time service\n4 –Reliable_Timeserv_Announce_Yes: Domain controllers will always broadcast the Reliable Time service\n8 –Reliable_Timeserv_Announce_Auto: Domain controller automatically determines whether the Reliable Time service should be broadcast\nFlag is 5 (we\u0026rsquo;re actually talking about 1+4)\n\u0026gt; Services\rrestart Windows Time PowerShell(Admin)\n\u0026gt; Set-ItemProperty -Path \u0026#34;HKLM:\\SYSTEM\\CurrentControlSet\\Services\\w32time\\TimeProviders\\NtpServer\u0026#34; -Name \u0026#34;Enabled\u0026#34; -Value 1\r\u0026gt; Set-ItemProperty -Path \u0026#34;HKLM:\\SYSTEM\\CurrentControlSet\\services\\W32Time\\Config\u0026#34; -Name \u0026#34;AnnounceFlags\u0026#34; -Value 5\r\u0026gt; Restart-Service w32Time Open UDP port 123\n\u0026gt; w32tm /stripchart /computer:ad-01.vmsgbj.es /dataonly /samples:5 ","date":"2021-05-06T16:49:08-05:00","permalink":"/p/ntp/","title":"ntp"},{"content":"SATA controller versionc\r$ sudo dmesg |grep SATA $ sudo smartctl -a /dev/sda | grep SATA lsblk\r$ lsblk\t# list block devices. $ lsblk\t-d -o name,rota\t# \u0026#34;0\u0026#34; Solid State Drives. \u0026#34;1\u0026#34; Hard Disk Drive. $ lsblk --output NAME,FSTYPE,ROTA,PARTTYPE,TYPE,RAND,TRAN NAME - device name (nicely arranged in a tree) FSTYPE - filesystem type ROTA - is this a \u0026ldquo;rotational device\u0026rdquo; (spinning rust, DVD etc.) PARTTYPE - partition type UUID (values one sets in fdisk) TYPE - device type RAND - \u0026ldquo;adds randomness\u0026rdquo; TRAN - device transport type fdisk\r$ sudo fdisk -l\t# Commands lists the partitions on your system. $ lsblk $ sudo fdisk /dev/sda\t# Entering command mode. Type m and press Enter to see a list of the commands you can use.\nUse p to print the current partition table to the terminal from within command mode.\nUse the n command to create a new partition.\nIf I want to change its type, I can use the t command and specify the partition\u0026rsquo;s number.\nUse the d command to delete a partition.\nUse w to write the changes you\u0026rsquo;ve made to disk.\nUse q if you want to quit without saving changes.\n$ sudo mkfs -t ext4 /dev/sda3\t# Formatting a partition. $ sudo mkswap /dev/sda5\t# Format a partition as a swap partition. $ sudo mount /dev/sda3 /test $ sudo umount /dev/sda6 $ sudo umonnt /test $ df -h $ sudo blkid /dev/sda1 $ sudo vim /etc/fstab $ sudo systemctl daemon-reload $ sudo mount -a $ sudo umount -a parted\r# parted -l # parted /dev/sdc (parted) print (parted) select /dev/sdb (parted) mklabel msdos (parted) mkpart (parted) quit # mkfs.ext4 /dev/sdb1 Logical Volume Manager(LVM)\r$ sudo fdisk -l $ lsblk Create physical volume\r$ sudo pvcreate /dev/sdb $ sudo pvcreate /dev/sdc $ sudo pvdisplay $ sudo pvs Remove physical volume\r$ sudo pvscan $ sudo pvremove /dev/sdc $ sudo pvscan $ lsblk Create volume group\r$ sudo vgcreate vgpool /dev/sdb $ sudo vgextend vgpool /dev/sdc $ sudo vgdisplay $ sudo vgs Extend physical volume to volume group\r$ sudo vgdisplay $ sudo vgextend vgpool /dev/sdc $ sudo vgs Remove physical volume from volume group\r$ sudo vgdisplay $ sudo pvdisplay $ sudo vgreduce /dev/sdc $ sudo vgs Remove volume group\r$ sudo vgremove vgpool $ sudo vgdisplay Rename volume group\r$ sudo vgs $ sudo vgrename /dev/vgpool /dev/vgpool-new $ sudo vgs Create logical volume\r$ sudo lvcreate -n mackay -l 100%free vgpool $ sudo lvdisplay $ sudo lvs $ sudo mkfs.ext4 /dev/vgpool/mackay $ sudo resize2fs /dev/mapper/vgpool-mackay $ lsblk $ sudo blkid /dev/mapper/vgpool-mackay $ sudo vim /etc/fstab UUID=af88d797-5f9a-406e-b2d0-27b37bff169f /data ext4 defaults 0 0 $ sudo mount /dev/mapper/vgpool-mackay /data $ df -h $ sudo umount /data Extend logical volume\r$ sudo lvextend -L 110G /dev/vgpool/mackay\t# Logical volume expand to 110GB. $ sudo lvscan $ sudo lvextend -L +5G /dev/vgpool/mackay\t# Add 5GB to logical volumes. $ sudo lvscan $ sudo lvextend -l +100%free /dev/mapper/vgpool-mackay $ sudo lvscan $ sudo vgdisplay $ sudo resize2fs /dev/vgpool/mackay Shrink logical volume\r$ sudo e2fsck -f /dev/vgpool/mackay $ sudo resize2fs dev/vgpool/mackay -20G\t# File system reduced by 20GB. $ sudo lvreduce -L -20G /dev/vgpool/mackay\t# Logical volume reduced by 20GB. $ sduo lvscan $ sudo e2fsck -f /dev/vgpool/mackay $ sudo resize2fs /dev/vgpool/mackay 90G\t# File system reduced to 90GB. $ sudo lvreduce -L 90G /dev/vgpool/mackay\t# Logical volume reduced to 90GB. $ sduo lvscan Remove logical volume\r$ sudo lvdisplay $ sudo lvremove /dev/vgpool/mackay Rename logical volumes\r$ sudo vgs $ sudo lvs $ sudo lvrename /dev/vgpool/mackay /dev/vgpool/data Also remember to change the name in the /etc/fstab\nNotes\rreboot and enter rescue mode\n$ vi /etc/lvm/lvm.conf locking_type = 1 ","date":"2021-05-06T16:56:28-04:00","permalink":"/p/disk-management/","title":"Disk Management"},{"content":" Chrony NTP Pool Project Centos 7 \u0026amp; 8\r$ sudo dnf install chrony $ sudo systemctl enable/start chronyd $ sudo chronyd -q \u0026#39;server 3.pool.ntp.org iburst\u0026#39; $ sudo chronyc -a makestep $ sudo chronyc tracking $ sudo chronyc sources $ sudo chronyc sourcestats -v $ sudo vim /etc/chrony.conf $ sudo firewall-cmd --add-service=ntp --permanent $ sudo firewall-cmd --reload ","date":"2021-05-04T16:00:41-04:00","permalink":"/p/chrony/","title":"chrony"},{"content":"Ubuntu 22.04 LTS\r$ sudo apt update \u0026amp;\u0026amp; sudo apt upgrade $ sudo apt install sysstat iostat Get report and statistic. iostat -x Show more details statistics information. iostat -c Show only the cpu statistic. iostat -d Display only the device report. iostat -xd Show extended I/O statistic for device only. iostat -k Capture the statistics in kilobytes or megabytes. iostat -k 2 3 Display cpu and device statistics with delay. iostat -j ID mmcbkl0 sda6 -x -m 2 2 Display persistent device name statistics. iostat -p Display statistics for block devices. iostat -N Display lvm2 statistic information. $ iostat %user is CPU utilization for the user, %nice is the CPU utilization for apps with nice priority, %system is the CPU being utilized by the system, %iowait is the time percentage during which CPU was idle but there was an outstanding i/o request, %steal percentage of time CPU was waiting as the hypervisor was working on another CPU, %idle is the percentage of time system was idle with no outstanding request. Devices, shows the name of all the devices on system,\nTps, is the short for transfer per second, Blk_read/s \u0026amp; Blk_write/s are the transfer speed for read and write operations, Blk_read \u0026amp; Blk_write shows the total number of blocks read \u0026amp; written. Generate only CPU stats\r$ iostat -c To Generate i/o statistics for all the devices (-d option)\r$ iostat -d Generate detailed i/o statistics\r$ iostat -x $ iostat -cx $ iostat -dx Getting i/o statistics for a single device\r$ iostat -p sda Generate reports in either MB or KB\r$ iostat -h -p sda $ iostat -k -p sda $ iostat -m -p sda Generating system i/o statistics report with delay\r$ iostat 5 3 we are capturing 3 reports at 5 seconds interval\nGenerate the LVM statistics report\r$ iostat -N Generate the reports for only active devices\r$ iostat -z 3 9 Generate iostat reports with timestamp\r$ iostat -t ","date":"2021-05-03T11:34:16-04:00","permalink":"/p/iostat/","title":"iostat"},{"content":"You can select code page for zip archives from command line.\ncmd \u0026#34;d:\\Program Files\\7-Zip\\7z.exe\u0026#34; x \u0026#34;111.zip\u0026#34; -mcp=936 ","date":"2021-05-02T22:36:20-04:00","permalink":"/p/decompress-files-with-foreign-characters/","title":"Decompress Files With Foreign Characters"},{"content":" FFmpeg Windows builds from gyan.dev FreeBSD 14\r# cd /usr/ports/multimedia/ffmpeg # make install clean Ubuntu 22.04 LTS\r$ sudo apt update $ $sudo apt install ffmpeg $ ffmpeg -version $ ffmpeg -encoders $ ffmpeg -decoders CentOS 7\r$ sudo yum install epel-release $ sudo yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm $ sudo yum install ffmpeg ffmpeg-devel CentOS 8\r$ wget http://www.ffmpeg.org/releases/ffmpeg-4.4.tar.gz $ tar -xvf ffmpeg-4.4.tar.gz $ cd ffmpeg-4.4/ $ ./configure \u0026amp;\u0026amp; make \u0026amp;\u0026amp; make install $ ffmpeg -version Windows 10\rVisit the FFmpeg download page. The More downloading options section has FFmpeg packages and executable files for Linux, Windows, and Mac. To get the Windows version, Windows builds from gyan.dev\nExtract the Downloaded Files\nAdd FFmpeg to PATH\n\u0026gt; set path=D:\\Program Files\\ffmpeg-7.0.2-full_build\\bin Verify FFmpeg PATH\n\u0026gt; ffmpeg -version Instructions\r$ sudo yum install mediainfo $ mediainfo input.mp4 Conversion\r$ ffmpeg -i input.avi output.mp4 $ ffmpeg -i input.mp4 output.ts Encoding format conversion\r$ ffmpeg -i input.mp4 -vcodec h264 output.mp4 Extract audio\r$ ffmpeg -i input.mp4 -acodec copy -vn output.aac $ ffmpeg -i input.mp4 -acodec aac -vn output.aac Extract video\r$ ffmpeg -i input.mp4 -vcodec copy -an output.mp4 Video clip\rffmpeg -ss [start] -i [input] -t [duration] -c copy [output] ffmpeg -ss [start] -i [input] -to [end] -c copy [output] $ ffmpeg -ss 00:03:03 -i ./input.mp4 -c copy ./output.mp4 $ ffmpeg -ss 00:03:03 -to 33:33:33 -i ./input.mp4 -c copy ./output.mp4 Video merge\r$ vim ./join.txt file /home/sk/myvideos/part1.mp4 file /home/sk/myvideos/part2.mp4 file /home/sk/myvideos/part3.mp4 $ ffmpeg -f concat -i join.txt -c copy output.mp4 $ ffmpeg -f concat -safe 0 -i ./join.txt -c copy output.mp4 Bit rate\rThere are 3 options for ffmpeg to control the bit rate: -minrate**-b:v****-b:a****-maxrate**\nbitrate = file size / duration\nbiterate = 20.8M bit/60s = 20.810241024*8 bit/60s= 2831Kbps\n分辨率320x240 码率200-384kbps 分辨率640x480 码率768-1024kbps 分辨率1280x720(720p) 码率2048-3072kbps 分辨率1920x1080(1080p) 码率5120-8192kbps $ ffmpeg -i input.mp4 -b:v 2000k -bufsize 2000k output.mp4 $ ffmpeg -i input.mp4 -b:v 2000k -bufsize 2000k -maxrate 2500k output.mp4 Use of filters\rScale down the input 1920x1080 to 960x540 output\n$ ffmpeg -i input.mp4 -vf scale=960:540 output.mp4 $ ffmpeg -i input.mp4 -vf scale=960:-1 output.mp4 Add logo to video\r$ ffmpeg -i input.mp4 -i logo.png -filter_complex overlay output.mp4 $ ffmpeg -i input.mp4 -i logo.png -filter_complex overlay=W-w output.mp4 $ ffmpeg -i input.mp4 -i logo.png -filter_complex overlay=0:H-h output.mp4 $ ffmpeg -i input.mp4 -i logo.png -filter_complex overlay=W-w:H-h output.mp4 Remove video logo\r-vf delogo=x:y:w:h[:t[:show]]\nthe coordinates from the upper left corner\n-vf delogo=x:y:w:h[:t[:show]] x:y The coordinates from the upper left corner w:h Logo width and height t The thickness of the rectangle edges defaults to 4 show If set to 1 to have a green rectangle, the default value is 0. $ ffmpeg -i input.mp4 -vf delogo=0:0:220:90:100:1 output.mp4 Capture video image\rffmpeg -i input.mp4 -r 1 -q:v 2 -f image2 pic-%03d.jpeg -r 表示每一秒几帧 -q:v表示存储jpeg的图像质量，一般2是高质量。 如此，ffmpeg会把input.mp4，每隔一秒，存一张图片下来。假设有60s，那会有60张。可以设置开始的时间，和你想要截取的时间。 ffmpeg -i input.mp4 -ss 00:00:20 -t 10 -r 1 -q:v 2 -f image2 pic-%03d.jpeg -ss 表示开始时间 -t 表示共要多少时间。 如此，ffmpeg会从input.mp4的第20s时间开始，往下10s，即20~30s这10秒钟之间，每隔1s就抓一帧，总共会抓10帧。 Batch file\r$ ffmpeg -i a.mp4 $ ffmpeg -i a.mp4 -hide_banner $ ffmpeg -i a.mkv b.mp4 $ ffmpeg -i input.webm -qscale 0 output.mp4 $ ffmpeg -formats $ ffmpeg -i ./input.mp4 -ss 01:01:01 -to 02:02:02 -c copy ./output.mp4 $ ffmpeg -i input.mp4 -t 00:33:03 -c copy output.mp4 $ ffmpeg -i input.mp4 -t 00:01:06 -c copy part1.mp4 -ss 00:01:06 -c copy part2.mp4 #!/bin/sh Folder_A=\u0026#34;/home/a\u0026#34; for file_a in ${Folder_A}/* do out_filename=`basename $file_a` in_filename=\u0026#34;NEW-\u0026#34;${out_filename} ffmpeg -i /home/a/$out_filename -vf scale=1280:-1 $in_filename -y done #!/bin/sh echo -e \u0026#34;start_time:${PWD}\u0026#34; read start_time echo -e \u0026#34;end_time:${PWD}\u0026#34; read end_time Folder_A=\u0026#34;/home/cidi/Documents/vedio/fill_vedio\u0026#34; for file_a in ${Folder_A}/* do out_filename=`basename $file_a` in_filename=\u0026#34;_CIDI_\u0026#34;${out_filename} ffmpeg -i /home/cidi/Documents/vedio/fill_vedio/$out_filename -vcodec copy -acodec copy -ss $start_time -to $end_time $in_filename -y done ","date":"2021-04-27T19:30:00-04:00","permalink":"/p/ffmpeg/","title":"FFmpeg"},{"content":" Ventoy Rufus ","date":"2021-04-26T08:42:55-04:00","permalink":"/p/create-bootable-usb-drive/","title":"Create Bootable USB Drive"},{"content":"Drives benchmark tool\rCrystalDiskInfo\nCrystalDiskMark\nDisk space analysis\rSpaceSniffer\nWizTree\nWindows\rLog Parser Studio\n","date":"2021-04-25T08:28:17-04:00","permalink":"/p/software/","title":"Software"},{"content":"$ uptime $ grep \u0026#39;model name\u0026#39; /proc/cpuinfo | wc -l Take 1 CPU core as an example, assuming that the CPU can handle up to 100 processes per minute\nload=0, no process needs CPU load=0.5, CPU processed 50 processes load=1, the CPU has processed 100 processes. At this time, the CPU is full, but the system can still operate smoothly load=1.5, the CPU has processed 100 processes, and 50 processes are being excluded waiting for CPU processing. At this time, the CPU has been overloaded. View the number of logical CPU cores.\n1.0 is a critical value, beyond this value, the system is not in the best state. Generally 0.7 is an ideal value. In addition, the health status of the load value is also related to the number of CPU cores in the system. If the number of CPU cores is 2, then the health value of the load value should be 2, and so on.\n$ w $ top Under the top command, press 1 to show how many CPUs the server has and the usage of each CPU.\n$ vmstat $ iostat $ iotop sysstat\r$ vi /etc/sysconfig/sysstat $ vi /etc/cron.d/sysstat $ vi /var/log/sa $ sar $ sar -r $ sar -b ","date":"2021-04-22T16:14:37-04:00","permalink":"/p/check-system-load/","title":"Check System Load"},{"content":"VideoPad\nVSDC\nHitFilm\nOpenshot\niMovie\nKdenlive\nShotcut\nDaVinci Resolve\n","date":"2021-04-21T08:37:44-04:00","permalink":"/p/video-editor/","title":"Video Editor"},{"content":"Firefox\rEnable TLS 1.0\rabout:config security.tls.version.min\t1 security.tls.version.max\t4 Chrome\rTampermonke\nGreasy Fork Sleazy Fork Parallel downloading\rchrome://flags/#enable-parallel-downloading Tab hover card\nSamsung Internet Browser\rinternet://debug/ ","date":"2021-04-20T09:33:37-04:00","permalink":"/p/browser-featured/","title":"Browser Featured"},{"content":"User \u0026amp; Group\r# whoami # who # adduser aaron # passwd aaron # pw useradd amber -u 1011 -m -d /home/amber -g admin -G wheel -s csh -c ftp # pw useradd april -u 1012 -m -d /home/april -g staff -s /usr/sbin/nologin -c ftp # pw lock amber # pw unlock amber # pw groupadd admin # pw groupmod admin -m aaron amber # pw groupmod admin -d amber # pw groupdel admin Update\r# freebsd-update fetch # freebsd-update install # freebsd-update rollback # ee /etc/freebsd-update.conf bsdconfig\rsysrc\rsysrc gateway_enable=\u0026#34;YES\u0026#34; sysrc ipv6_gateway_enable=\u0026#34;YES\u0026#34; sysrc firewall_enable=\u0026#34;YES\u0026#34; sysrc firewall_script=\u0026#34;/etc/ipfw.rules\u0026#34; sysrc firewall_nat_enable=\u0026#34;YES\u0026#34; # ee /boot/loader.conf net.inet.ip.fw.default_to_accept=1 # ee /etc/ssh/sshd_config # ee /etc/wpa_supplicant.conf # ee vi /etc/hostapd.conf ","date":"2021-04-19T21:47:29-04:00","permalink":"/p/installing-freebsd/","title":"Installing FreeBSD"},{"content":" Yellowdog Updater Modified (YUM) Dandified YUM (DNF) Advanced package tool (APT) apt\r$ sudo apt update $ sudo apt list --upgradable $ sudo apt upgrade $ sudo search vim $ sudo show vim $ sudo apt install vim $ sudo apt remove vim $ sudo apt purge remove vim $ sudo apt autoremove vim $ apt list --installed | grep ssh $ sudo apt depends vim $ sudo apt rdepends vim $ sudo apt/apt-get clean\t# Cleans the packages and install script in /var/cache/apt/archives/ $ sudo apt/apt-get autoclean\t# Cleans obsolete deb-packages, less than clean $ sudo apt/apt-get autoremove\t# Removes orphaned packages which are not longer needed from the system Being phased in\r$ apt policy [package name] Solve the dependencies apt\r$ dpkg --force-all --configure -a $ dpkg --purge --force-depends kali-desktop-base\t#to remove the first faulty package $ dpkg --purge --force-depends kali-themes\t#to remove the second faulty package $ dpkg --purge --force-depends kali-themes-common\t#to remove the third faulty package $ apt --fix-broken install $ apt-get -f install $ apt update \u0026amp; apt-upgrade dnf\rRepository\r$ sudo dnf repoinfo $ sudo dnf repolist all/enabled/disabled $ sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo $ sudo dnf config-manager --set-enabled docker-ce-test # cd /etc/yum.repos.d # cp ./CentOS-Base.repo CentOS-Base.repo.bak # wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo # wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo # dnf clean all # dnf makecache Install\r$ sudo yum install epel-release $ sudo yum install dnf $ sudo dnf --version $ sudo dnf check-update $ sudo dnf upgrade $ sudo dnf upgrade-minimal $ sudo dnf downgrade $ sudo dnf list installed/available/update/recent $ sudo dnf grouplist installed/available/update/recent $ sudo dnf search samba $ sudo dnf provides samba $ sudo dnf deplist samba $ sudo dnf download samba $ sudo dnf info/install/reinstall/remove samba $ sudo dnf groupinfo/install/reinstall/remove workstation $ sudo dnf history $ sudo dnf autoremove $ sudo dnf clean all/metadata/packages/dbcache/expire-cache $ sudo dnf install dnf-plugins-core ","date":"2021-04-14T17:05:21-04:00","permalink":"/p/linux-package-manager/","title":"Linux Package Manager"},{"content":"Chocolatey\r\u0026gt; Get-ExecutionPolicy Restricted \u0026gt; Set-ExecutionPolicy AllSigned OR \u0026gt; Set-ExecutionPolicy Bypass -Scope Process \u0026gt; $PSVersionTable.PSVersion \u0026gt; host \u0026gt; Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString(\u0026#39;https://chocolatey.org/install.ps1\u0026#39;)) \u0026gt; choco --version \u0026gt; $env:ChocolateyInstall \u0026gt; choco upgrade chocolatey \u0026gt; choco feature -? \u0026gt; choco feature list \u0026gt; choco feature enable -n allowGlobalConfirmation # 避免每次回答 Y \u0026gt; choco feature enable -name=exitOnRebootDetected # 不执行重启检测 # 软件原生安装目录 C:\\Program Files C:\\Program Files (x86) C:\\Users\\\u0026lt;username\u0026gt;\\AppData # Chocolatey 安装目录 C:\\ProgramData\\chocolatey # 通过环境变量设置软件安装目录 [environment]::setEnvironmentVariable(\u0026#39;ChocolateyInstall\u0026#39;,\u0026#39;C:\\ProgramData\\chocolatey\u0026#39;,\u0026#39;Machine\u0026#39;) [environment]::setEnvironmentVariable(\u0026#39;ChocolateyToolsLocation\u0026#39;,\u0026#39;D:\\Choco\u0026#39;,\u0026#39;Machine\u0026#39;) # 非管理员安装默认路径是 C:\\ProgramData\\chocoportable $env:path += \u0026#34;;C:\\ProgramData\\chocoportable\u0026#34; $InstallDir=\u0026#39;C:\\ProgramData\\chocoportable\u0026#39; $env:ChocolateyInstall=\u0026#34;$InstallDir\u0026#34; \u0026gt; choco outdated --proxy=localhost:1080 \u0026gt; choco -? \u0026gt; choco search \u0026lt;package name\u0026gt; \u0026gt; choco info \u0026lt;package name\u0026gt; \u0026gt; choco install \u0026lt;package name\u0026gt; \u0026gt; choco uninstall \u0026lt;package name\u0026gt; \u0026gt; refreshenv \u0026gt; choco upgrade \u0026lt;package name\u0026gt; \u0026gt; choco upgrade all \u0026gt; choco list -l \u0026gt; chocolatey.txt \u0026gt; choco install -y software1 software2 ... \u0026gt; choco source add -n=MyCustomSource -s=https://example.com/packages/ \u0026gt; choco source remove -n=MyCustomSource Chocolatey GUI\r\u0026gt; choco install chocolateygui \u0026gt; chocolateygui WinGet\r\u0026gt; winget features \u0026gt; winget settiings settings.json \u0026#34;experimentalFeatures\u0026#34;: { \u0026#34;uninstall\u0026#34;: true, \u0026#34;upgrade\u0026#34;: true, \u0026#34;list\u0026#34;: true, \u0026#34;experimentalMSStore\u0026#34;: true }, \u0026#34;visual\u0026#34;: { \u0026#34;progressBar\u0026#34;: \u0026#34;accent\u0026#34;\t#accent,retro,rainbow }, \u0026gt; winget -? \u0026gt; winget show \u0026lt;package name\u0026gt; \u0026gt; winget search \u0026lt;package name\u0026gt; \u0026gt; winget install \u0026lt;package name\u0026gt; Scoop\r\u0026gt; Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser Modify Installation Location\n\u0026gt; $env:SCOOP=\u0026#39;D:\\Applications\\Scoop\u0026#39; \u0026gt; $env:SCOOP_GLOBAL=\u0026#39;F:\\GlobalScoopApps\u0026#39; \u0026gt; [Environment]::SetEnvironmentVariable(\u0026#39;SCOOP\u0026#39;, $env:SCOOP, \u0026#39;User\u0026#39;) \u0026gt; [Environment]::SetEnvironmentVariable(\u0026#39;SCOOP_GLOBAL\u0026#39;, $env:SCOOP_GLOBAL, \u0026#39;Machine\u0026#39;) Setting PowerShell Execution Policies and Downloading Installation Scripts\n\u0026gt; irm get.scoop.sh -outfile \u0026#39;install.ps1\u0026#39; \u0026gt; .\\install.ps1 -RunAsAdmin [-OtherParameters ...] \u0026gt; iex \u0026#34;\u0026amp; {$(irm get.scoop.sh)} -RunAsAdmin\u0026#34; \u0026gt; scoop checkup \u0026gt; scoop help \u0026gt; scoop search git \u0026gt; scoop install git \u0026gt; scoop update git \u0026gt; scoop status git \u0026gt; scoop uninstall git \u0026gt; scoop info git \u0026gt; scoop home git \u0026gt; scoop hold/unhold git \u0026gt; scoop bucket known \u0026gt; scoop uninstall scoop Setting up a proxy\n\u0026gt; scoop config proxy 127.0.0.1:7890 Multi-threaded downloads\n\u0026gt; scoop config aria2-enabled true \u0026gt; scoop config aria2-options --check-certificate=false Links\rChocolatey\nChocolatey-gui\nScoop\nWinget\nWinget-cli\nWinget-Docs\n","date":"2021-04-12T08:12:06-04:00","permalink":"/p/windows-package-manager/","title":"Windows Package Manager"},{"content":" FreeBSD Ports collection FreeBSD Ports\r# pkg update \u0026amp;\u0026amp; pkg upgrade # pkg install portsnap # portsnap fetch # portsnap extract # cd /usr/ports # ls -lsa # make index # make search name=nano ","date":"2021-04-10T17:05:21-04:00","permalink":"/p/unix-package-manager/","title":"UNIX Package Manager"},{"content":"Windows 10\rRun WinSAT to Generate Windows Experience Index\rThe Windows System Assessment Tool (WinSAT) remains tucked away in Windows 10. You can use WinSAT to generate a Windows Experience Index for your processor, graphics card, memory speed, and more.\nType command in your Start Menu search bar, right-click the Best Match and select Run as Administrator. When the Command Prompt opens, input the following command: winsat formal Wait for the process to complete. When it finishes, you can find the XML file in C:\\Windows\\Performance\\WinSAT\\DataStore. Wait for the process to complete. When it finishes, you can find the XML file in C:\\Windows\\Performance\\WinSAT\\DataStore. When prompted, select your internet browser to view the XML file. Your browser will make the XML data readable. winsat formal winsat cpu winsat mem winsat disk winsat dwm winsat d3d winsat media winsat mfmedia winsat features Use the Windows PowerShell\rType powershell into your Start Menu search bar, right-click Windows PowerShell and select Run as Administrator. When PowerShell opens, input the following command: Get-CimInstance Win32_WinSat Use the Performance Monitor and System Diagnostics\rType performance into your Start Menu search bar and select Performance Monitor. Under Performance, head to Data Collector Sets \u0026gt; System \u0026gt; System Diagnostics. Right-click System Diagnostics and select Start. The System Diagnostic will run, collecting information regarding your system. Now, head to Report \u0026gt; System \u0026gt; System Diagnostics \u0026gt; [computer name]. After selecting your computer name, the System Diagnostic Report will appear. Scroll down the report until you find the Hardware Configuration Expand the Desktop Rating, then the two additional dropdowns, and there you find your Windows Experience Index. ","date":"2021-03-22T13:43:57-04:00","permalink":"/p/optimization-windows/","title":"Optimization Windows"},{"content":"# dmesg | grep Wireless # ee /boot/loader.conf if_iwn_load=\u0026#34;YES\u0026#34; iwn2000fw_load=\u0026#34;YES\u0026#34; iwn2030fw_load=\u0026#34;YES\u0026#34; iwn2230fw_load=\u0026#34;YES\u0026#34; # ee /etc/wpa_supplicant.conf ctrl_interface=/var/run/wpa_supplicant eapol_version=2 ap_scan=1 fast_reauth=1 network={ ssid=\u0026#34;WiFi name\u0026#34; psk=\u0026#34;password\u0026#34; } # ee /etc/rc.conf wlans_iwn0=\u0026#34;wlan0\u0026#34; ifconfig_wlan0=\u0026#34;WPA inet 192.168.1.10/24\u0026#34;; ifconfig_wlan0=\u0026#34;WAP dhcp\u0026#34; defaultrouter=\u0026#34;192.168.1.1\u0026#34; # service netif restart # /etc/netstart ","date":"2021-02-15T22:13:43-04:00","permalink":"/p/wifi-on-freebsd/","title":"WiFi on FreeBSD"},{"content":"Find files in the specified directory\r$ find . -name sayboy.txt $ find /home -name sayboy.txt Use name ignoring case lookup\r$ find /home -iname sayboy.txt Find a directory by name\r$ find /home -type d -name sayboy Find all PHP files in the directory\r$ find . -type f -name \u0026#34;*.php\u0026#34; Find files with 777 permissions\r$ find . -type f -perm 0777 -print $ find / -type f ! -perm 777 $ find / -perm 2644 $ find / -perm 551 $ find / -perm /u=s $ find / -perm /g=s $ find / -perm /u=r $ find / -perm /a=x $ find / -type f -perm 0777 -print -exec chmod 644 {} \\; $ find / -type d -perm 777 -print -exec chmod 755 {} \\; Find and delete individual files\r$ find . -type f -name \u0026#34;rumenz.txt\u0026#34; -exec rm -f {} \\; $ find . -type f -name \u0026#34;*.txt\u0026#34; -exec rm -f {} \\; $ find . -type f -name \u0026#34;*.mp3\u0026#34; -exec rm -f {} \\; Find all empty files or all empty directories\r$ find /tmp -type f -empty $ find /tmp -type d -empty $ find /tmp -type f -name \u0026#34;.*\u0026#34; Find the 50MB file\r$ find / -size 50M $ find / -size +50M -size -100M $ find / -type f -size +100M -exec rm -f {} \\; $ find / -type f -name *.mp3 -size +10M -exec rm {} \\; ","date":"2021-02-11T12:13:09-04:00","permalink":"/p/find-command/","title":"Find Command"},{"content":"CentOS 7\r$ sudo yum update -y $ sudo yum install mailx -y $ sudo mail -V $ echo \u0026#34;This is test email\u0026#34; | mail -s \u0026#34;Test Email\u0026#34; root@localhost $ tail -f /var/spool/mail/root Instructions\rSend mail to a local system user\r$ mail -s \u0026#34;Hello World\u0026#34; username Subject and Message in a single line\r$ mail -s \u0026#34;Hello World\u0026#34; someone@example.com $ mail -s \u0026#34;This is the subject\u0026#34; somebody@example.com \u0026lt;\u0026lt;\u0026lt; \u0026#39;This is the message\u0026#39; $ echo \u0026#34;This is the body\u0026#34; | mail -s \u0026#34;Subject\u0026#34; -aFrom:Harry\\\u0026lt;harry@gmail.com\\\u0026gt; someone@example.com Take message from a file\r$ mail -s \u0026#34;Hello World\u0026#34; user@yourmaildomain.com \u0026lt; /home/user/mailcontent.txt $ echo \u0026#34;This is the message body\u0026#34; | mail -s \u0026#34;This is the subject\u0026#34; mail@example.com Specify CC and BCC recipients\r$ mail -s \u0026#34;Hello World\u0026#34; user1@example.com -c usertocc@example.com -b usertobcc@example.com Sending to multiple recipients\r$ mail -s \u0026#34;Hello World\u0026#34; user1@example.com,user2@example.com Specify the FROM name and address\r$ echo \u0026#34;This is the message body\u0026#34; | mail -s \u0026#34;This is the subject\u0026#34; mail@example.com -aFrom:sender@example.com $ echo \u0026#34;This is the body\u0026#34; | mail -s \u0026#34;Subject\u0026#34; -aFrom:Harry\\\u0026lt;harry@gmail.com\\\u0026gt; someone@example.com ","date":"2021-01-26T09:44:12-04:00","permalink":"/p/mail-command/","title":"Mail Command"},{"content":"CentOS 7\r$ sudo yum update -y $ sudo yum install mailx -y $ sudo mail -V $ sudo vim /etc/mail.rc set from=sayboy@163.com set smtp=smtps://smtp.163.com:465 set smtp-auth-user=sayboy@163.com set smtp-auth-password=password set ssl-verify=ignore set nss-config-dir=~/.certs/ Generate the certificate\r$ mkdir ./.certs $ echo -n | openssl s_client -connect smtp.163.com:465 | sed -ne \u0026#39;/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p\u0026#39; \u0026gt; ~/.certs/163.mail.crt $ certutil -A -n \u0026#34;GeoTrust SSL CA\u0026#34; -t \u0026#34;C,,\u0026#34; -d ~/.certs -i ~/opt/163.mail.crt $ certutil -A -n \u0026#34;GeoTrust Global CA\u0026#34; -t \u0026#34;C,,\u0026#34; -d ~/.certs -i ~/opt/163.mail.crt Verify the certificate\r$ cd ~/.certs \u0026amp;\u0026amp; ll $ certutil -A -n \u0026#34;GeoTrust SSL CA - G3\u0026#34; -t \u0026#34;Pu,Pu,Pu\u0026#34; -d ./ -i 163.mail.crt $ certutil -L -d /root/.certs Sending\r$ echo \u0026#34;Hello world\u0026#34; | mail -s \u0026#34;Test mail\u0026#34; daodaotest@163.com $ echo \u0026#34;Hello world\u0026#34; | mail -v -c \u0026#34;user2@163.com，user3@qq.com\u0026#34; -s \u0026#34;Test mail\u0026#34; -a files.zip user1@163.com ","date":"2021-01-25T13:19:44-04:00","permalink":"/p/sending-emails-with-mailx/","title":"Sending Emails with Mailx"},{"content":"Time\rtime.is\nIP\rIPAddress.com\nWhatIsMyIPAddress.com\nDNS leak test.com\nTest network speed\rFast.com\nSpeedtest.net\nVirus\rVirustotal.com\nChenk data breach\rHaveibeenpwned.com\nPDF editor\rPDFescape\nAlternative\ralternativeto.net\nDesign assets\rDesign stock\rVHV.RS\nAI Gahaku\nundraw.co\nwww.cleanpng.com\npixabay.com\nwallpaperaccess.com\nPicture compression\rtinypng.con\nCourse\rCodecadmy\nWGestures 2\n","date":"2020-12-21T15:47:52-05:00","permalink":"/p/website/","title":"Website"},{"content":"Boiled lobster\rBaked lobster with garlic, butter \u0026amp; cheese\r","date":"2020-12-19T10:47:52-05:00","permalink":"/p/lobster/","title":"Lobster"},{"content":"\r","date":"2020-12-18T10:47:52-05:00","permalink":"/p/spicy-crawfish/","title":"Spicy Crawfish"},{"content":"\r","date":"2020-12-17T10:47:52-05:00","permalink":"/p/fried-shrimps/","title":"Fried Shrimps"},{"content":"\r","date":"2020-12-13T10:47:52-05:00","permalink":"/p/sugar-garlic/","title":"Sugar Garlic"},{"content":"\r","date":"2020-12-12T10:47:52-05:00","permalink":"/p/pickled-taiwanese-cabbage/","title":"Pickled Taiwanese Cabbage"},{"content":"酸白菜配方：\n2个大白菜，去外面的菜叶后3.5公斤 盐或泡菜盐：70克 （白菜重量的2%）如果有泡菜引子，盐的用量可以减少为1%。酸菜泡好之后，再添菜的时候，可以不放盐或者少放。 室温腌制10-14天。或者适合自己的酸度。 Pickled Chinese cabbage:\nChinese cabbage: 2, 3.5 kg after outer layer leaves removed. Salt or pickling salt: 70 g, 2% of the weight of the cabbage. If previous pickling water is available, 1 % salt is sufficient. When adding second batch of fresh cabbage, salt is not required. Ferment at the room temperature for 10-14 days. Or longer for additional acidity. ","date":"2020-12-11T10:47:52-05:00","permalink":"/p/pickled-chinese-cabbage/","title":"Pickled Chinese Cabbage"},{"content":"\r","date":"2020-12-10T10:47:52-05:00","permalink":"/p/pickled-cabbage/","title":"Pickled Cabbage"},{"content":" 白菜切段洗淨後，均勻地撒鹽（把白菜梗折不斷就是好了)，洗淨醃好的白菜，瀝乾後備用。 煮糯米粉，3杯水，½ 杯糯米粉，煮到冒泡就立刻熄火，加入¼ 杯的糖，放置到涼。用果菜機把(1杯蒜 1顆洋蔥 1顆蘋果或1顆水梨 1杯魚露 1-2小匙薑末) 打成泥，再把打好的魚露果菜泥倒入放涼的糯米糊拌勻，再加入1杯韓國辣椒粉（想要辣一點加2杯），這就是完成了泡菜的關鍵“藥念醬”。泡菜的成敗就看這個步驟了！ 拌入切好的紅白蘿蔔青蔥絲，拌好後就可以加入醃好的白菜。 拌好泡菜就完美完成了，可以分裝到容器裡但記得裝八分滿就好，留一點空隙幫助泡菜發酵，裝好的泡菜我通常會蓋上保鮮膜（預防冰箱有味道）再蓋上蓋子，放在室溫下一晚隔天再放入冰箱（幫助發酵）再以個人喜好泡菜的酸度來決定開吃時間，一般來說5天就可以吃了，但是如果喜歡吃酸一點就等到7天。 ","date":"2020-12-09T10:47:52-05:00","permalink":"/p/kimchi/","title":"Kimchi"},{"content":"北美超市食用油选购\nsmoke point\n","date":"2020-12-05T10:47:52-05:00","permalink":"/p/cooking-oil/","title":"Cooking Oil"},{"content":"\r","date":"2020-12-03T10:47:52-05:00","permalink":"/p/seasoning-for-cooking/","title":"Seasoning for Cooking"},{"content":"Calphalon Classic\nSelect by Calphalon\nCalphalon Contemporary\nCalphalon Signuture\nCalphalon Premier\nClassic Select Contemporary Signature Premier 硬氧化铝厚度 3MM 3MM 3.6MM 3.6MM 3.6MM 涂层层数 2 2 3 3 3 烤箱安全温度 450F 400F 450F 500F 450F 使用锅铲 软性锅铲 软性锅铲 软性锅铲 金属锅铲 金属锅铲 All-Clad\rEssential HA1\u0026amp;B1 氧化铝厚度 3.6MM 3.6MM 涂层层数 3 3 烤箱安全温度 500F 500F 使用锅铲 金属锅铲 金属锅铲 锅底结构 无 不锈钢底座 价格 便宜 贵 LC creuset VS Staub\r","date":"2020-12-01T10:47:52-05:00","permalink":"/p/utensils/","title":"Utensils"},{"content":"荨麻疹\r去药店找Claritin （loratadine）10mg，药剂师可能会推荐Benadryl，但这是第一代抗过敏药，会让你头晕昏睡。选Claritin就好。\nCostco保健品分类\rAntioxidants - 抗氧化 Cough \u0026amp; Cold - 抗感冒 Diabetes Care - 糖尿病保健 Digestive Aids - 助消化 Eye Health - 视力保健 Heart Health - 心脏保健 Immune System \u0026amp; Cleansing - 免疫系统保健 Mood, Memory \u0026amp; Nervous System - 抗焦虑、记忆、睡眠类 Pain \u0026amp; Anti-inflammatories - 止痛消炎类 Supplements - 营养补充 Vitamins \u0026amp; Minerals - 维他命、矿物类 Notes\r","date":"2020-11-20T07:40:11-05:00","permalink":"/p/healthcare/","title":"Healthcare"},{"content":"norberts gambit\rHORIZONS ETFs 什么是基金？基金和股票债券的关系？\rMutual Fund|Stock or ETF|GIC|Bonds\ncall option|put option\ndividend withholding tax 30%\nnon-registered account\ncaptial loss capital gain\nTFSA\rSuccessor Beneficiary TFSA (Tax Free Savings Account ) 加拿大最好的投资避税账户\r你需要知道的关于免税账户TFSA的都在这（浅谈）\rTFSA 2020 你真的需要吗? | 十分钟轻松了解加拿大免税储蓄账户 TFSA | TFSA 基础篇\rTFSA 六大陷阱 (上) | 为什么不买科技股? 离开加拿大怎么办? 加拿大免税账户TFSA\rTFSA 六大陷阱 (下) | 加拿大免税账户TFSA 适合投什么? 不适合投什么? (美股, 加股, ETF, Mutual Fund, REITs)\r你的TFSA可能被CRA征税的7种情况\rTFSA-10 Things You DON\u0026rsquo;T Know\r加币美刀互换\r你好，像视频里解释的，ECN费用是按每股0.0035。视频里用的是以QUESTRADE为例子，是因为我给大家操作的时候是$1000，而换汇$1万以下用Questrade比较划算，手续费会相对较低。 之前也有人留言问过如果大额的话是否银行的DIRECT INVESTING会比较划算，我有回答过大额的话在银行的DIRECT INVESTING用这种方法购买会比较划算，因为银行会收取$7-$9.99的FLAT FEE， 没有ECN FEE, 因为ECN FEE 是按每一股来收取，所以数量大的话是不划算的， 如果只是一般股票交易，如500股以下是比较划算的。 但是NORBERT GAMBIT这种方法比在各大银行直接用加币买美金划算多了， 我以前用的TD银行直接换过，3万多美金被收取了600多加币的spread 手续费（也就是说比这种方法要贵600多加币），所以Nobert Gambit 这种方法比起银行直接加币换美金还是便宜很多的。 婷婷为什么你说超过1w 最好用银行investment 账户呀 因为我算了一下ecnfee 如果是0.0035每股 一卖一买也不算高吧?因为银行是flat fee, 交易一次$9.99，无论多少股都是这个价钱，所以9288股的话会差个几十块钱，但是如果股数少的话就是Questrade划算，比如平时你买200股TD或其他什么股票，ecn fee就只要200*0.0035=$0.7 +$4.99的交易费 (如果是买入etf则没有交易费)，所以会比银行的$9.99交易费便宜。注意，这里$9.99是用股票交易平台用我视频里讲的方法的费用，比如TD direct investing, 千万不要到银行直接用美金买加币，这样的话手续费是2% ，这样10万的话会比用这个方法少换2000多。\n就我的亲身体验来看，这个方法耗时耗金，不推荐。CIBC的银行职员都推荐的VBCE换汇，利率好，快捷，没手续费。\n用BMO investline 买DLR,打电话转换DLR. U立即到账\nQuestrade里面的美金取出来的时候会产生其他费用吗？是免费的，但是有每日$25，000美金或$50,000加币的上限\n用限價單買可以被100整除的股數，可以避免ECN Fee。只要可以增加流通性的，都算。限價單就是增加流通性，市價單就不是，但若用高於市價的限價單，因為馬上就成交，也不能增加流通性，所以也不算。\n如何用加币炒美股？如何加元美元便宜换汇？如何划算的加币美刀互换？\r如何用加币换美金最省钱？\rnotic\rcoca-cola european partners(ccep)\nwealthsimple trade (canada)\n","date":"2020-11-19T21:16:08-05:00","permalink":"/p/finance/","title":"Finance"},{"content":"How to repair/fix a hole on a drywall/plasterboard\rHow to painting\rHow To Fix A Crack in Door\rCaulk\rFew People Know About This Silicone Trick\rElectrical outlet and how to wire\r","date":"2020-11-17T21:16:08-05:00","permalink":"/p/home/","title":"Home"},{"content":"The Registration of Canadians Abroad\nRegistration of Canadians Abroad is a free service that allows the Government of Canada to notify you in case of an emergency at your destination or a personal emergency at home. The service also enables you to receive important information before or during a natural disaster or civil unrest.\n","date":"2020-11-16T21:16:08-05:00","permalink":"/p/travel/","title":"Travel"},{"content":"Request Your Claims History Statement\nSAAQclic Services for Individuals\nBattery\rNOCO GENIUS10 Battery Charger \u0026amp; Maintainer\r","date":"2020-11-15T21:16:08-05:00","permalink":"/p/vehicle/","title":"Vehicle"},{"content":" FRP fatedier/frp CentOS 8\rInstall\r$ sudo wget https://github.com/fatedier/frp/releases/download/v0.33.0/frp_0.33.0_linux_amd64.tar.gz $ sudo cd frp_0.33.0_linux_amd64/ $ sudo cp ./systemd/frps@.service /etc/systemd/system/ Configure\r$ sudo vim /etc/systemd/system/frps.service ExecStart=/usr/local/bin/frps -c /etc/frp/%i.ini $ sudo cp ./frps /usr/local/bin/ $ sudo mkdir /etc/frp $ sudo cp ./frps.ini /etc/frp/ Start \u0026amp; stop\r$ sudo systemctl daemon-reload $ sudo systemctl enable frps $ sudo systemctl start frps Notes\r$ sudo vi /etc/frp/%i.ini Windwos\rPowerShell(Admin) \u0026amp; Command Prompt(Admin)\r\u0026gt; frps -c frps.ini \u0026gt; ./frps.exe -c frps.ini \u0026gt; nohup ./frps -c ./frps.ini \u0026amp; ","date":"2020-10-30T11:33:45-04:00","permalink":"/p/frp/","title":"Frp"},{"content":"Frees up disk space and optimizes the system.\rOpen command prompt as an administrator and wait for completion.\n\u0026gt; Dism.exe /online /Cleanup-Image /StartComponentCleanup Repair Windows image\rOpen command prompt as an administrator.\n\u0026gt; sfc /scannnow \u0026gt; dism /Online /Cleanup-Image /CheckHealth \u0026gt; dism /Online /Cleanup-Image /ScanHealth \u0026gt; dism /Online /Cleanup-image /RestoreHealth Explanation:\rSystem file checker\n\u0026gt; SFC /scannow This option performs a more advanced scan to determine if the image has any problems.\n\u0026gt; dism /Online /Cleanup-Image /ScanHealth Quickly determine if there are any corruptions inside the local image, but the option won\u0026rsquo;t perform any repairs.\n\u0026gt; dism /Online /Cleanup-Image /CheckHealth Run an advanced scan and repair problems automatically.\n\u0026gt; dism /Online /Cleanup-image /RestoreHealth List all of the features available in the operating system.\n\u0026gt; dism /Image:C:\\test\\offline /Get-Features \u0026gt; dism /online /Get-Features \u0026gt; dism /online /Enable-Feature /FeatureName:XXX \u0026gt; dism /online /Disable-Feature /FeatureName:XXX Displays the edition of the specified image.\n\u0026gt; dism /Image:C:\\test\\offline /Get-CurrentEdition \u0026gt; dism /online /Get-CurrentEdition Displays a list of Windows editions that an image can be changed to.\n\u0026gt; dism /Image:C:\\test\\offline /Get-TargetEditions \u0026gt; dism /Online /Get-TargetEditions Change an Windows image to a higher edition.\n\u0026gt; dism /Image:C:\\test\\offline /Set-Edition:Ultimate \u0026gt; dism /online /Set-Edition:Datacenter /ProductKey:12345-67890-12345-67890-12345 Backup third party device drivers.\n\u0026gt; dism /online /export-driver /destination:C:\\drivers-backup Install all of the drivers from a folder and all its subfolders.\n\u0026gt; dism /online /Add-Driver /Driver:D:\\DriversBackup /Recurse Repair an offline image using a mounted image as a repair source.\n\u0026gt; dism /Image:C:\\offline /Cleanup-Image /RestoreHealth /Source:c:\\test\\mount\\windows Repair an online image using some of your own sources instead of windows update.\n\u0026gt; dism /Online /Cleanup-Image /RestoreHealth /Source:c:\\test\\mount\\windows /LimitAccess Notes:\r\u0026gt; dism /Capture-Image /ImageFile:D:\\BF\\Win10Pro.wim /CaptureDir:C:\\ /Name:Win8Pro-1 /Description:00-00-00 \u0026gt; dism /Append-Image /ImageFile:D:\\BF\\Win10Pro.wim /CaptureDir:C:\\ /Name:Win8Pro-2 /Description:00-00-00 ","date":"2020-10-30T11:33:37-04:00","permalink":"/p/dism/","title":"DISM"},{"content":" Power Toys FancyZones\nFile Explorer\nImage Resizer\nPowerRename\n.* 匹配名称中的所有文本 ^foo 匹配以foo开头的文本 bar$ 匹配以bar结尾的文本 ^foo bar$ 匹配以foo开头，以bar结尾的文本 .+?(?=bar) 匹配所有bar的文本 foo[\\s\\S]*bar 匹配所有在foo和bar之间的文本 需要注意的是，为能够完全使用这些表达式，务必勾选「全字匹配」选项！\n(.*).png foo_$1.png 现有文件名前加上“foo_” (.*).png $1_foo.png 现有文件名后加上“_foo” (.*) $1.txt 现有文件名后加\u0026quot;.txt\u0026quot;的扩展名 (^\\w+.$)|(^\\w+$) $2.txt 仅当文件没有扩展名时，文件名后加\u0026quot;.txt\u0026quot;的扩展名 Shortcut Guide\nWindow Walker\n","date":"2020-10-30T11:33:32-04:00","permalink":"/p/powertoys/","title":"PowerToys"},{"content":" Sysinternals Sysinternals Suite ","date":"2020-10-29T11:33:32-04:00","permalink":"/p/sysinternals/","title":"Sysinternals"},{"content":"$ curl ip.sb $ curl ifconfig.me ","date":"2020-10-05T22:09:14-05:00","permalink":"/p/get-your-public-ip-address/","title":"Get Your Public IP Address"},{"content":"Every Cut Of Meat Explained\rSteak Grading\r","date":"2020-09-15T10:47:52-05:00","permalink":"/p/detailed-explanation-of-beef/","title":"Detailed Explanation of Beef"},{"content":"\r","date":"2020-09-09T10:47:52-05:00","permalink":"/p/pan-searing-the-perfect-steak/","title":"Pan Searing The Perfect Steak"}]