Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View LinuxPhreak's full-sized avatar
🎯
Focusing

Ben P. Dorsi-Todaro LinuxPhreak

🎯
Focusing
View GitHub Profile
//The below PHP hashes the password correctly
<?php
function cryptPass($input, $rounds = 9) {
$salt = "mysalt";
$saltChars = array_merge(range('A','Z'), range('a','z'), range(0,9));
for($i = 0; $i < 22; $i++) {
$salt .= $saltChars[array_rand($saltChars)];
}
return crypt($input, sprintf('$2y$%02d$', $rounds) . $salt);
}
if (isset($_GET['wingdings']))
{
include 'keywords1/metas.php';
}
elseif (isset($_GET['dingdongs']))
{
include 'keywords2/metas.php';
}
@LinuxPhreak
LinuxPhreak / gist:9401011
Created March 6, 2014 22:22
Possible Failed Attempt at SQL Injection On Word Press Blog
//The use of Curely Brackets {} and Bars || make raises concern as to some sort of malicious intentions to insert keywords into //my word press MySQL database.
{
{I have|I’ve} been {surfing|browsing} online more than {three|3|2|4} hours
today, yet I never found any interesting article like
yours. {It’s|It is} pretty worth enough for me.
{In my opinion|Personally|In my view}, if
all {webmasters|site owners|website owners|web owners} and bloggers made good content as you did,
the {internet|net|web} will be {much more|a lot more} useful
than ever before.|
I {couldn’t|could not} {resist|refrain from} commenting.
@LinuxPhreak
LinuxPhreak / modal.js
Created March 16, 2014 07:18
Modal Wont Close
$(document).ready(function() {
$('a.gv-pop').click(function() {
// Getting the variable's value from a link
var loginBox = $(this).attr('href');
//Fade in the Popup and add close button
$(loginBox).fadeIn(300);
//Set the center alignment padding + border
@LinuxPhreak
LinuxPhreak / gist:2b3f9ea10405d1671a0a
Created November 17, 2014 10:47
switches between php pages in a way I don't want
/* user.php may be user.php?foo=bar and I need the if ($actual_url == 'http://' . $website . '/user.php') to work in that case as well. */
<?php
include_once $main . 'includes/left.php';
$website = 'example.com';
$actual_url = 'http://' . $_SERVER[HTTP_HOST] . $_SERVER[REQUEST_URI];
if ($actual_url == 'http://' . $website . '/user.php')
{
include_once $main . 'includes/middle-user.php';
}
else if ($actual_url == 'http://' . $subdomain . '.' . $website . '/' || $actual_url = 'http://' . $website)
@LinuxPhreak
LinuxPhreak / gist:5280306
Created March 31, 2013 11:12
Get the following error. Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')'
$posts[] = array('type'=> $type, 'description'=> $desc, 'sfirstname'=> $sfn, 'slastname'=> $sln, 'sheight'=> $sheight, 'saddress'=> $saddress, 'saddress2'=> $saddress2', 'scity'=> $scity, 'sstate'=> $sstate, 'szip'=> $szip, 'sethnicity'=> $sethnicity, 'sclothing'=> $sclothing, 'vfirstname'=> $vfn, 'vlastname'=> $vln, 'vaddress'=> $vaddress, 'vaddress2'=> $vaddress2, 'vcity'=> $vcity, 'vstate'=> $vstate, 'vzip'=> $vzip, 'vethnicity'=> $vethnicity, 'vphone'=> $vphone, 'vdate'=> $vdate, 'vphoto'=> $vphoto);
@LinuxPhreak
LinuxPhreak / Signup Validator
Created June 30, 2013 11:36
Everything works until the end where I try to check to see if passwords validate. Any ideas?
<html>
<head>
<script type="text/javascript" charset="utf-8">
function validateForm()
{
/* This is to make sure the user entered their first name */
var firstname=document.forms["signuppage"]["fname"].value;
if (firstname==null || firstname=="")
{
@LinuxPhreak
LinuxPhreak / gist:6237657
Last active December 21, 2015 02:49
SMS Sender
require_once '../class.phpmailer.php';
$results_messages = array();
$mail = new PHPMailer(true);
$mail->CharSet = 'utf-8';
$mail->IsSMTP();
$mail->SMTPDebug = 0;
$mail->Host = "smtp.gmail.com";
$mail->Port = "587";
$mail->SMTPSecure = "ssl";
$mail->SMTPAuth = true;
<?php
$f = fopen('counter.txt', 'r+');
flock($f, LOCK_EX);
$total = (int) fread($f, max(1, filesize('counter.txt')));
if (isset($_POST['submit'])) {
rewind($f);
fwrite($f, ++$total);
}
fclose($f);
?>
@LinuxPhreak
LinuxPhreak / crypto-info.py
Created August 8, 2017 23:33
Trying To Create Arguments
#!/usr/bin/python
import argparse, urllib, json
__author__ = 'Ben P. Dorsi-Todaro'
print "What Currency Are You Using? "
currency = raw_input(" Type list for currencies ")
#I would like to make list an argument so when the user types crypto-info.py -l or --list a list shows up
if currency == "list":
print "List of all crypto currencies symbols. "
print "btc = Bitcoin"