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
@gwpl
gwpl / clean.sh
Last active Feb 5, 2020
`openssl pkeyutl` how to: -sign -verify -encrypt -decrypt , using openssh keys snippets/examples
View clean.sh
rm -v pub.pkcs8 test.sign test.txt.decrypted test.txt.encrypted
@gwpl
gwpl / README.md
Last active Feb 1, 2020
Bash script that generates tex with barcode containing data from commandline. gen_barcode.sh - has "preview|save|print" options and is tailored to be used with Dymo 450 LaberWriter printers. Self-link: https://goo.gl/QCqrOj
View README.md

This gist consist of tex templates for making barcodes using \psbarcode command using pst-barcode package: https://www.ctan.org/pkg/pst-barcode?lang=en .

Scripts and templates are tailored for use with label printer. I use Dymo 450 LabelWriter under Linux systems (Arch, Ubuntu, Raspibian) without hassle.

However it's easy to modify templates below to work with A4 sheets of label stickers for oridinary ink printers using labels - here is example: http://tex.stackexchange.com/a/289151/7128 .

  • standalone_code128_special_chars.tex - base template
  • standalone_code128_special_chars.sh - base for crafting bash script. It outputs same tex as standalone_code128_special_chars.tex
  • standalone_code128_gen_latex.sh - more generic generator. You can modify output by providing between 0 and 4 optional parameters.
  • gen_barcode.sh - most comprehensive script. It's standalone_code128_gen_latex.sh extended by options : `p
View clear_git_backup_after_rewrite.sh
# solution from https://blog.tinned-software.net/rewrite-author-of-entire-git-repository/
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
gwpl / Errors Before Downgrading jemalloc.md
Last active May 25, 2019
2017-12-17 Daedalus on ArchLinux - building notes by Grzegorz Wierzowiecki
View Errors Before Downgrading jemalloc.md
@gwpl
gwpl / collapsible_list.html
Last active Mar 27, 2019
Answer: https://stackoverflow.com/a/55377750/544721 ← there is a video to see how it works! It is list expandable html5 <details> <summary> (checked with https://validator.w3.org/nu/#textarea , clean on 2019-03-27)
View collapsible_list.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Details/summary opened with anchor via javascript</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script language='JavaScript' type='text/JavaScript'>
function MakeArrayOfAllPrefixes(str){
//console.log("MakeArrayOfAllPrefixes("+str+")");
var prefixes = [];
@gwpl
gwpl / chromium_profile_by_topic.sh
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 :).
View chromium_profile_by_topic.sh
#!/bin/bash
chromium_profiles_dir="$HOME/.config/chromium_profiles/"
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
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)): https://superuser.com/a/1021823/81861

get pulseaudio source from list:

pactl list | grep "Monitor Source"

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

@gwpl
gwpl / example_use_way_of_playing_mp3s_over_https_on_Sonos_using_socos.sh
Last active Jan 25, 2019
Play FLAC m3u playlist from NAS on Sonos via http URIs
View example_use_way_of_playing_mp3s_over_https_on_Sonos_using_socos.sh
#!/bin/bash
#find speaker IP with `socos` :
# socos list
#(1) 192.168.1.101 Moon
#(2) 192.168.1.102 Mars
# (...)
#(6) 192.168.1.106 Playroom stereo
python3 soco_play_m3u_by_uri_http_flac_Sonos_NAS.py 192.168.1.106 meshuggah*.m3u 4dots*.m3u phobh*.m3u the_number_twelve_looks_like_you*.m3u the_dillinger_escape_plan*.m3u
@gwpl
gwpl / repeat
Last active Jan 12, 2019
repeat command in bash n times ( answer https://unix.stackexchange.com/a/494158/9689 )
View repeat
#!/bin/bash
n=$1
shift 1
for ((x=0; x<$n; ++x)); do
"$@"
done
@gwpl
gwpl / README.md
Last active Jan 12, 2019
Adding Custom Page to ppd. Definition of S0929100 Cards for LabelWriter printers (including Dymo 450 LabelWriter), as this roll is missing in Linux Drivers (lw450.ppd and other .ppd files) and Macintosh dymo.ppd file. It's reconstructed by hand. I've send email to technical support, so let's work on this one until official specification for roll…
View README.md

Definition of S0929100 Cards for LabelWriter printers (including Dymo 450 LabelWriter), as this roll is missing in Linux Drivers (lw450.ppd and other .ppd files) and Macintosh dymo.ppd file. It's reconstructed by hand. I've send email to technical support, so let's work on this one until official specification for roll will arrive.

Please note you need to add each line to appropriate section in .ppd file according to : http://stackoverflow.com/a/3112256/544721 (On my systems, lw450.ppd files were located in /usr/share/cups/model/lw450.ppd)

Update: When I tried to apply patch below on dymo-cups-drivers-1.4.0.5 (dymo-cups-drivers-1.4.0.tar.gz), it turned out that there is already another definition of w144h252 page. Testing:

You can’t perform that action at this time.