Skip to content

Instantly share code, notes, and snippets.

Avatar

Trog Trogious

View GitHub Profile
@Trogious
Trogious / mkbootable_dmg.sh
Created March 27, 2022 13:35
Create bootable Montenery install DMG
View mkbootable_dmg.sh
hdiutil create -o Montenery -size 15000m -volname Montenery -layout SPUD -fs HFS+J
mkdir /Volumes/Montenery
hdiutil attach Montenery.dmg -noverify -mountpoint /Volumes/Montenery
/Applications/Install\ macOS\ Monterey.app/Contents/Resources/createinstallmedia --volume /Volumes/Montenery --nointeraction
@Trogious
Trogious / github_latest_release_version_java.md
Last active April 25, 2020 15:03
Get latest release version of a GitHub repo's release (Android Java)
View github_latest_release_version_java.md

Gets the latest release version (based on tag name) for a given GitHub repo. (requires Guava due to usage of CharStreams).

    private static class VersionTask extends AsyncTask<String, String, String> {
        @Override
        protected String doInBackground(String... strings) {
            String result = null;
            URL url;
            HttpURLConnection connection = null;
            try {
@Trogious
Trogious / git_tag_or_version_gradle.md
Last active April 23, 2020 11:58
How to get latest git tag or commit ID (gradle)
View git_tag_or_version_gradle.md

How to get latest git tag or commit ID (gradle)

The following will give you the latest git tag name (if the HEAD is tagged) or latest commit ID otherwise. The getAppVersion function returns the end value.

Why is this useful?

I use it to name packages of my builds and other versioning purposes in my Android projects.

The code:

def getAppVersion = { ->
 def stdout = new ByteArrayOutputStream()
@Trogious
Trogious / git_tag_or_version_sh.md
Last active April 23, 2020 11:59
How to get latest git tag or commit ID (shell)
View git_tag_or_version_sh.md

How to get latest git tag or commit ID (shell)

The following will give you the latest git tag name (if the HEAD is tagged) or latest commit ID otherwise. After execution the X_VERSION variable holds the end value.

Why is this useful?

I use it to name packages of my builds and other versioning purposes. See example here.

The script:

X_GIT_COMMITID=`git rev-parse --short HEAD | tr -d "\n" | sed 's/ //g'`
X_GIT_TAG=`git tag --points-at $X_GIT_COMMITID | tr -d "\n" | sed 's/ //g'`
@Trogious
Trogious / vobsub2srt.md
Last active February 27, 2020 19:57
VobSub2SRT static build
View vobsub2srt.md

VobSub2SRT

Fully static build of VobSub2SRT can be found here.

compiled with:

tesseract-4.1.1
glibc-2.30

...and all other required libs.

@Trogious
Trogious / rtorrent.md
Last active February 27, 2020 15:37
rtorrent static builds
View rtorrent.md