Skip to content

Instantly share code, notes, and snippets.

@cyc0der
cyc0der / speech-downloader.php
Created July 22, 2015 05:17
download word speech from google translate
<form method="post" action="">
word : <input type="text" name="word" value="hello" /> <br/>
folder : <input type="text" name="folder" value="word_speech" /> <br/>
<input type="submit" name="Download" value="Download" /> <br /> <br />
</form>
<?php
if(isset($_POST[Download])) {
$content = file_get_contents('http://translate.google.com/translate_tts?tl=en&q=' . urlencode($_POST['word']));
@cyc0der
cyc0der / PUT_fsockopen.php
Created November 7, 2013 20:48
This script is an example of posting multiple files using (PUT method) fsockopen. The tricky part is making sure the HTTP headers and file boundaries are acceptable to the target webserver. This script is for example purposes only and could/should be improved upon.
<?php
$host='targethost';
$port=80;
$path='/test/socket/file_upload/receive_files.php';
// the file you want to upload
$file_array[0] = "dingoboy.gif"; // the file
$file_array[1] = "dingoboy2.gif"; // the file
@cyc0der
cyc0der / password_hasher.php
Created November 7, 2013 20:47
a secure algoritm for hash passwords
<?php
function hasher($string){
$hash = hash('sha384', 'kw-8u2j8746&$%@)+sk/'.$string.'16seg)#%(nasf');
$hash .= hash('sha512', 'ogw00`97gt644q*93jas'.$string.'14:JFH*#%,,.t');
$hash .= hash('haval256,5', '464f(^%q3`580F444)h)_'.$hash.'GFYT&QWrml%f%@');
$hash .= hash('crc32b', '19(@#]$)&[)^$~d143Y%)'.$hash.'^#%%&(*%^(##3^');
$hash .= hash('crc32b', '19(@#$){p&)^$$fd143Y%'.$hash.'hghfaf(T)4%53^');
$hash .= hash('sha512', 'ogw00`97gt644q*93jas'.$string.'14:JFH*#%,,.t');
$hash .= hash('crc32b', '19(@#$G#dgh5$$fd143Y%'.$hash.'hghfaf(T)y#53^');
@cyc0der
cyc0der / antiXSS.php
Created November 7, 2013 20:46
PHP anti XSS for MySQL queries
<?php
function db_query($db_string, $file=null, $line=null)
{
// One more query....
$db_count = !isset($db_count) ? 1 : $db_count + 1;
$clean = '';
$old_pos = 0;