Sunday, 6 November 2022

Extending LVM logical volume when 100% utilized

 When the logical volume is 100% used and you try to extend the logical volume, you will likely encounter the following error. 


# lvextend -L+5G /dev/mapper/vgname_lvname
 Couldn't create temporary archive name.
 Volume group "vgname" metadata archive failed.

A quick way to extend even when the volume is 100% utilize is by disabling autobackup (using -An)

# lvextend -An -L+5G /dev/mapper/vgname_lvname


Until next time!!!

Friday, 9 September 2022

sed Search and Replace with forward slash "/"

I always enjoy performing search and replace using sed command when I need to edit the same thing over multiple files. Usually the syntax that I use is as follow:

sed -i 's/search/replacement/' *.txt

This will replace all the word "search" with "replacement" in all files that ended with txt. 

But what if you want to replace the word "search" with "replace/ment". You just need to do minor adjustment as follow:

sed -i "s|search|replace/ment|" *.txt

Usually I omit the "-i" first to see the changes on the screen to make sure that the text are replaced properly before adding "-i" to perform the actual changes. 

Until next time!!! 

Wednesday, 7 September 2022

SSH Tunneling - Simple localhost port forwarding

 Recently I saw an application that run on 127.0.0.1 port 8080 on the server that I need to access from my workstation. The easiest way to access this is to use ssh tunneling. 


To tunnel remote port to local machine, you can just perform the following:

ssh -g -L 9999:localhost:8080 -f -N username@remoteip


This will allow your local machine port 9999 to be tunneled to the remote machine application on port 8080


Launch your browser and login to http://localhost:9999 and you will be accessing the application running on the server localhost.   


Until next time :)

Saturday, 1 August 2020

LogStory - Updated UI

Hi All, 

I am still working on new functionality of the logstory and still keen to hear feedbacks and input. 

For now I have updated the UI a little bit. Enjoy!!!



Feel free to contact me at davidtio at fosstech dot biz 

You can view it live in http://tableau.fosstech.biz/ServerConn2.html
Username: logstory
Password: A1r0plan3

Friday, 26 June 2020

Tableau + syslog-ng - Let's the story begins

In Linux world, syslog has been doing a great job logging most of system and user activities. However finding information from log is not easy at all. With so much data in the log files, it can be a daunting task to just understand the log. 

So with Tableau + syslog-ng, I decide to begin my journey of telling the story from log files. I called this project LogStory. 

This first visualization is capturing when the user login, logout and the duration spent in the session. It will also show when the session is active and refreshed every 3 second. 



You can view it live in http://tableau.fosstech.biz/ServerConn.html
Username: logstory
Password: A1r0plan3

What story should I tell next ? 




Thursday, 4 June 2020

ldapsearch over ssl (ldaps) to Active Directory

In order for Linux to perform ldapsearch over ssl, you need to import Active Directory CA certificate.

On ActiveDirectory run the following command:
> certutil -ca.cert adca.der

Copy adca.der into the Linux server and convert the cert into Linux friendly cert
#  openssl x509 -inform DER -in adca.der -out adca.crt

Move the file into the default ca-trust directory
# cp adca.crt /etc/pki/ca-trust/source/anchors/
# update-ca-trust

You are ready to run ldapsearch over ssl to Active Directory

Assuming you ad server is adsvr.fosstech.biz for fosstech.biz domain, you can run ldapsearch as follow

# ldapsearch -x -W -H ldaps://adsvr.fosstech.biz  -D "administrator@fosstech.biz" -b "dc=fosstech,dc=biz" *

Cheers!!!

Sunday, 31 May 2020

RHEL 7 AD Authentication

RHEL 7 authentication to AD is quite straight forward

If you are using minimal server setup, install the following package:

# yum install realmd sssd samba-common-tools

The following command is assuming you have AD with domain fosstech.biz setup.

# authconfig --enablesssd --update
# realm join fosstech.biz

Key in the administrator password and your system should be joined to the domain server.

Edit /etc/sssd/sssd.conf if you need to fine tune the configuration. I personally like to have the home directory with the following format: /home/username@domain.com, so I would update the following config

fallback_homedir = /home/%f

Restart sssd and have fun trying

Note: The above are tested on RHEL 7.8

Cheers