Skip to content

Instantly share code, notes, and snippets.

View HinchK's full-sized avatar

.: HinchK :. HinchK

View GitHub Profile
@HinchK
HinchK / heardyoulikehashes
Created April 13, 2014 02:05
F.U.E. by BlackHatDBL (www.netforme.net)
// f(ucking) u(ncrackable) e(ncryption) function by BlackHatDBL (www.netforme.net)
function fue($hash,$times) {
// Execute the encryption(s) as many times as the user wants
for($i=$times;$i>0;$i--) {
// Encode with base64...
$hash=base64_encode($hash);
// and md5...
$hash=md5($hash);
// sha1...
$hash=sha1($hash);
<?
define("WEBDOMAIN", "your host");
define("DEFDBNAME", "your db name");
define("DEFUSERNAME", "your user");
define("DEFDBPWD", "your pwd");
if(!$conn = connectDb()) {die("err db");} else {$conn->query("SET NAMES 'utf8';");}
function connectDb() {
#!/opt/local/bin/php
<?php
/*
1) replace the shebang (first line) with the path to your php binary
(probably something like /usr/bin/php)
2) move the file to /usr/local/bin/datauri.php
(this should be in your PATH)
3) chmod ugo+rx /usr/local/bin/datauri.php
(make the script executable for everyone)
@HinchK
HinchK / seo_dashify
Created April 13, 2014 02:36
seo loves the dash
function seo_dashify($title) {
return preg_replace('/[^a-z0-9_-]/i', '', strtolower(str_replace(' ', '-', trim($title))));
}
/*
* DOMParser HTML extension
* 2012-09-04
*
* By Eli Grey, http://eligrey.com
* Public domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
/*! @source https://gist.github.com/1129031 */
@HinchK
HinchK / .bashrc
Last active January 20, 2017 00:27
a solid sysadmin/sudoer's bashrc script
# .bashrc
# https://gisthub.com/10978137/blob/master\.bashrc
# If not running interactively, don't do anything
[[ "$-" != *i* ]] && return
#enable tab completion while as root
complete -cf sudo
#prevent overwriting files with pipe or cat
@HinchK
HinchK / .bash_profile.sh
Last active August 29, 2015 14:00 — forked from Maxwell2022/.bash_profile.sh
continuation of my sysadmin bash scripts; credit to Maxwell2022 for additions https://gist.github.com/Maxwell2022/5596032
# extending .bashrc (per interactive prompt control)
# Note: .bashrc is only read by a shell that's both interactive and non-login
[[ -r ~/.bashrc ]] && . ~/.bashrc
#prevent overwriting files with pipe or cat
set -o noclobber
#stops ctrl+d from logging me out
set -o ignoreeof
<?php
function getS3Settings($filename)
{
$AWSbucket = 'YOUR_BUCKET_NAME';
$AWSkey = 'YOUR_ACCESS_KEY';
$AWSsecret = 'YOUR_SECRET_KEY';
$acl = 'public-read'; // private
// Get the file extension
@HinchK
HinchK / 0_reuse_code.js
Created April 22, 2014 10:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
namespace S3;
use Aws\S3\S3Client;
use \Aws\Common\Exception\TransferException;
/**
* Description of S3Client
* @author Rana
* @link http://codesamplez.com/programming/amazon-s3-get-multiple-objects-php