Skip to content

Instantly share code, notes, and snippets.

@yuan3y
yuan3y / tree_each_folder.sh
Created October 19, 2014 10:36
output a html directory to each folder, used for transmission daemon (after finishing downloads)
#!/bin/bash
mybasepath=/down
mybaseurl=http://yuan3y.com/down/
cd "$mybasepath"/
while IFS="" read -r -d $'\000' dir
do
echo "$mybaseurl""$dir" && tree -shC -H "$mybaseurl""$dir" -T "<a href=\"$mybaseurl\">down</a>" -o "$dir"/index.html "$dir"
done < <(find . -type d -print0)
@yuan3y
yuan3y / url_response.php
Created October 8, 2014 13:39
Send parameters to url using POST or GET and show response HTML
<?php
$method = 'GET'; //change to 'POST' for post method
$url = 'http://localhost/browse/';
$data = array(
'manufacturer' => 'kraft',
'packaging_type' => 'bag'
);
if ($method == 'POST'){
//Make POST request