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
for f in *; do; t=`identify -format '%[exif:DateTime]' "$f" 2>/dev/null | sed -e 's/[: ]//g' -e 's/^\(.\{12\}\)\(.*\)/\1.\2/'`; echo -n "$t $f\t\t"; touch -t $t "$f" 2>/dev/null && echo "done" || echo "fail"; 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
RewriteEngine On | |
# special mod_rewrite variables | |
RewriteRule .* - [E=MR_SPECIALS_API_VERSION:%{API_VERSION},NE] | |
RewriteRule .* - [E=MR_SPECIALS_THE_REQUEST:%{THE_REQUEST},NE] | |
RewriteRule .* - [E=MR_SPECIALS_REQUEST_URI:%{REQUEST_URI},NE] | |
RewriteRule .* - [E=MR_SPECIALS_REQUEST_FILENAME:%{REQUEST_FILENAME},NE] | |
RewriteRule .* - [E=MR_SPECIALS_IS_SUBREQ:%{IS_SUBREQ},NE] | |
RewriteRule .* - [E=MR_SPECIALS_HTTPS:%{HTTPS},NE] | |
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 | |
PATH=/bin:/usr/bin | |
HOSTNAME=localhost | |
USERNAME=username | |
PASSWORD=password | |
DATABASE=database | |
# list of tables to be ignored in "data" mode | |
DATA_IGNORE=( table1 table2 table2 ) | |
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
<script>window.location = window.location.href.replace(/^.*\?r=/, "");</script> |
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
# | |
# Reverse proxy (mod_proxy, mod_rewrite) | |
# | |
# http[s]://<hostX>[<.subdomain>...].example.com | |
# \_ | |
# | http://<subdomain[.subdomain]...>.example.com:<portX> | |
# | |
# Mark requests with http header to distinguish forwarded requests on | |
# backends and apply special rules |
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
# | |
# Virtual hosts by mod_rewrite | |
# | |
RewriteEngine On | |
RewriteMap lowercase int:tolower | |
# Domain to path mapping overriding default rule below | |
# | |
# File format: |
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
# exiftool command for renaming images to datetime name | |
exiftool -d %y%m%d-%H%M%S%%-c.%%e "-filename<datetimeoriginal" "$@" | |
# change file modtime as well (this one does not work sometimes for some reason) | |
# exiftool -d %y%m%d-%H%M%S%%-c.%%e "-filename<datetimeoriginal" -execute "-filemodifydate<datetimeoriginal" "$@" |
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 zsh | |
# Get terminal background color luminance as integer 0..100 | |
# 0 - white, 100 - black | |
if [ $TERM_PROGRAM = 'Apple_Terminal' ]; then | |
colors_string=$(osascript -e 'tell application "Terminal" to get background color of current settings of selected tab of front window') | |
elif [ $TERM_PROGRAM = 'iTerm.app' ]; then | |
colors_string=$(osascript -e 'tell application "iTerm.app" to get background color of current session of current terminal') | |
else | |
echo "Error: Could not get terminal background color" |
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
# Chroot into Gentoo partition | |
mount /dev/sdc4 /mnt/gentoo | |
mount -t proc none /mnt/gentoo/proc | |
mount --rbind /sys /mnt/gentoo/sys | |
mount --rbind /dev /mnt/gentoo/dev | |
chroot /mnt/gentoo /bin/bash | |
grep -v rootfs /proc/mounts > /etc/mtab | |
source /etc/profile | |
export PS1="(chroot) $PS1" |
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
var a = 1, b = 2; | |
a = [b, b = a][0]; |