Skip to content

Instantly share code, notes, and snippets.

View gmas's full-sized avatar

George Masgras gmas

  • Barcelona
  • 04:35 (UTC +01:00)
View GitHub Profile
@gmas
gmas / Ruby.markdown
Created February 17, 2014 05:28 — forked from avdi/Ruby.markdown

Core ideas

  • An Object is a set of instance variables and a pointer to a 'singleton class'.
  • Properties are looked up in the instance variables, methods are dispatched via the singleton class.
  • Module is a subtype of Object. A Module is a set of methods and an ordered list of zero-or-more 'parent' modules.
  • Module A becomes a parent of module B via B.include(A).
  • Method lookup works by doing a depth-first right-to-left search of a module tree.
  • Class is a subtype of Module. A Class is a Module that can be instantiated.
  • A Class has only one 'superclass'. A class includes its superclass as its first parent module for the purposes of method dispatch. A class's singleton class includes the superclass's singleton class as its first parent.
  • The default superclass of all classes is Object.
%s/:\(\w\+\)\(\s*=>\s*\)/\1: /gc
ssh-copy-id [email protected]
# on the pi
sudo su -
cat <<EOF >> /etc/wpa_supplicant/wpa_supplicant.conf
network={
ssid="Your SSID Here"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
@gmas
gmas / PKGBUILD
Created November 29, 2015 02:23 — forked from anish/PKGBUILD
kubernetes 1.0.7 PKGBUILD
#Maintainer: Iwan Timmer <[email protected]>
Contributor: Anish Bhatt <[email protected]>
pkgname=kubernetes
pkgver=1.0.7
pkgrel=1
pkgdesc="Container Cluster Manager for Docker"
depends=('glibc')
makedepends=('go' 'rsync')
optdepends=('etcd: etcd cluster required to run Kubernetes')
@gmas
gmas / pedantically_commented_playbook.yml
Created July 21, 2016 21:54 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@gmas
gmas / arch-linux-install
Created October 20, 2016 00:38 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
@gmas
gmas / stack.yml
Created October 11, 2017 22:31 — forked from tomvachon/stack.yml
AWS IAM Policy for Tag Restricted EBS & EC2
Type: AWS::IAM::ManagedPolicy
Properties:
Description: AWS Policy for EC2 Instance, EBS Creation with Tagging required
PolicyDocument:
Version: "2012-10-17"
Statement:
# This allows the untaggable calls to work when RunInstances is the actor
-
Effect: Allow
Action:
@gmas
gmas / rbac-kops.md
Created October 18, 2017 21:18 — forked from chrislovecnm/rbac-kops.md
RBAC Notes

kops cluster config

kubeAPIServer:
  authorizationMode: RBAC
  authorizationRbacSuperUser: admin
  oidcCAFile: /srv/kubernetes/ca.crt
  oidcClientID: example
  oidcGroupsClaim: groups
  oidcIssuerURL: https://dex.example.com
  oidcUsernameClaim: email
@gmas
gmas / perf-flame-graph-notes.md
Created October 24, 2017 18:28 — forked from trevnorris/perf-flame-graph-notes.md
Quick steps of how to create a flame graph using perf

The prep-script.sh will setup the latest Node and install the latest perf version on your Linux box.

When you want to generate the flame graph, run the following (folder locations taken from install script):

sudo sysctl kernel.kptr_restrict=0
# May also have to do the following:
# (additional reading http://unix.stackexchange.com/questions/14227/do-i-need-root-admin-permissions-to-run-userspace-perf-tool-perf-events-ar )
sudo sysctl kernel.perf_event_paranoid=0