Skip to content

Instantly share code, notes, and snippets.

@briankip
briankip / celtac.sh
Last active August 29, 2015 14:14 — forked from kitsao/celtac.sh
#!/bin/bash
stty -F /dev/ttyS0 19200 parenb
cat /dev/ttyS0 >| /var/www/celtac/celtac-results.txt
@briankip
briankip / tests-list.txt
Created February 9, 2015 09:21
Relevant tests
BS for mps
GXM
Direct COOMBS test
Full Haemogram
Creatinine
Electrolytes
Urea
HB
RFTS
Pregnancy test
@briankip
briankip / deleteMeasures.sql
Last active August 29, 2015 14:15
Measures that are tests
delete from iblis.testtype_measures where test_type_id = 192;
delete from iblis.testtype_specimentypes where test_type_id = 192;
delete from iblis.test_types where id = 192;
delete from iblis.testtype_measures where test_type_id = 181;
delete from iblis.testtype_specimentypes where test_type_id = 181;
delete from iblis.test_types where id = 181;
delete from iblis.testtype_measures where test_type_id = 184;
delete from iblis.testtype_specimentypes where test_type_id = 184;
delete from iblis.test_types where id = 184;
delete from iblis.testtype_measures where test_type_id = 185;
# -*- coding: utf-8 -*-
"""
This script will delete all of the tweets in the specified account.
You may need to hit the "more" button on the bottom of your twitter profile
page every now and then as the script runs, this is due to a bug in twitter.
You will need to get a consumer key and consumer secret token to use this
script, you can do so by registering a twitter application at https://dev.twitter.com/apps
@requirements: Python 2.5+, Tweepy (http://pypi.python.org/pypi/tweepy/1.7.1)
@briankip
briankip / interfacer.py
Last active December 26, 2023 06:10
Python program for continually reading data from serial port and dumping it to file
#/usr/bin/env python
#Supposed mapping of sysmex KX-21 results output http://www.medelexis.ch/plugins_doc/2.1.7/Sysmex_Laborger%C3%A4teanbindung/KX-21N%20Interface.pdf
import serial
import datetime
#variables
port='/dev/ttyS0';
baudrate='9600';
@briankip
briankip / wvdial.conf
Created April 1, 2015 08:08
Configuration for wvdial to work with safaricom modem
[Dialer Defaults]
Phone = *99#
Username = saf
Password = data
Stupid Mode = 1
Dial Command = ATDT
Modem = /dev/ttyUSB0
Baud = 3600000
Init2 = ATZ
Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
@briankip
briankip / SudokuSolve.cpp
Created May 4, 2015 12:53
PM Lee's C++ Sudoku Solver Souce Code.
#include "stdio.h"
int InBlock[81], InRow[81], InCol[81];
const int BLANK = 0;
const int ONES = 0x3fe; // Binary 1111111110
int Entry[81]; // Records entries 1-9 in the grid, as the corresponding bit set to 1
int Block[9], Row[9], Col[9]; // Each int is a 9-bit array
@briankip
briankip / py.py
Created May 7, 2015 08:51
python script for reading from windows serial
#/usr/bin/env python
import serial
#variables
port='COM2';
baudrate='9600';
bytesize=serial.EIGHTBITS; #EIGHT BITS
parity=serial.PARITY_NONE; # ODD
stopbits=serial.STOPBITS_ONE; # 2 STOP BITS
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<sys/socket.h>
#include<arpa/inet.h>
#include<unistd.h>
#define QUEUE 1 //Queue for incoming connections
#define BUFFLENGTH 512 //Send buffer length
@briankip
briankip / myftpc.c
Last active October 7, 2015 04:51
client
#include <stdio.h>
#include <stdlib.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <string.h>
#include <netdb.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>