Skip to content

Instantly share code, notes, and snippets.

View liladas's full-sized avatar
💭
falalalala

Adam Buga liladas

💭
falalalala
  • Lilrobo, Karaokio
  • Solana Beach, CA
View GitHub Profile
@steder
steder / aws_sg_recipe.py
Created December 19, 2011 19:11
Create and update AWS security groups using Python and Boto.
#!/usr/bin/env python
"""
Recipe for creating and updating security groups programmatically.
"""
import collections
import boto
@andyferra
andyferra / github.css
Created April 30, 2012 02:11
Github Markdown CSS - for Markdown Editor Preview
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
import time
from boto.ec2.autoscale import AutoScaleConnection
def find_unused_launch_configs():
conn = AutoScaleConnection()
autoscale_groups = conn.get_all_groups(max_records=100)
launch_configs = conn.get_all_launch_configurations(max_records=100)
launch_config_names = {lc.name for lc in launch_configs}
@wpscholar
wpscholar / vagrant-cheat-sheet.md
Last active April 7, 2024 13:53
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@barseghyanartur
barseghyanartur / clean_media.py
Last active November 24, 2017 18:09
Clean media by deleting those files which are no more referenced by any FileField (django command)
# -*- coding: utf-8 -*-
import os
import sys
from six.moves import input
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.apps import apps
@fdobrovolny
fdobrovolny / filter.py
Last active October 31, 2019 08:39
Pass multiple parametrs into Django filter
"""Pass multiple parametrs into Django filter.
Inspired by http://stackoverflow.com/a/24402622/2629036.
By this filters you can chain as many variables into parametrs as you like.
You can even make different lengths for one filter.
WARNING: You have to apply n_chain_end filter at the end of the n_chains.
Thanks to this the intial var can also be tupple.
@oseiskar
oseiskar / swagger-yaml-to-html.py
Last active April 3, 2024 15:24
Converts Swagger YAML to a static HTML document (needs: pip install PyYAML)
#!/usr/bin/python
#
# Copyright 2017 Otto Seiskari
# Licensed under the Apache License, Version 2.0.
# See http://www.apache.org/licenses/LICENSE-2.0 for the full text.
#
# This file is based on
# https://github.com/swagger-api/swagger-ui/blob/4f1772f6544699bc748299bd65f7ae2112777abc/dist/index.html
# (Copyright 2017 SmartBear Software, Licensed under Apache 2.0)
#
const AWS = require('aws-sdk');
const fs = require('fs');
const mime = require('mime-types')
const path = require("path");
// Base AWS config.
// AWS Reference: Make sure the profile exists in ~/.aws/credentials
// See managing access keys:
// https://docs.aws.amazon.com/general/latest/gr/managing-aws-access-keys.html
// https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html#id_users_create_console
@liladas
liladas / gource.sh
Created June 8, 2018 05:21 — forked from XueshiQiao/gource.sh
Generate a MP4 Video for your Git project commits using Gource!
# 1.install gource using HomeBrew
$ brew install gource
# 2.install avconv
git clone git://git.libav.org/libav.git
cd libav
# it will take 3-5 minutes to complie, be patient.
./configure --disable-yasm
make && make install
# Source: https://gist.github.com/8d941690a087b0de0e2731a52cfb1f51
###############################################################
# Building Event-Driven Microservices In Kubernetes With Dapr #
# https://youtu.be/-4sHUvfk2Eg #
###############################################################
# Additional Info:
# - https://dapr.io
# - What is microservices architecture?: https://youtu.be/F-37_gV2tMs