Skip to content

Instantly share code, notes, and snippets.

View kitsao's full-sized avatar

Kitsao Emmanuel kitsao

  • Nairobi, Kenya
View GitHub Profile
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@kitsao
kitsao / sources.list
Created September 29, 2021 05:46 — forked from ishad0w/sources.list
Ubuntu 20.04 LTS (Focal Fossa) -- Full sources.list
deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
// CHT to EMR
// patient registration
{
"_id": "contact-abc-123",
"type": "contact",
"name": "Another Patient",
"sex": "female",
"date_of_birth": "1974-09-22",
"knows_dob": "",
"art_start_date": "2010-06-27",
@kitsao
kitsao / gist:4f0b8470ea6c4e907c5926250c83962f
Created May 26, 2020 21:25 — forked from mrtns/gist:78d15e3263b2f6a231fe
Upgrade Chrome from Command Line on Ubuntu
# Install
# via http://askubuntu.com/questions/510056/how-to-install-google-chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
# Update
@kitsao
kitsao / specimen_table_update.sql
Last active August 29, 2015 14:14
Update existing specimen records for accepted_by/rejected_by to have user_id!=0 to avoid breaking patient report
update specimens set accepted_by=10 where accepted_by=0 and rejection_reason_id is null;
update specimens set rejected_by=10 where rejected_by=0 and rejection_reason_id is not null;
-- ID 160 is not available, set it to 8 - wasike
update specimens set accepted_by=8 where accepted_by=160 and rejection_reason_id is null;
update specimens set rejected_by=8 where rejected_by=160 and rejection_reason_id is not null;
@kitsao
kitsao / celtac.sh
Created January 28, 2015 15:06
celtac daemon
#!/bin/bash
stty -F /dev/ttyS0 19200 parenb
cat /dev/ttyS0 >| /var/www/celtac/celtac-results.txt
-- RUN THESE ONLY ONCE
-- INDEXING TEST TABLE
-- Helps improve performance
alter table blis_301.test add index (external_lab_no);
-- PRELIMINARY MIGRATION BEFORE MIGRATING REJECTION REASONS AND SPECIMEN
-- Create measure_range table - same structure as measure_ranges table
CREATE TABLE IF NOT EXISTS `measure_range` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`measure_id` int(10) unsigned NOT NULL,
`age_min` int(10) unsigned DEFAULT NULL,
`age_max` int(10) unsigned DEFAULT NULL,
`gender` tinyint(3) unsigned DEFAULT NULL,
`range_lower` decimal(7,3) DEFAULT NULL,
`range_upper` decimal(7,3) DEFAULT NULL,
`alphanumeric` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,