Skip to content

Instantly share code, notes, and snippets.

View denzhel's full-sized avatar
🇺🇦

Dennis Zheleznyak denzhel

🇺🇦
View GitHub Profile
@denzhel
denzhel / kubernetes_pods_nodes_location.md
Created January 24, 2021 09:05
Where my pods are running

If you want to know on which nodes your pods are running, use this alias:

konode='k get pod -o=custom-columns=NAME:.metadata.name,STATUS:.status.phase,NODE:.spec.nodeName'
@denzhel
denzhel / mongo_shell_collections.md
Last active January 26, 2021 18:50
Show collections for the specific database

To show all collections for the specific database:

mongo <dbName> --quiet --eval "db.getCollectionNames().join('\n')”
@denzhel
denzhel / es_disk_usage.md
Created January 22, 2021 22:32
elasticsearch node disk usage

To get information about disk usage on every elasticsearch node:

curl -XGET "http://localhost:9200/_cat/allocation?v&pretty"
@denzhel
denzhel / elastic_blocked_index.md
Last active January 22, 2021 23:07 — forked from hkulekci/solve.md
Elasticsearch "blocked by: [FORBIDDEN/12/index read-only / allow delete (api)" error

If you are getting the following error while indexing:

{
  "error": {
    "root_cause": [
      {
        "type": "cluster_block_exception",
        "reason": "blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"
      }
@denzhel
denzhel / ssh_key_aws.md
Created January 22, 2021 02:26
Upload SSH public key to AWS SecretManager

To create a ssh key:

ssh-keygen -f ~/.ssh/keyName_rsa -t rsa -b 4096

Then, upload it to AWS Secret Manager to be used as Terraform key_name when creating instances for example:

aws secretsmanager create-secret --name "Path/To/KeyName" --description "Added Manually" --secret-string "$(cat ~/.ssh/keyName_rsa.pub)"
@denzhel
denzhel / extend_lvm.md
Last active January 21, 2021 21:31
Linux: extend LV after increase the disk size

To extend a logical volume after increasing the disk size, lets say AWS EBS:

sudo pvresize /dev/sdb
sudo lvextend -l +100%FREE /dev/vgName/lvName
sudo resize2fs /dev/vgName/lvName