Ignore SSL certificate errors when using Curl
curl -k https://expired.badssl.com
References
https://reqbin.com/req/c-ug1qqqwh/curl-ignore-certificate-checks
curl -k https://expired.badssl.com
References
https://reqbin.com/req/c-ug1qqqwh/curl-ignore-certificate-checks
curl https://reqbin.com/echo
References
https://reqbin.com/req/c-1n4ljxb9/curl-get-request-example
curl -X POST https://reqbin.com/echo/post/json -H 'Content-Type: application/json' -d '{"login":"my_login","password":"my_password"}'
References
https://reqbin.com/req/c-dwjszac0/curl-post-json-example
Check if IPv6 is disabled
sysctl -a 2>/dev/null | grep disable_ipv6
Disabling IPv6 temporarily
sysctl -w net.ipv6.conf.all.disable_ipv6=1 sysctl -w net.ipv6.conf.default.disable_ipv6=1 sysctl -w net.ipv6.conf.lo.disable_ipv6=1
Disabling IPv6 Permanently
sudo nano /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6=1 net.ipv6.conf.default.disable_ipv6=1 net.ipv6.conf.lo.disable_ipv6 = 1
sysctl -p
References
https://www.thegeekdiary.com/how-to-disable-ipv6-on-ubuntu-18-04-bionic-beaver-linux/
https://www.golinuxcloud.com/linux-check-ipv6-enabled/
https://www.garron.me/en/go2linux/sysctl-linux.html
Generating a GPG key
gpg --full-generate-key
gpg --list-secret-keys --keyid-format=long
From the list of GPG keys, copy the long form of the GPG key ID you’d like to use. In this example, the GPG key ID is 3AA5C34371567BD2
:
$ gpg --list-secret-keys --keyid-format=long /Users/hubot/.gnupg/secring.gpg ------------------------------------ sec 4096R/3AA5C34371567BD2 2016-03-10 [expires: 2017-03-10] uid Hubot ssb 4096R/42B317FD4BA89E7A 2016-03-10
gpg --armor --export 3AA5C34371567BD2 # Prints the GPG key ID, in ASCII armor format
Copy your GPG key, beginning with -----BEGIN PGP PUBLIC KEY BLOCK-----
and ending with -----END PGP PUBLIC KEY BLOCK-----
.
gpg --list-secret-keys --keyid-format LONG
Example output:
pub 4096R/ABC12345 2020-01-01 [expires: 2025-12-31] uid Your Name <user@example.com> sub 4096R/DEF67890 2020-01-01 [expires: 2025-12-31]
Remember the ID of your key (second column, after the slash, e.g. “ABC12345”). If you have a “sub” entry, you can ignore it.
Run this command to export your key:
gpg --export-secret-keys YOUR_ID_HERE > private.key
Run this command to import your key:
gpg --import private.key
sudo apt install android-tools-adb android-tools-fastboot
adb version
adb devices
References
https://www.linuxbabe.com/ubuntu/how-to-install-adb-fastboot-ubuntu
sudo nmcli networking off sudo nmcli networking on
References
https://itsfoss.com/restart-network-ubuntu/
Flush all routes
sudo ip route flush table main
ip route show
Empty a routing cache
sudo ip route flush cache
sudo ip route show cache
References
https://linoxide.com/how-to-flush-routing-table-from-cache/
var=$(command-name-here) var=$(command-name-here arg1) var=$(/path/to/command) var=$(/path/to/command arg1 arg2)
OR use backticks based syntax as follows to assign output of a Linux command to a variable:
var=`command-name-here` var=`command-name-here arg1` var=`/path/to/command` var=`/path/to/command arg1 arg2`
Examples
## store date command output to $now ## now=$(date)
## alternate syntax ## now=`date`
To display back result (or output stored in a variable called $now) use the echo or printf command:
echo "$now" printf "%s\n" "$now"
References
https://www.cyberciti.biz/faq/unix-linux-bsd-appleosx-bash-assign-variable-command-output/