Skip to content

Instantly share code, notes, and snippets.

Avatar
😃

FLEISCHMANN György, _flex, Gyurci, FleXoft FleXoft

😃
View GitHub Profile
View linux_pv_vg_lv_mkfs
pvcreate /dev/sdc1
vgcreate vtl-media /dev/sdc1
lvcreate -n lv_vtl-media vtl-media --size 1500G
mkfs.xfs -L vtl-media /dev/mapper/vtl--media-lv_vtl--media
cat /etc/fstab
@FleXoft
FleXoft / Db2 delete archive logs in every 10 minutes
Created Apr 30, 2021
Db2 delete archive logs in every 10 minutes
View Db2 delete archive logs in every 10 minutes
while :; do find /tsmarchlog/tsminst1/TSMDB1/NODE0000/LOGSTREAM0000/C0000001/ -name '*.LOG' -mmin +1 -exec echo "{}" \; -exec rm -rf {} \; ; date; echo "Sleeping..."; sleep 600; done
View X after sudo
xauth add $(xauth -f ~flex/.Xauthority list|tail -1)
@FleXoft
FleXoft / Password shortcut to Microsoft Windows clipboard
Last active Feb 17, 2021
Password shortcut to Microsoft Windows clipboard
@FleXoft
FleXoft / BATCH simple loop template
Created Jan 21, 2021
BATCH simple loop template
View 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 Jan 18, 2021
BATCH loop counter with leading zero
View 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 Jan 13, 2021
List of virtual FC adapters and their WWNs on the HMC using hscroot (find all servers in Operational state and all LPARs on them):
View 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 Jan 13, 2021
List of physical FC adapters and their WWNs on the VIO server by padmin users (lists only the adapters of the given VIO server):
View 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 Jan 13, 2021
Listing physical and virtual FC adapters and their WWNs on the server as root (lists only the adapters for that server):
View 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
Recursively counting files in a Linux directory
View Recursively counting files in a Linux directory
find . -maxdepth 1 -type d -print0 | xargs -0 -I {} sh -c 'echo $(find "{}" | wc -l) "{}"'