Skip to content

Instantly share code, notes, and snippets.

View zommiommy's full-sized avatar
💤
Too tired to live

Tommaso Fontana zommiommy

💤
Too tired to live
View GitHub Profile
@zommiommy
zommiommy / GetFileInFolder.md
Last active January 6, 2019 10:35
GetFileInFolder

A little recursive function that return the list of absolute path of all the file in a folder.

from os import listdir
from os.path import isfile

def get_file_in_folder(path="."):
    if isfile(path):
 return path
@zommiommy
zommiommy / Firing_up_LaTex_on_Windows.md
Last active April 5, 2021 16:42
Firing up LaTex on Windows 🔥

Firing up LaTex on Windows 🔥

Tex

There are 2 main Tex Distribution for windows The main difference is that TexLive has tlmgr that allows you to make a granular installation downloading only the package that you'll need. While MikTex has tons of packagee per installed but it works too.

TexLive

TexLive for windows Click here to download it (Warning: The full installation of TexLive is big and it will take a while)

@zommiommy
zommiommy / latex_to_markdwon.md
Last active January 6, 2019 12:17
Latex $<Text>$ to markdown which don't support mathjax

Latex dollars to markdown which don't support mathjax

Since GitHub READEME doesn't seems to sopport math mode like $\int_0^1 cos(\theta) d\theta = 1$

We can workaround this using codecogs which is an online latex equation editor which provvides it's outpus as gifs.

The base gif url is https://latex.codecogs.com/gif.latex? which is followed by the percentage encoded query.

So i made this function to convert an equation to a Markdown image:

@zommiommy
zommiommy / setup.sh
Created June 14, 2019 13:54
Manjaro Setup Script
#!/bin/bash
sudo pacman -Syu base-devel git gdb vim nano terminator net-tools netcat zsh linux419-headers gparted neofetch htop nmap jdk-openjdk pycharm-community-edition
yay -S google-chrome code gitkraken spotify telegram-desktop
yay -S nvidia nvidia-utils lib32-nvidia-utils nvidia-settings
# Setup Zsh
sh -c "$(wget -O- https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
@zommiommy
zommiommy / x.py
Created April 4, 2020 19:08
MidnightsunCTF 2020 Admpanel2
from pwn import *
s = remote("admpanel2-01.play.midnightsunctf.se", 31337)
system = 0x000000000401598
username_addr = 0x000000000040159B
s.sendline("1")
s.sendline("admin")
s.sendline("password")
@zommiommy
zommiommy / .latexmkrc
Last active April 15, 2020 13:39
Overleaf Default .latexmkrc
###############################
# Add shell-escape
###############################
$latex = 'latex %O --shell-escape %S';
$pdflatex = 'pdflatex %O --shell-escape %S';
###############################
# Post processing of pdf file #
###############################
@zommiommy
zommiommy / Dockerfile
Last active May 14, 2020 13:31
Mongodb laboratory service
from mongo:latest
ENV DEBIAN_FRONTEND=noninteractive
# 32 bit
RUN dpkg --add-architecture i386
RUN apt-get update -qyy && apt-get install -qyy apt-utils build-essential software-properties-common
###########################################################
# Basic devel tools
###########################################################
@zommiommy
zommiommy / tldr.md
Created August 4, 2020 06:31
Tensorflow gpu setup for ubuntu

How to setup tensorflow gor gpu on Ubuntu

To check if tensorflow can detect any GPU just run

python -c "import tensorflow as tf;print(tf.test.is_gpu_available(True))"

If the GPUs are available it should print True.

Setup anaconda

The easiest way to setup cuda and tensorflow-gpu is to install everything using anaconda. Anaconda do not requires root permissions and create a self-contained folder in $HOME/anaconda3.

@zommiommy
zommiommy / keras_metrics.py
Last active November 10, 2020 12:35
A bunch of metrics for binary classification tasks implemented in Keras
import tensorflow as tf
import tensorflow.keras.backend as K
from tensorflow.keras.metrics import Metric, AUC
from tensorflow.keras.backend import epsilon
class ConfusionMatrixMetric(Metric):
def __init__(self, name, **kwargs):
super(ConfusionMatrixMetric, self).__init__(name=name, **kwargs)
self.tp = self.add_weight(name='tp', initializer='zeros')
self.fp = self.add_weight(name='fp', initializer='zeros')
@zommiommy
zommiommy / x.py
Last active December 2, 2020 21:33
HITCON2020 dual expolit
from pwn import *
libc = ELF('/lib/x86_64-linux-gnu/libc-2.31.so')
host = '13.231.226.137'
port = 9573
p = remote(host, port)
def op():