Skip to content

Instantly share code, notes, and snippets.

View zQueal's full-sized avatar
🦍

Zach zQueal

🦍
View GitHub Profile
@zQueal
zQueal / blog.md
Last active January 31, 2020 23:19
Necessary Implementation of Adjustable Work Factor Ciphers in Modern Cryptographic Algorithms as it Relates to HeartBleed and OpenSSL

Abstract

In the 24 years since the creation of the world wide web there have been many severe security failures that have resulted in the exposure of sensitive data to the general public or malicious third parties. Most notably is the recent HeartBleed bug for OpenSSL v1.0.1 -- 1.0.2--beta in which a would-be attacker is able to exploit the implementation of the TLS heartbeat extension, which was originally meant to be used for keep-alive messages between client and server, to retrieve sensitive data stored in memory up to and including the server's private key. Already, HeartBleed is being regarded as the single most significant security bug in the history of the Internet; mainly because it was undetected by the community at large for such an extended period of time. The emerging details of HeartBleed revealed that the community of developers who on or with projects which depend on OpenSSL are beginning to rethink their position when it comes to traditional security.

Discovery

The official position fro

@zQueal
zQueal / trash.sh
Last active August 29, 2015 14:06
A simple trash system for UNIX.
TRASH_DIR=~/.Trash # Set the Trash directory
mkdir -p "$TRASH_DIR" # Create it if it's not already created
trash() {
# list trash dir if no arguments given
if [[ -z $1 ]]; then
if _bash_trash_is_empty; then # call _bash_trash_is_empty function, then
echo "$TRASH_DIR: trash is empty" # return that the trash is empty
else
du -csh "$TRASH_DIR"/* # else list the contents of the trash directory
@zQueal
zQueal / default
Created September 25, 2014 04:14
server {
listen 80 default_server;
root /usr/share/nginx/html;
index index.php index.html index.htm;
server_name web.dev; # FQDN
location / {
try_files $uri $uri/ =404;
}
@zQueal
zQueal / README.md
Last active August 31, 2015 05:54
How to Setup WordPress in Ubuntu 14.04 Using a Remote MySQL Server

About

For this instructional tutorial we'll be exploring the installation and setup of both WordPress v4.0 and the required MySQL database used to support it. However, sometimes we find ourselves in interesting situations which either necessitate or involve remote instances of a MySQL server or database. Quite simply, most of the time remote databases or servers are used for security purposes--specifically security through obscurity and not having all of your eggs in a single basket.

Important: Please ensure that you are correctly modifying usernames, passwords, hostnames and IP addresses to suit your needs. If you do not, this setup will not work correctly for you.

The Setup—LEMP

LEMP (Linux, Nginx, MySQL, PHP) is one of the most stable and widely used production/development environments available to developers. Anything Apache can do, Nginx can do much faster. This includes PHP proc

@zQueal
zQueal / clip.md
Created August 3, 2014 07:12
Handy script to help make xclip really simple.
#!/bin/bash
if [[ -t 0  && -z "$1" ]]; then 
    # output contents of clipboard
    xclip -out -selection clipboard || exit 1
elif [[ -n "$1" ]]; then
    # copy file contents to clipboard
    xclip -in -selection clipboard < "$1" || exit 1
else
    # copy stdin to clipboard

xclip -in -selection clipboard <&0 || exit 1

@zQueal
zQueal / dns.php
Created July 25, 2014 23:49
Return DNS records for a domain.
#!/usr/bin/env php
<?php
class DNS {
public function __construct() {
$q = $_SERVER['argv'];
if(isset($q[1])) {
$lookup = dns_get_record($q[1], DNS_ALL - DNS_PTR);
echo json_encode($lookup);
} else {
@zQueal
zQueal / juicecalc.pl
Created June 26, 2014 00:23
Calculate eJuice recipes from CLI. Made By: http://www.reddit.com/user/j_hornsties
#!/usr/bin/perl -w
# Caclulate Volumes for ejuice
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

Keybase proof

I hereby claim:

  • I am xanza on github.
  • I am zqueal (https://keybase.io/zqueal) on keybase.
  • I have a public key whose fingerprint is 7B5A C030 0E2C 74FD 355C CC81 B1DA 56DC B73E 8516

To claim this, I am signing this object:

@zQueal
zQueal / .htrouter
Created May 12, 2014 22:41
bcrypt() proof of concept
<?php
if(!file_exists(__DIR__ . '/' . $_SERVER['REQUEST_URI'])){
$_GET['_url'] = $_SERVER['REQUEST_URI'];
}
return false;
@zQueal
zQueal / btc.php
Created February 5, 2014 03:24
Uses cURL to pull the current price of BTC in USD.
#!/usr/bin/env php
<?php
$c = curl_init();
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_HTTPHEADER, array('Accept: application/json', 'Content-Type: application/json'));
curl_setopt($c, CURLOPT_URL, 'http://data.mtgox.com/api/2/BTCUSD/money/ticker');
$data = curl_exec($c);
curl_close($c);