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 /
Created Dec 15, 2011 — forked from adrianratnapala/
A note on X11-Forwarding in SSh.

I used to think that

ssh -X

"just bloody worked". However this might not work - ssh must play ball on both sides of the link. On the remote (ssh server, X client) sshd must sit behind some port, tell Xlib to send X11 requests to it and then forward them back to you the X server (where the ssh client is). If the remote box is locked down to prevent this, you will get:

X11 forwarding request failed on channel 0

as part of an otherwise working login. As it happens, I am the admin of the remote box in question, so I followed the ArchWiki and went to /etc/ssh/sshd_config and uncommented

gwpl / LICENSE.The Unlicense
Last active Jan 24, 2016
barcodes_labels_test.tex - test of barcodes printing for Emerson 525x25,4mm paper on HP 3525 Ink Advantage. (Before I make repo, let's make it gist. Licence: as it is just LaTeX document, I give it with no warranty to Public Domain, let's use "The Unlicense" license (even more permissive then CC0) following advice on :…
View LICENSE.The Unlicense
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
if [ "$1" == 'make_files_for_user' ]; then
if [ -z "$2" -o -z "$3" ]; then
echo Usage: $0 make_files_for_user Username Groupname
exit 1
gwpl / only_exec_command.c
Last active Apr 30, 2016
It is "pseudo-shell" that will only execute provided -c command. Might be helpful for sshd users configured with "ForcedCommand" and "ChrootDirectory". (example with further references: ). License: This is trivial code snippet directly based on documentation and C specification, please consider it public domain.
View only_exec_command.c
#include <unistd.h>
// compile with: gcc only_exec_command.c -static -o only_exec_command
// It is "pseudo-shell" that will only execute provided -c command.
// Usage : ./only_exec_command -c /bin/echo This is test
// Please note that this is far from perfect. It should actually parse and split string
// provided in argv[2], like shlex.Split in python. However, it's enought for my application
// of running one binary specified in ForceCommand sshd_config option.
int main(int argc, char **argv){
View passwordcard_template.tex
% set page size
paperwidth = 3.5in,
paperheight = 2in,
margin = 0.15in,
gwpl / README.txt
Last active May 7, 2016
systemd.timer example: rsync script example with pidfile and trap for the purpose of
View README.txt
Copy&Paste of :
self-link (web):
self-link (doc):
# linux userX -> remotey (only over local network)
Notes from setting rsync systemd.timer .
gwpl / fstab
Last active May 7, 2016
sshfs mount config snippets
View fstab
# remote on remoteY ( remoteY has to be defined in /root/.ssh/config,/home/userX/.ssh/config )
userX@remoteY:/mnt/remoteY/ext4/userX/mount /mnt/remoteY_mount fuse.sshfs noauto,x-systemd.automount,x-systemd.device-timeout=10,_netdev,user,idmap=user,transform_symlinks,identityfile=/home/gwpl/.ssh/id_ecdsa521_sftplenovox230,allow_other,default_permissions,uid=123456789,gid=100,reconnect 0 0
# assuming 123456789 is UID and 100 GID desired of mount
gwpl / standalone_verbatim.tex
Last active May 9, 2016
standalone_verbatim.tex is parametrized tex template, that genrates cropped pdf containing given text verbatim of given file in monospace. Just compile below, or get some ascii art penguin into penguin.txt (e.g. from: ) and run: $ pdflatex '\def\txtfile{penguin.txt} \input{standa…
View standalone_verbatim.tex
% Following standalone configuration:
% Usage: pdflatex '\def\txtfile{input.txt} \input{this_document_template.tex}'
% Example pdflatex '\def\txtfile{penguin.txt} \input{standalone_verbatim.tex}'
% following
%Specified file: \txtfile
View .gitconfig
branch = auto
diff = auto
interactive = auto
status = auto
grep = auto
st = status
ci = commit
br = branch
wget -A pdf -c -r -l 1 -nd
You can’t perform that action at this time.