Skip to content

Instantly share code, notes, and snippets.

@parzonka
parzonka / _services.txt
Last active September 21, 2016 19:22
yoctoservices, ..., microservices, ..., yottaservices. Seen at https://news.ycombinator.com/item?id=9859544
Prefix Symbol Size Example
yocto y 1 bit Theoretical minimum
zepto z 1 byte (close enough to 10 bits) Really small APL program
atto a 10 chars nc -l 8080
femto f 1 line (roughly 100 chars) netcat piped into something else
pico p 10 lines tiny python service
nano n 100 lines small python service
micro μ 1000 lines typical "smallish" service
milli m 10,000 lines about as big as "microservices" would go these days, or a small monolithic app
centi c 100,000 lines decent-sized monolithic app
@parzonka
parzonka / jdk-mvn-ubuntu.sh
Last active December 20, 2016 17:39
install jdk and maven for ubuntu
#!/bin/bash
# jdk
sudo su root
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u73-b02/jdk-8u73-linux-x64.tar.gz
tar -zxf jdk-8u73-linux-x64.tar.gz -C /opt
update-alternatives --install /usr/bin/java java /opt/jdk1.8.0_73/bin/java 100
echo 'export JAVA_HOME=/opt/jdk1.8.0_73' >> /home/ubuntu/.bash_profile
rm jdk-8u73-linux-x64.tar.gz
@parzonka
parzonka / DistributionTest.java
Last active July 27, 2016 18:38 — forked from MikhailGolubtsov/DistributionTest
Hazelcast map-reduce example - counting distribution
import com.hazelcast.core.Hazelcast;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.IMap;
import com.hazelcast.mapreduce.Combiner;
import com.hazelcast.mapreduce.CombinerFactory;
import com.hazelcast.mapreduce.Context;
import com.hazelcast.mapreduce.Job;
import com.hazelcast.mapreduce.JobCompletableFuture;
import com.hazelcast.mapreduce.JobTracker;
import com.hazelcast.mapreduce.KeyValueSource;
@parzonka
parzonka / install_oracle_jdk_on_ubuntu.sh
Last active October 8, 2017 22:10
Install Oracle JDK on Ubuntu
#!/bin/bash
JDK_UPDATE_VERSION=144
JDK_BUILD_VERSION=b01
JDK_HASH=090f390dda5b47b9b721c7dfaa008135
echo "installing Oracle jdk1.8.0_${JDK_UPDATE_VERSION}..."
wget -N --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u$JDK_UPDATE_VERSION-$JDK_BUILD_VERSION/$JDK_HASH/jdk-8u$JDK_UPDATE_VERSION-linux-x64.tar.gz
sudo mkdir -p /opt/jdk
sudo tar -zxf jdk-8u${JDK_UPDATE_VERSION}-linux-x64.tar.gz -C /opt/jdk
sudo update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_${JDK_UPDATE_VERSION}/bin/java 100
@parzonka
parzonka / ec2.ini
Last active April 10, 2019 19:32
Configuration for ansibles dynamic ec2 inventory. Forked from https://github.com/ansible/ansible/tree/devel/contrib/inventory/ec2.ini and configured for eu-central-1 and performance.
# Ansible EC2 external inventory script settings
#
[ec2]
# to talk to a private eucalyptus instance uncomment these lines
# and edit edit eucalyptus_host to be the host name of your cloud controller
#eucalyptus = True
#eucalyptus_host = clc.cloud.domain.org
@parzonka
parzonka / substitute_strings_in_files_recursively.sh
Created February 26, 2016 23:41
find . -type f -name "*.*" -print0 | LC_ALL=en_US.CP437 xargs -0 sed -i '' -e 's/{{{name}}}/bar/g'
# substitute the string '{{{name}}}' with 'johndoe' in all files (including hidden ones) recursively and in-place
# tested on OSX, it does not creates any strange files based on .DS_STORE
find . -type f -name "*.*" -print0 | LC_ALL=en_US.CP437 xargs -0 sed -i '' -e 's/{{{name}}}/johndoe/g'
@parzonka
parzonka / install-gradle-centos.sh
Last active July 4, 2024 05:28
Install gradle on redhat/centos linux
# installs to /opt/gradle
# existing versions are not overwritten/deleted
# seamless upgrades/downgrades
# $GRADLE_HOME points to latest *installed* (not released)
gradle_version=2.9
wget -N https://services.gradle.org/distributions/gradle-${gradle_version}-all.zip
sudo unzip -foq gradle-${gradle_version}-all.zip -d /opt/gradle
sudo ln -sfn gradle-${gradle_version} /opt/gradle/latest
sudo printf "export GRADLE_HOME=/opt/gradle/latest\nexport PATH=\$PATH:\$GRADLE_HOME/bin" > /etc/profile.d/gradle.sh
. /etc/profile.d/gradle.sh
cscript /nologo wget.js http://example.com
@parzonka
parzonka / sysinfo.sh
Created February 23, 2014 14:47
Get linux system info and version
# architecture #
lscpu
# release #
# RHEL, CentOS
cat /etc/redhat-release
# Ubuntu
cat /etc/issue
lsb_release -a
@parzonka
parzonka / rpm-spec-reference.sh
Created February 14, 2014 14:15
rpm quick reference / cheat sheet
# do not rely on specific architecture
BuildArch: noarch
# suppress automatic detection of requirements
AutoReqProv: no