All posts by danman

Testing chinese FRAMs

I’m planning to use FM24CL16 EEPROMs in some projects. These are simple I2C EEPROMs but based on FRAM technology so they should last 10^14 of writes while typical 24Cxx chips only last one million. They are much cheaper on aliexpress than at my local distributor so I ordered 5pcs from this seller for about 40 cents each. Since my local distributor sells them 5 times more expensive I was a little bit suspicious if these are legit parts so I decided to test them.

Continue reading Testing chinese FRAMs

Playing with CAN bus

I got inspired by comma.ai – it’s a HW device which will drive your car, pretty much like Tesla does but for a fraction of it’s price. For this, it needs to connect to CAN bus of your car. My current car cannot be driven by wire but it has some simple CAN buses so I decided to have a little play with one of them, just to explore the technology. Continue reading Playing with CAN bus

Enable system site packages in virtualenv

I started using virtualenv for all python apps I run (because I hate to make mess with pip in system site-packages). Later I’ve found out that some dependencies can not be installed via pip but are included in standard system packages installed via apt or yum. To use these imports inside your venv, you need to specify parameter –system-site-packages when creating your venv. If you only find out that you really need them later, you can enable them by deleting following file:
your_venv_dir/lib/pythonXXX/no-global-site-packages.txt

Happy pythoning!

Source: https://virtualenv.pypa.io/en/latest/userguide/#the-system-site-packages-option

My unbiased experience with JLCPCB

I needed to fabricate some PCBs. I’ve seen some youtubers to advertise and recommend this service so I decided to give it a try. My order was done without using any affiliation link or discount code so there was no way for them to know who I am. I needed to create a microSD breakout board and luckily I found a similar OSHw project and only made some modifications: https://github.com/danielkucera/MicroSD_Sniffer . I prepared my board in Eagle and generated gerber files. Continue reading My unbiased experience with JLCPCB

Automatic letsencrypt wildcard cert renewal with nsupdate

I’m using a wildcard cert from letsencrypt. Currently there is only one way how to verify that you hold the domain you are requesting cert for: creating TXT record in that domain. You can do it by hand when asked by certbot but you don’t want to do this each 90 days. If you are running your own DNS servers with PowerDNS like me there’s an elegant solution: RFC2136. This allows you to update your zones without writing config files and restarting anything.

Continue reading Automatic letsencrypt wildcard cert renewal with nsupdate

My git cheatsheet

Show git log as tree

$ git log --oneline --graph --decorate --all
| * 0255f78c (HEAD -> qmtech, my/qmtech) added support for qm_xc6slx16_sdram board
| * dae037cf (my/spisingle, spisingle) added spi 1-bit mode, code from litex
|/
* 1325aff6 (origin/master, origin/HEAD, master) correctly use result of Record.connect in Converter (#81)

Rebasing

$ git rebase --onto master spisingle qmtech
First, rewinding head to replay your work on top of it...
Applying: added support for qm_xc6slx16_sdram board

$ git log --oneline --graph --decorate --all
* 37d2eff0 (HEAD -> qmtech) added support for qm_xc6slx16_sdram board
| * 0255f78c (my/qmtech) added support for qm_xc6slx16_sdram board
| * dae037cf (my/spisingle, spisingle) added spi 1-bit mode, code from litex
|/
* 1325aff6 (origin/master, origin/HEAD, master) correctly use result of Record.connect in Converter (#81)

Push changed branch

$ git push my qmtech -f
Counting objects: 7, done.
Delta compression using up to 12 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 1.86 KiB | 1.86 MiB/s, done.
Total 7 (delta 5), reused 0 (delta 0)
remote: Resolving deltas: 100% (5/5), completed with 5 local objects.
To https://github.com/danielkucera/misoc.git
+ 0255f78c...37d2eff0 qmtech -> qmtech (forced update)

$ git log --oneline --graph --decorate --all
* 37d2eff0 (HEAD -> qmtech, my/qmtech) added support for qm_xc6slx16_sdram board
| * dae037cf (my/spisingle, spisingle) added spi 1-bit mode, code from litex
|/
* 1325aff6 (origin/master, origin/HEAD, master) correctly use result of Record.connect in Converter (#81)