Skip to content

Instantly share code, notes, and snippets.

View petrosp's full-sized avatar

Petros petrosp

  • AMS-IX
  • Amsterdam
View GitHub Profile
@petrosp
petrosp / nexus3-rm.json
Created November 8, 2022 19:18
API Specs
{
"swagger" : "2.0",
"info" : {
"version" : "3.42.0-01",
"title" : "Nexus Repository Manager REST API"
},
"basePath" : "/service/rest/",
"tags" : [ {
"name" : "Security Management: Anonymous Access"
}, {
@petrosp
petrosp / Dockerfile
Created March 1, 2022 23:29 — forked from uyorum/Dockerfile
Dockerfile for ruby-centos7
FROM centos:7 as builder
RUN yum install -y git make gcc bzip2 openssl-devel libyaml-devel libffi-devel readline-devel zlib-devel gdbm-devel ncurses-devel && \
git clone https://github.com/rbenv/ruby-build.git && \
PREFIX=/usr/local ./ruby-build/install.sh
ARG RUBY_VERSION
ENV RUBY_VERSION=${RUBY_VERSION:-2.7.3}
ENV RUBY_DIR=/usr/local/ruby-${RUBY_VERSION}
RUN /usr/local/bin/ruby-build ${RUBY_VERSION} ${RUBY_DIR}
@petrosp
petrosp / nexus3.sh
Created February 8, 2022 19:38 — forked from aelkz/nexus3.sh
Nexus3 Openshift Configuration
#!/bin/bash
#
# Configure Nexus3 after installation
#
# Call this script with parameters:
# $1: Nexus UserID
# $2: Nexus Password
# $3: Nexus URL
#
@petrosp
petrosp / tmux.conf
Created March 3, 2021 22:20 — forked from chentex/tmux.conf
The best and greatest tmux.conf ever
0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@petrosp
petrosp / tmux.conf
Created March 3, 2021 22:15 — forked from jonasmac16/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@petrosp
petrosp / 1. ELK.install
Created October 18, 2018 22:46 — forked from PavloBezpalov/1. ELK.install
ELK Stack with Rails (Elasticsearch, Logstash, Kibana) on Ubuntu VPS
INSTALL JAVA
$ sudo apt-get update && sudo apt-get install default-jre
INSTALL ELASTIC SEARCH https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html
$ wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
$ echo "deb https://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list
$ sudo apt-get update && sudo apt-get install elasticsearch
$ sudo update-rc.d elasticsearch defaults 95 10
$ sudo service elasticsearch restart
$ sudo service elasticsearch status
@petrosp
petrosp / rich_domain_models2.md
Created January 31, 2018 21:58 — forked from Fitzsimmons/rich_domain_models2.md
Building Rich Domain Models in Rails (revision 2)

Building Rich Domain Models in Rails

Part 1. Decoupling Persistence

Abstract

Domain model is an effective tool for software development. It can be used to express really complex business logic, and to verify and validate the understanding of the domain among stakeholders. Building rich domain models in Rails is hard. Primarily, because of Active Record, which doesn't play well with the domain model approach.

One way to deal with this problem is to use an ORM implementing the data mapper pattern. Unfortunately, there is no production ready ORM doing that for Ruby. DataMapper 2 is going to be the first one.

Another way is to use Active Record just as a persistence mechanism and build a rich domain model on top of it. That's what I'm going to talk about here.

@petrosp
petrosp / Vagrantfile
Created June 10, 2017 11:10 — forked from prashcr/Vagrantfile
Node.js starter kit for Ubuntu 14.04 Vagrant box on DigitalOcean
Vagrant.configure('2') do |config|
config.vm.hostname = 'vagrant-example'
config.vm.provider :digital_ocean do |provider, override|
override.ssh.username = 'vagrant'
override.ssh.private_key_path = '~/.ssh/id_rsa'
override.vm.box = 'digital_ocean'
override.vm.box_url = "https://github.com/smdahlen/vagrant-digitalocean/raw/master/box/digital_ocean.box"
provider.token = ENV['DIGITAL_OCEAN_TOKEN']
@petrosp
petrosp / deploy.rb
Created January 29, 2017 17:18 — forked from yanyingwang/deploy.rb
mina+puma+nginx
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
# require 'mina/rbenv' # for rbenv support. (http://rbenv.org)
require 'mina/rvm' # for rvm support. (http://rvm.io)
require 'mina/puma'
require 'mina/nginx'
# Basic settings:
@petrosp
petrosp / dump_fixtures.rake
Last active November 24, 2016 19:55 — forked from dimidd/dump_fixtures.rake
Dump fixtures from the current environment's database
# Source: http://blog.ivanilves.com/2016/rails-dump-fixtures-from-db/
# Usage:
# * rake db:fixtures:dump to dump all models.
# * rake db:fixtures:dump MODELS="user billing_account" to dump only User and BillingAccount models.
# * rake db:fixtures:dump EXCEPT="user billing_account" to dump all, except for User and BillingAccount models.
#
namespace :db do
namespace :fixtures do