verification of certificate chain using openssl verify command

When attempting to verify google server’s certificate chain using openssl, I am getting error.

Extract google’s server and intermediate certificates:

$ echo | openssl s_client -showcerts -connect www.google.com:443 | sed -ne ‘/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p’ > /tmp/server_certs.crt

Extract google’s root CA from jdk:

$ pwd

/cygdrive/c/Program Files/Java/jdk1.8.0_231/jre/lib/security

$ keytool -export -keystore cacerts -storepass changeit -alias ‘globalsignr2ca [jdk]’ -file /cygwin64/tmp/google_root.der

$ openssl x509 -in /tmp/google_root.der -out /tmp/google_root.pem -inform der

Also extracted google’s root certificate from chrome browser to /tmp/google-chrome-root.pem. Doing a diff between chrome’s root certificate and jdk extracted root certificate, there is no difference

$ diff /tmp/google_root.pem /tmp/google-chrome-root.pem

$ Based on this, I know, I am using the right root certificate.

Invoke openssl verify

$ openssl verify -CAfile /tmp/google_root.pem /tmp/server_certs.crt

C = US, ST = California, L = Mountain View, O = Google LLC, CN = www.google.com

error 20 at 0 depth lookup: unable to get local issuer certificate error /tmp/server_certs.crt: verification failed

I know verification through

$ openssl s_client -showcerts -servername www.google.com -connect www.google.com:443

is successful

CONNECTED(00000005) depth=2 OU = GlobalSign Root CA - R2, O = GlobalSign, CN = GlobalSign verify return:1 depth=1 C = US, O = Google Trust Services, CN = GTS CA 1O1 verify return:1 depth=0 C = US, ST = California, L = Mountain View, O = Google LLC, CN = www.google.com verify return:1 

and was expecting a similar successful result through the openssl verify command as well.

I am doing this exercise in windows 10 and cygwin.

How in command “Reformat Code” of PhpStorm use only spaces?

Hello,
In my vue page PhpStorm 2019.2.3 with eslint used
Running command "Reformat Code" I got error in my app:

./src/views/About.vue Module Error (from ./node_modules/eslint-loader/index.js): error: Mixed spaces and tabs (no-mixed-spaces-and-tabs) at src/views/About.vue:177:2: 
Code (markup):

Looks like this command use tab symbol for ident spaces and I did not find to to make that command "Reformat Code"
will use only spaces?
I found these
https://imgur.com/
options

But I do not any option…

How in command "Reformat Code" of PhpStorm use only spaces?

How to apply command to all elements of a list?

So I generated a list of cities and I want to apply FindGeoLocation to all of them without having to seperate the elements and then applying.

y= CityData[{Large, Last[x]}]  

(x here is dynamically updated from

x = RandomChoice[CountryData[]]]  TextString@y 

Gives me a list of the Cities.

But now I want to take the list and have FindGeoLocation evaluate it at all the given cities in the list.

As far as I know, Map does that with functions. I don’t know what to do next.

Using Lean Theorem Prover from command line [closed]

I have read this link about using Lean: https://leanprover.github.io/reference/using_lean.html and am able to use Lean with VSCode, but I still have questions about using Lean from the command line.
1. When I download the lean binaries, there is a lean and leanchecker binary. What does each one do, and is there any documentation on using them?
2. What is LEAN_PATH? I wrote a Lean file that uses the Lean library list type. I want this to to be checked from the command-line, that is when I write a #check command in the file, on VSCode the #check is underlined in blue letting me know that it checks; I want to do the equivalent from the command-line. But when I run the Lean binary on my file, it says ‘error: file ‘data/list’ not found in the LEAN_PATH’. Now, I have the entire Lean repository (https://github.com/leanprover/lean) in my system and it also contains the built binaries – this is what it took to get Lean to work on VSCode (that and telling VSCode where the head of the repository is). Also, the head of this repository is in my PATH but what does it mean for data/list to be in my LEAN_PATH?

I’m not able to find documentation for these specifics, most of them talk about using Lean from VSCode or Emacs. If I missed it, please point me to the right resource. Thanks!

Finding original command result from MD5 hash

Basically I hashed the result of the “date” command with md5sum:

$ date | md5sum

The output is indeed in the likes of:

e4c94362cd4fd71ec6aca78c7411bdc3 -

My question was: is it possible to recover the result of the date command knowing the date pattern (except for maybe the minutes and seconds)?

I tried using john’s mask option as well as a custom wordlist, without result.

Do you guys have any idea how we could pull that off?

is there something like a “foreach” mode from the command line? Like in perl?

With perl we can run perl -p . That wraps a foreach loop around the code and executes the code on the file. What I’m looking for is something like

StringReplace[filename,”\t”->”,”]

and then I get a new file in which the string replace happened (the above would convert a .tsv to a .csv). Doesn’t have to be StringReplace, can be anything that takes a line of stuff as input. Total[filename] would total all numbers in the rows of the file.

That is like “scripting” the M command line-by-line (during MS-DOS we used to call that “batch mode” — really means line-by-line).

Command and control versus intelligent assistants for senior citizens

I have a zero-configuration call screening program that targets/protects senior citizens from robocallers and other miscreants and scams. The program runs on low-end dev-boards and interfaces with telco landlines using an USB modem. I want to provide a way to modify a running configuration, but I don’t want to require a desktop computer or smartphone.

Reading indicates voice commands can help senior citizens. See, for example, Voice Recognition Innovation and the Implications for Seniors and Usability of Voice User Interfaces for Senior Citizens.

Given a voice interface is helpful, that leaves the “how” for seniors. I feel like “command and control” is a better interface for this particular application, but folks who build voice engines say “intelligent assistants” is a better interface in general. From CMU Pocket Sphinx project:

For command and control, it was popular to use a finite state grammar for a long time. However, we do not recommend this approach nowadays. It’s way better to employ a medium vocabulary recognizer with a semantic analysis framework on top to improve the users’ experience and let them use more or less natural language. In short, don’t build command and control, build intelligent assistants instead.

For intelligent assistants you do not only need the recognition, but also intent parsing and database knowledge. For more details on how to implement this you can check Lucida powered by OpenEphyra. Dialog systems will require a framework for user feedback as well.

When I started researching and designing the voice interface, the use cases I envisioned include the following. The use cases are driven by the low resource constraints, and fall into “command and control” interface.

  • “Callman, block call”
  • “Callman, block caller”
  • “Callman, allow call”
  • “Callman, allow caller”

(I also have a whimsical grammar. “Callman, yuk yuk” means the caller is bad and should be moved to a blacklist. “Callman, yum yum” means the caller is good and should be moved to a whitelist).

I think I need to better understand the intersection of “command and control” with seniors. I need to know if the voice command implementation is going to confuse them (more than normal?). My questions are:

  • are there empirical results that indicate “intelligent assistants” are [far?] superior to “command and control” when used with seniors?
  • are there empirical results that indicate “command and control” is ineffective with seniors?

Command action for strike summons/minion

Wonder if someone could help. I have created a pathfinder 2e Druid character with an animal companion (Bear) and a Summon Fey spell (Sprite). Can the bear only attack my enemy when commanded (Your animal companion has the minion trait, and it gains 2 actions during your turn if you use the Command an Animal action to command it p214) while the summoned Sprite does not require the command (generally attacks your enemies to the best of its abilities p637)

Thanks