Problem

Useful Commands

Mongo

db.users.find( { name: "Joe" } );

db.db_to_api.find().pretty();

mongodump --authenticationDatabase "admin" --port 25080 -d apinizerdb -u apinizer -p PASSWORD

sudo tail -999f /var/log/mongodb/mongod.log



db.api_proxy.update( {},
    { 
        "$pull": { 
            "apiProxyDeployList": { 
                "environmentSettingsId": "60e2ad54d5ba7a7636db3aa6" 
            }
        } 
    },
    { "multi": true }
);


db.api_proxy.update( {_id : ObjectId("611628a3c21a5c04977e98e2")},
    { 
        "$pull": { 
            "apiProxyDeployList": { 
                "environmentSettingsId": "60e2ad54d5ba7a7636db3aa6" 
            }
        } 
    },
    { "multi": true }
);


Linux

//Changing the system clock after the control with date command and seeing it is in wrong zone:

sudo ln -sf /usr/share/zoneinfo/Europe/Istanbul /etc/localtime

//If it is in correct zone but still wrong:

date -s '2014-12-25 12:34:56'

//In case of "ubuntu no-key" error:

//W: GPG error: https://download.docker.com/linux/ubuntu focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7EA0A9C3F273FCD8

//Convert user to use bash shell instead of dash shell

chsh -s /bin/bash $(whoami)
Kubernetes

journalctl -xeu kubelet

kubectl get events --all-namespaces --sort-by='.metadata.creationTimestamp'

kubectl describe pod -n PODNAMESPACE PODNAME

kubectl exec -it podName -n prod -- curl x.y.gov.tr

Elasticsearchcurl -XPUT '10.1.1.1:9200/*log*/_settings' -H 'Content-Type: application/json' -d'{"index": {"blocks": {"read_only_allow_delete": null}}}'
curl

curl -D -  --header "Content-Type:text/xml;charset=UTF-8" --header "SOAPAction:XXX" -d '#SOAP BODY GOES HERE#' https://api.address/apigateway/relativepath >> response.txt

//Disable Ssl check: -k

//Sending request with verbose logging: -v

//timeout: -m 10

//Sending username and have it ask for password: -u abc

//Saving the response as file: --output response.txt