Skip to content

Instantly share code, notes, and snippets.

View PradeepTammali's full-sized avatar
🙂
Working

Pradeep Tammali PradeepTammali

🙂
Working
View GitHub Profile
@PradeepTammali
PradeepTammali / sudoku.py
Last active March 14, 2021 21:26
Program which takes a Sodoku puzzle as input and solves it for you. The puzzle has to given as a string combining the row wise and filling the empty values with 0.
puzzle = "004006079000000602056092300078061030509000406020540890007410920105000000840600100"
def line_to_grid(values):
grid = []
for i in range(0,9):
grid.append(list(map(lambda x: int(x), list(values[i*9:(i+1)*9]))))
return grid
def grid_to_line(grid):
line = ""
class Address(db.Document):
config_collection_name = "address"
street_address = db.StringField()
city = db.StringField()
state_province = db.StringField()
country = db.StringField()
class User(db.Document):
config_collection_name = "user"
name = db.StringField()
---
kind: Pod
apiVersion: v1
metadata:
name: test
spec:
containers:
- name: busybox
image: busybox
args:
@PradeepTammali
PradeepTammali / nginx.yaml
Last active November 24, 2020 11:38
Forward the traffic to a service or app using Nginx with https.
---
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-conf
data:
nginx.conf: |
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log;
#!/bin/bash
host_log="/home/pradeep/scripts"
install_log="$host_log/tmp.log"
# Color logging
log() {
# Color Logging
RED="\033[1;31m" # ERROR
GREEN="\033[1;32m" # INFO
YELLOW="\033[33;33m" # WARN
BLUE='\e[0;34m' # DEBUG