Skip to content

Instantly share code, notes, and snippets.

@tmiz
tmiz / build_openssl_dylib.sh
Last active Apr 12, 2021
Build latest OpenSSL Universal Binary on OSX
View build_openssl_dylib.sh
#!/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 Dec 25, 2011
Using ruby in place of grep/awk/sed like perl
View gist:1518596

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 Feb 22, 2012
Keeping a fork up to date
View gist:1885435

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 Mar 3, 2012
OCR on OS X with tesseract
View ocr.markdown

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 Apr 27, 2012
Basic Curl deploy file to Nexus
View gist:2510227
#!/bin/sh
SERVER="http://localhost:8081"
URL="$SERVER/nexus/service/local/artifact/maven/content"
REPO="sandbox"
USER="admin:admin123"
group=$1
artifact=$2
View 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 Dec 7, 2012
Maven archetypes list (mvn archetype:generate)
View maven-archetype.list
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 Jun 19, 2013
cors.js Nicholas Zakas' helper method to help sort out the browser differences in CORS or Cross Origin Resource Sharing support.
View cors.js
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 Jun 24, 2013
Sample maven settings.xml
View gist:5848891
<?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 Oct 10, 2019
EC2 CloudWatch stats for Dashing
View Dashing EC2.md

Get EC2 CloudWatch stats and graph them in Dashing.