Skip to content

Instantly share code, notes, and snippets.

View tisto's full-sized avatar

Timo Stollenwerk tisto

View GitHub Profile
@tisto
tisto / gist:42b5b815a649878cf22784a0d4bd9700
Created September 7, 2023 06:45
Pwnagotchi with Waveshare V3 (rev 2.1) display
# Todo
- create SD card with latest pwnagotchi release (1.5.5)
- git clone https://github.com/evilsocket/pwnagotchi
- rsync -avz pwnagotchi pi@10.0.0.2:/home/pi/pwnagotchi/
- cd pwnagotchi
- pip3 install .
Source: https://github.com/evilsocket/pwnagotchi/issues/1156#issuecomment-1509986603
brew list
```
gdbm libmagic openssl@1.1 readline tcl-tk
jpeg libssh2 pkg-config rust xz
libffi openjdk@11 python@3.8 sqlite zlib
```
cat .zchrc:
@tisto
tisto / md
Last active January 21, 2021 20:52
# System info
* MacBook pro M1 13 inch 2020, 16GB RAM, 512GB HD
## Python 3.7 via rosetta 2
Installed via rosetta2 terminal:
```
brew install python@3.7
Create virtual Python 3 environment:
```
python3 -m venv .
```
Create a requirements.txt file:
```
# Keep this file in sync with: https://github.com/kitconcept/buildout/edit/master/requirements.txt
def test_FilenameToRefId():
tm = Transmogrifier(object())
tm._raw = []
tm._data = {}
previous = iter([{'filename': '1_iskandarsyah2014.pdf'}])
transform = FilenameToRefId(tm, 'test', {}, previous)
result = transform.__iter__().next()
assert 'ref_id' in result
assert 'iskandarsyah2014' == result.get('ref_id')
digraph dependencies {"plone.app.versioningbehavior";"typeinfo" -> "toolset"; "portal-transforms-various" -> "componentregistry"; "atcttool" -> "catalog"; "atcttool" -> "componentregistry"; "atcttool" -> "toolset"; "actions" -> "componentregistry"; "skins" -> "componentregistry"; "import-intid-util" -> "toolset"; "factorytool" -> "componentregistry"; "factorytool" -> "typeinfo"; "factorytool" -> "toolset"; "placeful_workflow" -> "typeinfo"; "placeful_workflow" -> "workflow"; "componentregistry" -> "toolset"; "controlpanel" -> "actions"; "controlpanel" -> "componentregistry"; "placeful_marker" -> "workflow"; "jsregistry" -> "skins"; "jsregistry" -> "componentregistry"; "jsregistry" -> "plone.app.registry"; "jsregistry" -> "toolset"; "plone.app.event-catalog" -> "plone.app.registry"; "plone.app.registry" -> "componentregistry"; "plone.app.registry" -> "toolset"; "mimetypes-registry-various" -> "componentregistry"; "referenceablebehavior-various" -> "toolset"; "reference_catalog" -> "toolset"; "viewlets" -> "com
Scenario: As a manager I can add a new field to the user form
Given a logged-in manager
When I add a new text-line field 'office_name' to the member fields
Then a field 'office_name' appears in the user profile form
Manager can edit the user schema
Given I'm logged in as a 'Manager'
then I go to Member fields editor
and I add a new Text line (String) field 'office_name'
and I do not see the 'office_name' field in user form
@tisto
tisto / html_to_xxx_comment.py
Last active August 29, 2015 14:21
html_to_xxx transform & test
# -*- coding: utf-8 -*-
import os
import re
from lxml import etree
from Products.PortalTransforms.interfaces import ITransform
from zope.interface import implements
class HtmlToXXXComment:
implements(ITransform)