Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View FleXoft's full-sized avatar
😃

FLEISCHMANN György, _flex, Gyurci, FleXoft FleXoft

😃
View GitHub Profile
@FleXoft
FleXoft / Password shortcut to Microsoft Windows clipboard
Last active February 17, 2021 09:33
Password shortcut to Microsoft Windows clipboard
echo|set /p=password|clip
@FleXoft
FleXoft / BATCH simple loop template
Created January 21, 2021 08:14
BATCH simple loop template
set loopcount=[Number of times]
:loop
[Commands you want to repeat]
set /a loopcount=loopcount-1
if %loopcount%==0 goto exitloop
goto loop
:exitloop
@FleXoft
FleXoft / BATCH loop counter with leading zero
Created January 18, 2021 19:30
BATCH loop counter with leading zero
@echo off
setlocal enabledelayedexpansion
SET d=10
for /L %%t IN ( ) DO (
SET /A d = !d! + 10
rem echo alma !d!
set "formattedValue=0000000000!d!"
@FleXoft
FleXoft / List of virtual FC adapters and their WWNs on the HMC using hscroot (find all servers in Operational state and all LPARs on them):
Last active January 13, 2021 13:27
List of virtual FC adapters and their WWNs on the HMC using hscroot (find all servers in Operational state and all LPARs on them):
lssysconn -r all -F resource_type,state,type_model_serial_num | grep '^sys,Connected' | cut -d',' -f3 | while read name; do echo ${name}; lshwres -r virtualio --rsubtype fc -m ${name} --level lpar -F lpar_name,slot_num,wwpns --header | grep -v null; done
@FleXoft
FleXoft / List of physical FC adapters and their WWNs on the VIO server by padmin users (lists only the adapters of the given VIO server):
Last active January 13, 2021 13:27
List of physical FC adapters and their WWNs on the VIO server by padmin users (lists only the adapters of the given VIO server):
lsdev -type adapter -state available | grep '^fcs' | while read name rest; do lsdev -dev ${name} -vpd | grep -E "${name} |Network Address"; done
@FleXoft
FleXoft / Listing physical and virtual FC adapters and their WWNs on the server as root (lists only the adapters for that server):
Last active January 13, 2021 13:27
Listing physical and virtual FC adapters and their WWNs on the server as root (lists only the adapters for that server):
lsdev -S a -Cc adapter | grep '^fcs' | awk '{print $1}' | while read name; do lscfg -vl ${name} | grep -E "${name}|Network Address"; done
@FleXoft
FleXoft / Recursively counting files in a Linux directory
Created May 15, 2020 12:39
Recursively counting files in a Linux directory
find . -maxdepth 1 -type d -print0 | xargs -0 -I {} sh -c 'echo $(find "{}" | wc -l) "{}"'
@FleXoft
FleXoft / kef search
Last active April 10, 2020 09:19
KEF search
@FleXoft
FleXoft / codesign
Created March 28, 2019 20:10
OS X codesign
codesign -f -s - --deep
@FleXoft
FleXoft / hr
Created December 28, 2018 12:07
Term size line
hr(){ yes -- ${@:-=} | tr -d $'\n' | head -c $COLUMNS ; }