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 | |
// script to generate fs_uae configs for amiga floppies on mac os x or linux (.fs-uae files) as a zip archive | |
// | |
// first organise games with more than one disk into a subfolder containing the disks | |
// this will auto-load each extra floppy drive drive with each floppy (up to 4) | |
// e.g. make a folder 'alien_breed' containing abreed1.adz and abreed2.adz, config created is: Alien_Breed.fs-uae | |
// run 'php 0make_uae_configs.php' in Floppies folder to generate .fs-uae configs in folder 0configs to manually copy/move | |
// | |
// place games with multiple floppies under a subfolder per game | |
// author: [email protected] |
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/sh | |
files=$@ | |
for file in $files; | |
do | |
set `du $file`; | |
size=$1 | |
for times in 0 1 2; | |
do | |
dd if=/dev/urandom of=$file count=$size conv=notrunc | |
done |
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
time $(which rsync) \ | |
--partial \ | |
--delay-updates \ | |
-aAHHSxXESy \ | |
--stats \ | |
--exclude-from=$HOME/.rsync-excludes |
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
# jpeg image - add comment (and/or rename based on exif date setting file time if exif exists) delete thumb | |
export JHEAD_FILE_ARGS="%Y-%m-%d-%a-%H%M%S" | |
export COMMENT="image use allowed only by permission of vijay mahrra <[email protected]> - all rights reserved" | |
# add comment, auto-rotate, rename files with exif tags, set file date | |
find . -type f -iname "*.jp*" -exec jhead -cl "${COMMENT}" -exonly -zt -di -dt -ft -autorot -n${JHEAD_FILE_ARGS} {} \; | |
# add comment, set file date to all files - will skip existing | |
find . -type f -iname "*.jp*" -exec jhead -cl "${COMMENT}" {} \; |
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
#!/usr/bin/php | |
<?php | |
// get all files in a dir path, | |
function get_all_files($dir, $ignore_dirs = true) { | |
static $alldirs = array(); | |
$dirs = glob($dir . '/*'); | |
if (count($dirs) > 0) { | |
foreach ($dirs as $newdir) { | |
if (!array_key_exists($newdir, $alldirs)) { |
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 | |
// find square jpeg images | |
$cmd = 'find . -type f -iname "*.jp*" -print'; | |
$files = cmd_execute($cmd); | |
$counts = []; | |
$by_size = []; | |
foreach ($files as $k => $path) { | |
$data = getimagesize($path); |
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 | |
// find small jpeg images | |
$cmd = 'find . -type f -iname "*.jp*" -print'; | |
$files = cmd_execute($cmd); | |
$counts = []; | |
$by_size = []; | |
foreach ($files as $k => $path) { | |
$data = getimagesize($path); |
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
caffeinate -i youtube-dl --yes-playlist --download-archive archive.log -r 256k \ | |
--skip-unavailable-fragments --playlist-random --write-info-json \ | |
--write-description --no-check-certificate \ | |
--sleep-interval 10 --max-sleep-interval 50 --merge-output-format mp4 \ | |
--audio-format mp3 --audio-quality 0 --extract-audio --embed-thumbnail \ | |
--ignore-errors \ | |
$1 | |
# see https://gist.github.com/vijinho/c8e2abd174d1d9ae71541c9007da701a for post-processing |
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
time $(which rsync) \ | |
--archive \ | |
--checksum \ | |
--super \ | |
--stats \ | |
--acls \ | |
--hard-links \ | |
--xattrs |
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
#!/usr/bin/php | |
<?php | |
// counterpart to https://gist.github.com/vijinho/645786c3ab8133d49ca9ef9b50a3944f | |
// for post processing filenames | |
$cmd = 'find . -type f -iname "*.mp3" -depth 1 -print'; | |
$files = cmd_execute($cmd); | |
sort($files); | |
$data = $tags = []; | |
foreach ($files as $j => $path) { |