Skip to content

Instantly share code, notes, and snippets.

View paveljurca's full-sized avatar
🎯
Focusing

Pavel paveljurca

🎯
Focusing
View GitHub Profile
# ====
# perl Seul_contre_tous.pl|fold -w 50 -s|less
# ====
use strict;
use warnings;
use LWP::Simple;
use Mojo::DOM;
use open qw/:std :utf8/;
use utf8;
@paveljurca
paveljurca / tld.sh
Last active November 23, 2017 07:29
#!/bin/sh
x=./tld.txt
perl -ne'/^[.][a-z]/ and print qq(\ntld.txt\n) and <STDIN> and system(q(clear))' $x
# cat tld.txt|perl -ne'/^[.][a-z]/ and print qq(\ntld.txt\n) and <STDIN> and system(q(clear))'
@paveljurca
paveljurca / bc.pl
Last active November 19, 2017 10:32
use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Request::Common;
use constant API => shift;
$ua = new LWP::UserAgent;
$ua->agent('Mozilla/8.0');
@paveljurca
paveljurca / replace_crlf_with_space.pl
Last active January 5, 2017 17:58
Replace CRLF with SPACE
use strict;
use warnings;
use open qw/:std :utf8/;
@ARGV = shift; # limit to one file at once
# $| = 1; # auto-flush buffer
# open my $out, '>:utf8', 'replace_crlf_with_space.txt';
my $next = <>;
use v5.10;
use strict;
use warnings;
use open qw/:std :utf8/;
use JSON::PP;
# API call example
# http://api.rozhlas.cz/data/v2/schedule/day/2017/01/05/vltava/brief.json?callback=jQuery18204554739051964134_1484244887343&_=1484244901325
# *.json
use strict;
use warnings;
# SINGLE
# perl iradio.pl 20min_marketa_pravdova_cestina.mp3
# MULTI
# perl iradio.pl ladislav_hejdanek_dopisy_priteli_
my $name = shift;
die unless $name;
set number
set shiftwidth=2
set softtabstop=2
set shiftround
set expandtab
set t_Co=256
set autoindent
set wrap
set showmatch
" :make
@paveljurca
paveljurca / AUTOEXEC.BAT
Last active July 25, 2017 07:17
Play media files with CMD.exe
@PATH %USERPROFILE%\bin
@PATH %USERPROFILE%\Desktop
@SET PLAY=start VLC.lnk ^"^%cd^%\
@paveljurca
paveljurca / README.md
Last active July 17, 2017 10:44
Restart Explorer.exe context menu

Restart Explorer.exe context menu

Following creates a "Restart Explorer.exe" context menu (doing right click on Desktop). If you wonder what the /v:on switch does, it turns on Delayed Expansion which by default is turned off. It does expand %WINDIR% at the execution time.

reg add "HKCR\Directory\Background\shell\Restart Explorer.exe\Command" /ve /d "cmd /v:on /c """taskkill /f /im explorer.exe ^& start ^!windir^!\explorer.exe""""

Pro Tip

While CMD.exe is a command-line interpreter (CLI), EXPLORER.exe is a Windows shell.

@paveljurca
paveljurca / log.md
Created July 4, 2017 14:42
WINDOWS log files

WINDOWS

%windir%\System32\Logfiles\

%windir%\LOGS\