Merge pull request 'dev' (#4) from dev into master

Reviewed-on: lieuwe/personal-page#4
This commit is contained in:
Lieuwe Leene 2021-09-19 14:16:18 +02:00
commit 376fa992a7
15 changed files with 521 additions and 28 deletions

1
.gitignore vendored
View File

@ -1,5 +1,4 @@
# ---> Hugo # ---> Hugo
# Generated files by hugo # Generated files by hugo
static/
public/ public/
resources/_gen resources/_gen

View File

@ -23,7 +23,7 @@ themeColor = "#494f5c"
dateformShort = 'Jan 2' dateformShort = 'Jan 2'
dateformNum = '2006-01-02' dateformNum = '2006-01-02'
dateformNumTime = '2006-01-02 15:04 -0700' dateformNumTime = '2006-01-02 15:04 -0700'
homeSubtitle = "Welcome Friend. 🐸" homeSubtitle = "Welcome Friend 🐸"
[author] [author]
name = 'L. B. Leene' name = 'L. B. Leene'
@ -45,11 +45,15 @@ themeColor = "#494f5c"
url = "https://git.leene.dev/lieuwe" url = "https://git.leene.dev/lieuwe"
[menu] [menu]
[[menu.main]]
name = "Posts"
url = "posts/"
weight = 16
[[menu.main]] [[menu.main]]
name = "About" name = "About"
url = "about/" url = "about/"
weight = 16 weight = 16
[[menu.main]]
name = "Projects"
url = "projects/"
weight = 16
[[menu.main]]
name = "Posts"
url = "posts/"
weight = 16

View File

@ -1,23 +1,47 @@
--- ---
title: "Welcome" title: "Hello friend 🐱‍👤"
date: 2021-08-23T17:52:07+02:00 date: 2021-08-23T17:52:07+02:00
draft: false 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 record
This site shares a bit of informal documentation and more blog-based recod
keeping. Providing commentary on design decisions should be just as useful as keeping. Providing commentary on design decisions should be just as useful as
some of the technical documentation however included in my repositories. some of the technical documentation however included in my repositories.
### Setup ## My Setup
| Environment | Development | Production | 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
| Operating System | Fedora 33 | CentOS 8 | 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)

11
content/links.md Normal file
View File

@ -0,0 +1,11 @@
---
title: "Links"
date: 2021-08-29T12:35:51+02:00
draft: true
---
## Not Fun
List of links go here:
## Fun

View File

@ -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="<personal-part> ::= <first-name> | <initial> \".\" "
echo "$KGT_DEF" | kgt -l bnf -e svg | awk -vf1="$(<style.svg)" -f replace_style.awk > 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}
/<style>/{style_flag=1}
{if(style_flag == 0) print $0}
/<\/style>/{style_flag=0;print f1}
```
For completeness we include the style definition below but this could be
added directly to KGT as a feature in future releases.
``` xml
<style>
rect, line, path { stroke-width: 1.5px; stroke: white; fill: transparent; }
rect, line, path { stroke-linecap: square; stroke-linejoin: rounded; }
path { fill: transparent; }
text { fill: white; font-family:'Trebuchet MS'; }
text.literal { }
line.ellipsis { stroke-dasharray: 1 3.5; }
tspan.hex { font-family: monospace; font-size: 90%; }
path.arrow { fill: white; }
</style>
```
The final result is shown below.
![example_kgt.svg](/images/example_kgt.svg)

168
content/posts/calibre.md Normal file
View File

@ -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}
```

View File

@ -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

82
content/posts/pyside.md Normal file
View File

@ -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')
```

View File

@ -1,16 +1,16 @@
--- ---
title: "Setting up a new site." title: "Setting Up a New Site 🌃"
date: 2021-08-24T10:24:27+02:00 date: 2021-08-24T10:24:27+02:00
draft: false draft: false
toc: false toc: true
images:
tags: tags:
- website - website
- setup - config
- hugo - 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 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 editing environment didn't feel good and after googling around a bit hugo
already seemed a lot more appealing. It renders from markdown with some html/css already seemed a lot more appealing. It renders from markdown with some html/css
@ -33,14 +33,14 @@ cd hugo
go install go install
``` ```
I started off with the hermit theme and initialized a repository for this site 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 type-setting to some extent. Then eventually adjusting the actual layouts and
templates as we go. templates as we go.
## Git filter ## Git filter
Currently I setup two branches: `master` which is deployed statically on 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: things. I setup a clean-smudge git filter to manage deployment on a site-basis:
``` toml ``` toml
@ -49,9 +49,22 @@ things. I setup a clean-smudge git filter to manage deployment on a site-basis:
clean = sed 's@http://localhost@\\$HOSTNAME\\$@' 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 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 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 ## Planned features and content

View File

@ -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).

View File

@ -0,0 +1,39 @@
<?xml version='1.0' encoding='utf-8'?>
<svg
xmlns='http://www.w3.org/2000/svg'
xmlns:xlink='http://www.w3.org/1999/xlink'
width='290' height='220'>
<style>
rect, line, path { stroke-width: 1.5px; stroke: white; fill: transparent; }
rect, line, path { stroke-linecap: square; stroke-linejoin: rounded; }
path { fill: transparent; }
text.literal { font-family: monospace; }
text { font: trebuchet; font-size: 8; fill: white }
line.ellipsis { stroke-dasharray: 1 3.5; }
tspan.hex { font-family: monospace; font-size: 90%; font-color: white}
path.arrow { fill: white; }
</style>
<g transform='translate(40 50)'>
<text x='-30' y='-10'>personal-part:</text>
<path d='M5.5 14 v12 m 4 0 v-12' class='station'/>
<path d='M220.5 14 v12 m 4 0 v-12' class='station'/>
<rect x='70' y='10' height='20' width='90' rx='0' ry='0' class='rule'/>
<text x='115' y='25' text-anchor='middle' class='rule'>first-name</text>
<rect x='60' y='40' height='20' width='70' rx='0' ry='0' class='rule'/>
<text x='95' y='55' text-anchor='middle' class='rule'>initial</text>
<rect x='150' y='40' height='20' width='20' rx='8' ry='8' class='literal'/>
<text x='160' y='55' text-anchor='middle' class='literal'>.</text>
<path d='M190 30 v10'/>
<path d='M170 50 h10 q10 0 10 -10'/>
<path d='M130 50 h20'/>
<path d='M40 40 q0 10 10 10 h10'/>
<path d='M190 30 q0 -10 10 -10'/>
<path d='M160 20 h60'/>
<path d='M30 20 q10 0 10 10 v10'/>
<path d='M10 20 h60'/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,15 @@
#!/bin/awk
BEGIN{style_flag=0}
/<style>/{
style_flag=1
}
//{
if(style_flag == 0) print $0
}
/<\/style>/{
style_flag=0
print f1
}

BIN
static/images/sip.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

10
static/images/style.svg Normal file
View File

@ -0,0 +1,10 @@
<style>
rect, line, path { stroke-width: 1.5px; stroke: white; fill: transparent; }
rect, line, path { stroke-linecap: square; stroke-linejoin: rounded; }
path { fill: transparent; }
text { fill: white; }
text.literal { font-family: monospace; }
line.ellipsis { stroke-dasharray: 1 3.5; }
tspan.hex { font-family: monospace; font-size: 90%; }
path.arrow { fill: white; }
</style>

@ -1 +1 @@
Subproject commit 3481a1b88dc15753f06e558dad835c8e2b97f7be Subproject commit 68210f4097be480f2f0dce2d7466b48b02e57bb2