Useful Commands
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( {}, db.api_proxy.update( {_id : ObjectId("611628a3c21a5c04977e98e2")}, |
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
//Check which processes killed by OOM Killer:
|
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 |
Elasticsearch | curl -XPUT '10.1.1.1:9200/*log*/_settings' -H 'Content-Type: application/json' -d'{"index": {"blocks": {"read_only_allow_delete": null}}}' // General information about snapshots curl 'http://IP:9200/_snapshot?pretty' // Repository and snapshot details curl 'http://IP.23:9200/_slm/policy/apinizer-slm-policy-slai?pretty' // Detailed examination with repository and snapshot names obtained from the previous command curl -XGET "http://IP:9200/_snapshot/apinizer-repository-slai/apinizer-snapshot-slai-2023.03.13-m33h8zcpq_if4swyzn0wrq?pretty" // Deletion of all settings related to the snapshot curl -XDELETE 'http://IP:9200/_snapshot/apinizer-repository-slai?pretty' |
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 #Getting ssl certificate from a Linux server
|