Skip to content

Instantly share code, notes, and snippets.

View coldnew's full-sized avatar
💭
I may be slow to respond.

Yen-Chin,Lee coldnew

💭
I may be slow to respond.
View GitHub Profile
@coldnew
coldnew / jetty-clojure.md
Created November 2, 2016 06:44 — forked from karanth/jetty-clojure.md
Notes on installing SSL certificates in jetty - clojure + ring

SSL is an important security and privacy feature for all websites. Its details are outlined in this wikipedia [article] ("http://en.wikipedia.org/wiki/Secure_Sockets_Layer"). At Scibler, we use SSL certificates, encrypting all traffic to and fro from our servers. SSL is a public-key based asymmetric encryption scheme for symmetric key exchange. Symmetric keys are used for payload encryption. On our servers, we use embedded jetty (ring jetty adapter), with the clojure [ring] (https://github.com/ring-clojure) library to handle the http specific functionality.

This is a tutorial about installing SSL certificates on jetty webservers. SSL certificates are X.509 certificates that can be self-signed (authorized by Scibler) or can be signed by trusted third-parties. Trusted third-party certificates are the ones that a Internet user and browsers trust the most. Trusted third-party certification authorities issue certificates per domain and charge a nominal yearly fee.

####Pre-Requisites

  • The Java JDK has to be
@coldnew
coldnew / certificate.sh
Created October 31, 2016 08:18 — forked from WebReflection/certificate.sh
A basic Self Signed SSL Certificate utility
#!/usr/bin/env bash
# A basic Self Signed SSL Certificate utility
# by Andrea Giammarchi @WebReflection
# https://www.webreflection.co.uk/blog/2015/08/08/bringing-ssl-to-your-private-network
# # to make it executable and use it
# $ chmod +x certificate
# $ ./certificate # to read the how-to
@coldnew
coldnew / install-cockpit.md
Last active October 17, 2016 05:12 — forked from baydam/install-cockpit.md
How to install cockpit on Debian/Ubuntu

How to install cockpit on Debian/Ubuntu

$ git clone https://github.com/cockpit-project/cockpit.git
$ cd cockpit

Install latest nodejs

$ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
$ sudo apt-get install -y nodejs
#include <stdio.h>
int main()
{
int a = 42;
printf("%d\n", a);
return 0;
}
int main()
{
int a = 42;
printf("%d\n", a);
}
@coldnew
coldnew / bl.asm
Last active July 8, 2016 03:01
2016 embedded note: ARM BL example
...
BL calc ; Jump to calc
... ; Execute here after return
...
calc: ; function body
ADD r0, r1, r2 ; do some calculate here
MOV pc, r14 ; PC = R14 to return
@coldnew
coldnew / curveball.markdown
Created May 15, 2016 14:47 — forked from daveliepmann/curveball.markdown
Implementing Sugar & James’ paper, "Finding the number of clusters in a data set: An information theoretic approach" in Clojure — Part 3

Implementing the k-means jump method: Part Three

After implementing Sugar & James jump method and applying it straightforwardly to a few data sets, we're ready to throw it a few curveballs. This will demonstrate both its robustness and some necessary aspects of setting it up for success.

Again we need some functions we built in part one and part two. Feel free to skip this part if you don't need the review and you're not following along with a REPL. If you are following along in the REPL, here's the full Clojure source.

(def iris (i/to-matrix (incd/get-dataset :iris)))
@coldnew
coldnew / testprogram.c
Created May 9, 2016 05:08 — forked from je-so/testprogram.c
Xlib transparent window with OpenGL support
/*
____ _____
/\__ \ /\ ___\
\/__/\ \ \ \ \__/_
\ \ \ \ \____ \
_\_\ \ \/__/_\ \
/\ _____\ /\ _____\
\/______/ \/______/
Copyright (C) 2011 Joerg Seebohn
@coldnew
coldnew / application.markdown
Created May 8, 2016 07:48 — forked from daveliepmann/application.markdown
Implementing Sugar & James’ paper, "Finding the number of clusters in a data set: An information theoretic approach" in Clojure — Part 2

Implementing the k-means jump method: Part Two

After implementing Sugar & James' jump method and exploring its application to Fisher's iris data in Part One of this series, we're now ready to apply the jumps-in-distortions test to some other sample data sets. Pure Clojure source here.

Remember these functions from earlier? We'll be using them again.

(defn assoc-distortions
  "Given a number `transformation-power-y` and a seq of maps