Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@briankip
briankip / Pluralizer.php
Last active July 4, 2017 13:26
from Illuminate\Support
<?php
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
briankip / binwalk.md
Last active March 2, 2024 13:25
A short introduction to binwalk

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.

Installation

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

Usage

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
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>
#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 / 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
@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 / 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 / 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';