Skip to content

Instantly share code, notes, and snippets.

View d4rken's full-sized avatar
🤗
!

Matthias Urhahn d4rken

🤗
!
View GitHub Profile
@jv-k
jv-k / bump-version.sh
Last active January 15, 2024 02:49
This script automates bumping the git software project's version using automation ⚠️ For an updated version, please see https://github.com/jv-k/ver-bump — a CLI module you can use with your projects ⚠️
#!/bin/bash
#
# █▄▄ █░█ █▀▄▀█ █▀█ ▄▄ █░█ █▀▀ █▀█ █▀ █ █▀█ █▄░█
# █▄█ █▄█ █░▀░█ █▀▀ ░░ ▀▄▀ ██▄ █▀▄ ▄█ █ █▄█ █░▀█
#
# Description:
# - This script automates bumping the git software project's version using automation.
# - It does several things that are typically required for releasing a Git repository, like git tagging,
# automatic updating of CHANGELOG.md, and incrementing the version number in various JSON files.
@Zhuinden
Zhuinden / FragmentViewBindingDelegate.kt
Last active February 24, 2024 20:13
Fragment view binding delegate
// https://github.com/Zhuinden/fragmentviewbindingdelegate-kt
import android.view.View
import androidx.fragment.app.Fragment
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.Observer
import androidx.viewbinding.ViewBinding
import kotlin.properties.ReadOnlyProperty
@dragon788
dragon788 / .crypt-fix.md
Last active March 13, 2024 09:52
Repair "ubuntu--vg-root" not found with LUKS and LVM encryption

Crypt-fix

Use this script via curl -L -O https://gist.github.com/dragon788/e777ba64d373210e4f6306ad40ee0e80/raw/a86f3d05fb56feb6ef01fc2d61a4feb2fd82b281/crypt-fix.sh and sudo bash ./crypt-fix.sh. You may need to edit the DEVICE variable to reflect your disk and partition layout (this was created on an EFI system using LUKS and LVM). It will prompt you for your disk password once to mount and discover the correct name for the encrypted volume mount and then prompt again to mount with the correct name so that the update-initramfs command succeeds with the appropriate mapping, if this wasn't done you would get a warning and your next boot would still fail.

@d4rken
d4rken / gist:787061bd1f059e789061224a2a886d5e
Created July 16, 2018 19:37
Tutorial for self-hosted mail servers
A collection of guides/sites/posts that you may want to look through when setting up a mail server.
### General
* https://www.digitalocean.com/community/tutorials/how-to-configure-a-mail-server-using-postfix-dovecot-mysql-and-spamassassin
### Postfix (SMTP)
* https://seasonofcode.com/posts/custom-domain-e-mails-with-postfix-and-gmail-the-missing-tutorial.html
* https://seasonofcode.com/posts/setting-up-dkim-and-srs-in-postfix.html
@xsot
xsot / instructions.md
Last active March 3, 2024 13:42
sed maze solver

Usage

sed -E -f solver.sed input where input is a file containing the maze.

For best results, resize your terminal to match the height of the maze. To disable animations, delete the lines containing p.

Maze format

The solver assumes the following:

  • The maze only contains the characters # \nSE
  • Every line has the same number of characters
  • There is only one start (S) and end (E)
@musale
musale / fix.md
Last active April 25, 2024 03:16
How to fix and recover a “corrupt history file” in zsh
# move to home directory
cd ~

# move the .zsh_history file into another .zsh_history_bad file
mv .zsh_history .zsh_history_bad

# write all printable strings into a new .zsh_history file
strings .zsh_history_bad > .zsh_history
@justjanne
justjanne / Price Breakdown.md
Last active April 11, 2024 22:21 — forked from kylemanna/price.txt
Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:

Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:

Permalink: git.io/vps

$5/mo

Provider Type RAM Cores Storage Transfer Network Price
@koral--
koral-- / build.gradle
Last active December 12, 2017 01:31
testApt to testAnnotationProcessor migration, workaround for issue: https://code.google.com/p/android/issues/detail?id=224272
android.applicationVariants.all {
def aptOutputDir = new File(buildDir, "generated/source/apt/${it.unitTestVariant.dirName}")
it.unitTestVariant.addJavaSourceFoldersToModel(aptOutputDir)
}
@gbaman
gbaman / HowToOTGFast.md
Last active April 26, 2024 17:59
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)

More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh in the SD card as well. By default SSH i

@baconpat
baconpat / RecycleViewMatcher.java
Created March 30, 2016 01:13
RecycleViewMatcher (updated for scrolling)
package com.foo.RecyclerViewMatcher;
import android.content.res.Resources;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher;