Skip to content

Instantly share code, notes, and snippets.

Grzegorz Wierzowiecki gwpl

Block or report user

Report or block gwpl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
# solution from
git fetch origin
git reset --hard origin/master
git for-each-ref --format='delete %(refname)' refs/original | git update-ref --stdin
git reflog expire --expire=now --all
git gc --prune=now
gwpl / collapsible_list.html
Last active Mar 27, 2019
Answer: ← there is a video to see how it works! It is list expandable html5 <details> <summary> (checked with , clean on 2019-03-27)
View collapsible_list.html
<!DOCTYPE html>
<html lang="en">
<title>Details/summary opened with anchor via javascript</title>
<script src=""></script>
<script language='JavaScript' type='text/JavaScript'>
function MakeArrayOfAllPrefixes(str){
var prefixes = [];
gwpl /
Last active Mar 15, 2019
Use different chromium profiles for different activities! Enjoy lightweight chrome, that has to carry only what it needs for task, plus more order as keeping separated different interested and activities (of sets of extensions) for order :).
mkdir -p "$chromium_profiles_dir"
# echo "$ ls -1 $chromium_profiles_dir"
# select profile in "$(ls "$chromium_profiles_dir")" "make_new"; do break; done
# echo $profile
# if [ "$profile" == "make_new" ]; then
# read -p "Profile name (preferably no spaces):" profile
gwpl / How to play linux default audio output on Sonos speakers (with delay using http streaming).md
Last active Jan 26, 2019
How to play linux default audio output on Sonos speakers (with delay using http mp3 or flac streaming)
View How to play linux default audio output on Sonos speakers (with delay using http streaming).md

how tu setup pulseaudio->streaming via cvlc (command line vlc -> so should simmilarily work with gui version (in my case don't)):

get pulseaudio source from list:

pactl list | grep "Monitor Source"

and assign to P , e.g. in my case it's usually:

gwpl / repeat
Last active Jan 12, 2019
repeat command in bash n times ( answer )
View repeat
shift 1
for ((x=0; x<$n; ++x)); do
gwpl / rmlint_example_run_stats.txt
Last active Jan 1, 2019
rmlint some example run tests statistics
View rmlint_example_run_stats.txt
$ find -type d | wc -l
$ file | wc -l
$ time rmlint -o sh:stdout -c sh:hardlink|tee >( xz > )
real 1447m43.626s
user 661m13.740s
sys 98m40.956s
$ ls -lha
-rw-r--r-- 1 user user 49M Dec 27 06:38
gwpl /
Last active Dec 25, 2018
rotate video cli linux commandline

from :

mencoder -ovc lavc -vop rotate=1 -oac copy input.mpg -o output.mpg
  • 0 Rotate by 90 degrees clockwise and flip (default).
  • 1 Rotate by 90 degrees clockwise.
  • 2 Rotate by 90 degrees counterclockwise.
  • 3 Rotate by 90 degrees counterclockwise and flip.

on my experience you need to change -vop flag with -vf

gwpl /
Last active Dec 25, 2018
# more info:
# generate script that hardlinks (if you have btrfs or other CoW use reflink or clone)
#rmlint -o -c sh:hardlink # <- for small outputs
rmlint -o sh:stdout -c sh:hardlink|tee >( xz > ) # <- for big outputs
#with -p -> paranoia , check files again before removing
./ -x -p
gwpl /
Created Dec 10, 2018
Checks if amount of files in directory has changed, if not than it executes killall to let thing restart in a loop
counter_old="$(cat "$counterf")"
echo -n 'Missing: '
comm -23 <(sort -u sites_source.txt) <(ls -1|sort -u)|wc -l
echo -n 'Total: '
sort -u sites_source.txt|wc -l
View gist:0bf0d8f9aa9385207d3636d130739f10
#cli #linux #snippet
# find lines only in file1
comm -23 file1 file2
# find lines only in file2
comm -13 file1 file2
# find lines common to both files
comm -12 file1 file2
You can’t perform that action at this time.