Skip to content

Instantly share code, notes, and snippets.

@albymor
albymor / .tmux.conf
Created May 12, 2025 18:14 — forked from rodricels/.tmux.conf
tmux configuration, mouse copy & paste added
# My tmux configuration, partly based on https://github.com/wbkang/wbk-stow/blob/master/tmux-config/.tmux.conf
# Scroll History
set -g history-limit 50000
# show messages for 4 seconds instead
set -g display-time 4000
# set first window to index 1 (not 0) to map more to the keyboard layout
set-option -g renumber-windows on
@albymor
albymor / ns3-tap-bridge.md
Created July 30, 2024 13:11
ns3 tap-bridge

Set NS3

git clone https://gitlab.com/nsnam/ns-3-dev.git
cd ns-3-dev
git checkout -b ns-3.41 ns-3.41
./ns3 configure --enable-examples --enable-sudo

Set tap devices and bridges

@albymor
albymor / compress_pdf.md
Created July 2, 2024 09:52 — forked from ahmed-musallam/compress_pdf.md
How to compress PDF with ghostscript

How to compress PDF using ghostscript

As a developer, it bothers me when someone sends me a large pdf file compared to the number of pages. Recently, I recieved a 12MB scanned document for just one letter-sized page... so I got to googlin, like I usually do, and found ghostscript!

to learn more abot ghostscript (gs): https://www.ghostscript.com/

What we are interested in, is the gs command line tool, which provides many options for manipulating PDF, but we are interested in compressign those large PDF's into small yet legible documents.

credit goes to this answer on askubuntu forum: https://askubuntu.com/questions/3382/reduce-filesize-of-a-scanned-pdf/3387#3387?newreg=bceddef8bc334e5b88bbfd17a6e7c4f9

import pandas as pd
import os
import re
import subprocess
import glob
import argparse
def get_foders(path='.', exclude=['.git', 'venv']):
# curl https://gist.githubusercontent.com/albymor/464c974ed476169a0ab9fd32748ea47f/raw/1cefb83c561498ea4690f324a4b1793e3fe8d4fc/nuc_setup.sh | sudo bash
sudo apt install curl fish git openssh-server
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
sudo apt-get install git-lfs
sudo ufw allow ssh
@albymor
albymor / Scheduled Tx Tools
Created August 26, 2022 17:59 — forked from jeez/ Scheduled Tx Tools
[TSN] Scheduled Tx Tools - Examples and Helpers for testing SO_TXTIME, and the etf and taprio qdiscs
We couldn’t find that file to show.
@albymor
albymor / gantt.py
Created July 27, 2022 08:05 — forked from Thiagobc23/gantt.py
Gantt Chart with Matplotlib v2
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Patch
from pandas import Timestamp
##### DATA #####
data = {'Task': {0: 'TSK M',
1: 'TSK N',
2: 'TSK L',
gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress -dEmbedAllFonts=true -sOutputFile=outputfile.pdf -f inputfile.pdf
@albymor
albymor / torrent-client-by-url.py
Created February 21, 2021 14:27 — forked from samukasmk/torrent-client-by-url.py
Script of example to download files by torrent in Python (By: magnet url)
# source:
# https://stackoverflow.com/questions/6051877/loading-magnet-link-using-rasterbar-libtorrent-in-python
#
# ATTENTION: This is only a example of to use a python bind of torrent library in Python for educational purposes.
# I am not responsible for your download of illegal content or without permission.
# Please respect the laws license permits of your country.
import libtorrent as lt
import time
@albymor
albymor / client.py
Created February 15, 2021 14:12 — forked from kittinan/client.py
Python OpenCV webcam send image frame over socket
import cv2
import io
import socket
import struct
import time
import pickle
import zlib
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client_socket.connect(('192.168.1.124', 8485))