Skip to content

Instantly share code, notes, and snippets.

View Flecart's full-sized avatar
🔥

X. Angelo Huang Flecart

🔥
View GitHub Profile
@Flecart
Flecart / md_to_latex.py
Created April 3, 2024 19:53
Small script to convert a markdown file into a tex file using some template and copying onto the clipboard.
#!/usr/bin/env python3
import sys
import os
import re
import subprocess
# Function to display help information
def display_help():
print("A script to build tex files for your papers")
@Flecart
Flecart / ip_plotter.py
Created March 19, 2024 20:56
Give a CSV with the list of IPs, then this script will try to create a map with the geolocation of everyIP! Don't know if you can batch the requests, currectly it is quite slow, at a rate of 30 plots for minute.
import pandas as pd
from geopy.geocoders import Nominatim
import folium
# Load the CSV file with pandas
df = pd.read_csv('access-log.csv') # Replace 'ip_addresses.csv' with your CSV file name
filtered_df = df[~df['Source IP'].str.startswith('192.168.1.')]
# Initialize geocoder
@Flecart
Flecart / string_appender.py
Created July 14, 2023 21:23
I used this script to add some tags on my obsidian vault, it's useful if you just imported stuff from notion-like websited, and you are trying to migrate to obsidian
#diary #pensieri
import os
def add_tag(file_name):
with open(file_name, 'r+') as f:
content = f.read()
f.seek(0, 0)
# if a string is in the file then print helloworld