Skip to content

Instantly share code, notes, and snippets.

Tomislav trajakovic

Block or report user

Report or block trajakovic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@trajakovic
trajakovic / compile-elixir-v1.6.3.sh
Last active Mar 10, 2018
Compile and install Erlang 20.2 from source on Ubuntu 16.04 (Xenial Xerus or Linux Mint Sylvia 18.3). Compile and install Elixir 1.6.3 on Ubuntu 16.04
View compile-elixir-v1.6.3.sh
# requirement: erlang, git
ELIXIR_VERSION="1.6.3"
sudo apt-get update && sudo apt-get install -y git && \
rm -rf /tmp/code/elixir/${ELIXIR_VERSION} && mkdir -p /tmp/code/elixir/${ELIXIR_VERSION} && cd /tmp/code/elixir/${ELIXIR_VERSION} && \
git clone -b "v${ELIXIR_VERSION}" --single-branch --depth 1 https://github.com/elixir-lang/elixir.git . && \
make clean test && \
sudo make install && \
cd && rm -rf /tmp/code/elixir && \
echo "Check your elixir version by typing 'iex --version'"
@trajakovic
trajakovic / react-native-clear-all.sh
Last active Mar 2, 2018 — forked from EQuimper/clear.txt
React-Native clear Watchman + Cache + Temp
View react-native-clear-all.sh
rm /tmp/haste-* /tmp/flow /tmp/metro-* /tmp/socketcluster/ -rf && watchman watch-del-all
yarn start -- --reset-cache
@trajakovic
trajakovic / generate_files.sh
Created Apr 20, 2017
Generate binary files with random content...and calculate their sha256
View generate_files.sh
#!/bin/bash
#size magnitude
sizes=( "" "K" "M" )
for magnitude in "${sizes[@]}"; do
for size in `seq 1 5 51`; do
echo "Generating ${size}${magnitude}"
head -c ${size}${magnitude} </dev/urandom >file-${size}${magnitude}.bin
View container-limits.sh
#!/bin/sh
# Detected container limits
# If found these are exposed as the following environment variables:
#
# - CONTAINER_MAX_MEMORY
# - CONTAINER_CORE_LIMIT
#
# This script is meant to be sourced.
@trajakovic
trajakovic / dhclient.conf
Last active Apr 7, 2017
Configuration how to /etc/resolv.conf regenerate with local DNS nameserver prepend; works on Fedora(24+) and probably on CentOS7
View dhclient.conf
# update/crete file on location /etc/dhcp/dhclient.conf
# replace 127.0.0.1 with your dns to prepend with
prepend domain-name-servers 127.0.0.1;
@trajakovic
trajakovic / docker_1.13_manual_install_centos.sh
Created Mar 28, 2017
Docker 1.13 manual installation on CentOS7 for Openshfit Origin 1.5.0.rc0 (since latest docker version is 17.03, oc cluster up is not happy with version)
View docker_1.13_manual_install_centos.sh
yum install wget
wget https://yum.dockerproject.org/repo/main/centos/7/Packages/docker-engine-1.13.1-1.el7.centos.x86_64.rpm
wget https://yum.dockerproject.org/repo/main/centos/7/Packages/docker-engine-selinux-1.13.1-1.el7.centos.noarch.rpm
#nice site with pckgs: https://pkgs.org/
#package for docker-engine-selinux
yum install -y policycoreutils-python
rpm -i docker-engine-selinux-1.13.1-1.el7.centos.noarch.rpm
@trajakovic
trajakovic / DeleteModelInBatchOnSubscribe.java
Created May 2, 2016
Android DbFlow Update/Delete/Save models in batch with RxJava - ReactiveX with DbFlow
View DeleteModelInBatchOnSubscribe.java
import android.database.Cursor;
import android.support.annotation.NonNull;
import com.raizlabs.android.dbflow.runtime.DBTransactionInfo;
import com.raizlabs.android.dbflow.runtime.TransactionManager;
import com.raizlabs.android.dbflow.runtime.transaction.BaseTransaction;
import com.raizlabs.android.dbflow.runtime.transaction.QueryTransaction;
import com.raizlabs.android.dbflow.runtime.transaction.TransactionListener;
import com.raizlabs.android.dbflow.sql.builder.ConditionQueryBuilder;
import com.raizlabs.android.dbflow.sql.language.Delete;
@trajakovic
trajakovic / create-ca-cert.sh
Created Nov 13, 2015
openssl - certificates: create ca, create cert, sign cert, pack cert to p12
View create-ca-cert.sh
#!/bin/bash
openssl genrsa -des3 -out ca.key 4096 && \
echo "CA key generated, file ca.key. Now retype password to create cert" && \
openssl req -new -x509 -days 730 -key ca.key -out ca.crt && \
echo "CA cert generated, file: ca.crt"
@trajakovic
trajakovic / git-security-fix.sh
Created Oct 26, 2015
Behind firewall: When git responds with Connection Refused, and heads start with git://
View git-security-fix.sh
git config --global url."https://".insteadOf git://
@trajakovic
trajakovic / unlimited_bash_history.sh
Created Oct 23, 2015
Fedora/unlimited_bash_history
View unlimited_bash_history.sh
#!/usr/bin/env bash
func_check_for_root() {
if [ ! $( id -u ) -eq 0 ]; then
echo "ERROR: $0 Must be run as root, Script terminating" ;exit 7
fi
}
func_check_for_root
cat <<_EOF_ | sudo tee /etc/profile.d/bash_unlimited_history.sh
You can’t perform that action at this time.