Skip to content

Instantly share code, notes, and snippets.

View oz123's full-sized avatar
🎯
Focusing

Oz Tiram oz123

🎯
Focusing
View GitHub Profile
@ryanburnette
ryanburnette / gist:cd2191fe9d01fa8b6163
Created May 22, 2015 22:33
Convert Liquid gist plugin from Jekyll to ERB for middleman-gist in Vim.
%s/{% gist ryanburnette\/\([a-z|0-9]\{20}\) %}/<%= gist "ryanburnette", "\1" %>/g
@chrismdp
chrismdp / s3.sh
Last active January 23, 2025 09:26
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@ric03uec
ric03uec / Vagrantfile
Last active June 26, 2018 09:36
kube cluster setup on 2 nodes
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.define "kube-master" do |master|
@emilbjorklund
emilbjorklund / Pseudo-makefile
Last active January 21, 2020 22:27
Makefile for Sass?
# This is probably some pseudo-makefile syntax, but basically I want to do this:
# - The `assets/scss/` dir has a bunch of "top level" Sass files to
# be compiled - foo.scss, bar.scss etc.
# - Note: these files will each generate one resulting .css file of the
# same name as the source inside the build dir. foo.scss -> foo.css etc.
# - The build needs to be re-run any time any partial inside of a
# subdir in the scss folder changes: if `assets/scss/baz/_baz.scss` changes,
# I want to recompile all of the "root" .scss files.
# I.e. all of the partials in subdirs are prerequisites.
@ipedrazas
ipedrazas / gist:2c93f6e74737d1f8a791
Created September 18, 2014 22:13
List Docker Container Names and IPs
function drips(){
docker ps -q | xargs -n 1 docker inspect --format '{{ .NetworkSettings.IPAddress }} {{ .Name }}' | sed 's/ \// /'
}
@MoritzMaxeiner
MoritzMaxeiner / gentoo_uefi_fde.md
Last active November 20, 2024 22:38
Short guide on how to setup Gentoo with full disk encryption on a UEFI system using Gummiboot

Preface

This is an as-short-as-sensible guide of the minimum necessary steps to setup Gentoo with LVM, LUKS, and UEFI booting using Gummiboot. It assumes you are already familiar with the subject of setting up GNU/Linux distributions and would like to know only what is specific to Gentoo for the abovementioned. This is most definitely not the only way, but it is the shortest I - as a current Gentoo newbie - was able to determine.

@j0lvera
j0lvera / auth.py
Created April 6, 2014 06:42
auth.py
#!/usr/bin/env python
from bottle import route, run, template, static_file, request, parse_auth, auth_basic
from redis import StrictRedis as Redis
from cork import Cork
from hashids import Hashids
from passlib.hash import pbkdf2_sha256
incr1 = Hashids(salt="Eehu6laucelohh3b", min_length="16")
incr2 = Hashids(salt="Phiejapie2ahr9wa", min_length="8")
@j0lvera
j0lvera / decorator.py
Last active June 1, 2021 20:33
bottle.py basic auth examples
from bottle import route, run, auth_basic
from passlib.hash import sha256_crypt
def check_pass(username, password):
hashed = ''.join(redis.hmget(username, "password"))
return sha256_crypt.verify(password, hashed)
@route('/', method='GET')
@auth_basic(check_pass) # <-- decorator
def index():
@martijnvermaat
martijnvermaat / ssh-agent-forwarding-screen.md
Created December 21, 2013 15:06
SSH agent forwarding and screen

SSH agent forwarding and screen

When connecting to a remote server via SSH it is often convenient to use SSH agent forwarding so that you don't need a separate keypair on that server for connecting to further servers.

This is enabled by adding the

ForwardAgent yes

option to any of your Host entries in ~/.ssh/config (or alternatively with the -A option). Don't set this option in a wildcard Host * section since any user on the remote server that can bypass file permissions can now als use keys loaded in your SSH agent. So only use this with hosts you trust.

@killercup
killercup / pandoc.css
Created July 3, 2013 11:31
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}