Skip to content

Instantly share code, notes, and snippets.

View kolosek's full-sized avatar

Nebojsa Zoric kolosek

View GitHub Profile
echo "Requires JAVA installation"
read
sudo apt-get purge elasticsearch
sudo su -c "echo 'deb https://artifacts.elastic.co/packages/6.x/apt stable main'>> /etc/apt/sources.list.d/elastic-6.x.list"
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
sudo apt-get update
sudo apt-get install elasticsearch
sudo systemctl enable elasticsearch.service
sudo systemctl start elasticsearch.service
# Programming Principles
Every programmer benefits from understanding programming principles and patterns. This overview is a reference for myself, and I've just put it here. Maybe it is of help to you during design, discussion, or review. Please note that it's far from complete, and that you often need to make trade-offs between conflicting principles.
The list was inspired by [The Principles of Good Programming](http://www.artima.com/weblogs/viewpost.jsp?thread=331531). I felt that the list closely, but not completely matches what I would personally put into something similar. Additionally, I wanted a bit more reasoning, details, and links to further resources. [Let me know](https://github.com/webpro/programming-principles/issues) if you have any feedback or suggestions for improvement.
## Contents
### Generic
@kolosek
kolosek / image-optimizer.py
Created November 29, 2018 09:52
Image optimizer (helper script for simplifying usage of ImageMagic)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
def optimize_file(file_path):
_, ext = os.path.splitext(file_path)
if ext == '.png':
@kolosek
kolosek / open-source-projects
Last active November 29, 2018 10:50
Interesting open source projects
### A tiny drop-in REST API to send emails
https://github.com/dthree/mailit
## Sceleton for new Rails app
https://github.com/thoughtbot/suspenders
## How to do refactoring
https://github.com/shakacode/fat-code-refactoring-techniques
## Codility
@kolosek
kolosek / private_fork.md
Created November 24, 2018 15:30 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@kolosek
kolosek / ubuntu-1804-basic-rails.sh
Last active January 15, 2022 18:37
Basic installation of rails under ubuntu 18.04
#!/bin/bash
echo 'This script will set up your Ubuntu 18.04 for Rails development.'
echo 'Make sure you run our Basic Library installation at https://gist.github.com/kolosek/6ee0a6f9ffe374e7a1d6ff04143cd203'
echo 'Press ENTER to continue with installation, press ^C to cancel.'
# libssl1.0-dev
read
# Install RVM
echo "------Installing rvm------"
sudo apt install -y curl gnupg2
@kolosek
kolosek / gitlab-runner.sh
Last active January 25, 2022 21:48
Install docker and runner on bare bone Linux 18.04.1 machine
#chmod +x gitlab-runners.sh
#Set memory allocation for each runner.
sudo sysctl -w vm.max_map_count=262144
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
sudo apt update
sudo apt install docker-ce
#!/bin/bash
echo 'This script will set up your Ubuntu 18.04 for Rails development.'
echo 'Press ENTER to continue with installation, press ^C to cancel.'
read
# Install required software
echo "------Installing requirements------"
sudo apt install -y curl git-core gdebi-core gdebi rar unrar gnupg2 vim
@kolosek
kolosek / gitlabci-cleanup.sh
Created September 14, 2018 08:55
Cleanup old builds of gitlab
#!/bin/bash
# cleanup_gitlab_builds: to remove old gitlab builds
WORK_DIR=/home/gitlab-runner/builds
LAST_MODIFY_DAYS=30 # no of days the directory was modified
dir_array=()
space_cleared=0
skipped_dirs=()
QUIET=1
#!/bin/bash
echo "Installing git"
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git -y
echo "Installing ubuntu basic software"
git clone https://gist.github.com/579167be758a9bc340e10ac7e7b1f644.git ubuntu-basic-software
cd ubuntu-basic-software