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
#!/bin/bash
VERSION=3.10.5
curl https://pyenv.run | bash
cat >> ~/.profile << EOF
export PYENV_ROOT="\$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="\$PYENV_ROOT/bin:\$PATH"
eval "\$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
EOF
@kcleong
kcleong / kuma.log
Created August 12, 2022 08:14
uptime kuma error
uptime-kuma | Trace: KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
uptime-kuma | at Client_SQLite3.acquireConnection (/app/node_modules/knex/lib/client.js:305:26)
uptime-kuma | at async Runner.ensureConnection (/app/node_modules/knex/lib/execution/runner.js:259:28)
uptime-kuma | at async Runner.run (/app/node_modules/knex/lib/execution/runner.js:30:19)
uptime-kuma | at async RedBeanNode.normalizeRaw (/app/node_modules/redbean-node/dist/redbean-node.js:588:22)
uptime-kuma | at async RedBeanNode.getRow (/app/node_modules/redbean-node/dist/redbean-node.js:574:22)
uptime-kuma | at async Function.calcUptime (/app/server/model/monitor.js:729:22)
uptime-kuma | at async Function.sendUptime (/app/server/model/monitor.js:792:24)
uptime-kuma | at async Function.sendStats (/app/server/model/monitor.js:671:13) {
uptime-kuma | sql: '\n' +
(yyy__2.7.17) ➜ yyy.buildout-5.2 git:(master) ✗ buildout -vvvvv
Installing 'mr.developer'.
We have the distribution that satisfies 'mr.developer==2.0.1'.
Version conflict while processing requirement zc.buildout (constrained to zc.buildout==2.13.4)
Getting required 'zc.buildout==2.13.4'
We have the distribution that satisfies 'zc.buildout==2.13.4'.
mr.developer: Queued 'collective.elasticindex' for checkout.
mr.developer: Queued 'collective.pdfpeek' for checkout.
mr.developer: Queued 'milieudefensie.addon' for checkout.
mr.developer: Queued 'plone.app.content' for checkout.
(zzz__3.8.13) ➜ wageindicator.buildout git:(master) ✗ buildout -vvv
Installing 'mr.developer'.
We have the distribution that satisfies 'mr.developer==2.0.1'.
Version conflict while processing requirement zc.buildout (constrained to zc.buildout==2.13.3)
Getting required 'zc.buildout==2.13.3'
We have the distribution that satisfies 'zc.buildout==2.13.3'.
mr.developer: Queued 'collective.themesitesetup' for checkout.
mr.developer: Queued 'incf.countryutils' for checkout.
mr.developer: Queued 'plonetheme.barceloneta' for checkout.
mr.developer: Queued 'wageindicator.addon' for checkout.
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": [
{
@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)
@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
➜ example-web-component git:(main) npm install -S [email protected]
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...
➜ example-web-component git:(main) ✗ npm install -S [email protected]
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...
#!/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