Skip to content

Instantly share code, notes, and snippets.

View chucktrukk's full-sized avatar

Charlie Madison chucktrukk

View GitHub Profile
@chucktrukk
chucktrukk / pint.json
Created January 14, 2023 12:57 — forked from JustSteveKing/pint.json
Laravel Pint configuration
{
"preset": "psr12",
"rules": {
"align_multiline_comment": true,
"array_indentation": true,
"array_syntax": true,
"blank_line_after_namespace": true,
"blank_line_after_opening_tag": true,
"combine_consecutive_issets": true,
"combine_consecutive_unsets": true,
@chucktrukk
chucktrukk / root.sh
Created October 27, 2016 05:02 — forked from Arinerron/root.sh
"Root" via dirtyc0w privilege escalation exploit (automation script) / Android (32 bit)
#!/bin/bash
# Give the usual warning.
clear;
echo "[INFO] Automated Android root script started.\n\n[WARN] Exploit requires sdk module \"NDK\".\nFor more information, visit the installation guide @ https://goo.gl/E2nmLF\n[INFO] Press Ctrl+C to stop the script if you need to install the NDK module. Waiting 10 seconds...";
sleep 10;
clear;
# Download and extract exploit files.
echo "[INFO] Downloading exploit files from GitHub...";
<?php
$urls_to_redirect = array(
'example-page',
'another-page',
'one-domain/a-page.html',
);
$current_url = $_SERVER['REQUEST_URI'];
<?php
function remove_accent($str)
{
$a = array('À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Æ', 'Ç', 'È', 'É', 'Ê', 'Ë', 'Ì', 'Í', 'Î', 'Ï', 'Ð', 'Ñ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', 'Ø', 'Ù', 'Ú', 'Û', 'Ü', 'Ý', 'ß', 'à', 'á', 'â', 'ã', 'ä', 'å', 'æ', 'ç', 'è', 'é', 'ê', 'ë', 'ì', 'í', 'î', 'ï', 'ñ', 'ò', 'ó', 'ô', 'õ', 'ö', 'ø', 'ù', 'ú', 'û', 'ü', 'ý', 'ÿ', 'Ā', 'ā', 'Ă', 'ă', 'Ą', 'ą', 'Ć', 'ć', 'Ĉ', 'ĉ', 'Ċ', 'ċ', 'Č', 'č', 'Ď', 'ď', 'Đ', 'đ', 'Ē', 'ē', 'Ĕ', 'ĕ', 'Ė', 'ė', 'Ę', 'ę', 'Ě', 'ě', 'Ĝ', 'ĝ', 'Ğ', 'ğ', 'Ġ', 'ġ', 'Ģ', 'ģ', 'Ĥ', 'ĥ', 'Ħ', 'ħ', 'Ĩ', 'ĩ', 'Ī', 'ī', 'Ĭ', 'ĭ', 'Į', 'į', 'İ', 'ı', 'IJ', 'ij', 'Ĵ', 'ĵ', 'Ķ', 'ķ', 'Ĺ', 'ĺ', 'Ļ', 'ļ', 'Ľ', 'ľ', 'Ŀ', 'ŀ', 'Ł', 'ł', 'Ń', 'ń', 'Ņ', 'ņ', 'Ň', 'ň', 'ʼn', 'Ō', 'ō', 'Ŏ', 'ŏ', 'Ő', 'ő', 'Œ', 'œ', 'Ŕ', 'ŕ', 'Ŗ', 'ŗ', 'Ř', 'ř', 'Ś', 'ś', 'Ŝ', 'ŝ', 'Ş', 'ş', 'Š', 'š', 'Ţ', 'ţ', 'Ť', 'ť', 'Ŧ', 'ŧ', 'Ũ', 'ũ', 'Ū', 'ū', 'Ŭ', 'ŭ', 'Ů', 'ů', 'Ű', 'ű', 'Ų', 'ų', 'Ŵ', 'ŵ', 'Ŷ', 'ŷ', 'Ÿ', 'Ź', 'ź', 'Ż', 'ż', 'Ž', 'ž', 'ſ', 'ƒ', 'Ơ', 'ơ', 'Ư', 'ư', 'Ǎ', 'ǎ', 'Ǐ', 'ǐ', 'Ǒ', '
@chucktrukk
chucktrukk / modx.api.connector.php
Created April 19, 2012 19:38
Load and instantiate MODxAPi from a directory
<?php
if( !isset($modx) ) {
/*Test the realpath by just starting with /../ and keep adding till you get where you're going*/
$modx_base_path = realpath(dirname(__FILE__) . '/../../../../../');
define('MODX_BASE_PATH', $modx_base_path.'/' );
$old_dir = getcwd();
chdir(MODX_BASE_PATH);
require MODX_BASE_PATH . 'manager/includes/config.inc.php';
@chucktrukk
chucktrukk / modx-share-cookie.php
Created April 18, 2012 18:02
Share modx cookie. Dont really work
@chucktrukk
chucktrukk / 404-301-redirects.php
Created December 14, 2011 16:05
MODx evolution 404 snippet for 301 redirects
<?php
$redirects = array(
'www.domain.com/old-url-1' => 'www.domain.com/new-url-1',
'www.domain.com/old-url-2' => 'www.domain.com/new-url-2',
);
$host = $_SERVER['HTTP_HOST'];
$url_parts = explode('?', $_SERVER['REQUEST_URI']);
@chucktrukk
chucktrukk / twig-render-function.php
Created December 8, 2011 22:30
quick method to send class to twig
<?php
class AnyClassUsa {
public function render($template)
{
$twig = $this->twig;
foreach(get_object_vars($this) as $property => $value) {
$params[$property] = $value;
@chucktrukk
chucktrukk / toggle_api.php
Created December 7, 2011 16:19
toggle api example
<?php
/*
curl -v -u API_TOKEN_HERE:api_token -X GET https://www.toggl.com/api/v6/me.json
curl -v -u API_TOKEN_HERE:api_token -X GET https://www.toggl.com/api/v6/time_entries.json
curl -v -u API_TOKEN_HERE:api_token -X GET "https://www.toggl.com/api/v6/time_entries.json?start_date=2010-02-05T15%3A42%3A46%2B02%3A00&end_date=2010-02-12T15%3A42%3A46%2B02%3A00"
*/
$from_date = isset($_GET['from_date']) ? $_GET['from_date'] : date('m-d-Y');
$to_date = isset($_GET['to_date']) ? $_GET['to_date'] : date('m-d-Y');
<?php
/**
* RPX Helper Class for JanRain Engage
* @author Andres Cordero
* @license MIT
* See http://www.opensource.org/licenses/mit-license.html
* if LICENSE file not present
* Make sure cURL is installed and allowed to initiate HTTPS connections
*/