Skip to content

Instantly share code, notes, and snippets.

View kcleong's full-sized avatar

Kim Chee Leong kcleong

  • Python United, Turftorr
  • The Netherlands, Groningen
View GitHub Profile
@kcleong
kcleong / kpn-ipv4-ipv6-tvbox.rsc
Last active August 8, 2024 18:25
KPN fiber Mikrotik config (working set-up for IPv4, IPv6, and KPN TV+ box)
# 2024-08-08 20:21:39 by RouterOS 7.15.2
# software id = BNE6-LLMM
#
# model = RB5009UPr+S+
# serial number = HF50964FXXX
/interface bridge
add arp=proxy-arp igmp-snooping=yes multicast-querier=yes name=local
/interface ethernet
set [ find default-name=sfp-sfpplus1 ] mtu=1512
/interface vlan
@kcleong
kcleong / rb5009_kpn.rsc
Last active July 17, 2024 07:34
KPN fiber config with working IPv4 + IPTV, IPv6 not working
# 2024-07-10 09:06:10 by RouterOS 7.15.2
# software id = BNE6-LLMM
#
# See https://gist.github.com/kcleong/426ae7a5c3c5ecb4870bb82966e80ef4 for a working config
#
# model = RB5009UPr+S+
# serial number = HF50964FXXX
/interface bridge
add arp=proxy-arp igmp-snooping=yes name=local
/interface vlan
@kcleong
kcleong / Dockerfile
Last active June 3, 2024 14:30
Elasticsearch 6
# https://stackoverflow.com/questions/72717414/how-to-run-elasticsearch-v6-on-m1-arm-inside-docker
# docker build -t es6 .
# docker run -p 9200:9200 es6
FROM ubuntu:bionic-20220531
# Must be root to install the packages
USER root
from ZODB.utils import p64
# Replace with OIDs from: https://gist.github.com/kcleong/b12a5aaaf3df5df0fee737457eeda5a0
oids= []
for oid in oids:
oid = p64(oid)
try:
pickle, state = app._p_jar.db()._storage.load(oid)
except:
#!/usr/bin/env python
"""
Modified ZODB-5.8.0-py3.8.egg/ZODB/scripts/fsrefs.py to report broken OIDs.
This fixed this following error when running `./bin/zeopack.
Traceback (most recent call last):
File "./bin/zeopack", line 48, in <module>
sys.exit(plone.recipe.zeoserver.pack.main(host, port, unix, days, username, password, realm, blob_dir, storage))
File "/opt/APPS/cms/prd/plone.buildout/eggs/plone.recipe.zeoserver-2.0.3-py3.8.egg/plone/recipe/zeoserver/pack.py", line 65, in main
@kcleong
kcleong / gist:7dc901b660eaf2fc90cc227cc5d968de
Created August 1, 2023 07:41
vue-web-component-wrapper@1.0.5
➜ example-web-component git:(main) ✗ npm install -S vue-web-component-wrapper@1.0.5
changed 1 package, and audited 28 packages in 880ms
3 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
➜ example-web-component git:(main) npx vite
Port 5173 is in use, trying another one...
@kcleong
kcleong / gist:722d8008858a4514424438a7074a5430
Last active August 1, 2023 07:40
vue-web-component-wrapper@1.1.0
➜ example-web-component git:(main) npm install -S vue-web-component-wrapper@1.1.0
changed 1 package, and audited 28 packages in 1s
3 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
➜ example-web-component git:(main) ✗ npx vite
Port 5173 is in use, trying another one...
@kcleong
kcleong / ikea.py
Created November 11, 2022 14:40
Example script to get ikea article numbers from a kitchen plan
"""
Example output:
41x: 60205664 | METOD | grijs | 200 cm | Kitchen cabinets
38x: 80338413 | BAGGANÄS | zwart | 143 mm | Knobs and handles
24x: 40205599 | METOD | zwart | 8 cm | Kitchen cabinets
19x: 70338418 | BAGGANÄS | grijs | 143 mm | Knobs and handles
18x: 40327505 | FÖRBÄTTRA | wit | 220x8 cm | Kitchen fronts
8x: 00455161 | ÄLMAREN | Kitchen taps, sinks and sink accessories
6x: 20317852 | LILLVIKEN | grijs | Kitchen taps, sinks and sink accessories
@kcleong
kcleong / django-dramatiq.log
Created November 8, 2022 09:21
Django dramatiq 0.11.0 stacktrace
./manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/Users/leong/.pyenv/versions/3.10.4/lib/python3.10/threading.py", line 1009, in _bootstrap_inner
self.run()
File "/Users/leong/.pyenv/versions/3.10.4/lib/python3.10/threading.py", line 946, in run
self._target(*self._args, **self._kwargs)
File "/Users/leong/.pyenv/versions/3.10.4/envs/xyz__3.10.4/lib/python3.10/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
This file has been truncated, but you can view the full file.
{
"version": 6,
"core": {
"buildingDocument": {
"uuid": "765A86F7-FCA1-4AC6-A53D-9AB81A01348C",
"buildings": [
{
"uuid": "776916D5-6399-4660-96BE-4AF43FF18DC9",
"levels": [
{