Skip to content

Instantly share code, notes, and snippets.

View mushfiq's full-sized avatar

Mushfiq mushfiq

View GitHub Profile
@prakhar1989
prakhar1989 / richhickey.md
Last active November 8, 2023 17:19 — forked from stijlist/gist:bb932fb93e22fe6260b2
richhickey.md

Rich Hickey on becoming a better developer

Rich Hickey • 3 years ago

Sorry, I have to disagree with the entire premise here.

A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.

Mastery comes from a combination of at least several of the following:

@carlossg
carlossg / Dockerfile
Created December 17, 2014 19:19
ansible maven
FROM ansible/centos7-ansible:stable
# or, for example, FROM ansible/ubuntu14.04-ansible:stable
RUN yum install -y tar
RUN ansible-galaxy install geerlingguy.java
RUN ansible-galaxy install https://github.com/silpion/ansible-maven.git
# Add playbooks to the Docker image
COPY site.yml /
@mblarsen
mblarsen / deploy.yaml
Last active July 24, 2022 13:27
Solution for `git clone` using Ansible for repos with private submodules with github deploy keys
# Problem:
#
# If you use git submodules linking two private github repos, you'll need to create a separate deploy key for each.
# Multiple keys are not supported by Ansible, nor does ansible (when running git module) resort to your `.ssh/config` file.
# This means your ansible playbook will hang in this case.
#
# You can however use the ansible git module to checkout your repo in multiple steps, like this:
#
- hosts: webserver
vars:
@devinrader
devinrader / gist:ba796aa318174958c14c
Last active November 22, 2018 18:05
Receive and Set Session Values using Flask and KVSession
from flask import Flask, request, make_response, session
from flaskext.kvsession import KVSessionExtension
from datetime import datetime, timedelta
from twilio import twiml
import json
import redis
from simplekv.memory.redisstore import RedisStore
SECRET_KEY = 'a secret key'
@devinrader
devinrader / gist:d50234733b8e059b98b8
Last active August 15, 2019 03:14
Receiving and Setting Cookies using Flask
from flask import Flask, request, make_response
from datetime import datetime, timedelta
from twilio import twiml
app = Flask(__name__)
@app.route("/sms")
def sms():
#get the cookie value, or default to zero
@tristanfisher
tristanfisher / Ansible-Vault how-to.md
Last active April 3, 2024 13:55
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.

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.

@ralovely
ralovely / pre-commit.example
Created March 5, 2014 14:03
Git pre-commit hook for Ansible Vault
#!/bin/sh
#
# Pre-commit hook that verifies if all files containing 'vault' in the name
# are encrypted.
# If not, commit will fail with an error message
#
# File should be .git/hooks/pre-commit and executable
FILES_PATTERN='.*vault.*\.yml$'
REQUIRED='ANSIBLE_VAULT'
@jpadilla
jpadilla / exceptions.py
Created January 15, 2014 00:41
Custom exception handler for Django Rest Framework that adds the `status_code` to the response and renames the `detail` key to `error`.
from rest_framework.views import exception_handler
def custom_exception_handler(exc):
"""
Custom exception handler for Django Rest Framework that adds
the `status_code` to the response and renames the `detail` key to `error`.
"""
response = exception_handler(exc)
@chrisboulton
chrisboulton / ip_blacklist.lua
Last active April 2, 2024 10:43
Redis based IP blacklist for Nginx (LUA)
-- a quick LUA access script for nginx to check IP addresses against an
-- `ip_blacklist` set in Redis, and if a match is found send a HTTP 403.
--
-- allows for a common blacklist to be shared between a bunch of nginx
-- web servers using a remote redis instance. lookups are cached for a
-- configurable period of time.
--
-- block an ip:
-- redis-cli SADD ip_blacklist 10.1.1.1
-- remove an ip:
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 7, 2024 01:27
A badass list of frontend development resources I collected over time.