Git Deployer

I wrote a python module Git Deployer. It allows me to automate the deployment of generated static sites (documentation, help guides, etc.) using Git.

My use case

I’m using Sphinx to generate documentation. And I need to deploy the generated static files from _build/html to my server.

On the server side I have created ‘bare’ Git repo with post-receive hook:

#!/bin/sh
GIT_WORK_TREE=/var/www/my_domain/html/help git checkout -f main.

When I push to this repo, it automatically deploys to a website folder.

I’m working in VS Code. I’ve installed Git Deployer with pip:

python -m pip install git+https://github.com/optinsoft/git-deployer.git

In the project’s folder I’ve created deploy_config.yml:

deploy:
  remote:
    name: 'myserver' 
    url: 'ssh://user@myserver/~/help.git'
  branch: 'master'
  name: owner_name
  email: owner@email
  message: 'new commit at %Y-%m-%d %H:%M:%S'
  git_init: True
  force_push: True

Now I can deploy _build/html with a single command:

deploy _build/html

gen_eth and gen_trx updates

After installing the NVIDIA GPU Computing Toolkit v13, the gen_eth and gen_trx projects started producing an error:

ImportError: DLL load failed while importing _driver: DLL load failed

The reason is that pycuda is trying to load the CUDA DLL from the bin directory:

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\bin

I am using the latest version of pycuda available at the moment: v2025.1.2.

pycuda\driver.py:

def _add_cuda_libdir_to_dll_path():
from os.path import dirname, join

text
cuda_path = os.environ.get("CUDA_PATH")

if cuda_path is not None:
    os.add_dll_directory(join(cuda_path, "bin"))
    return

However, in version v13 of the NVIDIA GPU Computing Toolkit, the DLLs are located in the bin\x64 directory:

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\bin\x64

To solve this problem, a new setting CUDA_DLL_PATH has been added to settings.ini, which contains the full path to the CUDA DLL.

settings.ini:

[settings]
CL_PATH=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64
CUDA_DLL_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\bin\x64

The latest versions of gen_eth and gen_trx are available on GitHub:

PS. If the following error occurs:

pycuda._driver.LogicError: cuModuleLoadDataEx failed: device kernel image is invalid

then you need to update the NVIDIA video driver: https://www.nvidia.com/en-us/drivers/

Blog migrated to Hexo

This blog has been migrated from WordPress to Hexo.

For the blog migration, I wrote a powershell script called wp-hexo-convertor, which is available on GitHub.

Prior to migration, the WordPress blog was converted to a static version. The wp-hexo-convertor utility was then used to generate posts and redirect pages for Hexo. These redirects are essential to prevent the loss of organic traffic from Google search.

The redirects are implemented via the hexo-generator-alias plugin. I created a GitHub fork that uses the url_for function instead of full_url_for.

Opt-In List Manager 1.6.105

by Vitaly, Thursday, March 19th, 2020

Version 1.6.105 of the Opt-In List Manager has been released.

What’s New

Extract And Clean

  1. Clean Mail Lists: Remove empty fields (columns).
  2. Clean Mail Lists: Custom field (column) delimiters.
  3. Clean Mail Lists: The number of output columns. If the source row contains less than the specified number of columns, the list manager will add missing columns (blank). If the source row contains more than the specified number of columns, the list manager will cut extra columns.

Merge E-Mail Lists

  1. Keep Email Duplicates (remove full duplicates only).

Misc. Utilites

  1. Replace blanks with the specified text.
  2. Replace the matched regular expression pattern with the specified text.
  3. You can specify field (column) numbers to modify (add prefix, suffix or replace the text).
  4. Calculate SHA1, SHA-256 and SHA-512 hash values.

Websites Loader 1.21

by Vitaly, Monday, December 16th, 2019

Version 1.21 of the Websites Loader 1.21 released.

What’s New

Replace Rules has been added. Replace rule applies to HTML content and allows, for example, replace one domain by another.

Each rule consist of the pattern, which is regular expression, and the replacement value. Matching text will be replaced with the replacement value.

Replacement value can contain references to matching groups. Example:

Pattern: (https?://)?(localhost/)
Replacement value: $2
Subject: http://localhost/aaa
Result: localhost/aaa

Tags: load, Regular Expression, website

Opt-In List Manager 1.3.95

by Vitaly, Thursday, December 12th, 2019

Version 1.3.95 of the Opt-In List Manager has been released.

What’s New

Extracting emails from the various sources has been improved. Now it can extract emails from:

  • Archive files. Supported formats (file extensions): ZIP, JAR, EXE (self-extracted archives), TAR, GZ, TGZ, CAB, BZ2, TBZ.
  • XLSX files (Microsoft Excel Open XML Format Spreadsheet).
  • XLS files (Excel 97/2003).

oilm-archive-processing

Tags: Archive, GZIP, TAR, XLS, XLSX, ZIP