Skip to content

Instantly share code, notes, and snippets.

@korczis
korczis / README.md
Last active Aug 29, 2015
Prepare ubuntu based box for http://github.com/korczis/apollon instalation
View README.md

Apollon Bootstrap Script

Prerequisites

  • bash
  • curl

Getting started

curl

View _README.md

csv2psql CLI examples

Enjoy them

List

  • Census 2010 as table
  • Census 2010 as SQL
  • CIA Factbook as table
  • CIA Factbook as SQL
View cia-all-table.txt
time ./bin/csv2psql analyze --format=table data/cia-data-all.csv
+------------------------------------------------------------------+--------+-----------+---------+------+--------+------+
| data/cia-data-all.csv |
+------------------------------------------------------------------+--------+-----------+---------+------+--------+------+
| column | Bigint | Character | Decimal | Null | String | Uuid |
+------------------------------------------------------------------+--------+-----------+---------+------+--------+------+
| id | 0 | 0 | 0 | 0 | 261 | 0 |
| Labor force | 222 | 0 | 0 | 39 | 222 | 0 |
| Labor force details | 66 | 0 | 0
@korczis
korczis / boost_spritit_csv_parser.cpp
Created Sep 1, 2014
How to parse CVS using C++ boost::spirit
View boost_spritit_csv_parser.cpp
// See http://stackoverflow.com/questions/18365463/how-to-parse-csv-using-boostspirit
#include <boost/tokenizer.hpp>
#include <boost/spirit/include/qi.hpp>
namespace qi = boost::spirit::qi;
int main() {
const std::string s = R"(1997,Ford,E350,"ac, abs, moon",""rusty"",3000.00)";
View dvorak-vyherci.json
[
{
"text": "Pavla Lopatková"
},
{
"text": "John Yungclas"
},
{
"text": "Alena Vlnasová"
},
@korczis
korczis / HOWTO.md
Last active Aug 29, 2015
PostGIS Cheat Sheet
View HOWTO.md

How To

Enable PostGIS Extensions

For more information se official postgis site

-- Enable PostGIS (includes raster)
CREATE EXTENSION postgis;
View Makefile
# Hey Emacs, this is a -*- makefile -*-
#----------------------------------------------------------------------------
# WinAVR Makefile Template written by Eric B. Weddington, Jˆrg Wunsch, et al.
#
# Released to the Public Domain
#
# Additional material for this makefile was written by:
# Peter Fleury
# Tim Henigan
# Colin O'Flynn
View rake-notes.txt
tomaskorcak@kx-mac gooddata-ruby (rest-merge) $ rake notes
lib/gooddata/cli/commands/process_cmd.rb:
* [ 81] [TODO] Add params. HOW?
lib/gooddata/cli/commands/project_cmd.rb:
* [ 23] [TODO] Move away the ask methods. Provide params
lib/gooddata/commands/datasets.rb:
* [ 22] [TODO] Review following connect replacement/reimplementation
* [ 65] [TODO] Review following connect replacement/reimplementation
View icmp_client_output.txt
tomaskorcak@kx-mac ~ $ sudo tcpdump -nettti en3 -v icmp
tcpdump: listening on en3, link-type EN10MB (Ethernet), capture size 65535 bytes
00:00:00.000000 ac:7f:3e:e5:de:65 > 44:32:c8:cb:af:4f, ethertype IPv4 (0x0800), length 190: (tos 0x0, ttl 255, id 42817, offset 0, flags [none], proto ICMP (1), length 48)
10.0.0.17 > 91.213.160.118: ICMP echo request, id 55724, seq 61754, length 28
00:00:00.183324 44:32:c8:cb:af:4f > ac:7f:3e:e5:de:65, ethertype IPv4 (0x0800), length 64: (tos 0x20, ttl 49, id 56301, offset 0, flags [none], proto ICMP (1), length 48)
91.213.160.118 > 10.0.0.17: ICMP echo reply, id 55724, seq 61754, length 28
00:00:01.817743 ac:7f:3e:e5:de:65 > 44:32:c8:cb:af:4f, ethertype IPv4 (0x0800), length 190: (tos 0x0, ttl 255, id 42817, offset 0, flags [none], proto ICMP (1), length 48)
10.0.0.17 > 91.213.160.118: ICMP echo request, id 55724, seq 61754, length 28
00:00:00.183441 44:32:c8:cb:af:4f > ac:7f:3e:e5:de:65, ethertype IPv4 (0x0800), length 64: (tos 0x20, ttl 49, id 56302, offset 0
@korczis
korczis / raw-udp.c
Created Aug 3, 2014
Raw socket udp client
View raw-udp.c
//
// main.cpp
// microping
//
// Created by Tomas Korcak on 8/2/14.
// Copyright (c) 2014 Tomas Korcak. All rights reserved.
//
#include <iostream>
#include <unistd.h>