Skip to content

Instantly share code, notes, and snippets.

View AnjaneyuluBatta505's full-sized avatar

Anjaneyulu Batta AnjaneyuluBatta505

View GitHub Profile
@AnjaneyuluBatta505
AnjaneyuluBatta505 / env_us-east-1.yml
Created February 3, 2022 09:10 — forked from adhorn/env_us-east-1.yml
Serverless framework to support deploy Lambda Functions in VPC
STATUS: 200
lambdaExecSecurityGroups: ["sg-xxxxxxx"]
subnets: ["subnet-xxxxxxx"]
@AnjaneyuluBatta505
AnjaneyuluBatta505 / iterm2.md
Created September 21, 2021 12:53 — forked from nobitagit/iterm2.md
iterm2 cheatsheet

This gist has been moved to its own Github repo, so it's easier to contribute with additions and corrections. Please open a PR there if you see any mistake, I don't track comments on here as there's no notification system for gists AFAIK. Thanks.

Tabs and Windows

Function Shortcut
Previous Tab + Left Arrow
Next Tab + Right Arrow
Go to Tab + Number
@AnjaneyuluBatta505
AnjaneyuluBatta505 / gpg_fix.txt
Created September 7, 2021 08:32 — forked from cezaraugusto/gpg_fix.txt
fixing `gpg failed to sign data` error on macOS
For troubleshooting, two things to first try:
run `git config --global gpg.program gpg2`, to make sure git uses gpg2 and not gpg
run `echo "test" | gpg2 --clearsign`, to make sure gpg2 itself is working
If that all looks all right, one next thing to try:
run `brew install pinentry` to ensure you have a good tool installed for passphrase entry
If after that install and you re-try git commit and still get the "failed to sign the data" error:
run `gpgconf --kill gpg-agent` to kill any running agent that might be hung
client = boto3.client(
'cognito-idp', region_name="ap-southeast-1",
**{
'aws_access_key_id': "",
'aws_secret_access_key': ""
})
cd ~/project/payslip-visualisation/
branch="$(git name-rev --name-only HEAD)"
git checkout $branch
git pull origin $branch
source ~/.virtualenvs/finklim/bin/activate
pip install -r requirements.txt
python manage.py migrate
python manage.py collectstatic --no-input
sudo supervisorctl restart all
import glob, os
import pathlib
from django.apps import apps
from django.db.models.fields.related import OneToOneField, ForeignKey
from collections import OrderedDict
from django.template import Template, Context
from django.db import connection
def execute_raw_sql(query):
@AnjaneyuluBatta505
AnjaneyuluBatta505 / main.go
Created April 1, 2020 05:24 — forked from konojunya/main.go
Sample using gin's BindJSON
package main
import (
"fmt"
"log"
"github.com/gin-gonic/gin"
)
type CreateParams struct {
@AnjaneyuluBatta505
AnjaneyuluBatta505 / kubernetes_commands.md
Created February 27, 2020 14:04 — forked from edsiper/kubernetes_commands.md
Kubernetes Useful Commands
@AnjaneyuluBatta505
AnjaneyuluBatta505 / redis_migrate.py
Created February 21, 2020 10:19 — forked from josegonzalez/redis_migrate.py
A simple script to migrate all keys from one Redis to another
#!/usr/bin/env python
import argparse
import redis
def connect_redis(conn_dict):
conn = redis.StrictRedis(host=conn_dict['host'],
port=conn_dict['port'],
db=conn_dict['db'])
return conn
@AnjaneyuluBatta505
AnjaneyuluBatta505 / wifi.py
Created September 13, 2019 08:19 — forked from taylor224/wifi.py
Python WiFi Example
# -*- coding: utf-8 -*-
import wifi
def Search():
wifilist = []
cells = wifi.Cell.all('wlan0')