diff --git a/.gitignore b/.gitignore index fbf0917..5d2947b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ # ---> Hugo # Generated files by hugo -static/ public/ resources/_gen diff --git a/config.toml b/config.toml index b5a0b89..d85719d 100644 --- a/config.toml +++ b/config.toml @@ -23,7 +23,7 @@ themeColor = "#494f5c" dateformShort = 'Jan 2' dateformNum = '2006-01-02' dateformNumTime = '2006-01-02 15:04 -0700' - homeSubtitle = "Welcome Friend. 🐸" + homeSubtitle = "Welcome Friend 🐸" [author] name = 'L. B. Leene' @@ -45,11 +45,15 @@ themeColor = "#494f5c" url = "https://git.leene.dev/lieuwe" [menu] - [[menu.main]] - name = "Posts" - url = "posts/" - weight = 16 [[menu.main]] name = "About" url = "about/" weight = 16 + [[menu.main]] + name = "Projects" + url = "projects/" + weight = 16 + [[menu.main]] + name = "Posts" + url = "posts/" + weight = 16 diff --git a/content/about.md b/content/about.md index f09fa69..e689827 100644 --- a/content/about.md +++ b/content/about.md @@ -1,23 +1,47 @@ --- -title: "Welcome" +title: "Hello friend 🐱‍👤" date: 2021-08-23T17:52:07+02:00 draft: false +tags: + - about + - config --- -Hello friend. +## About This Site -### About This Site - -This site shares a bit of informal documentation and more blog-based recod +This site shares a bit of informal documentation and more blog-based record keeping. Providing commentary on design decisions should be just as useful as some of the technical documentation however included in my repositories. -### Setup +## My Setup -| Environment | Development | Production | ---- | --- | --- -| Operating System | Fedora 33 | CentOS 8 | +I mainly use RHEL flavours of linux having both CentOS and Fedora machines. Most +hosted services run on CentOS 8 at the moment albeit they are approaching +end-of-life. Overall the package repository for CentOS 7/8 is just right. I +rarely need to compile anything from source and packages are very stable. +I will eventually migrate to Fedora completely which is where I operate my +development environment. -### About Me +This is a list of my most used self-hosted services: + - Gitea: Git server with web interface for repository mirrors and personal repos + - Plex: multi-media hosting service for streaming movies and tv-shows + - NextCloud: Cloud storage for synchronizing and sharing files + - Cockpit: Web base administration portal managing linux boxes + - RoundCube: Web based email client + - Postfix/Dovcot: Email stack providing SMTP for my domain + - NGINX: HTTP server serving as proxy for internal web services + - Danbooru: Ruby-on-rails based image hosting and tagging service -I do mixed signal circuit design and a bit of software development as a hobby. +There are several others that I have tried but these really have been the things +I relied on the most in the past 5 years or so. I think the only thing that is +possibly missing from this list is possibly the equivalent of a centralized LDAP +service but I simply haven't had to manage more than handful of users. + +Currently I develop quite a bit of python utilities for scraping, labelling, and +managing media in an automated fashion. In part I am preparing data for one of +my long term projects which is related to image classification based on +structural decomposition rather than textural features. The main idea here is +to analyse and extract structure in an image before performing in-depth analysis +such that said analysis is most specific to its context. + +![small_sip](/images/sip.gif) diff --git a/content/links.md b/content/links.md new file mode 100644 index 0000000..f02b51a --- /dev/null +++ b/content/links.md @@ -0,0 +1,11 @@ +--- +title: "Links" +date: 2021-08-29T12:35:51+02:00 +draft: true +--- + +## Not Fun + +List of links go here: + +## Fun diff --git a/content/posts/building-svg.md b/content/posts/building-svg.md new file mode 100644 index 0000000..3b149eb --- /dev/null +++ b/content/posts/building-svg.md @@ -0,0 +1,92 @@ +--- +title: "Building With SVG" +date: 2021-08-28T11:53:54+02:00 +draft: false +toc: true +tags: + - svg + - xml + - hugo + - golang +--- + +# SVG Tools and Hugo Integration + +SVG is generally the image container of choice having used it for illustrations, +chip or device specifications, and visual outputs generated by code. SVG is +plain xml that is structured with some top level object/properties followed by +standardized objects that draw lines and shapes. +The hope here is that we can call a predefined go procedure that parses +some section of markdown source code and instantiates the corresponding svg file +under our static folder that is then referenced. + +``` go +{{/* a comment */}} +``` + +## KGT: Kate's Grammar Tool + +KGT is a pretty neat starting point to experiment with this kind of function. +It is relatively self contained and produces compact SVG objects from simple +statements. + +### Build Instructions + +Building `libfms` and `kgt` from source was not too much of a hassle although +the build / dependency documentation could be better. This was build with my +WLS-Ubuntu environment. + +``` bash +apt install clang pmake +git clone --recursive "https://$libfsm_REPO/libfsm" +pushd libfsm; CC=clang PREFIX=$HOME pmake -r install; popd +git clone --recursive "https://$KGT_REPO/kgt" +pushd kgt/src; CC=clang PREFIX=$HOME pmake -r install; popd +``` + +The main issue is noticed +is the SVG being generated uses `path {rouded}` in its style definition which +the svg rasterizer from `librsvg2 2.40.20` complained about. Getting the latest +build however is quite involved requiring the latest cairo and proppler +libraries as well. Ideally generating pngs or rasterizing won't be needed. + +### Example + +Just to show a typical use case for making an illustration using the KGT tool, +below I generate the svg for one of the examples included by it's repository. + +``` bash +KGT_DEF=" ::= | \".\" " +echo "$KGT_DEF" | kgt -l bnf -e svg | awk -vf1="$( example_kgt.svg +``` + +The style is automatically introduced in the xml header section which is mostly +plain black. This has some legibility issues for dark themes so a short `awk` +script is used to replace the style with one that we define for this theme. + +``` awk +BEGIN{style_flag=0} +/ +``` + +The final result is shown below. + +![example_kgt.svg](/images/example_kgt.svg) diff --git a/content/posts/calibre.md b/content/posts/calibre.md new file mode 100644 index 0000000..8ccb4c4 --- /dev/null +++ b/content/posts/calibre.md @@ -0,0 +1,168 @@ +--- +title: "Calibre Physical Verification Hacks" +date: 2021-09-14T11:30:11+02:00 +draft: true +tags: + - calibre + - config + - verification +--- + +This is a list of 'modifications' to the standard Calibre verification flow I +have used in the past to either modify the checks performed by Calibre or input +data bases. + +# DRC + +## Extended Device Checks + +```tvf +NVA0.VAR_OVLP { @ Varactors / Tiles should not overlap + VARi AND > 1 +} +``` + +```tvf +NVA1.Cu_PPI.TEAR { @ Shape of Cu_PP I pad (under PM2 area): tear shape required + X0 = EXT Cu_PPIi <1 ABUT <125 INTERSECTING ONLY REGION + X1 = EXT Cu_PPIi <1 ABUT <180 INTERSECTING ONLY REGION + X2 = INT Cu_PPIi <1 ABUT <180 INTERSECTING ONLY REGION + X3 = EXPAND EDGE (X1 NOT TOUCH INSIDE EDGE X0) BY 1 EXTEND BY 50 + X4 = EXPAND EDGE (X2 NOT TOUCH INSIDE EDGE X0) BY 1 EXTEND BY 50 + (X3 AND X0) OR (X4 AND X0) +} +``` + + +## Layer / Device Aliasing + +```tvf +LAYER MAP 107 DATATYPE 0 746 +``` + +# LVS + +## Adding New Device Primitives + +```tvf +LAYER RESLYR 450 +LAYER MAP 215 DATATYPE 21 450 // layer to form memresistor +XTERM = RESLYR AND M4 +XCDTR = RESLYR NOT M4 +CONNECT metal4 MEMRESLYRT +DEVICE XDEVICE XCDTR XTERM(PORT1) XTERM(PORT2) netlist model xdevice +``` + +```spice +.SUBCKT xdevice PORT1 PORT2 +.ENDS +``` + +```lisp +(xdevice + (DEVICE_LIB DEVICE_CELL DEVICE_VIEW) + ( + (PORT1 PIN1) + (PORT2 PIN2) + ) + ( + (nil multi 1) + (nil m 1) + ) +) +``` + +## Extending Connectivity Layers + +```tvf +LAYER PM1i 5001 +LAYER MAP 5 DATATYPE 1 5001 +LAYER Cu_PPIi 7410 +LAYER MAP 74 DATATYPE 10 7410 +LAYER UBM 170 +LAYER MAP 170 DATATYPE 0 170 +LAYER PM2i 5002 +LAYER MAP 5 DATATYPE 2 5002 +VIA8 = COPY CB2 +metal9 = COPY Cu_PPIi +VIA9 = COPY PM2i +metal10 = COPY UBM +CONNECT metal9 metal8 BY VIA8 +CONNECT metal10 metal9 BY VIA9 +TEXT LAYER 140 ATTACH 140 metal9 +PORT LAYER TEXT 140 +TEXT LAYER 141 ATTACH 141 metal10 +PORT LAYER TEXT 141 +TEXT LAYER 125 ATTACH 125 metal10 +PORT LAYER TEXT 125 +``` + +## Hot fixing LVS comparison + +```tvf +LVS SPICE CULL PRIMITIVE SUBCIRCUITS YES +VIRTUAL CONNECT NAME "POWER" +TEXT "POWER" LOCX LOCY DATATYPE +LAYOUT RENAME TEXT "/DATA\\[(.*)\\]/DATA<-1>/M-" +``` + + + +# SPICE + +## Port Order Reshuffling + +```bash +function getSortedOrder() { + local SOURCE="" + local SORTED="" + read -a SOURCE <<< "$1" + SORTED="${SOURCE[@]}" + if [ -z "${SORTED//*\[*}" ] ; then + SORTED=($(echo "${SOURCE[@]:2}" | tr " " "\n" | sed -r "s/\[([0-9]+)\]/ \1 /g" \ + | sort -k 1,1 -k2,2nr | sed -r "s/ ([0-9]+) /\[\1\]/g" )) + else + SORTED=($(echo "${SOURCE[@]:2}" | tr " " "\n" | sed -r "s/<([0-9]+)>/ \1 /g" \ + | sort -k 1,1 -k2,2nr | sed -r "s/ ([0-9]+) /<\1>/g" )) + fi + echo "${SOURCE[@]:0:2} ${SORTED[@]}" +} +function updatePortOrder() { + local TARGET="$1" + local CDL_FILE="$2" + local PORTORDER="$(awk -v target="subckt ${TARGET} " -f "catch.awk" "$CDL_FILE")" + local PORTREF=$(getSortedOrder "$PORTORDER") + local SWPDELIMITER="" + echo $TARGET + if [ -z "${PORTREF//*\[*}" ] ; then SWPDELIMITER="TRUE" ; fi + awk -v target="subckt ${TARGET} " -v release="$PORTREF" -v swpdelim="$SWPDELIMITER" \ + -f "release.awk" "$CDL_FILE" > "${TARGET}.cdl" + [ ! -z "$(grep -m 1 "\[" "${TARGET}.cdl")" ] && [ ! -z "$(grep -m 1 "<" "${TARGET}.cdl")" ] \ + && echo "Error $CDL_FILE uses mixed delimiters" +} +``` + +```awk +BEGIN{ hold = ""; IGNORECASE = 1 } +NF { + if( $1 == "+" && hold != "") + { for(i=2;i<=NF;i++) hold=hold " " $i } + else if( hold != "") { print hold; hold=""; exit } + }; +$0 ~ target { hold = $0 }; +``` + +```awk +BEGIN{output="";hold="";IGNORECASE=1}; +NF{if($1!="+")hold=""} +$0~target{ + hold=$0 + n=split(release,ports," ") + for(i=n;i>0;i--){ + if(swpdelim!=""){ + gsub("<","[",ports[i]) + gsub(">","]",ports[i])} + output=ports[i]" "output} + print output} +NF{if(hold=="")print $0} +``` diff --git a/content/posts/mile-stones.md b/content/posts/mile-stones.md new file mode 100644 index 0000000..350efd0 --- /dev/null +++ b/content/posts/mile-stones.md @@ -0,0 +1,23 @@ +--- +title: "Mile Stones 📚" +date: 2021-08-28T16:13:52+02:00 +draft: false +tags: + - content + - plan +--- + +This is a list of topics that I may include at some point in time: +1. SSL and NGINX setup guide +2. Postfix setup guide +3. Danbooru setup guide +4. pyside notes from pyviewer project +5. other fun stuff + +I also want to share some of the IC design work building up a technical profile: +1. Chip gallery +2. Academic topics +3. ADC stuff +4. Time domain processing +5. Skill and Cadence utilities +6. Design flow and scripts diff --git a/content/posts/pyside.md b/content/posts/pyside.md new file mode 100644 index 0000000..050ed73 --- /dev/null +++ b/content/posts/pyside.md @@ -0,0 +1,82 @@ +--- +title: "Binding QML with Python: PyViewer" +date: 2021-08-29T12:53:19+02:00 +draft: false +tags: + - python + - qml + - gui + - code +--- + +[PyViewer](https://git.leene.dev/lieuwe/pyviewer) is a example project which +implements a simple image browser / viewer in a scrollable grid array. This main +objective here was using QML to define a graphical layout and bind it to a +python code-base. Note that this code base is compatible with both Pyside2 and +Pyside6. This is because while Pyside6 is preferred it is not readily available +on all platforms. Running Pyside6 instead only recommend the qml library version +requirements to omitted. + +Please take a look at the git repository for exact implementation details. A +brief summary of this interaction is presented below. + +## Emitting QML Calls + +Creating a `QObject` and adding `PySide2.QtCore.Slot` decorators to its methods +will allow a python object to be added to the qml context as a referenceable +object. For example here we add "viewer" to the qml context which is a +"PyViewer" python object. + +```Python +pyviewer = PyViewer() +engine.rootContext().setContextProperty("viewer", pyviewer) +``` + +This way we can call the object's python procedure "update_tag_filter" from +within the QML script as follows: + +```QML +viewer.update_tag_filter(false); +``` + +Further using the `PySide2.QtCore.Property` decorator further allows us to call +states in our python object and manipulate them as it were a qml object. + +```QML +viewer.path.split("::") +``` + +## Emitting Python Calls + +Once this context is working we can create a `PySide2.QtCore.Signal` object to +call QML methods from within the python context. A python procedure could then +"emit" this signal and thereby prompt any connected qml methods. + +```python +self.path_changed.emit() +``` + +In the qml contect we can connect the signals from the python "viewer" object +to a qml function call "swipe.update_paths" for example. + +```qml +viewer.path_changed.connect(swipe.update_paths) +``` + +## Downside + +Debugging and designing QML in this environment is limited since the pyside +python library does not support all available QML/QT6 functionality. In most +cases you are looking at C++ Qt documentation for how the pyside data-types +and methods are supposed to behave without good hinting. + +Also the variety in data types that can be passed from one context to the other +is constrained although in this case I was able to manage with strings and byte +objects. + +## Other Notes: TODO + +```python +ImageCms.profileToProfile(img, 'USWebCoatedSWOP.icc', + 'sRGB Color Space Profile.icm', renderingIntent=0, outputMode='RGB') +``` diff --git a/content/posts/site-setup.md b/content/posts/site-setup.md index 2298c20..e3a5a5a 100644 --- a/content/posts/site-setup.md +++ b/content/posts/site-setup.md @@ -1,19 +1,19 @@ --- -title: "Setting up a new site." +title: "Setting Up a New Site 🌃" date: 2021-08-24T10:24:27+02:00 draft: false -toc: false -images: +toc: true tags: - website - - setup + - config - hugo + - git --- -Previously I tried using grav with the intention to serve a simple website as +Previously I tried using Grav with the intention to serve a simple website as it is quite easy to setup and the interface seemed quite nice. However the editing environment didn't feel good and after googling around a bit hugo -already seemed alot more appealing. It renders from markdown with some html/css +already seemed a lot more appealing. It renders from markdown with some html/css config files and can serve content statically or dynamically without superfluous features. @@ -33,25 +33,38 @@ cd hugo go install ``` I started off with the hermit theme and initialized a repository for this site -and the theme to track changes separately. I will probably adjust the color and +and the theme to track changes separately. I will probably adjust the colour and type-setting to some extent. Then eventually adjusting the actual layouts and templates as we go. ## Git filter Currently I setup two branches: `master` which is deployed statically on -leene.dev, and `dev` which is just for local development as I try out different +`leene.dev`, and `dev` which is just for local development as I try out different things. I setup a clean-smudge git filter to manage deployment on a site-basis: -```toml +``` toml [filter "hostmgmt"] smudge = sed 's@\\$HOSTNAME\\$@http://localhost@' clean = sed 's@http://localhost@\\$HOSTNAME\\$@' ``` +Note if we make a change to just the filter we can re-apply it by resetting our +index and checking out HEAD again. + +``` bash +rm .git/index +git checkout HEAD -- "$(git rev-parse --show-toplevel)" +``` + But looking closer at the hugo documentation, it would be better to prepare a similar development and production configuration. We'll see if this can evaluate -system environment variables. +system environment variables. Alternatively you can also specify the server +parameters directly. + +``` bash +hugo server --bind=0.0.0.0 --baseURL=http://zathura --port=1313 +``` ## Planned features and content diff --git a/content/projects/super_resolution.md b/content/projects/super_resolution.md new file mode 100644 index 0000000..a41f140 --- /dev/null +++ b/content/projects/super_resolution.md @@ -0,0 +1,13 @@ +--- +title: "Super Resolution 🧙‍♂️" +date: 2021-09-19T13:30:00+02:00 +draft: true +tags: + - upscaling + - image-processing + - anime + - python +--- + +WIP: this is an on going effort for super-resolving images given learned context +and Super-Resolution Using a Generative Adversarial Network (SRGAN). diff --git a/static/images/example_kgt.svg b/static/images/example_kgt.svg new file mode 100644 index 0000000..beae62a --- /dev/null +++ b/static/images/example_kgt.svg @@ -0,0 +1,39 @@ + + + + + + + personal-part: + + + + first-name + + initial + + . + + + + + + + + + + + diff --git a/static/images/replace_style.awk b/static/images/replace_style.awk new file mode 100644 index 0000000..fffe168 --- /dev/null +++ b/static/images/replace_style.awk @@ -0,0 +1,15 @@ +#!/bin/awk +BEGIN{style_flag=0} + +/ diff --git a/themes/hermit b/themes/hermit index 3481a1b..68210f4 160000 --- a/themes/hermit +++ b/themes/hermit @@ -1 +1 @@ -Subproject commit 3481a1b88dc15753f06e558dad835c8e2b97f7be +Subproject commit 68210f4097be480f2f0dce2d7466b48b02e57bb2