Public Documentation

Reset Repo Commits


export GIT_RESET_USER=yourUserNameOrOrgName
export GIT_RESET_REPO=yourRepoName
export bypassCF="git"
export bypassCF2="@"
export bypassCF3=""
rm -rf .git
git init
git add .
git checkout -b main
git commit -m "Initial Commit"
git remote add origin $bypassCF$bypassCF2$$GIT_RESET_USER/$GIT_RESET_REPO.git
git remote set-url origin$GIT_RESET_USER/$GIT_RESET_REPO.git
git push -u --force origin main


set GIT_RESET_USER=yourUserNameOrOrgName
set GIT_RESET_REPO=yourRepoName
set bypassCF=git
:: set bypassCF2 = @ (remove spaces)
set bypassCF2=@
rd /s /q .git
git init
git add .
git checkout -b main
git commit -m "Initial Commit"
git remote add origin %bypassCF%%bypassCF2%%bypassCF3%:%GIT_RESET_USER%/%GIT_RESET_REPO%.git
git remote set-url origin
git push -u --force origin main

GitHub API: Organization Membership

This simple curl command will set your membership to public/private for any organization.

A use case would be an organization so big you can't search for yourself.

For this to work, you need a GitHub Personal Access Token.

# To make an org private, replace PUT with DELETE
curl \
  -X PUT \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: token xxxxxxxxxxxxxxxx" \

GitHub API Docs

Saving chmod +x in a Git Repo

git config core.fileMode true
find . -type f -iname "*$fileType" -exec chmod +x {} \;
find . -type f -iname "*$fileType" -exec git update-index --chmod=+x {} \;
git add . && git commit -am "Update Execute Permissions" && git push

Ghost Snippets

Place any of the following in your Code Injection settings.

Found in: Ghost Admin -> Settings -> Advanced -> Code Injection

Site Header

    /* Hide "Powered By Ghost" from Footer, granted this makes the footer look weird. */
    .site-footer .inner div {
        display: none;

    /* Hide Footer entirely */
    footer {
        display: none;
  		(Only use this if you remove the footer) 
  		Padding the bottom of page if CTA/Read More/etc is visible because removing footer causes it to hug bottom of page
        margin-bottom: 35px;
    // External Links Open in New Tab
    var links = document.querySelectorAll('a');
    links.forEach((link) =>
        var a = new RegExp('/' + + '/');
        if (!a.test(link.href))
            link.addEventListener('click', (event) =>
      , '_blank');

    // Hide "Powered By Ghost" in Portal Popup
    window.onload = function ()
        let portal = document.getElementById("ghost-portal-root");
        const interval = setInterval(() =>
            let frame = portal.querySelector('[title="portal-popup"]');
            if (frame !== null)
                const styleElement = document.createElement("style");
                styleElement.innerHTML = `.gh-portal-powered { display: none; }`;
            } else
                frame = null
        }, 0)

    // Inject a "Share this article" at the end of all posts
    async function copyToClip(text)
            const protocol = window.location.protocol;
            await navigator.clipboard.writeText(`${ protocol }//${ text }`);
            var h4 = document.querySelector(`#c-share`);
            if (!h4.querySelector(`span`))
                var span = document.createElement(`span`);
                span.innerHTML = ` (copied to clipboard)`;
                setTimeout(function ()
                }, 2000);
        } catch { }
    var article = document.querySelector(``);
    var section = article.querySelector(`.gh-content`);
    // Hacky workaround to only show on blog posts and not on pages like "About" (Blog Posts have a CTA when signed out, a read more section, or article comments)
    if (document.querySelector(`.footer-cta`) || document.querySelector(`.read-more-wrapper`) || document.querySelector(`.read-more-wrap`) || document.querySelector(`.article-comments`))
        var hr = document.createElement(`hr`);
        var h4 = document.createElement(`h4`); = `c-share`;
        let url = `${ }${ window.location.pathname }`;
        url = url.replace(/\/$/, ``);
        h4.innerHTML = `Share this post: <a href="#" onclick="copyToClip(\`${ url }\`); return false;">${ url }</a>`;

Prune Docker

docker image prune -a -f
docker volume prune -f
docker network prune -f


Empty Lines after if/else/while/for

(if |else |else if |for |while ).+\n\n


HTML Redirects

Redirect to another site with HTML.

<!-- index.html -->
<meta http-equiv="refresh" content="0; url=">
# .htaccess
ErrorDocument 404

Resizing HDD (Linux)

  1. Resize disk with any solution (GParted, etc).
  2. Use lsblk to get the partition you want to expand.
  3. sudo growpart /dev/sda 2 # 2 is the partition you want to increase in size.
  4. sudo resize2fs /dev/sda2

Restart Windows Audio Service Script

Place the following into a .bat file and run it.

@echo off

:: Run as Admin
set "params=%*"
cd /d "%~dp0" && ( if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" ) && fsutil dirty query %systemdrive% 1>nul 2>nul || (  echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~sdp0"" && %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" && exit /B )

net stop audiosrv 
net start audiosrv 


EmuDeck Systems List