Skip to content

Instantly share code, notes, and snippets.

@psy-q
psy-q / gist:3122406
Created July 16, 2012 12:21
Encoding error in JRuby but not in MRI

Tne following code throws an error on line 171:

https://github.com/psy-q/stizun/blob/master/lib/supplier_util.rb

The error is:

Failure/Error: JetTestHelper.import_from_file(Rails.root + "spec/data/jet_products.utf8.csv")
Encoding::CompatibilityError: incompatible character encodings: UTF-8 and ASCII-8BIT

The file that gets imported is this:

@psy-q
psy-q / gist:3653377
Created September 6, 2012 09:03
pg_user never executes on the client
@psy-q
psy-q / gist:3756034
Created September 20, 2012 13:48
After git merge: "Trying to write ref refs/heads/master with nonexistant object"
remote: Counting objects: 45900, done.
remote: Compressing objects: 100% (14129/14129), done.
remote: Total 45900 (delta 30836), reused 44791 (delta 30042)
Receiving objects: 100% (45900/45900), 52.81 MiB | 18.27 MiB/s, done.
Resolving deltas: 100% (30836/30836), done.
error: refs/remotes/origin/master does not point to a valid object!
error: Trying to write ref refs/heads/master with nonexistant object 38eca7173be01a36ef03ebcf75732eba32e4038d
fatal: Cannot update the ref 'HEAD'.
remote: Counting objects: 45917, done.
remote: Compressing objects: 100% (13864/13864), done.
remote: Total 45917 (delta 30842), reused 45398 (delta 30323)
Receiving objects: 100% (45917/45917), 52.82 MiB | 18.37 MiB/s, done.
Resolving deltas: 100% (30842/30842), done.
From code.zhdk.ch:zhdk-typo3
* [new branch] bcr_bugfix_zhdkagenda-timestamp -> origin/bcr_bugfix_zhdkagenda-timestamp
* [new branch] beat -> origin/beat
* [new branch] classic -> origin/classic
* [new branch] feature_agenda-list -> origin/feature_agenda-list
009baa293a2f2dd897c8fd8dabbe17417cc42bfdf4f5 HEAD^@multi_ack thin-pack side-band side-band-64k ofs-delta shallow no-progress include-tag multi_ack_detailed
00484d7080de6d6269fc996d971fa319b4a612256279 refs/for/refs/heads/master
00588f98c4b8745169e2ea6257fb00cafccda9b8732e refs/heads/bcr_bugfix_zhdkagenda-timestamp
003d8f98c4b8745169e2ea6257fb00cafccda9b8732e refs/heads/beat
0040e055ec2e1966813c8ef536f639cde29e7d3693d7 refs/heads/classic
004c11a40de97286566362573898dc112e9e332cefcc refs/heads/feature_agenda-list
004e32e4d96318027e1212c310f0868bdc5b73a83caf refs/heads/feature_aux-localconf
0051ea434aa733c5c3f6e2dc9beb82c980998c0d23a1 refs/heads/feature_participant-list
00546c3bbd1e38232d8304bf5b69b831ce6a4897acb3 refs/heads/feature_vcard-jabber-export
00405948d6154f8a97b11c28161bd19cc690fe67d999 refs/heads/mab_old
some-crazy-id:
cmd:
- name: bash /foo/bar.sh
- user: foo
something-else:
cmd:
- name: cat /foo
- require:
- cmd: some-crazy-id
default:
paths:
features: %behat.paths.base%/../app/tests/features
bootstrap: %behat.paths.features%/bootstrap
ci:
paths:
features: %behat.paths.base%/../public/app/tests/features
bootstrap: %behat.paths.features%/bootstrap
formatter:
name: junit
@psy-q
psy-q / Actual execution
Created October 15, 2013 08:55
Can't figure out why the sequence is different when run without --list-tasks
PLAY [192.168.56.102] *********************************************************
GATHERING FACTS ***************************************************************
ok: [192.168.56.102]
TASK: [Give madek a PostgreSQL user] ******************************************
failed: [192.168.56.102] => {"failed": true, "parsed": false}
invalid output was: sudo: unknown user: postgres
sudo: unable to initialize policy plugin
@psy-q
psy-q / leihs_empty.sql
Created February 28, 2014 09:06
Empty leihs database
-- MySQL dump 10.13 Distrib 5.5.35, for debian-linux-gnu (i686)
--
-- Host: localhost Database: leihs2_dev
-- ------------------------------------------------------
-- Server version 5.5.35-0+wheezy1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
@psy-q
psy-q / main.yml
Created April 8, 2014 15:53
Ansible: git refuses to run because it can't cd to /root
---
- name: Install packages for rbenv
apt: pkg={{ item }} state=present
with_items:
- git
- libreadline-dev
- libreadline6-dev
- libssl-dev
- libxslt1-dev
- libxml2-dev