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
def path_to_attachment_image(attachment) | |
image_path("attachments/#{attachment.filename}") | |
end |
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
module ApplicationHelper | |
# Access Levels | |
ACCESS_LEVELS = { :private => 0, :friends => 1, :public => 2 } | |
# Access levels i18n translation | |
def access_levels | |
ACCESS_LEVELS.collect{|k,v| [I18n.t("access." + k.to_s), v]} | |
end | |
end |
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 | |
# This will tar all the subfolders within the PWD, uncomment the rm at your peril! | |
DIRS=`ls -d */` | |
for DIR in ${DIRS}; do | |
TAR_PATH=${DIR%%/} | |
echo "Processing : $TAR_PATH" | |
tar -zcvf ${TAR_PATH}.tar.gz ${TAR_PATH} > ${TAR_PATH}.tar.gz.log | |
# rm -rf ${TAR_PATH} | |
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
#!/usr/bin/env ruby | |
class Remover | |
attr_accessor :remove_words | |
attr_accessor :error_files | |
def initialize(path = "") | |
@remove_words = ['#ifdef RIDEBUG', '#endif'] | |
@error_files = [] | |
end |
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 | |
# Download locations | |
# http://www.bugzilla.org/docs/3.6/en/html/modules-manual-download.html | |
# http://www.bugzilla.org/docs/3.6/en/html/modules-manual-optional.html | |
LOGFILE=install_progress.txt | |
PROCESSED_FILES_DIR=processed_files | |
mkdir -p ${PROCESSED_FILES_DIR} |
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 | |
REMOTE_SERVER=192.168.109.2 | |
#IRV: Cat into same file? What if many try at same time? But would be better cos could tail -f! | |
#OUTPUT=/path/hosts_${HOSTNAME}.txt #IRV: advantage here is file date/time is updated on target, so dont need to know date here | |
#OUTPUT=/path/hosts.txt | |
OUTPUT=hosts.txt | |
touch $OUTPUT | |
REMOTE_PATH=/path2 | |
#TIME_STAMP=$(date +%Y%m%d) # doesnt work on blades due to no battery! |
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 | |
SEND=mail.txt | |
echo "Date: " > $SEND | |
echo "Subject: $S2SYSTEM is now at" >> $SEND | |
echo "From: ECM" >> $SEND | |
echo "" >> $SEND | |
ifconfig eth0 | grep "inet addr" >> $SEND |
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 | |
HOST=0 | |
if [ "$SYSTEM" == "type1" ]; then | |
HOST=192.168.0.2 | |
elif [ "$SYSTEM" == "type2" ]; then | |
HOST=192.168.0.1 | |
else | |
echo "Error 1" | |
exit |
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 | |
FILENAME=$1 | |
HOURS=$2 | |
SECONDS=$((3600 * ${HOURS})) | |
echo "Recording ${FILENAME} for ${SECONDS} seconds..." | |
rec -c 2 ${FILENAME}.ogg trim 0 ${SECONDS} |
OlderNewer