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/sh | |
ffmpeg -i “$1″ -acodec alac “`basename “$1″ .flac`.m4a” \ | |
-metadata title=\”"$(metaflac –show-tag=TITLE “$1″ | sed ‘s/title=//g’)”\” \ | |
-metadata author=\”"$(metaflac –show-tag=ARTIST “$1″ | sed ‘s/artist=//g’)”\” \ | |
-metadata album=\”"$(metaflac –show-tag=ALBUM “$1″ | sed ‘s/album=//g’)”\” \ | |
-metadata year=\”"$(metaflac –show-tag=DATE “$1″ | sed ‘s/date=//g’)”\” \ | |
-metadata track=\”"$(metaflac –show-tag=TRACKNUMBER “$1″ | sed ‘s/tracknumber=//g’)”\” \ | |
-metadata genre=\”"$(metaflac –show-tag=GENRE “$1″ | sed ‘s/genre=//g’)”\” |
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
on run | |
--edit this to be the correct location and file to run (typically only edit after the "drive_c") | |
set toRun to "$WINEPREFIX/drive_c/Program Files/MyProgram/MyProgramName.exe" | |
--edit winePrefix if you are not using the default prefix | |
set winePrefix to "$HOME/.wine" | |
--edit wineLocation if your wine install is not the default location | |
set wineLocation to "/usr/local/bin" |
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
on run | |
--edit this to be the correct location and file to run (typically only edit after the "drive_c") | |
set toRun to "$WINEPREFIX/drive_c/Program Files/MyProgram/MyProgramName.exe" | |
--edit winePrefix if you are not using the default prefix | |
set winePrefix to "$HOME/.wine" | |
--edit wineLocation if your wine install is not the default location | |
set wineLocation to "/usr/local/bin" |
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
#!/usr/bin/env python | |
#------------------------------------------------------------------------------- | |
# Name: example-TimedRotatingFileHandler.py | |
# Purpose: Write log using TimedRotatingFileHandler | |
# Author: Adrian Jones | |
# Created: 2012-05-25 | |
# | |
# TimedRotatingFileHandler: from handler.py source: | |
# Current 'when' events supported: | |
# S - Seconds |
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
import logging | |
import logging.handlers | |
# log file name and logging message level | |
log_file_name = 'loggingexample.log' | |
log_level = logging.INFO | |
# log record format string | |
format_string = '%(asctime)s %(name)s %(levelname)s %(message)s' | |
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
import logging | |
# change default log entry format, set filename and logging level | |
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(message)s", filename="example.log") | |
logging.info("Started") | |
logging.info("This is an example entry") | |
logging.debug("This line won't get logged as the log level is INFO") | |
logging.info("Done.") | |
# perform an orderly shutdown by flushing and closing all handlers; called at application exit and no further use of the logging system should be made after this call. | |
logging.shutdown() |
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
#!/usr/bin/env python3 | |
# vim: ft=python ts=4 sw=4 expandtab | |
# | |
# Copyright (c) 2013 Reed Kraft-Murphy <[email protected]> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is |
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
rem cd to the full repo directory | |
cd path\to\full_repo | |
rem export tracked files in sub directory by creating a filemap using an intermediary temp file | |
set SUBDIR=name_of_subdir | |
hg locate -I "%SUBDIR%" > ..\filemap.tmp | |
for /f "tokens=*" %A in (..\filemap.tmp) do @echo include %A >> ..\filemap.txt | |
echo rename "%SUBDIR%" . >> ..\filemap.txt | |
del ..\filemap.tmp |
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
# cd to the full repo directory | |
cd path/to/full_repo | |
# export tracked files in sub directory by creating a filemap | |
export SUBDIR=name_of_subdir | |
hg locate -I "$SUBDIR" | awk '{print "include \"" $1 "\"";}' > ../filemap.txt | |
echo "rename \"$SUBDIR\" ." >> ../filemap.txt | |
# create new repo using filemap | |
hg convert --filemap ../filemap.txt . ../new_repo_name |
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
#!/usr/bin/env sh | |
# check if share is mounted, attempt recovery and remount | |
if [ -z "$1" ]; then | |
echo "Usage: $0 /mount/point/to/check" | |
exit 0 | |
fi | |
DIR="$1" |
NewerOlder