Skip to content

Instantly share code, notes, and snippets.

View nfl0's full-sized avatar
😋

nfl0

😋
View GitHub Profile
import time
from blake3 import blake3
import hashlib
# Data for benchmarking
data = b"some data to hash" * 1000000
# BLAKE3 hashing and benchmarking
start_time_blake3 = time.time()
hasher_blake3 = blake3()
@nfl0
nfl0 / Python Programming Techniques Demo
Created April 17, 2023 11:18
This Python script demonstrates various programming techniques including conditional statements, loops, lists, dictionaries, functions, classes, file handling, random numbers, and system commands. Each programming technique is accompanied by examples and comments for clarity and understanding. Use this script as a reference or tutorial for learn…
# Importing modules
import os
import random
# Declaring variables
num1 = 5
num2 = 10
name = "John"
# Conditional statements
@nfl0
nfl0 / main.py
Created April 11, 2023 12:13
Don't sell in May, stay invested! #SellinMayAndGoAway
import requests
import pandas as pd
from scipy.stats import ttest_ind
# set up Coingecko API endpoint
base_url = "https://api.coingecko.com/api/v3"
endpoint = "/coins/bitcoin/market_chart"
# set number of days to retrieve historical data for
days = "max"
@nfl0
nfl0 / rpc_test.py
Created March 1, 2023 16:42
Check whether RPC is operational or not.
import requests
url = "https://rpc-mumbai.maticvigil.com"
try:
response = requests.post(url, json={"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1})
if response.status_code == 200 and "result" in response.json():
print("RPC is operational.")
print(response.json())
else:
#!/bin/bash
source $HOME/.bashrc
TZ=Africa/Casablanca
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
apt-get update
apt-get upgrade -y
apt-get install -y sudo nano wget tar zip unzip jq goxkcdpwgen ssh nginx build-essential git make gcc nvme-cli pkg-config libssl-dev libleveldb-dev clang bsdmainutils ncdu libleveldb-dev apt-transport-https gnupg2 cron
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
(echo ${my_root_password}; echo ${my_root_password}) | passwd root
service ssh restart
### Keybase proof
I hereby claim:
* I am nfl0 on github.
* I am naoufal (https://keybase.io/naoufal) on keybase.
* I have a public key ASAVv-4C6nesoQ9hHgvj46_8uBkydMmKU08Q0I7Tc91jOwo
To claim this, I am signing this object:
@nfl0
nfl0 / attestation.txt
Created April 12, 2022 04:15
Attestation
I contributed to the Semaphore Trusted Setup Multi-Party Ceremony.
The following are my contribution signatures:
Circuit: semaphore21
Contributor # 311
Hash: 7210d77e 2a58c23f 6b191f9b ddcd1219
4b1b2d27 b94d7d37 ab4d9351 07004cb6
e8b304e8 6a09e114 02103d9d 2b74f156
424ea978 f2ae9828 da863a46 ad43ea54
@nfl0
nfl0 / xorg.conf
Created February 27, 2022 00:21
my X server config (dual monitor + dual GPU) rig (Intel igpu+NVIDIA)
################################################################################
# Filename: /etc/X11/xorg.conf
# Purpose: config file for xserver
# See also:
# /usr/share/doc/xserver-xorg/ and
# http://wiki.x.org/wiki/Home and
# http://ftp.x.org/pub/X11R7.0/doc/html/index.html for information on Xorg
# Refer to the xorg.conf man page and to
# http://ftp.x.org/pub/X11R7.0/doc/html/xorg.conf.5.html
# for details about the format of this file.
##### config.yml #####
email:
username: darcoders77@gmail.com
password: roddy2023
imap_host: imap.gmail.com
imap_port: 993
##### end of config.yml #####
@nfl0
nfl0 / gist:89a7c211187ff09a4a20dbde73619da5
Created July 17, 2021 05:18
Packages crashing raspbian 5.10.17-v7+ (apt upgrade)
Following packages cause the filesystem to crash (sd card read/write):
* libraspberrypi-dev
* libraspberrypi-[bin, dev, doc]
* libx11-data
* raspberrypi-kernel
patch/hack:
apt-mark hold libraspberrypi-dev libraspberrypi-bin libraspberrypi-doc libx11-data raspberrypi-kernel