Skip to content

Instantly share code, notes, and snippets.

View tpiekarski's full-sized avatar
⌨️

Thomas Piekarski tpiekarski

⌨️
View GitHub Profile
@tpiekarski
tpiekarski / reseting-windows-acls.bat
Created March 29, 2021 08:37
Reseting recursively Windows ACLs
REM Reseting recursively Windows ACLs of a broken path
icacls <path> /reset /T /C /L /Q
@tpiekarski
tpiekarski / remove-accidentally-commited-big-files.sh
Last active February 27, 2021 21:16
Remove accidentally commited big files from GIT
# Get BFG Repo-Cleaner (https://github.com/rtyley/bfg-repo-cleaner)
wget https://repo1.maven.org/maven2/com/madgag/bfg/1.13.2/bfg-1.13.2.jar
# Removing by filesize
java -jar bfg-1.13.2.jar --strip-blobs-bigger-than <MB> <repository>
# Removing by filename
java -jar bfg-1.13.2.jar <filename> <repository>
# Prune reference logs, cleanup and optimize
@tpiekarski
tpiekarski / apt-downgrading-packages.sh
Created February 17, 2021 20:53
Downgrading packages with APT
# List all available package versions in a repository
apt-cache madison <package>
# Downgrade to a specific package version
apt-get install <package>=<version>
@tpiekarski
tpiekarski / git-resetting-files.sh
Created May 20, 2020 07:21
Resetting files to HEAD
# Resetting a single file from current branch [or from another branch]
git checkout [--] <filename>
@tpiekarski
tpiekarski / git-moving-commits.sh
Created April 10, 2020 13:17
Moving commit to another branch
# For all of us who forgetting to branch before starting new things ;)
git branch newbranch
git reset --keep HEAD~1
git checkout newbranch
# For a detailed description refer to:
# https://stackoverflow.com/questions/1628563/move-the-most-recent-commits-to-a-new-branch-with-git
@tpiekarski
tpiekarski / Makefile
Created March 23, 2020 10:24
Parameters in Makefiles
something:
$(info Using parameters in Makefiles... The value of parameter is $(in))
@echo $(in)
@tpiekarski
tpiekarski / Makefile
Created March 23, 2020 10:22
Variables inside Makefiles
something:
$(eval variable = 123)
$(info Using variables in Makefiles... The value of variable is $(variable))
@echo $(variable)
@tpiekarski
tpiekarski / mounting-iso-images.sh
Created March 23, 2020 10:18
Mounting ISO Images
# Example how to mount an ISO image file
sudo mount -o loop <image.iso> <directory>
@tpiekarski
tpiekarski / 02-wifi-device.yaml
Created March 12, 2020 09:12
Example netplan configuration for static IP
network: # No NetworkManager entry
version: 2
wifis:
some-wifi-device:
dhcp4: no
dhcp6: no
addresses: [192.168.0.42/24]
gateway4: 192.168.0.1
nameservers:
addresses: [8.8.8.8, 8.8.4.4] # Google DNS Service
@tpiekarski
tpiekarski / Log.java
Created March 6, 2020 21:07
A mock for Log while running tests for Android
package android.util;
import java.util.Locale;
import static java.lang.System.out;
@SuppressWarnings("UnusedReturnValue")
public class Log {
private static final int DEFAULT_RETURN_VALUE = 0;