Skip to content

Instantly share code, notes, and snippets.

Lucas Savva m1cr0man

Block or report user

Report or block m1cr0man

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cyberang3l
cyberang3l / How to setup VirtualGL and TurboVNC on Ubuntu.md
Last active Jul 30, 2019
Setup VirtualGL and TurboVNC on Ubuntu for OpenGL forwarding
View How to setup VirtualGL and TurboVNC on Ubuntu.md
@boaheck
boaheck / imgfucker.py
Last active Mar 20, 2019
ImageGlitcher
View imgfucker.py
#!/usr/bin/env python
import random
import sys
cutLength = 1
pasteDist = 1
frames = 20
imgSequence = False
View Solus-packaging-cheatsheet.md

Solus packaging cheat sheet

Setup

Install required packages

  • sudo eopkg install -c system.devel
  • sudo eopkg install git solbuild
  • sudo eopkg install solbuild-config-unstable

Create repository directory

  • mkdir ~/repository
@acundari
acundari / traefik-auth.conf
Last active Jul 17, 2019
Traefik fail2ban
View traefik-auth.conf
# /etc/fail2ban/filter.d/traefik-auth.conf
[Definition]
failregex = ^<HOST> \- \S+ \[\] \"(GET|POST|HEAD) .+\" 401 .+$
@bradmontgomery
bradmontgomery / single_dispatch_example.py
Created Aug 23, 2016
Example of single dispatch in python. This is seriously cool stuff.
View single_dispatch_example.py
"""
Playing with python's single dispatch.
See: https://hynek.me/articles/serialization/
See also PEP 443: https://www.python.org/dev/peps/pep-0443/
"""
from datetime import datetime
from functools import singledispatch
@jblachly
jblachly / cloudinit-tips.md
Last active Oct 28, 2018
SmartOS (standalone) cloudinit setup for KVM images
View cloudinit-tips.md

The following keys, when placed in the customer_metadata section of the VM definition JSON will effect the specified behaviour:

smartos key corresponds to cloudinit key effect
hostname local-hostname
root_authorized_keys public-keys copies to /root/.ssh and default user ~/.ssh (e.g., ubuntu)
user-script user-script Executed each boot
user-data legacy-user-data
cloud-init:user-data user-data Evaluated by cloud-init once at VM creation only
iptables_disable iptables_disable ?
@rasschaert
rasschaert / arch_bootstrap.bash
Last active Aug 15, 2019
Shell script that performs the installation of Arch Linux the way I like it.
View arch_bootstrap.bash
#!/bin/bash
bootstrapper_dialog() {
DIALOG_RESULT=$(dialog --clear --stdout --backtitle "Arch bootstrapper" --no-shadow "$@" 2>/dev/null)
}
#################
#### Welcome ####
#################
bootstrapper_dialog --title "Welcome" --msgbox "Welcome to Kenny's Arch Linux bootstrapper.\n" 6 60
@tristanfisher
tristanfisher / Ansible-Vault how-to.md
Last active Jul 25, 2019
A short tutorial on how to use Vault in your Ansible workflow. Ansible-vault allows you to more safely store sensitive information in a source code repository or on disk.
View Ansible-Vault how-to.md

Working with ansible-vault


I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.

What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.

Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.

@nhoad
nhoad / gist:8966377
Last active Mar 7, 2019
Async stdio with asyncio
View gist:8966377
import os
import asyncio
import sys
from asyncio.streams import StreamWriter, FlowControlMixin
reader, writer = None, None
@asyncio.coroutine
def stdio(loop=None):
@jclulow
jclulow / 00_info.md
Created May 5, 2012
SmartOS rc.local
View 00_info.md

So, to get something like /etc/rc.local you can use the custom SMF import facility. (See the source for more information about how this actually works.)

/opt is mounted out of zones/opt by default. You can create a directory /opt/custom/smf and populate it with SMF manifests. Any manifests you put in there will be imported by SmartOS when it boots. Below is an example SMF manifest that simply starts /opt/custom/bin/postboot, a self-explanatory shell script that you can use like /etc/rc.local.

Note that it would likely be better to customise and respin your own images, as putting a bunch of platform state in the zones pool undoes some of the benefits of the ramdisk platform architecture that SmartOS has.

You can’t perform that action at this time.