Skip to content

Instantly share code, notes, and snippets.

View prati0100's full-sized avatar

Pratyush Yadav prati0100

  • Amazon Web Services
  • Dresden
View GitHub Profile
#!/bin/bash
function find_globals () {
cut_content="$1"
# Find all the global declarations
globals=$(echo "$cut_content" | grep '^[[:space:]]global ' | sed 's/\s*global //')
if test -z "$globals"; then
return
#!/usr/bin/env tclsh
if {$argc > 2} {
puts "More arguments than expected"
exit 1
}
set dirname [lindex $argv 0]
# Create the target directory if it doesn't already exist.
@prati0100
prati0100 / mark_backport.sh
Last active March 17, 2021 12:56
Add "commit <hash> upstream" to the commit message by looking at the upstream branch for matching commits
#!/usr/bin/env bash
# SPDX-License-Identifier: MIT
# Example usage: mark_backport.sh upstream/master
#
# If the upstream branch has too many commits this can be very slow. In this
# case, pass other arguments to limit the git log to contain all your commits.
# For example, you are use '--author' or pathspecs. Example with pathspecs:
# mark_backport.sh upstream/master -- drivers/spi
@prati0100
prati0100 / mk
Last active August 17, 2022 14:53
Script to store and run multiple build configurations.
#!/usr/bin/env python3
# SPDX-License-Identifier: MIT
#
# mk can be used to easily store and run multiple build profiles. For example, I
# work on U-Boot at $DAYJOB and I need to run builds for 3-4 different
# platforms. Each platform first needs a defconfig and then a build. And the
# build command is slightly different for each. So I wrote this small utility to
# store a set of build commands and the currently active set.
#
# The commands are stored in the "config" format. For example, create a .mkconf
#!/usr/bin/python3
import numpy as np
from numpy.lib.stride_tricks import as_strided
from PIL import Image
infilename = "/tmp/foo/xac"
inwidth = 3280
inheight = 2464
bitspp = 10