Skip to content

Instantly share code, notes, and snippets.

View pruthvi6767's full-sized avatar
📺
Working from home

pruthvi6767

📺
Working from home
View GitHub Profile
@pruthvi6767
pruthvi6767 / sample.txt
Created August 21, 2017 05:23
Fortinet_QA
1. Objective: Algorithm:
Reverses a single list. Need answer with Java code
The Node of the single list as the following:
class Node{
Node next;
int value;
}
Test Cases:
@pruthvi6767
pruthvi6767 / Writing-Own-Gem
Created March 15, 2018 15:53
Generate boiler plate code for writing my own gem
Thanks to Fabiano (original author and CTO @ magnetis)..This is just a copy of his work in medium and all the credits are to his work out there...
I'm just trying to make it available through github....!! TO see a complete simple CLI tool please visit gitub.com/DevAuto/Learn-Tech
------------------------------------------------------------------------------------------------------------------------------
In this article we will write a simple example inspired by one of the best Breaking Bad scenes. But apart of its simplicity, it is the same process to create a CLI for really anything you want.
Creating a new gem
Let’s get started by creating a new gem, that will make it easier to distribute our software, in this case the executable file.
To create a new gem, bundler has a handy command (bundler itself is crafted with Thor):
class CLI < Thor
desc 'auto', 'start'
method_option :user,
required: true,
desc: 'username',
aliases: '-u'
method_option :pwd,
aliases: '-p',
required: true,
desc: "password"
## Generates an html page using ERB
require 'erb'
*Initializes the key,val objects to bind the erb templates
class BindMe
attr_accessor :key
attr_accessor :val
def initialize(key,val)
@key=key
@pruthvi6767
pruthvi6767 / ruby shell
Created July 11, 2018 15:29
launch shell sub process in ruby
https://i.stack.imgur.com/1Vuvp.png
@pruthvi6767
pruthvi6767 / gitlab.txt
Created March 22, 2019 20:51
manual setup
Starting Chef Client, version 13.6.4
resolving cookbooks for run list: ["gitlab"]
Synchronizing Cookbooks:
- gitlab (0.0.1)
- package (0.1.0)
- postgresql (0.1.0)
- redis (0.1.0)
- mattermost (0.1.0)
- registry (0.1.0)
- gitaly (0.1.0)
@pruthvi6767
pruthvi6767 / curl.md
Created August 5, 2019 19:05 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

#!/usr/bin/env python3
import abc
import sys
import urllib3
from http.client import HTTPSConnection
import json
import asyncio
import time
import logging
import aiohttp.client as async_http_client
from collections import deque
s = set()
q = deque()
count = 0
pictures = ['aaabc', 'aabbc', 'aaaac']
#pictures = ['ace', 'acd']
for i in range(len(pictures)):
for j in range(len(pictures[0])):
@pruthvi6767
pruthvi6767 / bs.py
Created November 22, 2019 01:35
bs
b = [1,2,3,4,5]
k = 6
l = 0
h = len(b)
def binary_Search(b,l,h,k):
m = (l+h)//2
#print(m)
if b[m] == k:
return True