Skip to content

Instantly share code, notes, and snippets.

View graudeejs's full-sized avatar

Aldis Berjoza graudeejs

View GitHub Profile
@graudeejs
graudeejs / nixos-encrypted-zfs.sh
Created November 6, 2020 17:50 — forked from dysinger/nixos-encrypted-zfs.sh
How I installed Encrypted ZFS root on NixOS
#!/bin/sh
# FIRST STOP THE zfs-zed SERVICE
systemctl stop zfs-zed
# FORCE UNLOAD ZFS KERNEL MODULES
lsmod | grep zfs | cut -d' ' -f1 | xargs rmmod -f
# NOW ADD THE FOLLOWING TO /etc/nixos/configuration.nix
#

Download Vagrant boxes manually

In this example, we're going to download the Midnight Sun box.

# The box URL is https://app.vagrantup.com/uwmidsun/boxes/box/versions/2.1.0
# In general, we just take the box URL, and then append the provider URL
# https://app.vagrantup.com/<organization name>/boxes/<box name>/versions/<version>/providers/<provider>.box
wget https://app.vagrantup.com/uwmidsun/boxes/box/versions/2.1.0/providers/virtualbox.box -O box-2.1.0.box
@graudeejs
graudeejs / ruby.2.6.3-setup.sh
Created October 28, 2019 19:48 — forked from mustafaturan/ruby.2.6.3-setup.sh
ruby 2.6.3 setup for centos 6.x
#!/usr/bin/env bash
# repository
cd /tmp
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm
# system update
yum -y update
yum -y groupinstall "Development Tools"
yum -y install libxslt-devel libyaml-devel libxml2-devel gdbm-devel libffi-devel zlib-devel openssl-devel libyaml-devel readline-devel curl-devel openssl-devel pcre-devel git memcached-devel valgrind-devel mysql-devel ImageMagick-devel ImageMagick
# coding=utf-8
"""
LICENSE http://www.apache.org/licenses/LICENSE-2.0
"""
import datetime
import sys
import time
import threading
import traceback
import SocketServer
@graudeejs
graudeejs / digitalocean-promo-cupon-code-free-trial.md
Created January 2, 2019 11:28
DigitalOcean Coupon Code $35 / $100 1 Year Free Trial - January 2019

alt text

Digital Ocean Promo Coupon Code $35 / $100 1 Year Free Trial

1) Get $35 / $25 / $20 / $10 free DigitalOcean Credit.

2) Get DigitalOcean 1 Year Free Trial.

3) Get $100 Credit For 60 Days. $100 Free Credits

@graudeejs
graudeejs / ansible-summary.md
Created September 7, 2018 07:49 — forked from andreicristianpetcu/ansible-summary.md
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@graudeejs
graudeejs / GNUPG_agent_forwarding.md
Created April 18, 2018 22:46 — forked from surhudm/GNUPG_agent_forwarding.md
GNUPG agent forwarding

Forward GNUPG agent with the following steps:

On the remote insecure machine:

Run gpg once to create the directory structure.

gpg --list-keys

On the local machine:

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@graudeejs
graudeejs / cors-test.sh
Created March 26, 2018 07:26 — forked from skounis/cors-test.sh
Test CORS headers with curl
#!/bin/bash
curl -X GET -H "Origin: http://example.com" --verbose http://foo.com/bar
curl -X POST -H "Origin: http://example.com" --verbose http://foo.com/bar
curl -X PUT -H "Origin: http://example.com" --verbose http://foo.com/bar
# https://www.erlang-solutions.com/downloads/download-erlang-otp
# wget http://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
# sudo dpkg -i erlang-solutions_1.0_all.deb
deb http://packages.erlang-solutions.com/ubuntu trusty contrib
deb http://packages.erlang-solutions.com/ubuntu saucy contrib
deb http://packages.erlang-solutions.com/ubuntu precise contrib
wget http://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc
sudo apt-key add erlang_solutions.asc