- Code changes in this pull request follows the code style of this project.
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
function collapse_pwd { | |
echo $(pwd | sed -e "s,^$HOME,~,") | |
} | |
function prompt_char { | |
git branch >/dev/null 2>/dev/null && echo '$' && return | |
hg root >/dev/null 2>/dev/null && echo '☿' && return | |
echo '○' | |
} |
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
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH="/Users/luvpreetsingh/.oh-my-zsh" | |
# Set name of the theme to load. Optionally, if you set this to "random" | |
# it'll load a random theme each time that oh-my-zsh is loaded. | |
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes | |
ZSH_THEME="customluvpreet" |
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
# syntax=docker/dockerfile:1.0.0-experimental | |
# The above comment is not to be deleted, its necessary. We are using an experimental feature and above line is important to enable that | |
# please refer to this, https://medium.com/@tonistiigi/build-secrets-and-ssh-forwarding-in-docker-18-09-ae8161d066 to know more about this | |
# before building docker image using this dockerfile, please do export DOCKER_BUILDKIT=1 | |
FROM python:3.6-alpine | |
ENV PYTHONUNBUFFERED 1 |
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
## Installation of aws-cli,jq is required | |
# get IP of EC2 instances | |
getec2ip(){ | |
aws ec2 describe-instances --filters "Name=tag:Name,Values=$1" --region=$2 | jq '.Reservations | .[0] | .Instances | .[0] | .NetworkInterfaces | .[0] | .PrivateIpAddresses | .[0] | .Association | .PublicIp' | cut -d '"' -f 2 | |
} | |
getec2type(){ | |
aws ec2 describe-instances --filters "Name=tag:Name,Values=$1" --region=$2 | jq '.Reservations | .[0] | .Instances | .[0] | .InstanceType ' | |
} |
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 syntax highlight | |
syntax enable | |
" set tabs to have 4 spaces | |
set ts=4 | |
" indent when moving to the next line while writing code | |
set autoindent | |
" convert tabs into spaces |
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 random | |
from pilot.models import Station | |
from django.contrib.gis.geos import Point | |
cities = ["Chandigarh", "Mumbai", "Ludhiana", "Bangalore", "Goa", "Delhi", "Hyderabad"] | |
cities_dict = { "Chandigarh": { "lat": "30.7", "lon": "76.7" }, "Mumbai": {"lat": "19.0","lon": "76.7" }, "Bangalore": { "lat": "12.9", "lon": "77.5"}, "Ludhiana": {"lat": "30.9", "lon": "75.8"},"Goa": {"lat": "15.2","lon": "74.1"},"Delhi": {"lat": "28.7","lon": "77.1"},"Hyderabad": {"lat": "17.3","lon": "78.4"},} | |
for i in range(1,100000): |
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
# only sending nginx logs. So, use the programname filter. | |
template(name="all-json" | |
type="list"){ | |
property(name="$!all-json") | |
} | |
if $programname == "nginx" then { |