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/bash | |
destdir=$1 | |
: ${destdir:=$(pwd)} # default value if $1 is not set | |
for ver in 5 6 ; do | |
for arch in SRPMS x86_64 ; do | |
pushd ${destdir}/${ver}/${arch} > /dev/null 2>&1 | |
createrepo --update . | |
popd > /dev/null 2>&1 |
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/bash | |
### BEGIN INIT INFO | |
# Provides: ahn | |
# Required-Start: ahn daemon | |
# Required-Stop: ahn daemon | |
# chkconfig: 2345 91 60 | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Adhearsion daemon |
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/bash | |
for i in *wav ; do | |
date=$(stat -c '%y' $i | cut -f 1 -d ' ' ) | |
dir="${date:5:2}/${date:8:2}" | |
echo "$date $dir $i" | |
mkdir -p $dir | |
mv $i $dir | |
done |
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
ffmpeg -i "<in file>" -ac 1 -ar 8000 "<out file>" |
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/bash | |
for i in *.mp4 ; do | |
echo -n $(basename $i .mp4) | |
echo -n ": " | |
ffmpeg -i $i 2>&1 | grep Duration | awk '{print $2}' | tr -d , | |
done |
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/env ruby | |
# encofing: utf-8 | |
require 'rubygems' | |
require 'nokogiri' | |
page = Nokogiri::HTML(open('/tmp/planetfossil.htm')) | |
feeds = Hash.new |
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/env ruby | |
output = open('output', 'w+') | |
lines = open('logfile').readlines | |
open('shortfile').each_line do |l| | |
name = l.chomp | |
output.puts name if lines.include? name | |
end |
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
# run with: rvmsudo god -c /srv/phone/phonzy/current/ahn/config/god/adhearsion.god | |
# debug with: rvmsudo god quit && rvmsudo god -c /srv/phone/phonzy/current/ahn/config/god/adhearsion.god -D | |
@deploy_path = '/srv/phone/phonzy' | |
@shared_path = File.join @deploy_path, 'shared' | |
@app_path = File.join @deploy_path, 'current', 'ahn' | |
@log_path = File.join @shared_path, 'log' | |
@pid_path = File.join @shared_path, 'pids' | |
@pid_file = File.join @pid_path, 'adhearsion.pid' | |
@god_env = YAML.load_file("#{@shared_path}/config/god_environment.yml") |
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
func open_file { | |
f, err := os.Open("/tmp/a_file") | |
if err != nil { | |
log.Fatal("Unable to open a_file") | |
} | |
defer f.Close() | |
// do something here | |
} |
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
" Vim syntax file | |
" Language: SQL | |
" Maintainer: Scott Morgan < blumf7 at gmail dot com > | |
" Last Change: 2014-06-13 | |
" Version: 1.0 | |
" For version 5.x: Clear all syntax items | |
" For version 6.x: Quit when a syntax file was already loaded | |
if version < 600 | |
syntax clear |