This article demonstrates how to install Fedora Linux on MacOS.
Specifically we will use
- a macbook with m1 (arm/apple silicon) processor & 32GB ram
- macOS Sonoma 14.0
- Fedora Linux beta
- UTM as the virtualization tool
This article demonstrates how to install Fedora Linux on MacOS.
Specifically we will use
import socket | |
import select | |
from logzero import logger | |
# python forwarder.py localhost:1337 ipinfo.io:80 | |
# curl -v http://localhost.com:1337 -H "Host: ipinfo.io" | |
# video: https://www.youtube.com/watch?v=32KKwgF67Ho | |
class Forwarder: |
pragma solidity >=0.8.0 <0.9.0; | |
// SPDX-License-Identifier: MIT | |
/// [MIT License] | |
/// @title Base64 | |
/// @notice Provides a function for encoding some bytes in base64 | |
/// @author Brecht Devos <brecht@loopring.org> | |
library Base64 { | |
bytes internal constant TABLE = | |
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; |
import os | |
import requests | |
from urllib.parse import urljoin | |
from bs4 import BeautifulSoup | |
import argparse | |
#%% Example | |
# one pdf | |
# python all_pdf_dl.py -l https://memento.epfl.ch/academic-calendar/ --save-here | |
# many pdfs |
Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.
NOTE: This logic can be extended to more than two accounts also. :)
The setup can be done in 5 easy steps:
import json | |
class EventStore: | |
base_location = 'events' | |
storage_format = 'jsonl' | |
@classmethod | |
def _get_event_storage_path(cls, key): |
{ | |
"Statement": [ | |
{ | |
"Action": [ | |
"apigateway:*", | |
"cloudformation:CancelUpdateStack", | |
"cloudformation:ContinueUpdateRollback", | |
"cloudformation:CreateChangeSet", | |
"cloudformation:CreateStack", | |
"cloudformation:CreateUploadBucket", |
countries = [ | |
{'timezones': ['Europe/Andorra'], 'code': 'AD', 'continent': 'Europe', 'name': 'Andorra', 'capital': 'Andorra la Vella'}, | |
{'timezones': ['Asia/Kabul'], 'code': 'AF', 'continent': 'Asia', 'name': 'Afghanistan', 'capital': 'Kabul'}, | |
{'timezones': ['America/Antigua'], 'code': 'AG', 'continent': 'North America', 'name': 'Antigua and Barbuda', 'capital': "St. John's"}, | |
{'timezones': ['Europe/Tirane'], 'code': 'AL', 'continent': 'Europe', 'name': 'Albania', 'capital': 'Tirana'}, | |
{'timezones': ['Asia/Yerevan'], 'code': 'AM', 'continent': 'Asia', 'name': 'Armenia', 'capital': 'Yerevan'}, | |
{'timezones': ['Africa/Luanda'], 'code': 'AO', 'continent': 'Africa', 'name': 'Angola', 'capital': 'Luanda'}, | |
{'timezones': ['America/Argentina/Buenos_Aires', 'America/Argentina/Cordoba', 'America/Argentina/Jujuy', 'America/Argentina/Tucuman', 'America/Argentina/Catamarca', 'America/Argentina/La_Rioja', 'America/Argentina/San_Juan', 'America/Argentina/Mendoza', 'America/Argentina/Rio_Gallegos', 'America/Argentina/Ushuai |
FROM python:latest | |
ADD requirements.txt /requirements.txt | |
RUN python3.6 -m venv /venv \ | |
&& /venv/bin/pip install -U pip \ | |
&& LIBRARY_PATH=/lib:/usr/lib /bin/sh -c "/venv/bin/pip install --no-cache-dir -r /requirements.txt" | |
ENV PYTHONUNBUFFERED 1 | |
# Copy your application code to the container (make sure you create a .dockerignore file if any large files or directories should be excluded) | |
RUN mkdir /code/ |
version: '2' | |
services: | |
zookeeper: | |
image: confluentinc/cp-zookeeper:3.3.0 | |
hostname: zookeeper | |
ports: | |
- "2181:2181" | |
environment: | |
ZOOKEEPER_CLIENT_PORT: 2181 |