Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View l2ol33rt's full-sized avatar

Robert James Hernandez l2ol33rt

View GitHub Profile

Keybase proof

I hereby claim:

  • I am l2ol33rt on github.
  • I am sarcasticadmin (https://keybase.io/sarcasticadmin) on keybase.
  • I have a public key whose fingerprint is BBBA 6D31 E451 9326 518A 1493 8CC9 6E1E C9BA 9CEF

To claim this, I am signing this object:

@l2ol33rt
l2ol33rt / zfs_geli_boot.sh
Created September 27, 2016 01:08
Create encrypted geli zpool against single disk on FreeBSD 10.3
#/bin/sh
# Create partitions
gpart destroy -F /dev/ada0
gpart create -s GPT /dev/ada0
gpart add -t efi -s 100M -a 1M -l EFI /dev/ada0
gpart add -t freebsd-swap -s 8G -a 1M -l freebsd-swap /dev/ada0
@l2ol33rt
l2ol33rt / simple_jinja_dictloader.py
Created August 24, 2016 15:33
Jinja DictLoader Example
from jinja2 import Environment, DictLoader
template = """{% for key, value in _dict.iteritems() %}
this is the {{ key }} whose value is {{ value }}
{% endfor -%}"""
j2_env = Environment(loader=DictLoader({'sample.txt': template}),
trim_blocks=True)
print j2_env.get_template('sample.txt').render(_dict={'linux': 4.4,
@l2ol33rt
l2ol33rt / unix_passwd.rb
Last active November 27, 2022 15:25
Generate /etc/shadow Hash Under Ruby
#!/usr/bin/env ruby
require 'unix_crypt'
require 'io/console'
require 'optparse'
#####
#
# Script for generating a users password hash defaults to SHA512. Will prompt for password twice
# to make sure that it has been entered correctly.
#
@l2ol33rt
l2ol33rt / README.md
Created May 19, 2015 23:13
SSH Config Sample 1

Overview

This config allows you to connect through jumphost1 to the instance behind-jumphost1. It establishes a control socket that is persistent for 10m after disconnecting. If you connect multiple times to behind-jumphost1 the existing TCP connection will be used for additional sessions.

For more information take a look at: http://en.wikibooks.org/wiki/OpenSSH/Cookbook/Proxies_and_Jump_Hosts

@l2ol33rt
l2ol33rt / saltsample_09252012_01
Created September 25, 2012 17:58
Saltstack sample of using states and pillars for users
Here is a sample of how I am currently dealing with users.
Big thanks to uggedal! I used his user states as an example: https://github.com/uggedal/states
###
# How to create password hashes
###
python -c "import crypt; print crypt.crypt('password', '\$6\$SALTsalt\$')"
###