Skip to content

Instantly share code, notes, and snippets.

@elvinio
elvinio / .bashrc
Last active May 31, 2016 09:34
Bashrc
PS1='\t $PWD$ '
################## Start of alias and function helpers #####################
# Change to directory and list content
c (){
if [ $# -eq 1 ]; then
cd $1; ls -ltr;
else
cd ..; ls -ltr;
fi
@elvinio
elvinio / Check
Created May 31, 2016 02:51
Check
/proc/sys/kernel/kptr_restrict
@elvinio
elvinio / MIC
Last active April 18, 2016 16:46
MIC or Market Identifier Code from ISO10383 uniquely identifies exchanges and trading platforms. The list is from the MIC ISO page: http://www.iso15022.org/MIC/homepageMIC.htm
MIC,COUNTRY,ISO COUNTRY CODE (ISO 3166),OPERATING MIC,O/S,NAME-INSTITUTION DESCRIPTION,ACRONYM,CITY,STATUS DATE
360T,GERMANY,DE,360T,O,360T,,FRANKFURT,SEPTEMBER 2007
AATS,UNITED STATES OF AMERICA,US,AATS,O,ASSENT ATS,,JERSEY CITY,OCTOBER 2011
ACEX,INDIA,IN,ACEX,O,ACE DERIVATIVES & COMMODITY EXCHANGE LTD,,MUMBAI,APRIL 2011
AFET,THAILAND,TH,AFET,O,AGRICULTURAL FUTURES EXCHANGE OF THAILAND,,BANGKOK,JANUARY 2008
AIXE,SWITZERLAND,CH,AIXE,O,AIXECUTE,,BERNE,OCTOBER 2013
ALDP,UNITED STATES OF AMERICA,US,XNYS,S,NYSE ALTERNEXT DARK,AMEXDARK,NEW YORK,MAY 2011
ALTX,SOUTH AFRICA,ZA,XJSE,S,JSE ALTERNATE EXCHANGE,ALTX,JOHANNESBURG,APRIL 2015
ALXA,THE NETHERLANDS,NL,XAMS,S,EURONEXT - ALTERNEXT AMSTERDAM,,AMSTERDAM,MAY 2015
ALXB,BELGIUM,BE,XBRU,S,EURONEXT - ALTERNEXT BRUSSELS,,BRUSSELS,APRIL 2015
@elvinio
elvinio / FIX44
Last active April 7, 2016 14:30
FIX 4.4 tags, description and values
1|Account|String|Account mnemonic as agreed between buy and sell sides, e.g. broker and institution or investor/intermediary and fund manager.<br /><br />|Execution Report, Order Cancel Reject, New Order Single, New Order List, Order Cancel Request, Order Cancel Replace Request, Order Status Request, Quote Request, Quote, Quote Cancel, Quote Status Request, Mass Quote Acknowledgement, Mass Quote, Bid Request, Registration Instructions, Registration Instructions Response, New Order Cross, Cross Order Cancel Replace Request, New Order Multileg, Multileg Order Cancel Replace, Trade Capture Report, Order Mass Status Request, Quote Request Reject, Quote Status Report, Quote Response, Position Maintenance Request, Position Maintenance Report, Request For Positions, Request For Positions Ack, Position Report, Trade Capture Report Ack, Assignment Report, Collateral Request, Collateral Assignment, Collateral Response, Collateral Report, Collateral Inquiry, Collateral Inquiry Ack
2|AdvId|String|Unique identifier of adv
@elvinio
elvinio / latency.plt
Last active April 5, 2016 01:13
Plots timediff in nanosecond in gnuplot
set grid xtics
set grid ytics
set xtics rotate
set yrange[-96000:-122000]
set format x '%.0f'
set format y "%.f"
set xtics 60
set ytics 5000
set border 3
plot "apr/pd" using (($1/1000000000-1459440000)/60):($3/1000)
@elvinio
elvinio / recordtemp.py
Created March 28, 2016 01:52
Records the temperature readout from the hardware sensor in a linux env.
#!/usr/bin/python
import subprocess
import time
temp = [3, 8, 13, 18, 23, 28, 33, 38, 43, 51, 56, 61, 66, 71, 76, 81, 86, 91, 147, 153, 159, 165, 171, 240, 246, 252, 258, 264]
f = open('temp', 'w')
while True:
output = subprocess.check_output(["sensors", "-u"])
lines = output.split("\n")
@elvinio
elvinio / pulse.cpp
Created March 22, 2016 06:49
UDP Time pulse receiver. gcc -std=c++11 pulse.cpp -o pulse
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <string.h>
void die(char *s)
{
@elvinio
elvinio / UDP_Time_Pulsor.cpp
Last active March 22, 2016 06:49
gcc -std=c++11 pulse.cpp -o pulse.
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <string.h>
void die(char *s)
{
#include <iostream>
using namespace std;
int main() {
int **seq;
int N, Q;
cin >> N;
cin >> Q;
//cout << N << " " << Q;
@elvinio
elvinio / clock_gettime.py
Created March 14, 2016 10:05
Return clock_gettime in python by invoking librt system call
#!/usr/bin/python
import ctypes, os
class timespec(ctypes.Structure):
_fields_ = [
('tv_sec', ctypes.c_long),
('tv_nsec', ctypes.c_long)
]
librt = ctypes.CDLL('librt.so.1', use_errno=True)