Skip to content

Instantly share code, notes, and snippets.

View oswalpalash's full-sized avatar

Palash Oswal oswalpalash

View GitHub Profile
@oswalpalash
oswalpalash / chat.py
Last active December 11, 2022 18:31
Make AI go brr
import sys
import os
import time
from chatgpt import Conversation
conversation1 = Conversation(config_path="./config.json")
conversation2 = Conversation(config_path="./config2.json")
if os.path.exists("log.txt"):
conversation1.reset()
op1 = conversation1.chat("My name is Assistant. How's it going?")
@oswalpalash
oswalpalash / dash.json
Created May 26, 2021 12:10
syzkaller grafana dashboard
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@oswalpalash
oswalpalash / subnetter.sh
Created December 26, 2018 09:54
Write a bash script to subdivide a given CIDR /24 and smaller subnets into a pre-defined number of smaller subnets.
#!/bin/bash
CIDR=""
BASE_IP=""
PARTS=""
validate() {
if [[ $BASE_IP =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
:
else
@oswalpalash
oswalpalash / flight.py
Created March 11, 2017 08:18
Google Flight API - Unlimited Key Queries
#!/usr/bin/python
import json,os,subprocess,requests,sys,datetime,smtplib
from datetime import timedelta
from pprint import pprint
SOURCES = ["BOM","BDQ","DEL"]
DESTINATIONS = ["BOM","BDQ","DEL","HYD","SFO","IAD","DXB","SIN","LHR","IXZ"]
WHEN = str(datetime.datetime.now() + datetime.timedelta(days=10)).split(" ")[0]
KEYS=["KEY1","KEY2","KEY3","KEY4","KEY5","KEY6","KEY7","KEY8","KEY9","KEY10","KEY11","KEY12","KEY13","KEY14","KEY15"]
// $ echo pikachu|sudo tee pokeball;ls -l pokeball;gcc -pthread pokemon.c -o d;./d pokeball miltank;cat pokeball
#include <fcntl.h> //// pikachu
#include <pthread.h> //// -rw-r--r-- 1 root root 8 Apr 4 12:34 pokeball
#include <string.h> //// pokeball
#include <stdio.h> //// (___)
#include <stdint.h> //// (o o)_____/
#include <sys/mman.h> //// @@ ` \
#include <sys/stat.h> //// \ ____, /miltank
#include <sys/types.h> //// // //
#include <sys/wait.h> //// ^^ ^^
@oswalpalash
oswalpalash / curl.spec
Last active August 3, 2016 05:57
Generate curl rpm with OpenSSL
[palash@localhost SPECS]$ cat curl.spec
%define name owncurl
%define tarball curl
%define version 7.50.0
%define release 1
%define curlroot %{_builddir}/%{tarball}-%{version}
%define curlprefix /opt/owncurl
Summary: get a file from an FTP or HTTP server.
sudo yum install -y rpm-build
sudo yum install -y redhat-rpm-config
sudo yum install -y rpmdevtools rpmlint
#Post Installation
rpmdev-setuptree
HTTP/1.1 200 OK
Date: Wed, 04 Nov 2015 10:21:07 GMT
Server: Apache/2.4.6 (CentOS)
Last-Modified: Fri, 02 Oct 2015 10:36:53 GMT
ETag: "6c-5211cdbf61c14"
Content-Length: 108
Content-Type: text/html; charset=UTF-8
X-Varnish: 32770
Age: 0
Via: 1.1 varnish-v4
sudo apachectl restart
sudo systemctl restart varnish
sudo yum install -y httpd
service httpd start