Skip to content

Instantly share code, notes, and snippets.

@zouzias
zouzias / introrx.md
Created September 28, 2015 19:08 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@zouzias
zouzias / nagios-ubuntu.txt
Created September 24, 2015 15:16
Setup Nagios Ubuntu Tomcat Jmeter
1 ) Install nagios on Ubuntu using the following guide.
https://help.ubuntu.com/lts/serverguide/nagios.html
2) Install the Jmeter and Tomcat Plugin from nagios exchange.
http://exchange.nagios.org/directory/Plugins/Java-Applications-and-Servers/Apache-Tomcat/check_tomcat-2Epl/details
@zouzias
zouzias / Remove all git tags
Last active September 8, 2015 10:27 — forked from okunishinishi/Remove all git tags
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
@zouzias
zouzias / csvToHive.txt
Last active September 14, 2015 08:51
Import CSV data into Hive
# 1) Copy namefile.csv into HDFS
hadoop fs -put /path/on/localsystem /path/to/hdfs
# Start Hive shell . Just type hive
hive
# in your shell
# 2) Create table and show it.
create table example1(name String, address String, price int) row format delimited fields terminated by ',' ESCAPED BY '\\' stored as textfile;
@zouzias
zouzias / checkMD5Dir.sh
Created July 7, 2015 08:02
MD5: Check md5 of all files from a directory
#!/bin/bash
# Check md5 from all files in a dir. It assumes that for each file "filename.txt" there exists a "filename.txt.md5" corresponding file
FILES=`ls *`
for f in $FILES
do
# echo "Processing $f"
MD5=`md5 $f`
TRUE_MD5=`cat $f.md5`
# Recipe for scala-2.10.0-RC5
require 'formula'
class ScalaCompletion < Formula
homepage 'http://www.scala-lang.org/'
url 'https://raw.github.com/scala/scala-dist/27bc0c25145a83691e3678c7dda602e765e13413/completion.d/2.9.1/scala'
version '2.9.1'
sha1 'e2fd99fe31a9fb687a2deaf049265c605692c997'
@zouzias
zouzias / dblp_parser.rb
Created June 11, 2015 04:56
Iterate over DBLP database
#!/usr/bin/env ruby
require 'nokogiri'
require './xml_parser.rb'
file="dblp.xml"
Xml::Parser.new(Nokogiri::XML::Reader(open(file))) do
inside_element 'article' do
for_element 'author' do puts "Author: #{inner_xml}" end
# Generic Aliases
alias ll='ls -latr' # List all file in long list format by modification time
alias ..='cd ..' # Go up one directory
alias ...='cd ../..' # Go up two directories
alias ....='cd ../../..' # Go up three directories
alias -- -='cd -' # Go back
alias c='clear' # Clear Screen
alias k='clear' # Clear Screen
alias cls='clear' # Clear Screen
alias _="sudo" # Execute with sudo
@zouzias
zouzias / hdfs
Created May 13, 2015 11:45
HDFS useful commands
# Summary of HDFS filesystem
sudo su hdfs -c "hdfs dfsadmin -report"
# Check the HDFS filesystem (detail block file)
sudo su hdfs -c "hdfs fsck / -files -blocks"
@zouzias
zouzias / client_guide
Created February 18, 2015 15:21
Install nagios on CentOS client
> wget dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
> rpm -ivh epel-release-6-8.noarch.rpm
> yum install nrpe nagios-plugins-all openssl
Then go to '/etc/nagios/nrpe.cfg '
and update the
allowed_hosts=nagios.change_me.com