Skip to content

Instantly share code, notes, and snippets.

View chewi's full-sized avatar

James Le Cuirot chewi

  • Edinburgh, Scotland
  • 21:37 (UTC +01:00)
View GitHub Profile
@chewi
chewi / armhf-migrate.bash
Last active January 12, 2020 22:28
Migrates a Gentoo ARM system from the old style tuple (CHOST) to the new style tuple ending in hf.
#!/bin/bash
# Abort if things go wrong. Very important!
set -ex
# Fetch the old CHOST from make.conf or profile.
OLD_CHOST=$(portageq envvar CHOST)
# The new CHOST needs to end in hf. The vendor part doesn't really
# matter as long as it's not softfloat or softfp but the convention is
@chewi
chewi / make-the-tea
Last active January 9, 2019 20:16
Script to create Gentoo icedtea-bin tarballs
#!/bin/bash -e
OLD_PWD=${PWD}
source /lib/gentoo/functions.sh || true
if [ -z "$1" ]; then
echo "usage: $0 /usr/portage/packages/dev-java/icedtea-X.X.X.X.tbz2 [-rX]"
exit 1
fi
@chewi
chewi / Java_Quiz.txt
Created December 5, 2014 23:06
The Gentoo Java quiz
= Ant fun =
Q1. build.sysclasspath
Q1.1. What effect does the property build.sysclasspath=ignore have?
Q1.2. Why would we want to use it?
Q1.3. How would it 'break' packages?
@chewi
chewi / validation_sentences.rb
Created October 13, 2011 11:03
Make Rails use full sentences in validation messages.
module I18n
module Backend
module Base
protected
def load_file_with_sentences(filename)
load_file_without_sentences(filename).tap do |data|
unless Rails.configuration.paths["config/locales"].expanded.include?(filename)
data.each do |locale, d|
if d and d.key?("errors")