Skip to content

Instantly share code, notes, and snippets.

briankip / Pluralizer.php
Last active July 4, 2017 13:26
from Illuminate\Support
use Doctrine\Common\Inflector\Inflector;
class Pluralizer
* Uncountable word forms.
* @var array
;************************** BLIS INTERFACE CLIENT CONFIGURATION FILE **********************************************
;This is the main configuration file for C4G BLIS Interface Client.
;BLIS Interface Client is a very lightweight client for Interfacing BLIS with external systems using Protocols like
;RS232 Serial Port,TCP/IP, HTTP
; C4G BLIS Equipment Interface Client
; Project funded by PEPFAR
briankip /
Last active May 8, 2024 13:51
A short introduction to binwalk


Binwalk is a simple linux tool for analysing binary files for embeded files and executable code. It is mostly used to extract the content of firmware images.


On kali linux, binwalk is already installed. On ubuntu you can do apt-get install binwalk or you can go to and follow the instructions.


int main()
char *str = "blablabla";
char c = 'H';
size_t len = strlen(str);
char *str2 = malloc(len + 1 + 1 ); /* one for extra char, one for trailing zero */
strcpy(str2, str);
str2[len] = c;
str2[len + 1] = '\0';
briankip / myftpc.c
Last active October 7, 2015 04:51
#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>
#define QUEUE 1 //Queue for incoming connections
#define BUFFLENGTH 512 //Send buffer length
briankip /
Created May 7, 2015 08:51
python script for reading from windows serial
#/usr/bin/env python
import serial
bytesize=serial.EIGHTBITS; #EIGHT BITS
parity=serial.PARITY_NONE; # ODD
stopbits=serial.STOPBITS_ONE; # 2 STOP BITS
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 / 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 /
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
import serial
import datetime