Skip to content

Instantly share code, notes, and snippets.

View lihonosov's full-sized avatar
Talk is cheap. Show me the code © Linus Torvalds

Oleksandr Lykhonosov lihonosov

Talk is cheap. Show me the code © Linus Torvalds
  • The Future
View GitHub Profile
@lihonosov
lihonosov / System Design.md
Created December 7, 2018 21:52 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@lihonosov
lihonosov / RemoteIteratorWrapper.scala
Created June 27, 2018 16:48 — forked from timvw/RemoteIteratorWrapper.scala
scala wrapper for hadoop remote iterator
case class RemoteIteratorWrapper[T](underlying: org.apache.hadoop.fs.RemoteIterator[T]) extends scala.collection.AbstractIterator[T] with scala.collection.Iterator[T] {
def hasNext = underlying.hasNext
def next() = underlying.next()
}
object Conversions {
implicit def remoteIterator2ScalaIterator[T](underlying: org.apache.hadoop.fs.RemoteIterator[T]) : scala.collection.Iterator[T] = RemoteIteratorWrapper[T](underlying)
}
@lihonosov
lihonosov / ApacheHadoop_NativeLibs.adoc
Last active June 8, 2018 22:39 — forked from zedar/ApacheHadoop_NativeLibs.adoc
Add native libraries to Apache Hadoop installation

Apache Hadoop - add native libraries

If native libraries are not available the following message is displayed with every hadoop command: hadoop checknative

WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
  • Clone hadoop source code


@lihonosov
lihonosov / The Technical Interview Cheat Sheet.md
Created August 12, 2016 17:57 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@lihonosov
lihonosov / latency.txt
Created August 7, 2016 15:55 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
#!/usr/bin/env ruby -w
# simple script to count row changes in a svn repo
def status dir=''
files = []
svn = `svn status #{dir}`
svn.split("\n").each do |line|
next if line =~ /^[^A-Z]/
line =~ /^[A-Z]\s+.*\s+(.+)$/
@lihonosov
lihonosov / .credentials
Created May 6, 2016 16:17 — forked from vrischmann/.credentials
Running SBT with a Nexus proxy with authentication
realm=Sonatype Nexus Repository Manager
host=nexus.company.com
user=admin
password=admin123
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA:DHE-RSA-CAMELLIA256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA:DHE-RSA-CAMELLIA128-SHA:DES-CBC3-SHA';
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:50m;
ssl_dhparam /etc/nginx/ssl/dh4096.pem;
ssl_stapling on;
ssl_stapling_verify on;
ssl_ecdh_curve secp384r1;
@lihonosov
lihonosov / oh_my_zsh
Created August 27, 2015 14:05
oh my zsh
theme crunch
@lihonosov
lihonosov / export_path.sh
Created August 16, 2015 19:14
linux_export_path
export ANT_HOME=/opt/ant
export M2_HOME=/opt/maven
export JAVA_HOME=/opt/java
export GRADLE_HOME=/opt/gradle
export PLAY_HOME=/opt/play
export SBT_HOME=/opt/sbt
export SCALA_HOME=/opt/scala
export PATH=$PATH:$ANT_HOME/bin:$M2_HOME/bin:$JAVA_HOME/bin:$GRADLE_HOME/bin:$PLAY_HOME:$SBT_HOME/bin:$SCALA_HOME/bin