This file contains 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 | |
# Batch renaming files via your sharpest tool - your text editor. | |
# Given a file pattern as argument renamer.sh opens $EDITOR | |
# with the selected files. Rename them in the editor, save | |
# and quit. You will be presented with the rename script | |
# so you can inspect what will happen when you continue. | |
# renamer.sh will do the renaming in two steps. First all | |
# files will be renamed to temporary names with increasing | |
# IDs. Then the renaming to the final name will be done. |
This file contains 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
# ala https://www.onli-blogging.de/1463/Sinatra-Code-im-Hintergrund-ausfuehren.html | |
require 'sinatra/base' | |
require 'thread/pool' | |
class Transcode | |
ThreadPool = Thread.pool(2) | |
def initialize message | |
ThreadPool.process do |
This file contains 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
function greparate() { | |
PATTERN=$1; | |
FILENAME=$2; | |
FILENAME_WITH=`echo $FILENAME | sed "s/\.\([^\.]*\)$/.with_$PATTERN.\1/"`; | |
FILENAME_WITHOUT=`echo $FILENAME | sed "s/\.\([^\.]*\)$/.without_$PATTERN.\1/"`; | |
echo "Seprating the content of $FILENAME by $PATTERN into $FILENAME_WITH and $FILENAME_WITHOUT" | |
grep $PATTERN $FILENAME > $FILENAME_WITH; | |
grep -v $PATTERN $FILENAME > $FILENAME_WITHOUT; |
NewerOlder