Skip to content

Instantly share code, notes, and snippets.

View vshymanskyy's full-sized avatar
🇺🇦
#StandWithUkraine

Volodymyr Shymanskyy vshymanskyy

🇺🇦
#StandWithUkraine
View GitHub Profile
@vshymanskyy
vshymanskyy / pdfsplit.pl
Created November 21, 2012 18:52
pdfsplit is a Perl script that cuts each page in pdf file into half.
#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Long;
use Pod::Usage;
use PDF::API2;
sub parseBox {
my ($box) = @_;
if ($box =~ /^\s*([\-\.\d]+)\s+([\-\.\d]+)\s+([\-\.\d]+)\s+([\-\.\d]+)\s*$/) {
@vshymanskyy
vshymanskyy / ussd.pl
Last active April 19, 2016 14:13
USSD requests using Huawei E1550 (probably other modems too) Tested on Win32 and Linux. requires Win32::SerialPort / Device::SerialPort and Device::Gsm::Pdu.
#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Std;
use Device::Gsm::Pdu;
use XPlat::SerialPort;
# defaults
our ($opt_p, $opt_t, $opt_v, $opt_h, $opt_n);
$opt_t = 3;
@vshymanskyy
vshymanskyy / rgb.ino
Created March 17, 2013 12:11
Arduino sketch for cycling through HSV space with an RGB diode.
/*
RGB
*/
typedef class rgb
{
public:
float r; // percent
float g; // percent
float b; // percent
@vshymanskyy
vshymanskyy / StdBinmode.pm
Last active December 15, 2015 03:29
Cross-platform module to detect and set binmode for standard files; Requires Encode::Locale to detect console encoding. Defaults to utf8 I/O.
package StdBinmode;
BEGIN
{
if ($^O eq 'MSWin32')
{
eval <<END;
use Encode;
use Encode::Locale;
@vshymanskyy
vshymanskyy / kademlia.pl
Last active December 17, 2015 08:19
Kademlia DHT implementation in Perl + AnyEvent.
#!/usr/bin/perl
# Kademlia DHT implementation in Perl + AnyEvent.
# Copyright © 2013 PE Volodymyr Shymanskyy. All rights reserved.
# License: GNU GPL v2 (http://www.gnu.org/licenses/gpl-2.0.txt)
our ($DBG, $DUMP);
$Data::Dumper::Terse = 1;
$Data::Dumper::Indent = 1;
package Kad {
use Readonly;
@vshymanskyy
vshymanskyy / extip.pl
Created May 22, 2013 11:15
A better way to get external ip address. Checks external ip address on random services until 2 of them return same result. (Needs wget utility)
#!/usr/bin/perl
# A better way to get external ip address
# Checks external ip address on random services until 2 of them return same result.
# Copyright © 2013 PE Volodymyr Shymanskyy. All rights reserved.
# Public Domain code
use strict;
use warnings;
use List::Util qw(shuffle);
sub get_ext_ip {
@vshymanskyy
vshymanskyy / hashviz.pl
Created June 3, 2013 16:39
Perl implementation of 'drunken bishop' (OpenSSL hash visualization algorithm)
#!/usr/bin/perl
# Perl implementation of 'drunken bishop' (OpenSSL hash visualization algorithm)
# Copyright © 2013 PE Volodymyr Shymanskyy. All rights reserved.
# License: GNU GPL v2 (http://www.gnu.org/licenses/gpl-2.0.txt)
=pod
Bishop Peter finds himself in the middle of an ambient atrium. There
are walls on all four sides and apparently there is no exit. The floor is
paved with square tiles, strictly alternating between black and white. His
head heavily aching - probably from too much wine he had before - he
starts wandering around randomly. Well, to be exact, he only makes
@vshymanskyy
vshymanskyy / PYBOARD.py
Created November 18, 2014 00:37
Config file to build Espruino for PyBoard (from MicroPython)
#!/bin/false
# This file is part of Espruino, a JavaScript interpreter for Microcontrollers
#
# Copyright (C) 2013 Gordon Williams <[email protected]>
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# ----------------------------------------------------------------------------------------
#!/usr/bin/env node
/*
1. Install Blynk App for iOS and Anrdoid
2. Login or Create new account in the Blynk App
3. Add project by scanning this QR:
http://tiny.cc/joule-blynk
4. Send Auth Token to your email, and update AUTH variable in this sketch
/*
* This utility allows you to cross-connect two serial channels
* using any Arduino-compatible device.
*
* This is usefull for:
* Checking wiring
* Converting baud rate
* Sending AT commands
* etc.
*