Skip to content

Instantly share code, notes, and snippets.

View dwweb0309's full-sized avatar

dwweb0309

View GitHub Profile
@dwweb0309
dwweb0309 / kibana.error.md
Created January 10, 2024 10:10
How to resolve kibana error(kibana server is not ready yet)
http://localhost:9200/_cat/indices/.kibana*?v=true&s=index

And delete kibana related indexes one by one

curl -XDELETE http://localhost:9200/.kibana_8.7.1_001

And resart kibana server

@dwweb0309
dwweb0309 / linux-commands.md
Last active December 29, 2023 19:25
Linux
  • See latest lines from systemd service log
    journalctl -u <service_name> [-e] [-f]
    

-f specifies that you'd like to follow the log as it changes

Question 1

Javascript function indexOf returns -1 if there is no match in the string, not a falsy value. The following code can resolve the issue.

function validateString(str) {
  if (str.toLowerCase().indexOf('superman') === -1) {
    throw new Error('String does not contain superman');
  }    
}