Skip to content

Instantly share code, notes, and snippets.

View dex4er's full-sized avatar

Piotr Roszatycki dex4er

  • Berlin, Germany
View GitHub Profile
@WebReflection
WebReflection / String.prototype.template.js
Last active August 17, 2022 04:04
ES6 Template like strings in ES3 compatible syntax.
// this is now a module:
// https://github.com/WebReflection/backtick-template#es2015-backticks-for-es3-engines--
var template = require('backtick-template');
// just string
const info = 'template';
`some ${info}` === template('some ${info}', {info});
@dex4er
dex4er / app.l4p
Created March 7, 2012 15:00
Default PSGI application
log4perl.logger.plack = DEBUG, LogfilePlack
log4perl.appender.LogfilePlack = Log::Dispatch::File::Stamped
log4perl.appender.LogfilePlack.stamp_fmt = %Y-%m-%d
log4perl.appender.LogfilePlack.filename = log/error.log
log4perl.appender.LogfilePlack.layout = PatternLayout
log4perl.appender.LogfilePlack.layout.ConversionPattern = %d{ISO8601}: %c: %m{chomp}%n
log4perl.logger.access = DEBUG, LogfileAccess
log4perl.appender.LogfileAccess = Log::Dispatch::File::Stamped
log4perl.appender.LogfileAccess.stamp_fmt = %Y-%m-%d
@Naouak
Naouak / install.sh
Created February 13, 2012 18:33
Joomla Extension installation with command line
#!/bin/sh
# Joomla extension auto installation
# Use that for development purpose, don't ever think of using it on a production website.
# The developer of that script won't endorse any problem you may encounter by using this script: Use it at your own risk!
# Please configure the three first params before using it.
# Usage :
# ./install.sh
# Will try to install every dir in the current dir
# ./install.sh directory
@dex4er
dex4er / eToken-9.sh
Last active October 31, 2023 15:05
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 / 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