Skip to content

Instantly share code, notes, and snippets.

View abhishekjiitr's full-sized avatar
:electron:
👨‍💻

Abhishek Jaisingh abhishekjiitr

:electron:
👨‍💻
View GitHub Profile
@abhishekjiitr
abhishekjiitr / k8s-secret-to-files.py
Last active November 18, 2020 12:33
Python script to read a given Kubernetes Secret and export all the keys present in it into separate files, base64 decoding values appropriately
#!/usr/bin/env python3
"""
Python script to read a given Kubernetes Secret and export all the keys present
in it into separate files, base64 decoding if necessary
Needs one command line argument, the secret name to read
"""
import base64
import pathlib
@abhishekjiitr
abhishekjiitr / medium-linux-kernel-module-programming-hello.c
Last active December 11, 2020 07:23
Medium Blog Linux Kernel Module Programming Supporting Code
// hello.c
#include <linux/module.h>
#include <linux/kernel.h>
// license for the module. required
MODULE_LICENSE("GPL");
// executed when module is inserted
int init_module(void)
{
@abhishekjiitr
abhishekjiitr / medium-linux-kernel-module-programming-Makefile
Created June 14, 2020 09:55
Medium Blog Linux Kernel Module Programming Supporting Code
# Makefile
obj-m += hello.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) cleanvv
@abhishekjiitr
abhishekjiitr / medium-linux-kernel-module-programming-Makefile
Created June 14, 2020 09:55
Medium Blog Linux Kernel Module Programming Supporting Code
# Makefile
obj-m += hello.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) cleanvv
@abhishekjiitr
abhishekjiitr / project-euler-19.py
Created March 9, 2020 10:57
Python based Solution to Project Euler Problem 19
# 1 Jan 1901 to 31 Dec 2000
# 1 Jan 1900 Monday => 1 Jan 1901 => Tuesday
month_days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
def is_leap(y):
return y % 400 == 0 if y % 100 == 0 else y % 4 == 0
def get_month_days(y, i):
if is_leap(y) and i == 1:
return 29
@abhishekjiitr
abhishekjiitr / Makefile
Created December 19, 2016 18:45
matxin-eng makefile
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile. Generated from Makefile.in by configure.
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
@abhishekjiitr
abhishekjiitr / python_must_install.md
Created November 30, 2016 10:22
Must have python packages

Python Must Have Packages

Mechanize

pip install mechanize
@abhishekjiitr
abhishekjiitr / ctf_must_have_tools.md
Last active November 30, 2016 10:47
List of most recommended tools for ctf / hacking

CTF / Hacking Must Have Tools

netcat

sudo apt install netcat

sqlmap

 sudo pip install sqlmap
@abhishekjiitr
abhishekjiitr / ubuntu_must_install.md
Last active April 8, 2022 00:08
top things to do after installing a fresh ubuntu
@abhishekjiitr
abhishekjiitr / air_india_queries.sql
Last active November 19, 2016 20:54
Queries for the Air India Database
# Check for expired aircrafts
SELECT AcID, Mfg_Date, Type FROM AirCraft JOIN AirCraft_Type ON (AirCraft.Ac_Type = AirCraft_Type.ActID) WHERE YEAR(CURDATE()) - YEAR(Mfg_Date)> 2 LIMIT 10;
# Flights btw airports
SELECT FlId, FlightDate, Fare, Departure, Arrival FROM ((Flight_Schedule JOIN AirFare ON (Flight_Schedule.NetFare=AirFare.AfID)) ) JOIN Route ON (Route=RtID) WHERE Airport='New Delhi' AND Destination='Bangalore';
# Passengers on Flight
SELECT Name, Age, Mobile FROM Transaction JOIN Passenger ON (Transaction.Passenger = PsID) JOIN Contact_Details ON (Contacts=CnID) WHERE Flight=5 ORDER BY Name LIMIT 10;
# Minor Passengers with complete address