Skip to content

Instantly share code, notes, and snippets.

View edi33416's full-sized avatar

Eduard Staniloiu edi33416

  • Bucharest, Romania
View GitHub Profile
demo
@edi33416
edi33416 / log_fn_decorator.py
Created April 11, 2022 14:26
Python function log decorator
import logging
import time
import inspect
from logging.handlers import RotatingFileHandler
from functools import wraps
class MyFormatter(logging.Formatter):
def format(self, record):
@edi33416
edi33416 / parse_teams_attendance_list.sh
Last active January 24, 2022 13:32
This parses MS Teams meeting attendance lists
#!/bin/bash
# Make sure your lists are in UTF-8.
# By default, on Windows, a downloaded file is saved using UTF-16 LE
# You can use the [convertutf16letoutf8.sh](https://gist.github.com/edi33416/834336a6866715088af2e603dfac4c01#file-convertutf16letoutf8-sh) script
if [ ! $# -eq 1 ]
then
echo -e "Error: wrong arguments.\n\tUsage: $0 <stud-attendance-list-dir>"
exit 1
@edi33416
edi33416 / purge.sh
Created November 3, 2021 13:14 — forked from adrienbrault/purge.sh
Script to reduce VM size before packaging for vagrant
#!/bin/sh
# Credits to:
# - http://vstone.eu/reducing-vagrant-box-size/
# - https://github.com/mitchellh/vagrant/issues/343
aptitude -y purge ri
aptitude -y purge installation-report landscape-common wireless-tools wpasupplicant ubuntu-serverguide
aptitude -y purge python-dbus libnl1 python-smartpm python-twisted-core libiw30
aptitude -y purge python-twisted-bin libdbus-glib-1-2 python-pexpect python-pycurl python-serial python-gobject python-pam python-openssl libffi5
@edi33416
edi33416 / .gdbinit
Last active March 28, 2024 02:42
GDB intro layout
# gdb configuration file
# place contents in ~/.gdbinit
source /home/fawkes/ws/pwndbg/gdbinit.py
# auto-load directory in which we run gdb, so we can have a
# .gdbinit per project directory
add-auto-load-safe-path .
# path to your library. Multiple dirs can be separated by ':' as in the comment below
set directories /home/fawkes/ws/glibc/glibc-2.31/stdio-common/
@edi33416
edi33416 / settings.json
Created October 12, 2021 17:50
Windows Terminal settings.json file
{
"$schema": "https://aka.ms/terminal-profiles-schema",
// Add custom actions and keybindings to this array.
// To unbind a key combination from your defaults.json, set the command to "unbound".
// To learn more about actions and keybindings, visit https://aka.ms/terminal-keybindings
"actions":
[
// Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json.
// These two lines additionally bind them to Ctrl+C and Ctrl+V.
// To learn more about selection, visit https://aka.ms/terminal-selection
@edi33416
edi33416 / etc-docker-daemon.json
Created September 6, 2021 12:59
Change docker data default location; place in /etc/docker/daemon.json with 644 perms and restart docker service
{
"data-root": "/home/edis/docker-data"
}
@edi33416
edi33416 / convertUtf16leToUtf8.sh
Last active November 30, 2021 14:07
Convert Windows UTF-16LE to UTF-8
#!/bin/bash
is_on_windows=1
if [ is_on_windows -eq 1]; then
for i in *.csv; do
powershell.exe -Command "Get-Content \"$i\" -Encoding Unicode | Set-Content -Encoding UTF8 \"r_$i\""
done
else
mkdir utf-8
@edi33416
edi33416 / gruvbox_light.json
Last active May 23, 2022 10:55
Gruvbox Light color scheme for Windows Terminal
{
"background": "#ffffaf",
"black": "#282828",
"blue": "#076678",
"brightBlack": "#A89984",
"brightBlue": "#076678",
"brightCyan": "#427B58",
"brightGreen": "#79740E",
"brightPurple": "#8F3F71",
"brightRed": "#9D0006",
@edi33416
edi33416 / hax.c
Created December 23, 2020 21:40 — forked from apsun/hax.c
Hook main() using LD_PRELOAD
/*
* Hook main() using LD_PRELOAD, because why not?
* Obviously, this code is not portable. Use at your own risk.
*
* Compile using 'gcc hax.c -o hax.so -fPIC -shared -ldl'
* Then run your program as 'LD_PRELOAD=$PWD/hax.so ./a.out'
*/
#define _GNU_SOURCE
#include <stdio.h>