Skip to content

Instantly share code, notes, and snippets.

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

Abhishek Jaisingh abhishekjiitr

:electron:
👨‍💻
View GitHub Profile
@levsthings
levsthings / docker-ce-ubuntu-17.10.md
Last active April 13, 2023 21:05
Install Docker CE on Ubuntu 17.10

Installing Docker CE on Ubuntu 17.10 Artful Aardvark

As of 20/10/2017, a release file for Ubuntu 17.10 Artful Aardvark is not available on Download Docker.

If you are used to installing Docker to your development machine with get-docker script, that won't work either. So the solution is to install Docker CE from the zesty package.

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
@sahilsk
sahilsk / kafka-cheat-sheet.md
Last active April 12, 2024 01:27 — forked from filipefigcorreia/kafka-cheat-sheet.md
Apache Kafka Cheat Sheet

Kafka Cheat Sheet

Display Topic Information

$ kafka-topics.sh --describe --zookeeper localhost:2181 --topic beacon
Topic:beacon	PartitionCount:6	ReplicationFactor:1	Configs:
	Topic: beacon	Partition: 0	Leader: 1	Replicas: 1	Isr: 1
	Topic: beacon	Partition: 1	Leader: 1	Replicas: 1	Isr: 1
@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
@asutoshpalai
asutoshpalai / go_back_n.c
Last active August 5, 2016 15:57
Sliding window protocol
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include <signal.h>
#include <time.h>
#include <fcntl.h>
#include <string.h>
#include <stdio.h>
#define PACKET_DROP_PROBABILITY 4 // Inverse of the probability
@abhishekjiitr
abhishekjiitr / subset_sum.cpp
Created February 9, 2016 10:11
Subset Sum DP
#include <bits/stdc++.h>
using namespace std;
void printer(int** a, int r, int c)
{
cout << endl;
for ( int i = 0 ; i <= r ; i++ )
{
for ( int j = 0 ; j <= c ; j++ )
{
cout << a[i][j] << " ";
@abhishekjiitr
abhishekjiitr / AdventOfCodeDay7.py
Created December 22, 2015 18:20
Advent of Code Day 7 Python Code Solution PS: Just basic recursion and memoization
def getdata(filename):
d = dict()
with open(filename, "r") as f:
for line in f.readlines():
line = line.replace('\n', '').split(' -> ')
d[line[1]] = line[0]
return d
def evaluate(var, d):
try:
val = int(var)
@egel
egel / auto-remove-sublime-license-popup
Last active April 8, 2024 23:00
Auto-remove Sublime's license popup
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sublime_plugin
import subprocess
from time import sleep
import sys
cl = lambda line: subprocess.Popen(line, shell=True, stdout=subprocess.PIPE).communicate()[0].strip()
log = lambda message: sys.stderr.write("Log: %s\n" % message)