Skip to content

Instantly share code, notes, and snippets.

@stahta01
stahta01 / assem.bat
Created May 2, 2023 20:09 — forked from pfiscarelli/assem.bat
6809 Coding Environment - 6809 Assembly Batch Script
@echo off & setlocal EnableExtensions EnableDelayedExpansion
cls
:: Set tool paths here
set LWTOOLS_PATH="%USERPROFILE%\Desktop\lwtools"
set TOOLSHED_PATH="%USERPROFILE%\Desktop\toolshed"
set MAME_PATH="%USERPROFILE%\Desktop\MESS"
set VCC_PATH="%USERPROFILE%\Desktop\VCC\VCC.exe"
set XROAR_PATH="%USERPROFILE%\Desktop\XRoar"
set XROAR_COMMAND="%USERPROFILE%\Desktop\XRoar\xroar.exe"
@stahta01
stahta01 / GNU-Make.md
Created March 2, 2023 19:54 — forked from rueycheng/GNU-Make.md
GNU Make cheatsheet
@stahta01
stahta01 / get-latest-tag-on-git.sh
Created December 7, 2020 02:27 — forked from rponte/get-latest-tag-on-git.sh
Getting latest tag on git repository
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples
@stahta01
stahta01 / build_cross_gcc.sh
Last active October 16, 2022 20:38 — forked from preshing/build_cross_gcc
A shell script to download packages for, configure, build and install a GCC cross-compiler.
#! /bin/bash
set -e
trap 'previous_command=$this_command; this_command=$BASH_COMMAND' DEBUG
trap 'echo FAILED COMMAND: $previous_command' EXIT
#-------------------------------------------------------------------------------------------
# This script will download packages for, configure, build and install a GCC cross-compiler.
# Customize the variables (INSTALL_PATH, TARGET, etc.) to your liking before running.
# If you get an error and need to resume the script from some point in the middle,
# just delete/comment the preceding lines before running it again.
@stahta01
stahta01 / git-extract-file.markdown
Created August 3, 2020 21:35 — forked from ssp/git-extract-file.markdown
Extract a single file from a git repository

How to extract a single file with its history from a git repository

These steps show two less common interactions with git to extract a single file which is inside a subfolder from a git repository. These steps essentially reduce the repository to just the desired files and should performed on a copy of the original repository (1.).

First the repository is reduced to just the subfolder containing the files in question using git filter-branch --subdirectory-filter (2.) which is a useful step by itself if just a subfolder needs to be extracted. This step moves the desired files to the top level of the repository.

Finally all remaining files are listed using git ls, the files to keep are removed from that using grep -v and the resulting list is passed to git rm which is invoked by git filter-branch --index-filter (3.). A bit convoluted but it does the trick.

1. copy the repository to extract the file from and go to the desired branch

@stahta01
stahta01 / 001-bnu-2.18-m68hc11.patch
Last active August 21, 2020 19:00
A shell script to download packages for, configure, build and install a GCC m6811 cross-compiler. #m6811 #cross-compiler #gcc
--- binutils-2.18/ld/scripttempl/elfm68hc11.sc 2007-08-07 19:50:33.000000000 +0000
+++ binutils-2.18/ld/scripttempl/elfm68hc11.sc 2007-08-07 19:55:30.000000000 +0000
@@ -321,7 +321,8 @@
${RELOCATING+_etext = .;}
${RELOCATING+PROVIDE (etext = .);}
- } ${RELOCATING+ > ${TEXT_MEMORY}}
+ ${RELOCATING+. = ALIGN(2);}
+ } ${RELOCATING+ > ${TEXT_MEMORY} =0xa7a7a7a7}