Skip to content

Instantly share code, notes, and snippets.

View tbenjis's full-sized avatar
🎯
Focusing

Tunde Olabenjo tbenjis

🎯
Focusing
View GitHub Profile
<?php
date_default_timezone_set('Europe/London'); // Set this to your local timezone - http://www.php.net/manual/en/timezones.php
/**
* The root directory where the repos live.
*
* @var string
*/
$root_dir = '/your/root/dir/';
@tbenjis
tbenjis / phonebook.c
Last active February 17, 2022 19:44
A phonebook application in C programming language using SQLite in Linux
/**
* Phone book application
* Usage: ./phonebook -f <database_file> or ./phonebook
*
*
*/
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
@tbenjis
tbenjis / search_tool.c
Last active January 2, 2018 20:01
Searching, replacing, highlighting search results, writing search / replace results to file. Compatible with *nix systems
/**
* Search and replace word application
* Usage: ./search_tool -f <input_filename> -s <search word> -r <replace word> -o <output_file> -h
*
* @Author: Tunde
*/
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
@tbenjis
tbenjis / CaesarCipher.java
Last active January 2, 2018 20:01
Simple Caesar Cipher in java, encrypts space too
/**
* @tbenjis
* Caesar cipher cryptography
* Author: tunde
*
* */
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
@tbenjis
tbenjis / KeywordCipher.java
Last active January 2, 2018 20:02
This uses keyword substitution cryptography. Encodes and decodes a text string
/**
* @tbenjis
* Keyword substitution cryptography
* Author: tunde
*
* */
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
@tbenjis
tbenjis / StatisticalAnalysis.java
Last active January 2, 2018 20:02
Cryptographic statistical analysis for shift cipher encryption in java
/**
* @tbenjis
* Cryptigraphic Statistical analysis
* Author: tunde
*
* */
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
@tbenjis
tbenjis / Queuing.java
Last active January 2, 2018 20:02
Simple graph for queuing in java
/**
** Simple Queuing, blocking probability with graph
** Author: Tunde
**/
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FontMetrics;
import java.awt.Graphics;
@tbenjis
tbenjis / rsa.py
Last active September 30, 2021 02:52
A simple RSA encryption in python using Miller-Rabin primality test. Outputs results in text files
# Compute RSA encryption in python
# Author: Tunde
import random
import math
import argparse
import re
KEY_INT = 100 # we define the near max value to get its random number for key
def main():
RewriteEngine On
# If the user is asking for the fullsite, set a cookie, remove the query, and stop.
RewriteCond %{QUERY_STRING} ^fullsite$
RewriteRule ^/?(.*)$ http://domain.com/$1? [L,CO=fullsite:yes:.domain.com]
# If the user is asking for the mobilesite, set a cookie, remove the query, redirect and stop.
RewriteCond %{QUERY_STRING} ^mobilesite$
RewriteRule ^/?(.*)$ http://m.domain.com/$1? [L,CO=fullsite:no:.domain.com]