Skip to content

Instantly share code, notes, and snippets.

@tmiz
tmiz / build_openssl_dylib.sh
Last active November 1, 2023 13:18
Build latest OpenSSL Universal Binary on OSX
#!/bin/bash
OPENSSL_VERSION="1.0.1g"
curl -O http://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz
tar -xvzf openssl-$OPENSSL_VERSION.tar.gz
mv openssl-$OPENSSL_VERSION openssl_i386
tar -xvzf openssl-$OPENSSL_VERSION.tar.gz
mv openssl-$OPENSSL_VERSION openssl_x86_64
cd openssl_i386
@ryenus
ryenus / gist:1518596
Created December 25, 2011 01:15
Using ruby in place of grep/awk/sed like perl

With options -e, -n, -p, perl can do what grep/awk/sed can, what about ruby?

Let's take the result of ls -l as input and process it with ruby

grep with ruby

\ls -l | ruby -ne 'print if /^d/'

awk with ruby

\ls -l | ruby -ne 'puts split(/\s+/).last if /^d/'

@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@henrik
henrik / ocr.markdown
Created March 3, 2012 17:07
OCR on OS X with tesseract

Install ImageMagick for image conversion:

brew install imagemagick

Install tesseract for OCR:

brew install tesseract --all-languages

Or install without --all-languages and install them manually as needed.

@arguile-
arguile- / gist:2510227
Created April 27, 2012 15:36
Basic Curl deploy file to Nexus
#!/bin/sh
SERVER="http://localhost:8081"
URL="$SERVER/nexus/service/local/artifact/maven/content"
REPO="sandbox"
USER="admin:admin123"
group=$1
artifact=$2
@tristan-k
tristan-k / tesseract brew tar
Created July 6, 2012 15:31
tesseract brew tar
$ brew install tesseract --all-languages
Warning: Experimental support for using the "Command Line Tools" without Xcode.
Some formulae need Xcode to be installed (for the Frameworks not in the CLT.)
==> Downloading http://tesseract-ocr.googlecode.com/files/tesseract-3.01.tar.gz
Already downloaded: /Library/Caches/Homebrew/tesseract-3.01.tar.gz
==> /bin/sh autogen.sh
==> ./configure --prefix=/usr/local/Cellar/tesseract/3.01
==> make install
==> Downloading http://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.01.heb.tar.gz
######################################################################## 100,0%
@zbigniewTomczak
zbigniewTomczak / maven-archetype.list
Created December 7, 2012 19:36
Maven archetypes list (mvn archetype:generate)
Choose archetype:
1: remote -> br.gov.frameworkdemoiselle.archetypes:demoiselle-jsf-jpa (Archetype for web applications (JSF + JPA) using Demoiselle Framework)
2: remote -> br.gov.frameworkdemoiselle.archetypes:demoiselle-minimal (Basic archetype for generic applications using Demoiselle Framework)
3: remote -> co.ntier:spring-mvc-archetype (An extremely simple Spring MVC archetype, configured with NO XML.)
4: remote -> com.agilejava.docbkx:docbkx-quickstart-archetype (-)
5: remote -> com.alibaba.citrus.sample:archetype-webx-quickstart (-)
6: remote -> com.bsb.common.vaadin:com.bsb.common.vaadin.embed-simple-archetype (-)
7: remote -> com.bsb.common.vaadin:com.bsb.common.vaadin7.embed-simple-archetype (-)
8: remote -> com.cedarsoft.open.archetype:multi (-)
9: remote -> com.cedarsoft.open.archetype:simple (-)
@dviramontes
dviramontes / cors.js
Created June 19, 2013 22:13
cors.js Nicholas Zakas' helper method to help sort out the browser differences in CORS or Cross Origin Resource Sharing support.
function createCORSRequest(method, url) {
var xhr = new XMLHttpRequest();
if ("withCredentials" in xhr) {
// Check if the XMLHttpRequest object has a "withCredentials" property.
// "withCredentials" only exists on XMLHTTPRequest2 objects.
xhr.open(method, url, true);
} else if (typeof XDomainRequest != "undefined") {
@dziobas
dziobas / gist:5848891
Created June 24, 2013 09:30
Sample maven settings.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
@jwalton
jwalton / Dashing EC2.md
Last active October 10, 2019 04:47
EC2 CloudWatch stats for Dashing

Get EC2 CloudWatch stats and graph them in Dashing.