Skip to content

Instantly share code, notes, and snippets.

@anask
anask / neo4j-snomed.sh
Created March 6, 2018 07:21
Sample script to install and run Neo4j on Linux for use with snomed-database-loader/NEO4J.
#!/bin/bash
#
# Script to install and run Neo4j on Linux.
# ./neo4j-snomed.sh
#
#
NEO4J_VER=3.3.3
echo "WARN: USING NEO4J VERSION $NEO4J_VER"
echo "WARN: USING THE DIRECTORY /dev FOR STORAGE. REPLACE IF NECESSARY."
@anask
anask / simple.py
Created November 30, 2017 18:11
A bare minimum python script.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Usage: ./simple.py arg1 arg2
# Note: to make this script executable: sudo chmod +x simple.py
# Indent: two spaces.
import sys
import time
@anask
anask / script.sh
Last active October 4, 2017 16:05
Bash script template with command line arguments parsing.
#!/bin/bash
#==============================================================================
#
# FILE: script.sh
#
# USAGE: ./script.sh -a <arg1> [-b <arg2>]
#
# DESCRIPTION: This is a bash script template that takes one required
# argument and one optional argument.
#
@anask
anask / input.txt
Created August 23, 2017 18:45
Sample input file
one
two two
three three three
four four four four
five five five five five
six six six six six six
seven seven seven seven seven seven seven
eight eight eight eight eight eight eight eight
nine nine nine nine nine nine nine nine nine
ten ten ten ten ten ten ten ten ten ten
@anask
anask / Main.java
Created August 23, 2017 18:43
Spark Java WordCount Example
// Ref: https://github.com/databricks/learning-spark/blob/master/mini-complete-example/src/main/java/com/oreilly/learningsparkexamples/mini/java/WordCount.java
// Edited by: Anas Katib
// Last updated: Aug. 23, 2017
package com.company.anask;
import org.apache.log4j.Logger;
import org.apache.log4j.Level;
import org.apache.spark.SparkConf;
@anask
anask / script-sample.py
Last active May 23, 2017 16:38
Python template script with a command line argument parser.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Anas Katib
# May 19, 2017
#
# Usage: ./script-sample.py -h
import argparse
import sys