Skip to content

Instantly share code, notes, and snippets.

View andy-shev's full-sized avatar

Andy Shevchenko andy-shev

View GitHub Profile
@andy-shev
andy-shev / Linux kernel simple tasks
Last active June 24, 2023 13:37
Linux kernel simple tasks for newbies or anybody who wants to enter to kernel development
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 / fdcalcspi.py
Last active July 1, 2021 14:16
Quark SoC SPI baudrate calculator
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# vim: ts=4 sw=4 et ai si
import sys
import os
import operator
import math
import fractions
@andy-shev
andy-shev / sfi-dump
Last active November 25, 2020 14:26
Dumb SFI table dumper
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim: ts=4 sw=4 et ai si
from __future__ import print_function
import operator
import os
import struct
import sys
@andy-shev
andy-shev / jive2git.py
Last active September 23, 2020 17:53
Covnvert Jive CMS document to a Git repository
#!/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

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 20:50
Git version to C file
version.h
module
*.o
@andy-shev
andy-shev / Test FAT32 Image
Last active January 27, 2020 16:31
mmc-fat-part
Test Fat32 image
@andy-shev
andy-shev / fdcalc8250.py
Last active January 14, 2020 17:50
Fractional divider calculator for Synopsys DesignWare UART (8250) v4.00a and newer
#!/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 / prepare-u-boot.sh
Last active February 21, 2019 15:42
Create U-Boot image suitable for xFSTK and DFU for Intel Edison
#!/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 / irq_flags_mismatch.py
Last active August 1, 2018 20:41
IRQ flag mismatch logic in __setup_irq() in Linux kernel for shared interrupts
#!/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