Skip to content

Instantly share code, notes, and snippets.

View zupo's full-sized avatar

Neyts Zupan zupo

View GitHub Profile
@zupo
zupo / synology_iperf3.md
Last active January 18, 2024 13:31
Synology NAS with DSM 7.1 that starts iperf3 at startup

Synology NAS with DSM 7.1 that starts iperf3 at startup

I wanted to run iperf3 on my Synology NAS to monitor WiFi speeds on different devices around my location.

Steps to install iperf3 are:

  1. Follow https://synocommunity.com/#easy-install to install SynoCommunity package repository.
  2. Log into DSM, Package Center -> Community -> SynoCli Monitor Tools -> Install.
  3. Temporarily enable SSH via Control Panel -> Terminal -> Enable SSH Service
  4. SSH into the NAS:
# Python 3.10
from enum import Enum
class Direction(Enum):
up = "up"
down = "donw"
assert "up" == Direction.up.value
# Python 3.11
7e9b0dff974c89e070da1ad85713ff3c20b0ca97 1622410071 1622503301
@zupo
zupo / ib_to_edavki.py
Last active April 7, 2023 14:50
Prepare Interactive Brokers report for entry into edavki.furs.si
### THIS IS DEPRECATED ###
# Use https://github.com/jamsix/ib-edavki instead
from collections import OrderedDict
from dataclasses import dataclass
from dataclasses import field
from decimal import Decimal
import xml.etree.ElementTree as ET
from datetime import date
from datetime import datetime
@zupo
zupo / Readme.md
Last active May 29, 2019 14:08
5 hacks to improve your code in 5 minutes
@zupo
zupo / export.py
Last active April 21, 2019 06:06
Export Plone site into a directory tree of PDFs.
# spin up a local instance
# portal_workflows, allow everything for Anonymous, click update portal security
# bin/instance debug
# >>> for brain in app.Plone.portal_catalog():
# >>> print brain.getURL().split('http://nohost/Plone/')[1]
# Paste paths into paths.txt
# More info on https://blog.niteo.co/export-plone-to-pdfs/
from subprocess import check_output
import os.path
<form method="POST" action="http://formspree.io/nz@niteo.co">
<textarea name="message" placeholder="Your message"></textarea>
<button type="submit">Send</button>
</form>
@zupo
zupo / modifieds.py
Created March 8, 2017 07:50
Migrate modified timestamps between Plone instances
# Run the following inside bin/instance debug to get list of paths + dates
# print ''.join(['{}|{}\n'.format(b.getURL(), b.modified)
# for b in app.office.portal_catalog.unrestrictedSearchResults()])
# Put the list in the MODIFIEDS variable below. Then run the script inside
# bin/instance debug on new server
MODIFIEDS = [
'events',
'news',
"""Showcasing Pyramid's Renderers.
Usage:
1. Install Pyramid: http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/install.html
2. Put this code into example.py
3. Run with ``$VENV/bin/python example.py``.
You can showcase with your browser or using curl:
$ curl http://localhost:8080/
"""Showcasing Pyramid's View Predicates.
Usage:
1. Install Pyramid: http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/install.html
2. Put this code into ``example.py``.
3. Run with ``$VENV/bin/python example.py``.
4. Showcase with your browser or using curl:
$ curl http://localhost:8080/
Welcome!