convert image.png -resize 40 txt:-|sed -E 's/://;s/\( ? ?//;s/, ? ?/,/g;s/\)//;s/(\w,\w,\w),\w/\1/g;/mage/d'|awk '{print $1,$2}'|python -c "import sys;f=sys.stdin.read().split('\n');f=filter(None,f);print 'tput rev;'+''.join([''.join(map(str,('echo;' if x.split(' ')[0].split(',')[0] is '0' else '','tput setaf '+str(sum(p*q for p,q in zip([36,6,1],[int(min(int(c),254)/42.5) for c in x.split(' ')[1].split(',')]))+16)+';echo -n \" \";'))) for x in f])+'echo;tput sgr0'"|bash
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 | |
# movein.sh - shamelessly stolen from O'Reilly's excellend "Linux Server Hacks" | |
# http://oreilly.com/pub/h/72 | |
# Version 0.2 - Added some comments and error checking | |
if [ -z "$1" ]; then | |
echo "Usage: `basename $0` hostname" | |
exit | |
fi |
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
# vlist generates a list of running Vagrant VMs | |
vlist () | |
{ | |
vagrant status | awk '/running/{ print $1 }' | |
} | |
# vssh runs your command(s) on all VMs. Enclose in quotes to run multiple commands. | |
vssh () | |
{ | |
[ $# -ne 1 ] && (echo "Usage: vssh command"; return 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
" Teach vim to syntax highlight Vagrantfile as ruby | |
" | |
" Install: $HOME/.vim/plugin/vagrant.vim | |
" Author: Brandon Philips <[email protected]> | |
augroup vagrant | |
au! | |
au BufRead,BufNewFile Vagrantfile set filetype=ruby | |
augroup 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
<powershell> | |
# First we add our administrative user, replace username and password with your own | |
$computer=$env:ComputerName | |
$user="username" ## Change this! | |
$password='password' ## And change this too! | |
$objOu = [ADSI]"WinNT://$computer" | |
$objGroup = [ADSI]"WinNT://$computer/Administrators,group" | |
$objUser = $objOU.Create("User", $user) | |
$objUser.setpassword($password) |
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
# Download and install cygwin and some packages | |
function Install-Cygwin { | |
param ( $TempCygDir="$env:temp\cygInstall" ) | |
if(!(Test-Path -Path $TempCygDir -PathType Container)) | |
{ | |
$null = New-Item -Type Directory -Path $TempCygDir -Force | |
} | |
$client = new-object System.Net.WebClient | |
$client.DownloadFile("http://cygwin.com/setup.exe", "$TempCygDir\setup.exe" ) | |
# This does a vanilla installation of Cygwin |
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 | |
# Set a higher ulimit so we don't segfault | |
ulimit -s 32768 | |
search_string=$1 | |
search_string=${search_string// /%20} | |
# Courtesy of heptal's Console Colors | |
# https://gist.github.com/heptal/6052573 | |
function image() { |
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 | |
# Set a higher ulimit so we don't segfault | |
ulimit -s 32768 | |
search_string=$1 | |
search_string=${search_string// /%20} | |
# Courtesy of heptal's Console Colors | |
# https://gist.github.com/heptal/6052573 | |
function image() { |
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
<powershell> | |
# Set the administrator password | |
$ComputerName = $env:COMPUTERNAME | |
$user = [adsi]"WinNT://$ComputerName/Administrator,user" | |
$user.setpassword("******") | |
# Get the instance ready for our bootstrapper, commands courtesy of Julian Dunn | |
winrm quickconfig -q | |
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="300"}' |
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
# | |
# Cookbook Name:: apache | |
# Recipe:: default | |
# | |
# Copyright 2013, YOUR_COMPANY_NAME | |
# | |
# All rights reserved - Do Not Redistribute | |
# | |
package "httpd" do |
OlderNewer