Json – Posting part of a file on Slack with curl
I want to send the contents of a file after a given line number to Slack using curl. I'd like it to be formated as code after some message. ChatGPT is failing to help here. The code I'm using is:…
I want to send the contents of a file after a given line number to Slack using curl. I'd like it to be formated as code after some message. ChatGPT is failing to help here. The code I'm using is:…
I have a json file list_values.json with array of json with an "origine" field : [ { "origine": "reason1", "identifiant": "1234_AAA" }, { "origine": "reason3", "identifiant": "5678_BBB" } ] I have mapping.json file with a list of predefined fields :…
I have a text file with contents: //input.txt 1) What is the first month of the year? a) March b) February c) January d) December Answer: c) January 2) What is the last month of the year? a) July b)…
I am trying to run a for loop but trying to exclude files with a specific pattern in the filename. This is the command I am using: for file in /home/ubuntu/discovery/download/*![.en].mp4; do I would like this filename to be included:…
I am trying to scrape a file with content similar to this this: "addressString":"12366 NY","eId":"64174f8e42b7fdfb837f68b","hasImage":false,"Price":5800,"Name":Bernard Bernoulli,"headline":"nice Fiat 500, red, slight damage to left mirror" "addressString":"451 Citadel","eId":"sd3448e42b7368b","year":1976,"hasImage":true,"Price":12220,"Name":Edward Diego,"headline":"Mercedes SLX, no issues" "addressString":"1321 Bejing","eId":"3102ffdb837fssdff3","Price":350,"Name":Jet Li,"headline":"Dodge Viper, no engine, no tires, no windshield;…
I use Arch Linux with VsCode to write Java and Python programs and have no issues. When I installed some Bash extensions and started writing bash scripts, it outputs "TERM environment variable not set." It will not let me read…
I try to use 'mongoexport' to retrieve the 'Url' value: $ mongoexport -d "db" -c "collection" -q '{"Id":"5400490185"} | jq . return: { "_id": { "$oid": "641e8845c0a3fde195b5901b" }, "Url": "https://example.org", "Id": "5400490185", "Title": "xxx", "Description": "foobar", "Date_Time": "1679697365" } Now…
I use a shell script to query MongoDB: #!/bin/bash mongoexport -d db -c collection -f Id I have: { _id: ObjectId("641e883ec0a3fde195b59019"), Id: '12027311490' }, { _id: ObjectId("641e8845c0a3fde195b5901b"), Id: '15400490185' }, { _id: ObjectId("641e884dc0a3fde195b5901d"), Id: '775662862079' }, { _id: ObjectId("641e8852c0a3fde195b5901f"), Id:…
This command echo "mysql -u root nextcloud -Bse 'DELETE FROM oc_filecache WHERE path=""${FILE_PATH}"";'" will show that mysql -u root nextcloud -Bse 'DELETE FROM oc_filecache WHERE path="files_encryption/keys/files/xxx/xxxx/xxx L'AME/2xxxx/OC_DEFAULT_MODULE/master_x626.shareKey";' There is a single quote in the path. When i execute command, this…
Suppose I have the following PHP script being run on the PHP CLI in a shell script: <?php # foo.php $a = rand(1,5); if ($a == 1) { fwrite(STDOUT, 'normal condition'); } else { fwrite(STDERR, 'error condition'); } The script…