Skip to content

Instantly share code, notes, and snippets.

@sunnykrGupta
sunnykrGupta / donwload-files.py
Last active February 1, 2017 07:46
Download-files. Feed link in given input files which u wanted to download irrespective of source.
import wget
import os
# Get the list of all the files in current directory
files = [f for f in os.listdir('.') if os.path.isfile(f)]
# Read from file. File contains list of links. All links in new line.
links = open("inputurl.in", "r")
i = 0
@sunnykrGupta
sunnykrGupta / Sublime
Last active September 12, 2019 10:17
Sublime setting
{
"color_scheme": "Packages/Color Scheme - Default/Eiffel.tmTheme",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"font_size": 11,
"highlight_line": true,
"ignored_packages":
[
"Vintage",
"Markdown"
local random = math.random
local function uuid()
local template ='xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
return string.gsub(template, '[xy]', function (c)
local v = (c == 'x') and random(0, 0xf) or random(8, 0xb)
return string.format('%x', v)
end)
end
#Remove unnecessary softwares
#sudo apt-get purge gnome-2048 aisleriot atomix gnome-chess five-or-more hitori iagno gnome-klotski lightsoff gnome-mahjongg gnome-mines gnome-nibbles quadrapassel four-in-a-row gnome-robots gnome-sudoku swell-foop tali gnome-taquin gnome-tetravex evolution
#update
sudo apt-get -y update and sudo apt-get -y upgrade
sudo apt-get install -y python-pip ipython zsh vim git vlc
#apt-add
@sunnykrGupta
sunnykrGupta / .fonts.conf
Created February 1, 2017 07:46
Improve rendering in debian 8
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
<edit name="antialias" mode="assign"><bool>true</bool></edit>
</match>
<match target="font">
<edit name="hintstyle" mode="assign"><const>hintnone</const></edit>
</match>
<match target="font">
@sunnykrGupta
sunnykrGupta / centos_python.sh
Created February 1, 2017 11:55 — forked from selfboot/centos_python.sh
CentOS 6.8: Install Python 2.7.10, pip, virtualenv, and virtualenvwrapper on CentOS
#!/bin/bash
# According to:
# How To Set Up Python 2.7.6 and 3.3.3 on CentOS 6.4
# https://www.digitalocean.com/community/tutorials/how-to-set-up-python-2-7-6-and-3-3-3-on-centos-6-4
yum -y update
yum groupinstall -y 'development tools'
yum install -y zlib-dev openssl-devel sqlite-devel bzip2-devel
yum install xz-libs
wget http://www.python.org/ftp/python/2.7.10/Python-2.7.10.tar.xz
I have three file in my directory named 'flask' :
➜ flask
── app.py
── Dockerfile
── requirement.txt
#----------------------------------------------
$ cat app.py
#sample-deployment.yaml
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 3
template:
metadata:
###### cat sample-services.yaml
kind: Service
apiVersion: v1
metadata:
name: my-service
spec:
type: LoadBalancer
loadBalancerIP: 10.10.10.1
ports:
## To view Nodes in a cluster
$kubectl get nodes
NAME STATUS AGE
gke-test-cluster-default-pool-2d123aa1-012f Ready 2d
gke-test-cluster-default-pool-2d123aa1-e23k Ready 2d
## To view the Deployment we created run:
$ kubectl get deployments