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
# Add this to your .bashrc, or paste it into your shell for testing | |
# | |
# Bookmarks for directories | |
# | |
# Usage: | |
# bm name -- Create a bookmark for the current working directory | |
# Bookmarks are saved across sessions in ~/.bookmarks | |
# to name -- cd to the bookmarked directory | |
# to -- Dump all bookmarks | |
# |
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
human_time() { | |
seconds=$1 | |
d=$(( $seconds / 86400 )) | |
h=$(( $seconds / 3600 % 24 )) | |
m=$(( $seconds / 60 % 60 )) | |
seconds=$(( $seconds % 60 )) | |
for unit in d h m; do | |
eval value=\$$unit | |
if [ $value -gt 0 ]; then | |
printing=true |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
Stylesheet to convert a JIRA report list exported as XML into a table in | |
TWiki's plaintext format. | |
The table contains these columns: | |
- ID: Issue ID with link to issue page | |
- summary | |
- priority: Numerical priority – smaller number is more important | |
- component: one ore more, divided by </br> |
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
package com.github.hfs.anttasks; | |
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.io.FileReader; | |
import java.io.IOException; | |
import org.apache.tools.ant.BuildException; | |
import org.apache.tools.ant.util.CompositeMapper; |
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/perl -p | |
use POSIX; | |
BEGIN { | |
$| = 1; | |
$separator = shift or $separator = "\t"; | |
} | |
print strftime("%Y-%m-%dT%H:%M:%S", localtime), $separator |
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 | |
export GIT_AUTHOR_NAME="Firstname Lastname" | |
export GIT_AUTHOR_EMAIL="[email protected]" | |
export GIT_COMMITTER_NAME="Firstname Lastname" | |
export GIT_COMMITTER_EMAIL="[email protected]" | |
mkdir afd | |
cd afd | |
git init | |
first=true |
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 | |
# | |
# Script to copy a number of files to a remote host using SFTP. Files are first | |
# copied to have a leading dot in the filename and then remotely renamed to | |
# their real name. This script creates the input for the 'sftp' command. | |
# | |
# Usage: | |
# sftp-cp * | sftp user@host:/target/directory | |
for each in "$@"; do |
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 | |
cd $(git rev-parse --show-toplevel) || exit 128 | |
echo "*.zip diff=zip" >> .gitattributes | |
git config diff.zip.textconv "unzip -c -a" |
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 | |
HOST=hostname | |
MAC=12:34:56:78:90:AB | |
wakeonlan $MAC | |
# Wait until the host is pingable | |
count=0 | |
while [ $count -lt 300 ]; do | |
let count++ |
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 | |
xml c14n --without-comments $1 | xml format --dropdtd --encode utf-8 --indent-spaces 4 |
OlderNewer