Skip to content

Instantly share code, notes, and snippets.

View OndrejValenta's full-sized avatar

Ondrej Valenta OndrejValenta

View GitHub Profile
@OndrejValenta
OndrejValenta / designer.html
Last active August 29, 2015 14:06
designer
<link href="../core-scaffold/core-scaffold.html" rel="import">
<link href="../core-header-panel/core-header-panel.html" rel="import">
<link href="../core-menu/core-menu.html" rel="import">
<link href="../core-item/core-item.html" rel="import">
<link href="../core-icon-button/core-icon-button.html" rel="import">
<link href="../core-toolbar/core-toolbar.html" rel="import">
<link href="../core-menu/core-submenu.html" rel="import">
<polymer-element name="my-element">
@OndrejValenta
OndrejValenta / Install Graylog on Ubuntu 18.04.md
Last active October 19, 2022 07:34
All steps necessary to install Graylog on Ubuntu 18.04, specifically Hetzner.com version of Ubuntu that is missing Java and pwgen that had to be installed.

Based on this video and guidelines for Java, MongoDB, Elasticsearch and so on

(not yet completed, ended at Graylog running but not configured)

JAVA + other prerequisities

sudo apt-get update && sudo apt-get -y install zsh   -- SO YOU DON'T WANT TO DRIVE YOURSELF CRAZY WITH PLAIN CONSOLE
chsh -s /bin/zsh -- to set Zsh as a default console

sudo apt-get update
sudo apt install default-jre

Based on this article

sudo apt-get update
sudo apt-get upgrade

sudo apt-get install redis-server
sudo systemctl enable redis-server.service

This is our set of iptables rules on Ubuntu 18.04

It is based on idea of blocked INPUT ports and opened OUTPUT ports but it would be smarter to close OUTPUT ports as well and just let open what we really need. Output rules in the rules below are not really needed because all OUTPUT traffic is open but when we decide to close it everything should keep working because the rules are already there.

We use Hetzner.com servers that are all in one private network. You should check you ifconfig to see what your interfaces are.

Let's start with the basics

Disable everything, enable ssh. Notice that for some iptables records we use -i parameter with ens10 (private network) or eth0 (public network) interfaces. You can safely remove this parameters/commands if you have only one interface you want to control.

This installation is based on Postgres Apt repository

  • Installation steps for Postgres are defined here
  • Installation steps for PostGIS are defined here

Add keys to Apt

sudo apt install curl ca-certificates gnupg
sudo curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" &gt; /etc/apt/sources.list.d/pgdg.list'

Install Zsh and Oh-my-zsh on CentOS 7

Based on this article

ALL INSTALLATIONS ASSUME YES WHEN PROMPTED, that's what -y does

This script can be copy paste to ssh as is. No hands installation. :-)

yum install zsh -y

Install Nginx and PHP on CentOS 7

Based on this article

Install Nginx

sudo yum install epel-release -y
sudo yum install nginx -y

sudo systemctl start nginx
@OndrejValenta
OndrejValenta / hetzner-centos8-first-steps.sh
Last active July 19, 2020 22:24
Hetzner Centos 8 - first steps
# Update everything automatically
yum update -y
# Install nano and other useful stuff because you are not a masochist
yum install epel-release -y;
yum install nano -y;
yum install mc -y;
yum install htop -y;
# Install and start firewalld
@OndrejValenta
OndrejValenta / install-erlang-on-centos8.sh
Last active June 19, 2020 23:45
Install Erlang on Centos8
# Install Epel repository
yum install epel-release -y
# Install necessary libraries for Erlang compilation
yum install gcc gcc-c++ glibc-devel make ncurses-devel openssl-devel autoconf java-1.8.0-openjdk-devel git wget wxBase3 libGL libGLU unixODBC wxGTK3 wxGTK3-gl -y
# Download Erlang package (update to proper package version)
wget https://packages.erlang-solutions.com/erlang/rpm/centos/8/x86_64/esl-erlang_23.0.2-1~centos~8_amd64.rpm
# Install Erlang

Install Zsh and Oh-my-zsh on CentOS 8

Based on this article

chsh is not available on some Centos8 so there is a dnf install to add the package that contains it

ALL INSTALLATIONS ASSUME YES WHEN PROMPTED, that's what -y does

This script can be copy paste to ssh as is. No hands installation. :-)