This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -name '*.java' | xargs wc -l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user@fdr-lnx ~]$ nmcli connection down MyFedoraHotspot | |
Connection 'MyFedoraHotspot' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/16) | |
[user@fdr-lnx ~]$ nmcli connection delete MyFedoraHotspot | |
Connection 'MyFedoraHotspot' (076c78bf-9e91-4779-832e-7306adb7b277) successfully deleted. | |
[user@fdr-lnx ~]$ ls -lh /etc/NetworkManager/system-connections/ | grep MyFedoraHotspot | |
[user@fdr-lnx ~]$ nmcli con add type wifi ifname wlp0s30f4 con-name MyFedoraHotspot autoconnect yes ssid MyFedoraHotspot | |
Connection 'MyFedoraHotspot' (9ec71f65-881b-43b3-b666-710a21d5c6a9) successfully added. | |
[user@fdr-lnx ~]$ nmcli con modify MyFedoraHotspot 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared | |
[user@fdr-lnx ~]$ nmcli con modify MyFedoraHotspot wifi-sec.key-mgmt none | |
Warning: WEP encryption is known to be insecure. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git commit --amend -m "New commit message." | |
git push --force <remoteName> <branchName> | |
# https://linuxize.com/post/change-git-commit-message/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in $(seq -w 1 02); | |
do | |
for j in $(seq -w 10); | |
do | |
for k in $(seq -w 16); | |
do | |
printf '%s:%s:%s,\t' "$i" "$j" "$k"; | |
done | |
done | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://stackoverflow.com/questions/9090817/copying-files-using-rsync-from-remote-server-to-local-machine | |
# https://explainshell.com/explain?cmd=rsync+-havzP+-e+%22ssh+-p+%24portNumber%22+user%40remote.host%3A%2Fpath%2Fto%2Fcopy+%2Flocal%2Fpath | |
# copy files from remote host with specific ssh port | |
rsync -havzP -e "ssh -p portNumber" [email protected]:/path/to/copy /local/path | |
# copy abc into local def | |
rsync -avzP user@remote-host:/source/folder/abc /destinate/folder/def/ | |
# copy the files in abc into local abc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
import subprocess | |
from Crypto.Cipher import AES | |
from Crypto.Util.Padding import pad, unpad | |
# Python 3.11.3 | |
# pycryptodome-3.18.0-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | |
def pad_pkcs5(byte_array: bytearray, block_size: int): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat /dev/urandom | tr -cd 'a-zA-Z0-9' | head -c 32 | xargs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jwtkey=/home/jwt/sign/keys | |
mkdir -p $jwtkey | |
openssl genrsa -out $jwtkey/rsa-prv.pem 2048 | |
openssl rsa -in $jwtkey/rsa-prv.pem -pubout > $jwtkey/rsa-pub.pem | |
# OpenSSL `1.0.2k-fips on 26 Jan 2017` on `CentOS Linux release 7.9.2009 (Core)` gives pkcs#1 with -----BEGIN RSA PRIVATE KEY----- | |
# OpenSSL `3.0.8 7 Feb 2023 (Library: OpenSSL 3.0.8 7 Feb 2023)` on `Fedora release 38 (Thirty Eight)` gives pkcs#8 with -----BEGIN PRIVATE KEY----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for ((i=1; i<=50; i++)); do curl -X POST http://127.0.0.1:8090/myapi/demo; echo ""; done; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import web | |
urls = ( | |
'/', 'index' | |
) | |
class index: |
NewerOlder