Skip to content

Instantly share code, notes, and snippets.

@virtualstaticvoid
virtualstaticvoid / iptables_rules.sh
Created June 14, 2011 08:58
25 Most Frequently Used Linux IPTables Rules Examples
# Modify this file accordingly for your specific requirement.
# http://www.thegeekstuff.com
# 1. Delete all existing rules
iptables -F
# 2. Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
@saetia
saetia / gist:1623487
Last active March 19, 2024 15:21
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@bohde
bohde / tags.py
Created January 30, 2012 03:25
Using django-taggit with django-tastypie
from tastypie.fields import ListField
class TaggedResource(ModelResource):
tags = ListField()
class Meta:
queryset = Model.objects.all()
def build_filters(self, filters=None):
if filters is None:
@theaboutbox
theaboutbox / .ackrc
Created September 20, 2012 21:49
My .ackrc
--type-add=css=.sass,.less,.scss
--type-add=ruby=.rake,.rsel,.builder,.thor
--type-add=html=.haml,.html.erb,.html.haml
--type-add=js=.js.erb,.coffee
--type-set=cucumber=.feature
--type-set=c=.c,.cpp,.ino,.pde,.h
--ignore-dir=vendor
--ignore-dir=log
--ignore-dir=tmp
--ignore-dir=doc
@phgrau
phgrau / gist:4048239
Created November 9, 2012 21:07 — forked from anonymous/gist:4047604
a quick and dirty tips-n-tricks for ansible
Variables
==========
predefined variables :
- inventory_hostname (fqdn) (normally the same as ansible.fqdn)
- inventory_hostname_short
To know the return codes returned by ansible modules, just use plain ansible -vvv to see them :
ansible -i ~/ansible/arrfab.net/hosts/hosts.cfg -vvv -m copy -a 'src=files/sysinfo dest=/etc/sysinfo' tungstene.arrfab.net
tungstene.arrfab.net | success >> {
"changed": true,
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@samuraisam
samuraisam / models.py
Last active February 22, 2019 21:50
Using STS (Security Token Service) to grant access for a federated user to a s3 bucket prefix
import json
import boto
from django.db import models
from django.conf import settings
from django.contrib.auth.models import User
class UploadToken(models.Model):
user = models.ForeignKey(User)
created = models.DateTimeField(auto_now_add=True)
@littlepea
littlepea / munin.rst
Last active April 18, 2019 06:08
Munin setup for monitoring Django on EC2 Ubuntu instance with nginx

This is a short tutorial on setting up munin to monitor your Django website on ec2.

We're gonna be using Nginx instead of apache here because it's more lightweight and popular between Django developers.

Step by step tutorial

1. Install munin ''''''''''''' :

@languitar
languitar / violations_trigger.groovy
Created August 26, 2013 07:59
A trigger script for the jenkins (hudson) email_ext plugin which informs users in case their commits introduce new violations or warnings. In contrast to the limit options of various other plugins for code analysis reporting this does not fail the build.A simple but insecure way to share this script between different jobs is to execute the follo…
import jenkins.model.Jenkins
build = Jenkins.instance.items[0].builds[0]
println build
println("Available actions on the build: " + build.actions)
def analysisCoreActions = []
// All static analysis actions based on static analysis core can be handled uniformly
analysisCoreActions.addAll(build.actions.findAll{it.class.name =~ "hudson.plugins.checkstyle.CheckStyle.*ResultAction"})
@ignasi
ignasi / post-commit
Last active December 27, 2015 15:19 — forked from consti/post-commit
Take a photo of you, whenever you make a commit
#!/bin/sh
#############
# This is my fork of consti/post-commit gist: https://gist.github.com/consti/3082406
# It uses a more human date naming and stores captures from same repo to same directory.
# I have also added branch name at filename.
#############
#
# Take a photo of you, whenever you make a commit