Skip to content

Instantly share code, notes, and snippets.

View RafalSladek's full-sized avatar

Rafal Sladek RafalSladek

View GitHub Profile

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
#This script was written by REXOVAS to automate 90% of a ZEN Secure Node setup process for an IPv4 node.
#Parts of this script were adapted from a script by github user rnkhouse
#rnkhouse script found here: https://gist.github.com/rnkhouse/f7f04f0cb10b596e2c6623275968a220
#Prior to running this script, please ensure that you are not signed in as root, and have completed all steps up until the copying
#of authentication key pairs in this guide: https://blockoperations.com/build-zencash-secure-node-part-1-prepare-vps/
#This script performs all actions described in the 3 guides found on blockoperations.com. It compiles zend from source.
#This script installs both Monit and PM2 and automatically configures monit to monitor zend.
#WARNING: This script is intended for use by advanced Linux users. Please read through this script thoroughly to ensure that
@RafalSladek
RafalSladek / ELK-install.sh
Created June 10, 2018 19:47 — forked from sniper7kills/ELK-install.sh
ELK-Install-Ubuntu-16.04
#/bin/bash
#Ask some info
echo -n "Enter ELK Server IP or FQDN: "
read eip
echo -n "Enter Admin Web Password: "
read adpwd
#Update System
sudo apt-get update
sudo apt-get upgrade -y
@RafalSladek
RafalSladek / docker-cleanup-resources.md
Last active May 25, 2018 09:22 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

docker volume rm $(docker volume ls -qf dangling=true)
docker volume ls -qf dangling=true | xargs -r docker volume rm
@RafalSladek
RafalSladek / isdockerlive.sh
Created January 9, 2018 10:16 — forked from peterver/isdockerlive.sh
A shell script that uses curl to see if docker is up and running
#!/bin/bash
rep=$(curl -s --unix-socket /var/run/docker.sock http://ping > /dev/null)
status=$?
if [ "$status" == "7" ]; then
echo 'not connected'
exit 1
fi
#!/usr/bin/env bash
# IMPORTANT: Run this script from /home/<USER>/ directory: bash -c "$(curl SCRIPT_URL)"
# (optional): Preparing the environment if you want to install zen from source:
# Once you get the VM up and running you need to login with your root account and run below commands.
# apt-get update && apt-get upgrade -y
# apt-get install -y build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev wget bsdmainutils automake libgtk2.0-dev && apt-get autoremove -y
@RafalSladek
RafalSladek / oracle_guid_helpers.sql
Created December 12, 2017 16:25 — forked from sandcastle/oracle_guid_helpers.sql
Oracle GUID helper functions for converting between GUID and RAW(16)
set serveroutput on;
declare
raw_guid raw(16);
guid varchar2(64);
begin
raw_guid := guid_to_raw ('88c6a267-65d2-48d6-8da2-6f45e2c22726');
guid := raw_to_guid('67A2C688D265D6488DA26F45E2C22726');
@RafalSladek
RafalSladek / ssh_agent_start.fish
Created July 11, 2017 05:00 — forked from gerbsen/ssh_agent_start.fish
Auto-launching ssh-agent in fish shell
# content has to be in .config/fish/config.fish
# if it does not exist, create the file
setenv SSH_ENV $HOME/.ssh/environment
function start_agent
echo "Initializing new SSH agent ..."
ssh-agent -c | sed 's/^echo/#echo/' > $SSH_ENV
echo "succeeded"
chmod 600 $SSH_ENV
. $SSH_ENV > /dev/null

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@RafalSladek
RafalSladek / setupVpn.sh
Last active July 9, 2017 15:01 — forked from nodesocket/vpnsetup.sh
install ipsec vpn
wget https://git.io/vpnsetup -O vpnsetup.sh && sudo \
VPN_IPSEC_PSK='your_ipsec_pre_shared_key' \
VPN_USER='your_vpn_username' \
VPN_PASSWORD='your_vpn_password' sh vpnsetup.sh