Skip to content

Instantly share code, notes, and snippets.

View ShabbirHasan1's full-sized avatar
:octocat:
Building Things

Shabbir Hasan ShabbirHasan1

:octocat:
Building Things
  • India
View GitHub Profile
@ShabbirHasan1
ShabbirHasan1 / asyncio_multithreading_multiprocessing.py
Created August 9, 2021 18:00 — forked from CMCDragonkai/asyncio_multithreading_multiprocessing.py
Python AsyncIO with Multithreading and Multiprocessing #python
import time
import asyncio
import logging
import uvloop
import aiojobs.aiohttp
import sys
from aiohttp import web
import aioprocessing
import concurrent.futures
@ShabbirHasan1
ShabbirHasan1 / run_coroutine_in_another_thread.py
Created August 10, 2021 11:29 — forked from lars-tiede/run_coroutine_in_another_thread.py
Safely run a coroutine in another thread's asyncio loop and return the result
import threading
import asyncio
async def run_coro_threadsafe(self, coro, other_loop, our_loop = None):
"""Schedules coro in other_loop, awaits until coro has run and returns
its result.
"""
loop = our_loop or asyncio.get_event_loop()
# schedule coro safely in other_loop, get a concurrent.future back
@ShabbirHasan1
ShabbirHasan1 / exporter.user.js
Created August 28, 2021 18:53 — forked from Bluscream/exporter.user.js
Cookie/LocalStorage Export/Import Userscript
// ==UserScript==
// @name Cookie/LocalStorage Export/Import
// @namespace github.com/bluscream
// @version 1
// @description No Description Yet
// @author Bluscream
// @encoding utf-8
// @license GNU GPL v3
// @include http://*
// @include https://*
@ShabbirHasan1
ShabbirHasan1 / desktop-mode-ubuntu-aws-ec2.markdown
Created December 16, 2021 19:41 — forked from pseudokool/desktop-mode-ubuntu-aws-ec2.markdown
Desktop (GUI) mode for Ubuntu 16.04 on AWS EC2

Ubuntu 16.04 on AWS EC2

This guide enables desktop mode in Ubuntu 16.04 (Xenial Xerus) running off an AWS EC2.

Setup

  • Launch an EC2 instance with Ubuntu 16.04 (should work on all versions greater too)
  • Ensure a security group is configured, that allows ingress on ports 22 (SSH) and 5901 (VNC, 5900+N, where N is the display number)
  • SSH into the instance, update the system, install the XFCE desktop and the lightweight VNC server:
@ShabbirHasan1
ShabbirHasan1 / jackett.md
Created December 25, 2021 12:48 — forked from wilmardo/jackett.md
Jackett add public indexers all in one go

Source: Jackett/Jackett#1576 (comment)

From the Jackett page, click the "add indexer" button so that the pop up window with the full list of indexers appears.

You'll then need to open your browser's development toolbar (in Chrome just hit F12) and go to the JavaScript Console and enter the following:

////hack to add all free indexers in Jackett
$(document).ready(function () {
	EnableAllUnconfiguredIndexersList();
@ShabbirHasan1
ShabbirHasan1 / .gitignore
Created December 29, 2021 12:56 — forked from isaacarnault/.gitignore
Find all the Fridays of the year 2019 using Python
________ ________ ___ __ ___
|\_____ \|\ __ \|\ \|\ \ |\ \
\|___/ /\ \ \|\ \ \ \/ /|\ \ \
/ / /\ \ __ \ \ ___ \ \ \
/ /_/__\ \ \ \ \ \ \\ \ \ \ \
|\________\ \__\ \__\ \__\\ \__\ \__\
\|_______|\|__|\|__|\|__| \|__|\|__|
You don't have to use packages such as datetime, timedelta, calendar.
@ShabbirHasan1
ShabbirHasan1 / 01.js
Created December 31, 2021 14:01 — forked from vielhuber/01.js
Google Translate API Hacking #knowhow #tools
function Bp(a, b) {
var c = b.split(".");
b = Number(c[0]) || 0;
for (var d = [], e = 0, f = 0; f < a.length; f++) {
var h = a.charCodeAt(f);
128 > h ? d[e++] = h : (2048 > h ? d[e++] = h >> 6 | 192 : (55296 == (h & 64512) && f + 1 < a.length && 56320 == (a.charCodeAt(f + 1) & 64512) ? (h = 65536 + ((h & 1023) << 10) + (a.charCodeAt(++f) & 1023), d[e++] = h >> 18 | 240, d[e++] = h >> 12 & 63 | 128) : d[e++] = h >> 12 | 224, d[e++] = h >> 6 & 63 | 128), d[e++] = h & 63 | 128)
}
a = b;
for (e = 0; e < d.length; e++) a += d[e], a = Ap(a, "+-a^+6");
a = Ap(a, "+-3^+b+-f");

Building Fedora RPMs that use pesign

This guide describes how to build RPMs that use pesign. Pesign is used for signing PE/COFF EFI executables so that they can be used with UEFI secure boot. Enrolling DB or MOK keys and signing kernel modules is beyond the scope of this guide.

Preparation

  1. Install pesign.

    sudo dnf install pesign
@ShabbirHasan1
ShabbirHasan1 / create-kiteconnect-candlestick-q.py
Created January 19, 2022 19:07 — forked from oldmonkABA/create-kiteconnect-candlestick-q.py
Implementation of ticks to 1min and 15 mins candles in zerodha kiteconnect using python queues. This code is modified version of the code given in http://ezeetrading.in/Articles/Candles_formation_from_tick_data_zerodha.html. The difference is that in on_ticks functions the only action performed is that the ticks are place in a event queue. This …
################## Ticks to candles in kiteconnect python ####################
# Author : Arun B
# Reference : http://ezeetrading.in/Articles/Candles_formation_from_tick_data_zerodha.html
# Purpose : Convert ticks to candles by putting ticks in a queue. This redues time wasted in on_ticks function
################################################################################
from kiteconnect import KiteTicker
import datetime
from copy import copy
import queue
@ShabbirHasan1
ShabbirHasan1 / kitetickersample.html
Created January 19, 2022 19:12 — forked from ajinasokan/kitetickersample.html
Kite Ticker Pure JS Example
<script src="ticker.js"></script>
<script>
var ticker = new KiteTicker({api_key: "api_key", access_token: "access_token"});
ticker.connect();
ticker.on("ticks", onTicks);
ticker.on("connect", subscribe);
function onTicks(ticks) {