This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $data = "\n---------------------------------------------------------------------\nRaw Input:\n" . file_get_contents("php://input"); | |
| $data .= "\n\nGet:\n". print_r($_GET,true); | |
| $data .= "\nPost:\n". print_r($_POST,true); | |
| file_put_contents( "log-output-test.txt", $data , FILE_APPEND | LOCK_EX ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #example: ./site_map.sh asdf.com | |
| SITE=$1 | |
| URLS="$1_urls.txt" | |
| echo -e "Starting Sitemap Generation===============================================\n" | |
| echo "" > site_url_list_raw.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #example: ./site_scooper.sh asdf.com | |
| #if it doesn't work, check your url, and see if it redirects from asdf.com to www.asdf.com, and retry with www.asdf.com | |
| SITE=$1 | |
| URLS="$1_urls.txt" | |
| echo -e "Starting Sitemap Generation===============================================\n" | |
| echo "" > site_url_list_raw.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #This part does the www to no-www redirect: | |
| RewriteEngine On | |
| RewriteBase / | |
| RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] | |
| RewriteRule ^(.*)$ https://%1/$1 [R=301,L] | |
| #This part does the http to https redirect: | |
| RewriteEngine On | |
| RewriteCond %{HTTPS} off | |
| RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $root = '.'; | |
| $min_count = 1000; | |
| $iter = new RecursiveIteratorIterator( new RecursiveDirectoryIterator( $root, RecursiveDirectoryIterator::SKIP_DOTS ), RecursiveIteratorIterator::SELF_FIRST, RecursiveIteratorIterator::CATCH_GET_CHILD ); | |
| foreach ( $iter as $path => $dir ) { | |
| if ( $dir->isDir() ) { | |
| $dir_count = count_files( $path ); | |
| if ( $dir_count > $min_count ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| basename=$(b=${1##*/}; echo ${b%.*}) | |
| dcraw -D -W -4 $1 | |
| mkdir $basename | |
| convert $basename.pgm -sample 100x50%\! -sample 50%x100\! -contrast-stretch 0x0 -compress zip $basename/r.tiff | |
| convert \( $basename.pgm -background white -gravity northwest -splice 0x1 \) -sample 100x50%\! -sample 50%x100\! -trim -fuzz 5% -contrast-stretch 0x0 -compress zip $basename/g1.tiff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $search_string = ".bak"; | |
| $count = 0; | |
| $output = ""; | |
| $root = '.'; | |
| $iter = new RecursiveIteratorIterator( new RecursiveDirectoryIterator( $root, RecursiveDirectoryIterator::SKIP_DOTS ), RecursiveIteratorIterator::SELF_FIRST, RecursiveIteratorIterator::CATCH_GET_CHILD ); | |
| $i=0; | |
| foreach ( $iter as $path => $dir ) { | |
| if( stripos($dir->__toString(),$search_string) !== false){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <pre> | |
| <?php | |
| $output=null; | |
| $retval=null; | |
| $return=null; | |
| exec('ps aux', $output, $retval); | |
| foreach ($output as $line){ | |
| $line = preg_replace('/\s+/', ' ', $line); | |
| $line = explode(' ',$line); | |
| if($line[10]=="lsphp"){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var form = document.getElementById("form-id"); //get the form for modifications we need to make | |
| //get the form action and then remove the form action so we can control when the form is sent | |
| var action = form.action; | |
| form.action = ""; | |
| console.log(`action: ${action}`); | |
| //create a hidden field for getting the page url, | |
| //since in php the HTTP_REFERER/HTTP_ORIGIN in PHP only returns domain | |
| var hiddenInput = document.createElement("input"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # takes a text file and makes an audiobook of it ex: | |
| # ./generate_audiobook.sh input_book.txt | |
| # a few notes, | |
| # first, you'll need to install edge-tts (pip3 install edge-tts), sox (sudo apt-get install sox), and |