Skip to content

Instantly share code, notes, and snippets.

View vedmichv's full-sized avatar

Viktor Vedmich vedmichv

  • AWS
  • Germany, Munich
View GitHub Profile
@vedmichv
vedmichv / iterm2.md
Created October 22, 2020 23:19 — forked from squarism/iterm2.md
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@vedmichv
vedmichv / gist:547ba4feeb193381df08822b85b6c4cb
Created October 21, 2020 23:21 — forked from sgergely/gist:3793166
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
#!/bin/bash
#
#
# есть большой файл логов с кучей строк типа:
# 10.10.2020 1.2.3.4 /index.html
# нужно найти последние уникальные 100 IP адресов в файлике
#
#
@vedmichv
vedmichv / .ps1
Last active August 29, 2015 14:25
$DefaultPassword = "Password2015"
$SecurePassword = $DefaultPassword | ConvertTo-SecureString -AsPlainText -Force
$UserName = "contoso\admin"
$SetupCredential = New-Object System.Management.Automation.PSCredential  -ArgumentList $UserName, $SecurePassword
$SAPass = $DefaultPassword | ConvertTo-SecureString -AsPlainText -Force
$SAUserName = "sa"
$saCreds = New-Object System.Management.Automation.PSCredential  -ArgumentList $SAUserName, $SAPass
$configdata = @{
AllNodes = @(
@{