This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <sys/types.h> | |
#include <sys/wait.h> | |
#include <sys/mman.h> | |
#define PRINT_ERROR(...) fprintf(stdout, "[ERROR (%i)] ", getpid()); fprintf(stdout, __VA_ARGS__); fprintf(stdout, "\n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am krallin on github. | |
* I am torozco (https://keybase.io/torozco) on keybase. | |
* I have a public key whose fingerprint is 6380 DC42 8747 F6C3 93FE ACA5 9A84 159D 7001 A4E5 | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enable_all false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
#### | |
# based on https://gist.github.com/jeffery/1115504 | |
# Helper script to update the Last modified timestamp of files in a Git SCM | |
# Projects working Copy | |
# | |
# When you clone a Git repository, it sets the timestamp of all the files to the | |
# time when you cloned the repository. | |
# | |
# This becomes a problem when you want the cloned repository, which is part of a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
has_yum=$(which yum) | |
has_apt=$(which apt-get) | |
function is_vulnerable { | |
env x='() { :;}; echo vulnerable' bash -c "echo this is a test" | grep "vulnerable" | |
return $? | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto.ec2 | |
# Connect to EC2 | |
conn = boto.ec2.connect_to_region("us-east-1") # Credentials are in the environment! | |
# Create a new SG | |
security_group = conn.create_security_group("test-sg, "Just making a point!") | |
# Define SG rules | |
ip_rules = [("tcp", 80, "0.0.0.0/0"), ("tcp", 443, "0.0.0.0/0")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def expire_view_cache(view_name, args=None, kwargs=None, namespace=None, key_prefix=None, method="GET"): | |
""" | |
This function allows you to invalidate any view-level cache. | |
view_name: view function you wish to invalidate or it's named url pattern | |
args: any arguments passed to the view function | |
namepace: optioal, if an application namespace is needed | |
key prefix: for the @cache_page decorator for the function (if any) | |
from: http://stackoverflow.com/questions/2268417/expire-a-view-cache-in-django | |
added: method to request to get the key generating properly |