Skip to content

Instantly share code, notes, and snippets.

Avatar

Andy Shevchenko andy-shev

View GitHub Profile
@andy-shev
andy-shev / jive2git.py
Last active Sep 23, 2020
Covnvert Jive CMS document to a Git repository
View jive2git.py
#!/usr/bin/python3 -tt
# -*- coding: UTF-8 -*-
# vim: ts=4 sw=4 et ai si
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
import argparse
import dateutil.parser
import errno
View GNUPG_agent_forwarding.md

Forward GNUPG agent with the following steps:

On the remote insecure machine:

Run gpg once to create the directory structure.

gpg --list-keys

On the local machine:

@andy-shev
andy-shev / .gitignore
Last active May 11, 2020
Git version to C file
View .gitignore
version.h
module
*.o
@andy-shev
andy-shev / Linux kernel simple tasks
Last active Sep 30, 2021
Linux kernel simple tasks for newbies or anybody who wants to enter to kernel development
View Linux kernel simple tasks
The below list of tasks for Linux kernel is in completely arbitrary order by
complexness, tree wideness, etc.
1. GCC warning: dubious: x | !y: `git grep -n ' | !'`
2. Check for possibility to use %*ph: `git grep -n -i '%02x[ :-]%02x[ :-]%02x'`
3. Any of custom code that implements already provided extensions described in printk-formats.rst
4. driver_override_store() unification (manipulation with strings)
5. Run `codespell` across drivers and subsystems
6. Fix ioremap(..., 0) [size = 0] across architectures, now some return NULL, some return address, some may even have leaks
7. Common helper to search for magic inside BIOS region: `git grep -n -i ' = .*0xf0000[^0-9a-f]'`
@andy-shev
andy-shev / irq_flags_mismatch.py
Last active Aug 1, 2018
IRQ flag mismatch logic in __setup_irq() in Linux kernel for shared interrupts
View irq_flags_mismatch.py
#!/usr/bin/python -tt
# -*- coding: UTF-8 -*-
# vim: ts=4 sw=4 et ai si
from __future__ import print_function
import sys
import os
import itertools
@andy-shev
andy-shev / fdcalc8250.py
Last active Jan 14, 2020
Fractional divider calculator for Synopsys DesignWare UART (8250) v4.00a and newer
View fdcalc8250.py
#!/usr/bin/python -tt
# -*- coding: UTF-8 -*-
# vim: ts=4 sw=4 et ai si
from __future__ import print_function
import sys
import os
import math
@andy-shev
andy-shev / bst.sh
Created Mar 19, 2018 — forked from iestynpryce/bst.sh
An implementation of a Binary Sort Tree in Bash. Object-like behaviour has been faked using eval. Remember that eval in shell scripting can be evil.
View bst.sh
#!/bin/sh -efu
#
# Binary search tree is of the form:
# 10
# / \
# / \
# 4 16
# / \ /
# 1 7 12
#
@andy-shev
andy-shev / prepare-u-boot.sh
Last active Feb 21, 2019
Create U-Boot image suitable for xFSTK and DFU for Intel Edison
View prepare-u-boot.sh
#!/bin/sh
#
# Required: xz, crc32, xxd, xfst-dldr-solo, dfu-util
#
# Version for stable edison-v2016.11 and edison-v2017.01
#dd if=u-boot.bin of=u-boot-4k.bin bs=4k seek=1 && truncate -s %4096 u-boot-4k.bin
# OSIP header (0x000000)
@andy-shev
andy-shev / pincfg.py
Last active Jan 17, 2017
Pack value with scale
View pincfg.py
#!/usr/bin/python -tt
# -*- coding: UTF-8 -*-
# vim: ts=4 sw=4 et ai si
from __future__ import print_function
import sys
import os
import math