This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Simple script to format a garbled python Traceback | |
where all new lines and tabs have been removed, and | |
to add them back. | |
""" | |
import sys | |
import os | |
import re |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# syntax=docker/dockerfile:1 | |
# Keep this syntax directive! It's used to enable Docker BuildKit | |
# Based on https://github.com/python-poetry/poetry/discussions/1879?sort=top#discussioncomment-216865 | |
# but I try to keep it updated (see history) | |
################################ | |
# PYTHON-BASE | |
# Sets up all our shared environment variables | |
################################ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ unset HISTFILE | |
$ gdb -q /usr/bin/etftp | |
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1". | |
(gdb) run -g $(perl -e 'print "AAAA"x64;for($i=65;$i<90;$i++){print | |
chr($i)x4}') | |
Starting program: /usr/bin/etftp -g $(perl -e 'print | |
"AAAA"x64;for($i=65;$i<90;$i++){print chr($i)x4}') | |
tftp: unknown host | |
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | |
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
WARNING: CAN TRIGGER EPILEPSY, ESPECIALLY IF ZOOMED IN ! | |
This is a very stupid white noise generator. | |
It simulates a TV screen's static noise so that you can display it onto a screen | |
and make it look like a TV. | |
I made it because I like that effect and couldn't find an app for it, but only shitty GIFs that aren't really random. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%!PS | |
% Author: Samuel Prevost <[email protected]> | |
% To view the result, run ps2pdf file.gs output.pdf | |
% Ref | |
% https://www-cdf.fnal.gov/offline/PostScript/BLUEBOOK.PDF | |
% https://www.math.ubc.ca/~cass/courses/ps.html | |
% https://ift2015h20code.files.wordpress.com/2020/01/ift2015h20-tp1-postscript.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import io | |
import os | |
from sys import argv | |
from time import sleep | |
from flask import Flask, Response, render_template | |
from PIL import Image | |
app = Flask(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import annotations | |
import os | |
from typing import List, Optional, Dict, Union | |
import subprocess as sp | |
import plotly.express as px | |
import torch | |
class Singleton(type): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
def main(): | |
"""Main function""" | |
for i in range(30, 37 + 1): | |
print(("\033[%dm" % i) + ("\\033[%dm" % i)) | |
print("\033[39m\\033[49m - Reset colour") | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CLI | |
import sys | |
# Traceroute | |
import pexpect | |
# import trparse # DEPRECATED | |
import socket | |
import struct | |
# IP location | |
import json | |
import urllib.request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import gym | |
import numpy as np | |
from itertools import count | |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import torch.optim as optim | |
from torch.distributions import Categorical |
NewerOlder