Linux page 1 of 8 for 79 posts

On my server, I have PHP 5.6 to 8.1 installed and use the versions for various testing purposes. To change the memory_limit across all versions as simply as possible instead of editing each file, I use the following command. find /etc/php -iname 'php.ini' -exec sed -i 's/memory_limit = .*/memory_limit = 512M/g' {} \; Continue Reading...

ISPConfig3 – DNSSEC ERROR: We are low on entropy.

It seems that ISPConfig3 checks for entropy availability to be below 200 and also 400 per the following file, /usr/local/ispconfig/server/bind_plugin.inc.php. Line 93 and line 210 check for entropy availability. Line 93, inside function soa_dnssec_create(): if (file_get_contents('/proc/sys/kernel/random/entropy_avail') < 400) { $app->log('DNSSEC ERROR: We are low on entropy. Not generating new Keys for '.$domain.'. Please consider installing package haveged.', LOGLEVEL_WARN); echo Continue Reading...

sed replace braces with brackets keeping content inside

Took me a minute to figure this out but it works. Given the following string, I want to replace { and } with [ and ] keeping each number inside and only with a number inside the braces without space and without letters. data.txt: {1}: Today is tomorrow's yesterday. {2}: This year is next year's yesteryear. {3}: Foo {10}: Bar {100}: Baz {91919}: Qux {99119a9}: 42 sed -e 's/{\([0-9]\+\)}/[\1]/ data.txt rjk@debian:~$ sed -e 's/{\([0-9]\+\)}/[\1]/' data.txt [1]: Today is tomorrow's yesterday. [2]: Continue Reading...

How to remove a systemd service

I'm not sure why systemd doesn't remove the service, but to do so you can run through the following commands. Also check /etc/init.d/[servicename] as there may be a wrapper there as well. If you know what service you're looking to remove, great. If not, you can quickly find all the systemd services enabled on your system with the following command: systemctl list-unit-files | grep enabled You can inspect the service and find any unit information for it using the following: systemctl Continue Reading...

Cacti Server

Input Validation Whitelist Protection Cacti Data Input methods that call a script can be exploited in ways that a non-administrator can perform damage to either files owned by the poller account, and in cases where someone runs the Cacti poller as root, can compromise the operating system allowing attackers to exploit your infrastructure. Therefore, several versions ago, Cacti was enhanced to provide Whitelist capabilities on the these types of Data Input Methods. Though this does secure Cacti Continue Reading...

Test SMTP Auth and StartTLS

To test SMTP auth with StartTLS, I used the following method. Base64 encode the username and password. echo -ne "yourpassword" | base64 eW91cnBhc3N3b3Jk echo -ne "your@email.com" | base64 eW91ckBlbWFpbC5jb20= Connect to the SMTP server using the openssl client. openssl s_client -connect smtp.test.com:587 -starttls smtp -crlf Once connected to the mail server, identify myself with EHLO or HELO command. ehlo there 250-smtp.test.com Hello [192.168.1.50] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-AUTH Continue Reading...

Installing Debian 11.3 on my Lenovo Yoga 2

I have an old Lenovo Yoga 2 (i5-5400u, 4GB RAM, 128GB SSD). This 2-in-1 system does not have an ethernet port and during Debian installation using the netinstall ISO, non-free firmware is needed for the Intel wireless controller. I went to Debian’s installer page for non-free firmware (for Bullseye) and downloaded the zip file: https://cdimage.debian.org/cdimage/unofficial/non-free/firmware/bullseye/11.3.0/ I expanded the zip all the way into the data compressed folder. Inside that I Continue Reading...

Disable User’s Home Folder Creation in Zentyal

By default, Zentyal creates a Home Folder for each user created through the web interface and not through Active Directory Users & Computers (dsa.msc). To disable this action, modifying the Samba stub for Zentyal is the preferred method. In order to maintain the changes across Zentyal and Samba updates, a Samba stub should be copied and modified as outlined below. Make the custom stubs directory. $ sudo mkdir -p /etc/zentyal/stubs/samba Copy the default Zentyal Samba stub to the directory Continue Reading...

Increase LVM Partition in Linux

Some notes on increasing LVM partition in Linux.
Terminology

Physical Volume (PV): This can be created on a whole physical disk (think /dev/sda) or a Linux partition.
Volume Group (VG): This is made up of at least one or more physical volumes.
Logical Volume (LV): This is sometimes referred to as the partition, it sits within a volume group and has a file system written to it.
File System: A file system such as ext4 will be on the logical volume.

Increase or Expand Logical Volume
To Continue Reading...

grep email regular expression

grep -E -o "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,6}"