Skip to content

Instantly share code, notes, and snippets.

View daudo's full-sized avatar

daudo daudo

View GitHub Profile
@daudo
daudo / gist:a225d00facdc70f41fe5
Created July 4, 2014 17:14
apache as a x509 proxy
<VirtualHost>
ServerName apache.example.com
[...]
ProxyPass /gitblit ajp://infra.example.com:8009/gitblit
# ProxyPassReverse is not required, because the apache context /gitblit is the same as the tomcat one
<Location /gitblit>
SSLVerifyClient require
@daudo
daudo / gist:11250137
Created April 24, 2014 10:50
sftp meets umask - finally
Subsystem sftp internal-sftp
Match group sftp-only
ChrootDirectory /home/sftp/
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp -u 0002
bash$ GLOBIGNORE="confidential.txt"
bash$ ls -l /opt/too_many_files/*
secret.txt
top_secret.txt
public.txt
bash$ shopt -s extglob
bash$ ls -l /opt/too_many_files/!(confidential.txt)
secret.txt
top_secret.txt
public.txt
bash$ ls -l --ignore="confidential.txt" /opt/too_many_files
secret.txt
top_secret.txt
public.txt
bash$ ls -l /opt/too_many_files/[!c]*
secret.txt
top_secret.txt
public.txt
bash$ ls -l /opt/too_many_files
secret.txt
top_secret.txt
confidential.txt
public.txt
% tail -c +17185 good_tail.tar > extracted_tail.tar
% tar xf extracted_tail.tar
% perl find_tar_headers.pl good_tail.tar
good_tail.tar:17185:top/secret/warp_reactor.so:157106
good_tail.tar:75041:top/secret/kernel_injectors.so:153125
good_tail.tar:130849:top/secret/dampening_fields.so:145746
good_tail.tar:183585:top/secret/plasma_controls.so:157035
[...]
% cat rec00[2-4][0-9][0-9] > good_tail.tar