Skip to content

Instantly share code, notes, and snippets.

\set AUTOCOMMIT off
\timing
\set ON_ERROR_STOP on
\set ON_ERROR_ROLLBACK on
% cat .rpmmacros
%_topdir %(echo ${HOME}/rpm)
%_tmppath %{_topdir}/tmp
%packager Jacob Helwig <jhelwig@cpan.org>
# Uncomment to have built RPMs land in RPMS/ instead of RPMS/<arch>/
#%_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
%_smp_mflags -j3
%__arch_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot
%{_topdir} %{getenv:HOME}/rpmbuild
%{_builddir} %{_topdir}/BUILD
%{_rpmdir} %{_topdir}/RPMS
%{_sourcedir} %{_topdir}/SOURCES
%{_specdir} %{_topdir}/SPECS
%{_srcrpmdir} %{_topdir}/SRPMS
%{_buildrootdir} %{_topdir}/BUILDROOT
%{buildroot} %{_buildrootdir}/%{name}-%{version}-%{release}.%{_arch}
$RPM_BUILD_ROOT %{buildroot}
#!/bin/sh
set -e
set -x
echo ENV
env | grep GIT
echo CN $GIT_COMMITTER_NAME
echo CE $GIT_COMMITTER_EMAIL
@jhelwig
jhelwig / iptables.sh
Created November 18, 2011 18:36
Clear iptables to accept everything
#!/bin/sh
# IPv4
IPT=/sbin/iptables
# Reset iptables
$IPT -P INPUT ACCEPT
$IPT -P OUTPUT ACCEPT
$IPT -P FORWARD ACCEPT
$IPT -F
@jhelwig
jhelwig / tic-tac-toe-count-fun-bug.rb
Created December 7, 2011 07:31
PDX.rb I Spy 2011-12-06
require 'rubygems'
def row(i)
[i % 3, (i/3) % 3, (i/9) % 3]
end
def row_number(r)
r[0]+3*r[1]+9*r[2]
end
@jhelwig
jhelwig / ant-clean-debug-install-all
Created July 15, 2012 17:25
Android CLI helpers
#!/bin/bash
# This assumes that there is a file named .activity-to-launch where the sole
# contents are the name of the activity to launch on each device.
#
# For example:
# net.technosorcery.rally.ts_200/net.technosorcery.rally.ts_200.MainActivity
ant clean
guard 'shell' do
watch(/(.*)/) do |m|
if system("git ls-files --exclude-standard -d -o -m | egrep '.' > /dev/null")
test_output = Tempfile.new('guard_commit_test_output')
test_output.close
tests_passing = system("rake 2>&1 >> #{test_output.path}")
commit_message = Tempfile.new('guard_commit_message')
commit_message.write("WIP: #{m[0]} (Tests: #{tests_passing ? 'passing' : 'failing'})\n\n")
commit_message.write(File.read test_output.path)
@jhelwig
jhelwig / Guardfile
Created December 4, 2012 16:11
Auto-commit & run tests on every save
# More info at https://github.com/guard/guard#readme
ignore /^coverage\//
require 'tempfile'
notification :'terminal_notifier'
#notification :tmux,
# :display_message => true,
# :timeout => 5, # in seconds
{
"variables": {
"http_temp_dir": null,
"vm_platform": "centos",
"vm_version": "{{timestamp}}",
"cpu_count": "1",
"memory_mb": "1024",
"disk_mb": "40000",
"iso_url_base": "http://baker/kickstart_isos/isos/centos/",
"iso_name": "centos-20140307T012531-production.iso",