This file contains hidden or 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 | |
if [ "$#" -lt 1 ] | |
then | |
echo "Scan keys in Redis matching a pattern using SCAN (safe version of KEYS)" | |
echo "Usage: $0 <host> [port] [database] [pattern] [count]" | |
exit 1 | |
fi | |
host=${1:-} | |
port=${2:-6379} |
This file contains hidden or 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
# vim:ft=zsh ts=2 sw=2 sts=2 | |
# | |
# AgnosterJ Theme - https://github.com/apjanke/agnosterj-zsh-theme | |
# | |
# A Powerline-inspired theme for ZSH | |
# Based on the original Agnoster Theme - https://github.com/agnoster/agnoster-zsh-theme | |
# | |
# # README | |
# | |
# In order for this theme to render correctly, you will need iTerm2 or a |
This file contains hidden or 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
# GMAIL | |
EMAIL_HOST = 'smtp.gmail.com' | |
EMAIL_PORT = 587 | |
EMAIL_HOST_USER = 'xxx@gmail.com' | |
EMAIL_HOST_PASSWORD = '' # APP Password | |
EMAIL_USE_TLS = True |
This file contains hidden or 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
{ | |
"Id": "Policy1555233602764", | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "Stmt1555233600130", | |
"Action": [ | |
"s3:GetObject" | |
], | |
"Effect": "Allow", |
This file contains hidden or 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
from django.core.exceptions import PermissionDenied | |
from simple_decorators.apps.models import Entry | |
def user_is_entry_author(function): | |
def wrap(request, *args, **kwargs): | |
entry = Entry.objects.get(pk=kwargs['entry_id']) | |
if entry.created_by == request.user: | |
return function(request, *args, **kwargs) | |
else: | |
raise PermissionDenied |
This file contains hidden or 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
#Generating a new SSH key | |
ssh-keygen -t rsa -b 4096 -C "your_email@example.com" | |
#Add a new SSH key to your GitHub account | |
~/.ssh/id_rsa.pub | |
# use python3 in django project | |
virtualenv .venv --python=python3 |