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 | |
| # create a file 'config.sh' where you set two variables one is your phone number the other is an api key from https://textbelt.com/ | |
| #phone=########## | |
| #apikey=####################################### | |
| #the tool read through a file called "sites-to-diff.txt" which is a list of sites with one url per line. | |
| source config.sh #get phone number & api key |
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
| curl https://alttext.ai/api/v1/images \ | |
| -s \ | |
| -X POST \ | |
| --header "X-Api-Key:API-KEY" \ | |
| -H 'Content-Type: application/json' \ | |
| -d "$( printf "{ \"image\": { \"raw\": \"$(base64 test.jpg)\" } }" )" \ | |
| | jq \ | |
| | grep -i alt_text \ | |
| | perl -pe 's/^[^"]*"[^"]*"[^"]*"([^"]*)".+/$1/i' |
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
| //pass a text file with one url per line: | |
| //node wave-screenshotter.js urls.txt | |
| const fs = require( 'fs' ); | |
| //get the arguments from the terminal | |
| const myArgs = process.argv.slice( 2 ); |
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 |
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
| <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
| <?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
| 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 | |
| $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
| #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] |