Skip to content

Instantly share code, notes, and snippets.

View ildar-shaimordanov's full-sized avatar

Ildar Shaimordanov ildar-shaimordanov

View GitHub Profile
@ildar-shaimordanov
ildar-shaimordanov / telnet-like.md
Last active March 13, 2024 12:16 — forked from Khoulaiz/gist:41b387883a208d6e914b
Checking ports without telnet

Here are several different ways to test a TCP port without telnet.

$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C

$ cat &lt; /dev/tcp/127.0.0.1/23

Once I decided weirdly to combine two commands into a single one with possibility to keep the command line options of the both commands. It was assumed the following:

# original and simple usage
command1 options1 | command2 options2

# modified and weird one
super_command options1 -- options2
@ildar-shaimordanov
ildar-shaimordanov / 00-print_last_start_entry.md
Last active August 6, 2023 18:55
Print last starting entries found in all available log files

Print last starting entries found in all available log files

There are two kinds of magic: black and white. Take one spell:

  • Gandalf's formulae use white magic of awk or perl
  • Saruman's formulae use black magic trickily blending grep, sed, awk, tac and sort

Description

  1. process files FILE_PATTERN
@ildar-shaimordanov
ildar-shaimordanov / ffmpeg-for-lightnings.md
Last active September 6, 2022 15:47
examples for making cuts of lightnings
@ildar-shaimordanov
ildar-shaimordanov / trap_ping.sh
Last active March 27, 2021 13:45
trap_ping for parallel pinging
# trap_ping 'commands' [ping-options] < file-with-hosts
#
# Parallelize pinging the network hosts and execute the specified shell
# commands if one of the hosts is not reachable.
#
# Any ping options are allowed; defaults to -n -c 1.
#
# Environment
#
# PING_MAXPROCS
@ildar-shaimordanov
ildar-shaimordanov / shell-000.md
Last active April 24, 2023 07:26
shell-hybrid

Shell hybrids

/*!
Math.uuid.js (v1.4)
http://www.broofa.com
mailto:robert@broofa.com
Copyright (c) 2010 Robert Kieffer
Dual licensed under the MIT and GPL licenses.
*/
/*

List of downloaders

@ildar-shaimordanov
ildar-shaimordanov / Get-IniContent.ps1
Created August 31, 2018 17:51 — forked from hsmalley/Get-IniContent.ps1
Powershell to/from INI Files
function Get-IniContent ($filePath)
{
$ini = @{}
switch -regex -file $FilePath
{
"^\[(.+)\]" # Section
{
$section = $matches[1]
$ini[$section] = @{}
$CommentCount = 0
#!/usr/bin/env perl
# another solution by this link
# https://stackoverflow.com/q/17318289/3627676
use strict;
use warnings;
sub decamelize {
my $s = shift;