Skip to content

Instantly share code, notes, and snippets.

@tciops
tciops / resize_home_and_root
Created April 30, 2024 14:15
#resize #lvm #home #lvextend
cd /home
tar cvf /tmp/home.tar *
cd /
umount /home
lvremove /dev/mapper/rhel-home
lvcreate -L 100G -n home rhel
mkfs.xfs /dev/rhel/home
mount /home
cd /home
tar xvf /tmp/home.tar
@tciops
tciops / ubuntu22_install_eToken_SAC_FF
Last active January 25, 2024 08:18
#etoken #ubuntu22 #SafeNet
# @host qm set 268 -usb0 host=0529:0620
dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb
apt update
apt install libgdk-pixbuf2.0-0 libgdk-pixbuf-xlib-2.0-0 openssh-server net-tools vim pcscd gnutls-bin openconnect opensc python3-pip
systemctl start ssh
dpkg -i safenetauthenticationclient_10.7.77_amd64.deb
mkdir -p /etc/pkcs11/modules/
echo 'module:/usr/lib/libeToken.so.10' > /etc/pkcs11/modules/eToken.module
@tciops
tciops / route_static_dynamic_check
Last active September 6, 2023 14:54
#linux #route #check
cat /etc/sysconfig/network-scripts/route-* > /tmp/routes.txt
echo "$" >> /tmp/routes.txt
echo "169.254.0.0/16" >> /tmp/routes.txt
cat /etc/sysconfig/network-scripts/route-* |sed -e 's/\/32 / /'>> /tmp/routes.txt
ip -4 a | grep inet |awk '{print $2}' |xargs -n 1 ipcalc -n | sed -e "s/NETWORK=//" >> /tmp/routes.txt
ip r | grep --color -E -f /tmp/routes.txt
@tciops
tciops / bash_timestamp_to_date_in_csv.sh
Last active April 26, 2021 20:22
#bash #timestamp_to_date
while read -r line;
do
cnt=`echo "$line" | awk '{print $1}'`
ts=`echo "$line" | awk '{print $2}'`
src=`echo "$line" | awk '{print $3}'`
dst=`echo "$line" | awk '{print $4}'`
echo "`date -d @$((${ts}-185)) "+%Y-%m-%d %H:%M:%S"`;${src};${dst};${cnt}"
done < dcca_Reqs_20210426.txt > dcca_Reqs_20210426_date.txt
@tciops
tciops / template_shard_replicas
Created March 11, 2021 17:04
#elasticsearch #replicas #shards #es
PUT _template/gtpx_cdr_template1
{
"order": 0,
"index_patterns": [
"gtpx_cdr*"
],
"settings": {
"index": {
"number_of_replicas": "0",
"number_of_shards": "1"
@tciops
tciops / elasticsearch_zero_replica_shards.txt
Last active March 11, 2021 16:52
#elasticsearch #zero #replica #shards
PUT */_settings
{
"settings": {
"number_of_replicas": 0
}
}
@tciops
tciops / elasticsearch_reroute_shards.txt
Last active March 11, 2021 16:52
#elasticsearch #unassigned
POST /_cluster/reroute?retry_failed
POST /_cluster/reroute
{
"commands": [
{
"allocate_empty_primary": {
"index": "gtpx_cdr-2021.03.11",
"shard": 3,
"node": "10.10.38.132",
@tciops
tciops / elasticsearch_allow_delete.txt
Last active March 11, 2021 16:52
#elasticsearch #allow #delete #read-only
PUT */_settings
{
"index": {
"blocks": {
"read_only_allow_delete": null
}
}
}
@tciops
tciops / hp_ilo_snmp_settings.txt
Last active March 11, 2021 16:53
#iLO #HP #SNMP #set #console
</>hpiLO-> show /map1/snmp1 accessinfo1
status=0
status_tag=COMMAND COMPLETED
Fri Mar 5 13:50:55 2021
/map1/snmp1
Properties
@tciops
tciops / idrac_virtualConsole.txt
Last active March 11, 2021 16:53
#dell #idrac #virtual #console
racadm>>get iDRAC.VirtualConsole
[Key=iDRAC.Embedded.1#VirtualConsole.1]
AccessPrivilege=Deny Access
#ActiveSessions=0
AttachState=Auto-attach
Enable=Enabled
EncryptEnable=Enabled
LocalDisable=Disabled
LocalVideo=Enabled
MaxSessions=6