Skip to content

Instantly share code, notes, and snippets.

View thefotios's full-sized avatar
💭
definitely snacking

Fotios Lindiakos thefotios

💭
definitely snacking
View GitHub Profile
@ready_file = 'sauce_ready'
# Get the Sauce configuration information
cfg = Sauce::Config.new()
# Create a command to spawn the jar file
cmd = "java -jar Sauce-Connect.jar -f #{@ready_file} #{cfg.opts[:username]} #{cfg.opts[:access_key]}"
# Create a command to kill it when we're done
# Source: http://goo.gl/CCiFz
kill_cmd = "ps aux | grep -e '#{cmd}' | grep -v grep | awk '{print $2}' | xargs -i kill {}"
@thefotios
thefotios / batch_ffmpeg.sh
Created November 2, 2011 15:16
ffmpeg batch conversion script. This script will take in mutlitple files from the command line and process them using the same ffmpeg options.
# Script for converting list of files using ffmpeg
#
# Author: Fotios Lindiakos (fotioslindiakos@gmail.com)
#
# Usage: batch_ffmpeg.sh file1 [file2 file3 ...]
extension=mp3
options="-y"
for source in "$@"
#!/usr/bin/env ruby
require 'rubygems'
require 'logger'
require 'chronic'
require 'ri_cal'
require 'action_mailer'
require 'mail'
# Use this gem for getting mail: https://github.com/mikel/mail
---
errors:
- !ruby/object:Test::Unit::Failure
location:
- ./rhc-chk:231:in `test_authentication'
message: " The user fotios12adf34@redhat.com does not have an account on this server\n FIX: Please ensure that you've entered the correct username\n\
.\n\
<false> is not true."
test_name: test_authentication(Test2_Authentication)
- !ruby/object:Test::Unit::Failure
#!/bin/bash
#
# General all-covering MediaTomb transcoding script.
#
#############################################################################
# Edit the parameters below to suit your needs.
#############################################################################
# Subtitles imply transcoding; set to 1 to disable subtitle rendering.
# For divx this doesn't matter much but for mp4, mkv and DVD it does.
@thefotios
thefotios / my_renice.sh
Created May 9, 2012 17:31
Renice a process and all of its children recursively
#!/usr/bin/env bash
# This can be run simply by passing it the outputs from pgrep:
# my_renice $(pgrep application)
#
# You may also want to use pgrep to find more complex processes based on arguments
# my_renice $(pgrep -f "bash.*$name")
function my_renice(){
newnice=10
@thefotios
thefotios / 99-vpn.sh
Created May 10, 2012 04:54
This script disables certain yum repos when disconnected from a VPN
#!/bin/bash
# This script will disable/enable yum repos when something happens to your VPN
# The first thing you will need to do is make copies of the repos you want to swap
# Modify the settings appropriately and set up symlinks for your current status
# Place this script in /etc/NetworkManager/dispatcher.d, chown to root, and chmod u+x
#
# RTFM: http://linux.die.net/man/8/networkmanager
# Inspired by http://www.techytalk.info/start-script-on-network-manager-successfull-connection/
#!/usr/bin/env bash
# GistID: 2664890
# This wrapper for wemux allows for more intelligent server selection
# Pretty much, it lists if you have servers running and allows you to select one
# It also allows you to just hit enter to pick the default
# Or type a name to create a new one
function full_path(){
readlink -f $1
---
title: Home
description:
layout : page
---
<div class="span8">
{{# posts }}
{{> post_summary }}
#!/usr/bin/env ruby
require 'socket'
require 'net/http'
require 'yaml'
require 'benchmark'
require 'optparse'
DEFAULT_TIMEOUT = 600
DEFAULT_WAIT = 2