Posts

Showing posts from July, 2020

Command line to stop Windows 10 updates

To stop Windows 10 updates: > net stop wuauserv > net stop bits > net stop dosvc Resume it: > net start wuauserv > net start bits > net start dosvc Ref:  https://lifehacker.com/pause-windows-10-updates-easily-from-the-command-line-1786614642

Sign and verify your file using SSL / OpenSSL

I want to learn know to sign and verify my file using SSL / OpenSSL. And I'd found Enrico Zimuel has did a very nice illustration on this issue: https://www.zimuel.it/blog/sign-and-verify-a-file-using-openssl

Add git information to your bash prompt

To show git information in your bash prompt, add the following function in your ~/.bashrc function git-shell() {   export GIT_PS1_SHOWDIRTYSTATE=1   export PS1='\[\033[01;33m\] (git) \[\033[01;34m\]\w$(__git_ps1 " \[\033[01;32m\](%s)")\[\033[00m\]\n\$ ' } Then, in your bash, run "git-shell" and you will get a nice git prompt: (git) /path_to_your_git_project (master *) $

curl returns "ssl_choose_client_version:unsupported protocol" error in Ubuntu 20.x

If you encountered  "ssl_choose_client_version:unsupported protocol" when using curl in Ubuntu 20:      $ curl https://somehost/   curl: (35) error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol It may because the "somehost" only accepts old protocol (e.g. TLS v1, etc.), but in Ubuntu 20.x, the OpenSSL assumes minimum = TLS v1.2 by default.  If the "somehost" just cannot upgrade to TLS v1.2, you might consider fixing it with the following: 1) Modify  /etc/ssl/openssl.cnf Search for the line "oid_section = new_oids" Add the following lines below it: openssl_conf = default_conf [default_conf] ssl_conf = ssl_sect [ssl_sect] system_default = system_default_sect [system_default_sect] MinProtocol = TLSv1.1 CipherString = DEFAULT@SECLEVEL=1 2) curl "somehost" with the following parameters $ curl --tlsv1 https://somehost 3) If the "somehost" just using a self-signed certificate      $ curl -k --tlsv1 https://som...