Skip to content

Instantly share code, notes, and snippets.

View harveytoro's full-sized avatar

Harvey harveytoro

View GitHub Profile
@harveytoro
harveytoro / decimal2baseConverter.c
Created November 8, 2012 22:35
Decimal to any base converter
#include <stdio.h>
int main(int argc, char *argv[]) {
int userInput = 2156; //number to convert
int base = 16; // change base here
int anws[10] = {}; //couldn't get dynamic array to work. Do not like this way.
int count = 0;
BigInteger kp;
kp = new BigInteger("17");
BigInteger np;
np = new BigInteger("3233");
BigInteger xp;
xp = new BigInteger("25");
BigInteger E;
E = xp.modPow(kp,np);
//BigInteger result = x.modPow(17, 3233);
#include <stdio.h>
int main(int argc, char *argv[]) {
int e = 1; // variable part of the Modular exponentiation algorithm.
int charInput = 97; // ASCII value of a
//Public keys
int n = 3233;
int k = 17;
@harveytoro
harveytoro / modpow.java
Created November 22, 2012 11:25
Modular Exponentiation Java method
public static int modpow(int value , int power, int mod){
int e = 1;
for (int i = 0; i < power; i++) {
e = ((e * value) % mod);
}
return e;
}//modpow
^([a-z0-9\.\-\+\_]+)@[a-z0-9\-\+\_]+\.[a-z0-9\-\+\_]*(\.?)[a-z0-9]+$
@harveytoro
harveytoro / Comment Templates
Last active December 20, 2015 02:09
Because we all love code comments
/*******************************************************************************
* Title Here *
* *
* Optional description space *
* *
* @author *
* @version *
* @date *
* @license *
*******************************************************************************/
@harveytoro
harveytoro / sendCV.php
Created October 20, 2013 15:19
Simple script that I am using with Twilio to send my CV to anyone that sends their email address to my Twilio number or so I can send it to someone quickly with a quick sms message. Requirements: PHPMailer (https://github.com/Synchro/PHPMailer)
<?php
require_once('mailer/class.phpmailer.php');
$myName = "YourName";
$email_pattern = "/^([a-z0-9\.\-\+\_\']+)@[a-z0-9\-\+\_]+\.[a-z0-9\-\+\_]*(\.?)[a-z0-9]+$/";
$email_address = trim($_POST['Body']);
$email = new PHPMailer();
$email->From = 'FromEmail';
$email->AddReplyTo('FromEmail', $myName);
$email->Mailer = 'mail';
@harveytoro
harveytoro / gist:7376939
Created November 8, 2013 20:13
Change root password
sudo passwd root

Keybase proof

I hereby claim:

  • I am harveytoro on github.
  • I am harveytoro (https://keybase.io/harveytoro) on keybase.
  • I have a public key ASCgWA6bsXr2TomAev5IlzBvLP08UfMDmThRzyM37zXIwgo

To claim this, I am signing this object:

# Basic Boxstarter
# Modified version of Jess Frazelle's https://gist.github.com/jessfraz/7c319b046daa101a4aaef937a20ff41f
# Install-BoxstarterPackage -PackageName <URL-TO-RAW-GIST> -DisableReboots
# Note Hyper-V stuff requires 10 pro
#---- TEMPORARY ---
Disable-UAC
#--- Windows Settings ---