Skip to content

Instantly share code, notes, and snippets.

View fronbasal's full-sized avatar
👨‍💻

Daniel Malik fronbasal

👨‍💻
View GitHub Profile
@fronbasal
fronbasal / crawler.py
Created July 6, 2024 19:28
SciHub downloader
from pathlib import Path
import requests
from bs4 import BeautifulSoup
# Inspired by https://github.com/stormsuresh92/Bulk-download-Sci-Hub-papers
class SciHub:
def __init__(self, doi: str, path: Path, url='https://sci-hub.se/', timeout=60):
self.url = url
self.timeout = timeout
@fronbasal
fronbasal / pretix-django-storages-writeup.md
Last active July 5, 2024 22:58
Pretix django-storages (S3) configuration for staticfiles & media

Pretix django-storages (S3) configuration

This is a quick write-up on how to configure Pretix (based on the Small-scale manual deployment documentation by Pretix) to use S3 (or another supported django-storages backend) to speed up page hits.

The process of this and additional steps to undertake are underlined in Pretix' scaling guide.

I wrote this to make it easier for myself and you to do this again ;)

  1. Create a new directory in /var/pretix, i.e. settings, include this directory in your PYTHONPATH.
  2. Add a custom settings.py by overwriting DJANGO_SETTINGS_MODULE as outlined in the scaling guide
@fronbasal
fronbasal / traktor_3.9.0_mac_arm_fix.md
Last active February 28, 2024 21:41
Fxing Traktor >= 3.9.0 on Apple M (Arm) chips

Traktor >= 3.9.0 Mac M1/M2/M3 Fix

Instructions on fixing Traktor >= 3.9.0 on MacOS with M1/M2/M3 chips:

  1. Open Terminal
  2. cd /Applications/Native\ Instruments/Traktor\ Pro\ 3/Traktor.app/Contents/MacOS
  3. cp Traktor Traktor.bak
  4. sudo lipo -thin x86_64 Traktor.bak -output Traktor

This will extract the x86_64 binary from the universal binary with 2 architectures.

@fronbasal
fronbasal / github_gc.py
Created February 13, 2024 15:59
Clean up github repository (set public repositories private, delete forks)
import github3
import click
@click.command()
@click.argument('access_token', required=True, type=str)
def main(access_token):
gh = github3.login(token=access_token)
username = gh.me().login
operator operator_owned_restaurants
McDonald's Deutschland LLC 118
Autobahn Tank & Rast QSR GmbH 31
Willy Dany Restaurantbetriebsgesellschaft mbH & Co. Service KG 29
Systemgastronomie Christian Eckstein GmbH & Co. KG 28
Heinritzi GmbH & Co. Restaurant KG 28
Mike Kraft Systemgastronomie e. K. 15
Hubertus Elster e.K. Systemgastronomie 15
Frank Mosher Restaurants e.K.

Keybase proof

I hereby claim:

  • I am fronbasal on github.
  • I am fronbasal (https://keybase.io/fronbasal) on keybase.
  • I have a public key whose fingerprint is 0CD0 E229 DA22 4C4A 7560 4E6F A9F6 A553 F4CC F339

To claim this, I am signing this object: