Skip to content

Instantly share code, notes, and snippets.

View dex4er's full-sized avatar

Piotr Roszatycki dex4er

  • Berlin, Germany
View GitHub Profile
@dex4er
dex4er / base64.sh
Last active April 3, 2024 08:13
Perl oneliners
# 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
@dex4er
dex4er / eToken-9.sh
Last active August 2, 2024 15:31
eToken
# 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 November 14, 2011 10:28
Bezpieczna Poczta Korporacyjna TP w Ubuntu
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 November 15, 2011 19:07
XML::Compile::SOAP example client
#!/usr/bin/env perl
use warnings;
use strict;
use XML::Compile::WSDL11;
use XML::Compile::SOAP11;
use XML::Compile::Transport::SOAPHTTP;
use HTTP::Tiny;
@dex4er
dex4er / calculator.url
Created November 16, 2011 16:13
YAML 2 SOAP
http://soaptest.parasoft.com/calculator.wsdl
@dex4er
dex4er / xsd-merge.xslt
Created November 21, 2011 23:04
XSLT tools for XSD and WSDL schemas
<?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 />
@dex4er
dex4er / bzr.sh
Created November 23, 2011 13:24
Bazaar
# 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 14:17
trim - convert all tabs to spaces and remove spaces at the end of lines
#!/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 November 24, 2011 15:41
SMS Receiver SOAP server
#!/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';
#!/usr/bin/perl
use HTTP::Proxy;
use HTTP::Proxy::BodyFilter::simple;
my $proxy = HTTP::Proxy->new;
$proxy->port(8888);
$proxy->push_filter(
mime => '*/*',