Skip to content

Instantly share code, notes, and snippets.

View this-is-r-gaurav's full-sized avatar

Gaurav this-is-r-gaurav

View GitHub Profile
@this-is-r-gaurav
this-is-r-gaurav / wifi-connect.sh
Last active October 10, 2021 09:50
wifi-connect
#!/usr/bin/env bash
ProgName=$(basename $0)
function main(){
# Main Caller Function
parse_args "$@"
}
function parse_args(){
sub_command=$1;
@this-is-r-gaurav
this-is-r-gaurav / awesome_commands.sh
Last active October 11, 2021 05:32
List of Commands that is used most frequently by me ...
# To list all the status whether they are enabled or disabled.
systemctl list-unit-files --type=service
# Grep The ID of Docker image having some name NAME
NAME=$0
docker ps | grep $NAME | awk 'print ${0}'
# To find a file that is not executable and is of text type
find . -type f ! -executable -exec file {} + | grep -w text
@this-is-r-gaurav
this-is-r-gaurav / cutomized_prompt.sh
Last active May 29, 2020 03:03
Bash Prompt: username in cwd
# get current branch in git repo
function parse_git_branch() {
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
if [ ! "${BRANCH}" == "" ]
then
STAT=`parse_git_dirty`
echo "[${BRANCH}${STAT}]"
else
echo ""
fi
# -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
import nmap
from scrapy.exceptions import DropItem
nm = nmap.PortScanner()
@this-is-r-gaurav
this-is-r-gaurav / get_proxy.py
Last active January 25, 2019 13:53
Proxy For Scrapy
import scrapy
import datetime
import scraper.items as ProxyItems
from scraper.settings import PROXY_DATA
import logging
class ProxySpider(scrapy.Spider):
name = 'proxy'
allowed_domains = ['sslproxies.org']
@this-is-r-gaurav
this-is-r-gaurav / GoogleMapJsonParser.js
Last active August 18, 2018 04:22
Struggling With Google Map Json Data, This Gist helps You analyze the data sent as Google JSON response and Get The Street City State automatically.
let lat = null; // place Your Latitude Value here
let lng = null; // place Your Longitude Value here
const YOUR_KEY = null; // place Your API Key here
$.get('https://maps.googleapis.com/maps/api/geocode/json?latlng=' + lat + ", " + lng + '&key=' + YOUR_KEY, function (data) {
if (data['status'] === "OK") {
let result = data['results'][0].address_components;
let street, city, state, postal_code, area = "";
for (let i = 0; i < result.length; i++) {
let type_of_param = result[i].types[0];
let long_name = result[i].long_name;