Skip to content

Instantly share code, notes, and snippets.

View smola's full-sized avatar

Santiago M. Mola smola

View GitHub Profile
@smola
smola / README.md
Last active June 26, 2020 11:35
Quick notes on installing Ubuntu with LUKS+LVM2

Quick notes on installing Ubuntu with LUKS+LVM2

These are just some quick notes about installing Ubuntu to an encrypted partition (LUKS) with LVM2 on top of it. The installer GUI has an advanced option to do this, but it is only available if you select the Erase disk and install Ubuntu option. I wanted to use this setup while preserving dual boot with Windows.

You should probably follow the following guide, instead of my instructions: https://help.ubuntu.com/community/Full_Disk_Encryption_Howto_2019

TODO

  • Encrypt /boot partition (see the linked guide above).
  • Fix Windows boot loader, removed from GRUB after last update-grub.
@smola
smola / GLUSTER_SETUP.sh
Created October 18, 2018 09:24
Quick and dirty single-node GlusterFS setup
#
# Instructions for quick gluster server (1 node) setup with a volume on LVM.
# No replication, just using localhost.
#
# See https://docs.gluster.org/en/latest/Administrator%20Guide/Brick%20Naming%20Conventions/
#
# Install GlusterFS
add-apt-repository ppa:gluster/glusterfs-4.0
apt-get install glusterfs-server
@smola
smola / keybase.md
Created September 19, 2018 13:49
keybase.md

Keybase proof

I hereby claim:

  • I am smola on github.
  • I am smola (https://keybase.io/smola) on keybase.
  • I have a public key whose fingerprint is C2A3 00EF 5DCA BC7E ED7F 01B6 3B05 0C2B 76AA FD1A

To claim this, I am signing this object:

@smola
smola / structured_logging.py
Created July 26, 2018 08:47
quick example on structured logging approaches for Python
#!/usr/bin/env python3
import logging
# setting up a JSON formatter for standard library
from pythonjsonlogger import jsonlogger
logger = logging.getLogger()
logHandler = logging.StreamHandler()
@smola
smola / README.md
Last active May 14, 2018 11:27
Get latest GitHub release from the command line (Linux, macOS, Windows)

Get latest GitHub release

These snippets can be used to retrieve the latest GitHub release from Linux, macOS and Windows. Note that other approaches involve either:

  • HTML scraping involving more dependencies or more complex code.
  • Using GitHub API, which has rate limit, so it is not suitable for all applications.

Replace the repository org/name with yours.

Bash

@smola
smola / gitbase_reference.ipynb
Last active May 29, 2018 15:16
Gitbase reference (DRAFT)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@smola
smola / k8s-jprofiler-attach.sh
Created March 23, 2018 14:49
Attach JProfiler agent to a JVM running in a Kubernetes pod
#!/bin/bash
set -e
if [[ -z ${K8S_JVM_POD} ]]; then
echo "K8S_JVM_POD not defined"
exit 1
fi
EXEC="kubectl exec ${K8S_JVM_POD}"
CP="kubectl cp ${K8S_JVM_POD}"
@smola
smola / setup_winrm_with_vboxmanage.rb
Last active June 5, 2017 16:04
Enable WinRM on Windows 10 VM on VirtualBox
# Copyright © 2017 Santiago M. Mola
# Licensed under the terms of the MIT License.
#
# This script is a proof-of-concept to enable WinRM
# on Windows 10 (vagrant box Microsoft/EdgeOnWindows10).
#
# It borrows from the instructions by André Albino Pereira
# at https://gist.github.com/andreptb/57e388df5e881937e62a
#
# This is not considered stable and, in fact, I'm moving
@smola
smola / git-find-roots
Created January 18, 2017 09:23
Find all initial commits and the commits where they were merged
#!/bin/bash
#
# git-find-roots finds every commit with no parent (initial commits)
# and the commit where they were merged.
#
# Usage:
# git-find-roots [commit-ish]
#
# Example:
# git-find-roots master