This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import csv | |
def generate_sorted_json(file): | |
command = ('jq "[.users[] | {user: .user, count: .count}] | sort_by(.count)" ' | |
+ file + '.json > ' | |
+ file + '.sorted.json' | |
) | |
subprocess.run(command, shell=True, executable="/bin/bash", stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import walk | |
import os | |
import subprocess | |
from datetime import date | |
from dateutil.relativedelta import relativedelta | |
def get_files(path): | |
f = [] | |
for (dirpath, dirnames, filenames) in walk(mypath): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Copyright (c) 2025 github.com/mrjones-plip | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/home/mrjones/.nvm/versions/node/v22.11.0/bin/node /home/mrjones/Documents/MedicMobile/app-services-team/fetch-users/index.js | |
Fetching CHAs for snyamira | |
Fetching CHAs for samburu | |
Fetching CHAs for baringo | |
Fetching CHAs for bomet | |
Fetching CHAs for bungoma | |
Fetching CHAs for busia | |
Fetching CHAs for elgeyomarakwet | |
Fetching CHAs for embu | |
Fetching CHAs for homabay |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
server="192-168-68-26.local-ip.medicmobile.org:10443" | |
database="medic" | |
login="medic" | |
password="password" | |
sleep=59 | |
createRecord(){ | |
json='{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// Channel ID is on the the browser URL.: https://mycompany.slack.com/messages/MYCHANNELID/ | |
// Pass it as a parameter: node ./delete-slack-messages.js CHANNEL_ID | |
// CONFIGURATION ####################################################################################################### | |
const token = 'SLACK TOKEN'; | |
// Legacy tokens are no more supported. | |
// Please create an app or use an existing Slack App |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -u | |
echo "erasing results.txt" | |
cat /dev/null > results.txt | |
if [ ! -f cache/responses.3.log ]; then | |
echo "caching 3.x responses" | |
grep medicmobile.org CHT3/*log|cut -f7,8,9 -d " " |grep -v "^\-1"|cut -f3 -d " " \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.idea |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# a quick way to install a CHT instance. Uses starndard docker based couchdb | |
# see bare-metal guide here: https://gist.github.com/mrjones-plip/7760b6a1a7e9cface3714a16fe60eb93 | |
# | |
# assumes running as not root user, but with user with sudo | |
# update system, choose default and "ok" for any prompts | |
sudo apt update | |
sudo apt -y dist-upgrade | |
# install NVM, add to path, install node 12 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# a quick way to install a CHT instance. Uses bare metal couchdb | |
# see docker based install here: https://gist.github.com/mrjones-plip/7bbe7b0a44ce7876a551b9730c6fc43d | |
# | |
sudo apt update | |
sudo apt dist-upgrade | |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion |
NewerOlder