Skip to content

Instantly share code, notes, and snippets.

View tingley's full-sized avatar

Chase Tingley tingley

View GitHub Profile
@tingley
tingley / evernote.xsl
Created August 28, 2017 19:08
Parameterized XSLT to add a <tag> to every note in an exported Evernote .enex file
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" cdata-section-elements="content"/>
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="note">
<xsl:copy>
@tingley
tingley / evernote.xsl
Created August 28, 2017 19:08
Parameterized XSLT to add a <tag> to every note in an exported Evernote .enex file
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" cdata-section-elements="content"/>
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="note">
<xsl:copy>
@tingley
tingley / README.md
Created April 4, 2017 22:03 — forked from ceejbot/README.md
How I set up a mastodon instance on AWS with ansible on ubuntu trusty
  1. Register a domain name. Buy a cert for it.
  2. Spin up Ubuntu Trusty 14.04 on AWS & point DNS at the instance. Don't bother making user accounts or anything; only somebody with your key should be able to ssh in. Add security group rules allowing https from anywhere, or maybe http if you want to redirect.
  3. Make an EBS volume or raid up some instance stores and mount them on /mnt/mastodon, owned by ubuntu.
  4. Download all the files in this gist to your local controlling host, e.g., your laptop.
  5. Make a file named inventory with [general]\nyour-host.tld in it.
  6. Put all of the *.conf files in this gist into a subdirectory named files.
  7. Put your certs somewhere in the directory & make sure the ansible playbook services.yml is pointing to them.
  8. Run ansible-playbook -i inventory host-setup.yml
  9. Run ansible-playbook -i inventory mastodon.yml
  10. you might get ruby 2.3.3 instead of 2.3.1 in which case you should just edit the Gemfile.
@tingley
tingley / longhorn.py
Created March 7, 2017 20:09
Calling longhorn API from python
import requests
url = 'http://localhost:8080/okapi-longhorn/'
response = requests.post(url+'projects/new')
# create a new project
response = requests.get(url+'projects/')
# push a file
payload = "hello world!"
headers = {'accept-encoding': 'multipart/form-data', 'content-type': 'text/html'}
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.spartansoftwareinc.samples</groupId>
<artifactId>sample-wssdk-client-component</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Sample WorldServer Web Services Component</name>
@tingley
tingley / wssdk-pom.xml
Last active August 29, 2015 13:58
Sample pom.xml for a custom WorldServer SDK component
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.spartansoftwareinc.samples</groupId>
<artifactId>sample-wssdk-component</artifactId>
<name>Sample WorldServer component</name>
<url>http://maven.apache.org</url>
@tingley
tingley / gist:7227570
Created October 30, 2013 05:20
Testcase for SuperTMXMerge Issue 1
<?xml version="1.0" ?>
<!DOCTYPE tmx SYSTEM "tmx14.dtd">
<tmx version="1.4">
<header
creationtool="Sdl.SDLX .Net API"
creationtoolversion="9.3.3002.0"
datatype="unknown"
segtype="sentence"
adminlang="en"
srclang="en"
@tingley
tingley / jstack.scala
Created October 16, 2013 21:02
Scala script to parse and analyze large numbers of jstack dumps in order to create an extremely basic profiler. This is currently set up to be used with GlobalSight, but it could be adapted for other uses as well.
import java.io.File
import scala.collection.mutable
// A tool to digest and visualize jstack traces, written poorly in scala.
// Usage
// scala jstack.scala -t [regex] [files]
// where
// [regex] is a regular expression applied to thread names in the jstack
// dumps. Matching threads will be processed. The -t option
@tingley
tingley / build_fat.sh
Created April 3, 2012 18:09
Modified script to x-compile tesseract-3.0.1 for iOS-5.1 from Xcode 4.3
#!/bin/sh
# build_fat.sh
#
# Created by Robert Carlsen on 15.07.2009. Updated 24.9.2010
# build an arm / i386 lib of standard linux project
#
# initially configured for tesseract-ocr v2.0.4
# updated for tesseract prerelease v3
outdir=outdir