Skip to content

Instantly share code, notes, and snippets.

@mrkskwsnck
mrkskwsnck / .bash_profile
Last active May 2, 2024 13:33
Customized bash prompt for Git's sake
source ~/.profile
# Customized terminal prompt to reflect current git branches. Based on Debian's default PS1 variable, which was
# e.g. '\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
# at the time beeing of Debian 12 Bookworm. The original prompt was broken in two parts (left and right)
# and it can get flavoured with the middle part, to your very linking.
#
# Left part: ${PS1:0:-3}
# Right part: ${PS1:${#ps1_left_part}:${#PS1}}
#
@mrkskwsnck
mrkskwsnck / git-prune.sh
Created May 2, 2024 12:24 — forked from peterwwillis/git-prune.sh
Prune Git's local orphan references, merged feature branches, remote tracking references, and more
#!/bin/bash
# Prune local orphan refs
git prune -v
# Deletes all stale (local) remote-tracking branches under origin.
# These stale branches have already been removed from the remote repository
# referenced by <name>, but are still locally available.
git remote prune origin
@mrkskwsnck
mrkskwsnck / EvilMouse.js
Created May 1, 2024 20:38 — forked from kwasmich/EvilMouse.js
UserScript for browser to enable Disney Plus on Linux
// ==UserScript==
// @name Enable Disney Plus on Linux
// @description This is your new file, start writing code
// @match *://*.disneyplus.com/*
// ==/UserScript==
Object.defineProperty(navigator, "userAgent", { value: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36", configurable: true, enumerable: true, writable: true });
# Description: Rename argument files of taken photos (JPG) and videos (AVI) to a Nextcloud compatible timestamp format.
#
# Author: Markus Kwaśnicki
#
# Prerequisites:
# * { Install-Module -Name ExifDateTime -Scope CurrentUser }
# * { Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser }
#
# Setup: Create shortcut to
# `"C:\Program Files\PowerShell\7\pwsh.exe" -WindowStyle Hidden -File "%USERPROFILE%\Documents\PowerShell\Scripts\Rename-FotofallenFotos.ps1"´ inside
@mrkskwsnck
mrkskwsnck / Skip YouTube Ads.js
Created December 30, 2022 12:17 — forked from kwasmich/Skip YouTube Ads.js
Script for Userscripts browser extension to skip ads on Youtube.
// ==UserScript==
// @name Skip YouTube Ads
// @description This is your new file, start writing code
// @match *://*.youtube.com/*
// ==/UserScript==
function skipAd() {
const adPlaying = document.body.querySelector(".ad-showing");
if (!adPlaying) {
@mrkskwsnck
mrkskwsnck / renmove_zero-conflicted_files.sh
Created August 21, 2022 16:28
Search synchronized files conflicted by Nextcloud and replace the original file if it is zero sized.
#!/usr/bin/bash
# Search synchronized files conflicted by Nextcloud and
# replace the original file if it is zero sized.
START_DIR="$1"
GLOB_PATTERN=' (conflicted copy ????-??-?? *)'
REGEX_PATTERN=' \(conflicted copy [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]+\)'
OLDIFS=$IFS
@mrkskwsnck
mrkskwsnck / README.md
Last active November 5, 2021 16:40
Example read me file by Golo Roden

<Add module name here>

<Add module description here>

Installation

$ npm install <Add module name here>
@mrkskwsnck
mrkskwsnck / http_proxy_extra_header_demo.php
Created February 26, 2021 10:39
Extra HTTP header from proxy
<?php
/*
* Description: Demonstration of the "extra HTTP header" issue using a
* web proxy. The problem becomes significant when the
* header is output with the body alltogether.
*
* Solution: See https://stackoverflow.com/a/17059693/3375584
*/
@mrkskwsnck
mrkskwsnck / powertest.sh
Last active August 12, 2019 13:45
Test the Raspberry Pi's power supply for stability
#!/bin/bash
#
# Description: Test the Raspberry Pi's power supply for stability
# Source: https://github.com/bamarni/pi64/issues/4#issuecomment-292707581
#
# Watch your Pi! RPi foundation knows that Micro USB for DC-IN
# is sh*t but also doesn't give a sh*t. Voltage drops caused by
# average USB cables cause all sorts of instabilities and also
# data corruption but instead of fixing the problem they masked
# it in their 'firmware'. The main CPU on the Raspberry monitors
@mrkskwsnck
mrkskwsnck / index.html
Created November 28, 2018 12:56
HTML dummy file (Flipping Tables)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Flipping Tables</title>
</head>
<body>
<p>(╯°□°)╯︵ ┻━┻</p>
</body>
</html>