Skip to content

Instantly share code, notes, and snippets.

Avatar

Andy Shevchenko andy-shev

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am andy-shev on github.
  • I am 0andriy (https://keybase.io/0andriy) on keybase.
  • I have a public key whose fingerprint is 8626 4E52 59C2 F682 8DDE 7DC0 993D FFF3 7739 4B2D

To claim this, I am signing this object:

@andy-shev
andy-shev / fdcalc.py
Last active Aug 29, 2015
Fractional divider calculator
View fdcalc.py
#!/usr/bin/python -tt
# -*- 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 / fdcalcspi.py
Last active Jul 1, 2021
Quark SoC SPI baudrate calculator
View fdcalcspi.py
#!/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 / fdcalcpwm.py
Last active Jun 24, 2016
Fractional divider for LPSS PWM
View fdcalcpwm.py
#!/usr/bin/python -tt
# -*- 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 Nov 25, 2020
Dumb SFI table dumper
View sfi-dump
#!/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 / 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
@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 / 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 / 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 / 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