Skip to content

Instantly share code, notes, and snippets.

Avatar

Piotr Roszatycki dex4er

View GitHub Profile
@dex4er
dex4er / base64.sh
Last active Jun 19, 2021
Perl oneliners
View base64.sh
# Encoding file
perl -MMIME::Base64 -0777 -ne 'print encode_base64($_)' < file
# Decoding file
perl -MMIME::Base64 -ne 'print decode_base64($_)' < file.b64
# HMAC-SHA1
perl -MDigest::HMAC_SHA1 -le '$_=Digest::HMAC_SHA1->new($ARGV[0])->add($ARGV[1])->b64digest; $_.="=" x length % 4; print' TestKey TestString
View eToken-9.sh
# udev
wget https://gist.githubusercontent.com/dex4er/1354710/raw/0f9738c7439cdfb9e4446663d137f91ee153b4d8/etc_udev_rules.d_90-hid-eToken.rules
sudo cp etc_udev_rules.d_90-hid-eToken.rules /etc/udev/rules.d
sudo service udev reload
# required packages
sudo apt-get -yy install pcscd opensc
# legacy library
wget http://mirrors.kernel.org/ubuntu/pool/universe/h/hal/libhal1_0.5.14-8_amd64.deb
@dex4er
dex4er / bptp_ubuntu.sh
Created Nov 14, 2011
Bezpieczna Poczta Korporacyjna TP w Ubuntu
View bptp_ubuntu.sh
cd /usr/local/share/ca-certificates
sudo wget http://www.bptp.lodz.telekomunikacja.pl/repozytorium/rootca/rootca_pem.crt
sudo wget http://www.bptp.lodz.telekomunikacja.pl/repozytorium/ca_tp_pem.crt
sudo update-ca-certificates
@dex4er
dex4er / soap-calculator-client.pl
Created Nov 15, 2011
XML::Compile::SOAP example client
View soap-calculator-client.pl
#!/usr/bin/env perl
use warnings;
use strict;
use XML::Compile::WSDL11;
use XML::Compile::SOAP11;
use XML::Compile::Transport::SOAPHTTP;
use HTTP::Tiny;
View calculator.url
http://soaptest.parasoft.com/calculator.wsdl
@dex4er
dex4er / xsd-merge.xslt
Created Nov 21, 2011
XSLT tools for XSD and WSDL schemas
View xsd-merge.xslt
<?xml version="1.0"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsl:output version="1.0" encoding="utf-8" indent="yes" name="xml" />
<xsl:template match="/">
<xsl:apply-templates />
View bzr.sh
# Tracking upstream source
bzr init-repo .
bzr init upstream
touch upstream/.bzrignore
bzr commit upstream
bzr import-upstream 1.22 XML-Compile-1.22.tar.gz upstream
bzr merge upstream -r tag:upstream-1.22
bzr commit -m upstream-1.22 upstream
bzr import-upstream 1.23 XML-Compile-1.23.tar.gz upstream
bzr merge upstream -r tag:upstream-1.23
@dex4er
dex4er / trim.sh
Last active May 11, 2016
trim - convert all tabs to spaces and remove spaces at the end of lines
View trim.sh
#!/bin/sh
die () {
echo "$@" 1>&2
exit 1
}
test -n "$1" || die "Usage: $0 file"
case "`stat --version 2>&1 | head -n1`" in
@dex4er
dex4er / sgw-sms-receiver-server.pl
Created Nov 24, 2011
SMS Receiver SOAP server
View sgw-sms-receiver-server.pl
#!/usr/bin/env perl
use warnings;
use strict;
use XML::Compile::SOAP::Daemon::NetServer;
use XML::Compile::WSDL11;
use XML::Compile::SOAP11;
use Log::Report syntax => 'SHORT';
View robokill_unlock_proxy.pl
#!/usr/bin/perl
use HTTP::Proxy;
use HTTP::Proxy::BodyFilter::simple;
my $proxy = HTTP::Proxy->new;
$proxy->port(8888);
$proxy->push_filter(
mime => '*/*',