Skip to content

Instantly share code, notes, and snippets.

View ntjn's full-sized avatar

Tamás Németh ntjn

View GitHub Profile
http://invisible-island.net/xterm/
XTerm Control Sequences
Edward Moy
University of California, Berkeley
Revised by
@ntjn
ntjn / gist:a79273ca5037f674055a0974299a242c
Created March 1, 2018 08:51 — forked from tsnoad/gist:2642087
SSHA password hashing. this format is used by OpenLDAP to store passwords
<?
function make_salt($salt_size=32) {
//list of possible characters from which to cerate the salt
$sea = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
//how many possible characters are there
$sea_size = strlen($sea);
$salt = "";
@ntjn
ntjn / array_slicing_and_compaction.advanced.bash
Created January 25, 2018 11:17
Advanced Bash :: Array slicing and compaction in bash
# Advanced Bash :: Array slicing and compaction in bash
# TL;DR
X=(something 'whatever' "i have more S P A C E S than i can give away. arent you jealous?")
# ${X[@]} the usual whole array
# ${X[@]:index:length} slice from index to index+length-1 inclusive
# ${X[@]::length} slice from 0 to length-1 inclusive
# ${X[@]:index} slice from index to end of array inclusive