Skip to content

Instantly share code, notes, and snippets.

View GooDeeJAY's full-sized avatar
👨‍💻
Hacking Pentagon

Jasur Yusupov GooDeeJAY

👨‍💻
Hacking Pentagon
View GitHub Profile
@hirokiky
hirokiky / periodic.py
Last active January 24, 2022 05:08
Periodic calling with asyncio
import asyncio
import logging
import time
import psutil
logger = logging.getLogger(__name__)
@GooDeeJAY
GooDeeJAY / random_generator.md
Last active August 3, 2022 06:20
Creative and fun ways of generating random numbers

Fun and creative ways of generating random numbers in python

Here I'm going to show some creative and fun ways of generating random numbers without using random package in python.

Example 1 - Generating random number in range 0-9

When we call time() function of the package time, it returns floating point number - current time in seconds since the Epoch:

>>> time.time()
3392849227.6848479
@bfroehle
bfroehle / file_wrapper.cpp
Created October 5, 2011 22:09
Boost.Python from Python to FILE* wrapper
#include <boost/python.hpp>
#include <iostream>
namespace {
void *convert_to_FILEptr(PyObject* obj) {
return PyFile_Check(obj) ? PyFile_AsFile(obj) : 0;
}
}
void test_argument(FILE* f) {
@thepoppingone
thepoppingone / m3u8streamffmpegdl.sh
Last active February 27, 2023 14:32
Download m3u8 playlist with ffmpeg - step by step download script (ffmpeg binary required)
#!/bin/sh
# Author : Wang Poh Peng
# Description : Use FFMPEG to download videos into mkv or mp4 format
RED='\033[1;31m'
NC='\033[0m' # No Color
GREEN='\033[0;32m'
CYAN='\033[0;36m'
@Jaza
Jaza / Private-pypi-howto
Last active July 2, 2023 16:24
Guide for how to create a (minimal) private PyPI repo, just using Apache with directory autoindex, and pip with an extra index URL.
*
@timbuethe
timbuethe / TestTablePagination
Last active September 23, 2023 18:27
JavaFX TableView with Pagination example
import javafx.application.Application;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Pagination;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
@GooDeeJAY
GooDeeJAY / docker_certbot.md
Last active October 30, 2023 12:21
Docker Certbot

Docker Certbot obtain SSL Certificate

Starting Nginx Server

Create nginx.conf file:

server {
  listen 80;
 server_name your_domain.uz;
@cbuckowitz
cbuckowitz / README.md
Last active January 21, 2024 21:17
Change Storage Location for Docker Desktop with WSL2 #DockerDesktop #WSL2

Change the Storage Location for Docker Desktop with WSL2

Docker Desktop stores docker data in 2 distros

  • docker-desktop
  • docker-desktop-data

These distros are installed on the system drive by default.

To move them to another drive, these distros can be exported, deleted and imported from the new location.

@joyrexus
joyrexus / README.md
Last active February 24, 2024 15:16
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@gabrielfalcao
gabrielfalcao / rsa_encryption.py
Created November 30, 2019 00:39
Using python cryptography module to generate an RSA keypair, serialize, deserialize the keys and perform encryption and decryption
import base64
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric import padding
def utf8(s: bytes):
return str(s, 'utf-8')