Skip to content

Instantly share code, notes, and snippets.

@glasser
glasser / stpncpy.patch
Created October 27, 2011 00:09
gettext patch 1
diff -Naurp gettext-0.18.1.1.orig/gettext-tools/configure gettext-0.18.1.1/gettext-tools/configure
--- gettext-tools/configure 2010-06-06 13:12:20.000000000 -0700
+++ gettext-tools/configure 2010-08-13 23:24:09.000000000 -0700
@@ -40606,7 +40606,9 @@ else
#include <stdlib.h>
#include <string.h> /* for strcpy */
/* The stpncpy prototype is missing in <string.h> on AIX 4. */
+#ifndef stpncpy
extern char *stpncpy (char *dest, const char *src, size_t n);
+#endif
--- gettext-tools/Makefile.in.orig 2010-06-03 16:38:55.000000000 -0500
+++ gettext-tools/Makefile.in 2010-06-04 01:16:07.000000000 -0500
@@ -1248,7 +1248,7 @@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = 1.5 gnu no-dependencies
ACLOCAL_AMFLAGS = -I m4 -I ../gettext-runtime/m4 -I ../m4 -I gnulib-m4 -I libgrep/gnulib-m4 -I libgettextpo/gnulib-m4
-SUBDIRS = doc intl gnulib-lib libgrep src libgettextpo po projects styles misc man m4 tests gnulib-tests examples
+SUBDIRS = doc intl gnulib-lib libgrep src libgettextpo po projects styles misc man m4 tests gnulib-tests
# Allow users to use "gnulib-tool --update".
@glasser
glasser / cat_test.js
Created September 19, 2012 19:37
Node 0.8 child_processes can't use /dev/stdin or /proc/self/fd/N
var spawn = require('child_process').spawn;
var cp = spawn('cat', ['/proc/self/fd/0']);
cp.stdout.setEncoding('utf8');
cp.stdout.on('data', function (chunk) {
console.log("child stdout: ", chunk);
});
cp.stderr.setEncoding('utf8');
@glasser
glasser / npm-cache-test.sh
Last active December 16, 2015 06:29
Shell script showing how the NPM cache can be corrupted
#!/bin/bash
set -eux
NPM=/usr/local/bin/npm
TESTDIR=`mktemp -d -t npm-test-XXXXXXXX`
cd $TESTDIR
echo "Deleting your local NPM cache"
@glasser
glasser / README.md
Last active December 25, 2015 01:18
Demonstrates why we need an error handler on proxySocket

To reproduce:

  • Run any websocket server. eg, 'meteor create x; cd x; meteor'. Now we have a websocket server on port 3001. (Meteor will tell you port 3000, but that's meteor's use of http-proxy; 3001 is the unproxied version.)

  • Run the above script.

  • Send lots of data through the proxy to the websocket. eg, install https://github.com/progrium/wssh and run

    yes | wssh localhost:6767/websocket

@glasser
glasser / keybase.md
Created March 26, 2014 22:13
Keybase verification

Keybase proof

I hereby claim:

  • I am glasser on github.
  • I am glasser (https://keybase.io/glasser) on keybase.
  • I have a public key whose fingerprint is 18A1 3E27 5DF9 37DA 7DA8 E9C5 B5AC B6C4 5396 057D

To claim this, I am signing this object:

@glasser
glasser / gist:98cfb41154e9a5afb0ec
Created November 4, 2014 23:45
gem install error
ubuntu@ip-10-13-187-68:~$ sudo gem install mosql
ERROR: Could not find a valid gem 'mosql' (>= 0) in any repository
ERROR: Possible alternatives: mosql
ubuntu@ip-10-13-187-68:~$ sudo gem update
Updating installed gems
Nothing to update
ubuntu@ip-10-13-187-68:~$ sudo gem install mosql
ERROR: Could not find a valid gem 'mosql' (>= 0) in any repository
ERROR: Possible alternatives: mosql
ubuntu@ip-10-13-187-68:~$ gem help
glasser@perseid 0 ~/Projects/Meteor/testing-cordova $ meteor --release 1.0 create --example localmarket
localmarket: created.
To run your new app:
cd localmarket
meteor
glasser@perseid 0 ~/Projects/Meteor/testing-cordova $ cd localmarket
glasser@perseid 0 ~/Projects/Meteor/testing-cordova/localmarket $ meteor run ios
request: updating npm dependencies -- request...
Error while running for mobile platforms: Error running /Users/glasser/.meteor/packages/meteor-tool/.1.0.35.wql4jh++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/tools/cordova-scripts/cordova.sh
@glasser
glasser / gist:114a341e9828849ffc87
Created February 6, 2015 17:32
failing self-tests
authorized: authorized - no username ...
... fail!
=> no-match at tools/tests/authorized.js:143
=> Pattern: : added test
=> Last 100 lines:
2| You must be logged in for that. Try 'meteor login'
cordova-plugins: add cordova plugins ...
... ok (134170 ms)
deploy-auth: deploy - expired credentials ...
... fail!
glasser@glasser-lyrid 0 ~/Scratch/issue-4068 $ vagrant init ubuntu/trusty64
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
glasser@glasser-lyrid 0 ~/Scratch/issue-4068 $ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'ubuntu/trusty64' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0