Posts

Showing posts from 2024

Differences between gz, bzip2, xz, 7z, rar, lzop

  Differences between gz, bzip2, xz, 7z, rar, lzop Gzip and bzip2, as well as xz and lzop, are functionally equivalent.  (There once was a bzip, but it seems to have completely vanished off the face of the world.)  Other common compression formats are zip, rar and 7z; these three do both compression and archiving (packing multiple files into one).  Here are some typical ratings in terms of speed, availability and typical compression ratio  (note that these ratings are somewhat subjective, don't take them as gospel): decompression speed (fast > slow): lzop > gzip, zip > xz > 7z > rar > bzip2 compression speed (fast > slow): lzop > gzip, zip > xz > bzip2 > 7z > rar compression ratio (better > worse): xz > 7z > rar, bzip2 > gzip > zip > lzop availability (unix) : gzip > bzip2 > xz > lzop > zip > 7z > rar availab...

Centos 8 repository error

   Centos Stream 8 is EOL, use archive from mirror. sudo sed -i -e '/mirrorlist=http:\/\/mirrorlist.centos.org\/?release=$releasever&arch=$basearch&repo=/ s/^#*/#/' -e '/baseurl=http:\/\/mirror.centos.org\/$contentdir\/$releasever\// s/^#*/#/' -e '/^\[baseos\]/a baseurl=https://mirror.rackspace.com/centos-vault/8.5.2111/BaseOS/$basearch/os' /etc/yum.repos.d/CentOS-Stream-BaseOS.repo sudo sed -i -e '/mirrorlist=http:\/\/mirrorlist.centos.org\/?release=$releasever&arch=$basearch&repo=/ s/^#*/#/' -e '/baseurl=http:\/\/mirror.centos.org\/$contentdir\/$releasever\// s/^#*/#/' -e '/^\[appstream\]/a baseurl=https://mirror.rackspace.com/centos-vault/8.5.2111/AppStream/$basearch/os' /etc/yum.repos.d/CentOS-Stream-AppStream.repo sudo sed -i -e '/mirrorlist=http:\/\/mirrorlist.centos.org\/?release=$releasever&arch=$basearch&repo=/ s/^#*/#/' -e '/baseurl=http:\/\/mirror.centos.org\/$contentd...

Wazuh opensearch dashboard ConnectionError: connect ECONNREFUSED ::1:9200"

 Wazuh opensearch dashboard ConnectionError: connect ECONNREFUSED ::1:9200"    If you see error like this:  Aug 19 13:38:21 wazuh opensearch-dashboards[486]: {"type":"log","@timestamp":"2024-08-19T04:38:21Z","tags":["error","opensearch","data"],"pid":486,"message":"[ConnectionError]: connect ECONNREFUSED ::1:9200"} the problem is with missing host localhost IP at: (default is IPv6 and deamon is not listening on it) /etc/wazuh-dashboard/opensearch_dashboards.yml  opensearch.hosts: https://127.0.0.1:9200 #opensearch.hosts: https://localhost:9200

M365 Exchange online how to find users with auto-forwarding enabled

 M365 Exchange online how to find users with auto-forwarding enabled   1. Use Powershell     Connect-ExchangeOnline  Get-Mailbox | Where {$null -ne $_.ForwardingSmtpAddress} | FT UserPrincipalName,ForwardingSmtpAddress,DeliverToMailboxAndForward $Mailboxes = Get-Mailbox -ResultSize unlimited  | where {$_.RecipientTypeDetails -eq "UserMailbox"} foreach ($Mailbox in $Mailboxes)     { Get-InboxRule -mailbox $Mailbox.Name | Where-object {$_.forwardto -or $_.forwardasattachmentto} | fl mailboxownerid,name,description }   

M365 Exchange online - bulk delete Quarantined emails

 M365 Exchange online - bulk delete Quarantined emails 0. Connect from Powershell  Connect-ExchangeOnline -UserPrincipalName  [email protected]   1.  Find quarantined emails using Powershell: Get-QuarantineMessage -SenderAddress [email protected] -ReleaseStatus NotReleased     2.   Create variable with IDs $id = Get-QuarantineMessage -SenderAddress [email protected] -ReleaseStatus NotReleased | select -ExpandProperty Identity 3. Delete or Release all: Delete-QuarantineMessage -Identities $id -Identity 000 Get-QuarantineMessage -SenderAddress [email protected] -ReleaseStatus NotReleased | Release-QuarantineMessage -ReleaseToAll

Convert Windows MBR partition to GPT using command line

  Convert an MBR disk from the command line deleting all data To complete the disk conversion from the command line with the diskpart disk partition process, follow these steps. Back up or move the data on the MBR disk prior to conversion. Open an elevated command prompt: select and hold (or right-click) Command Prompt , and select Run as Administrator . At the prompt, enter diskpart to initiate the disk partition process. Prepare the MBR disk for conversion by cleaning (deleting) any partitions or volumes. Note If the MBR disk doesn't have any partitions or volumes, skip to the last step to apply the conversion. At the DISKPART prompt, enter list disk . Make a note of the MBR disk number that you want to convert to GPT format. At the DISKPART prompt, enter select disk <disk-number> , where <disk-number> is the MBR disk number to convert. At the DISKPART prompt, enter clean to delete all partitions and volumes on the disk. At the DISKPART prompt,...

How to check if Windows server is domain controller?

How to check if Windows server is domain controller?  Win + R key  WMIC COMPUTERSYSTEM GET DOMAINROLE  0 {"Stand Alone Workstation"} 1 {"Member Workstation"} 2 {"Standalone Server"} 3 {"Member Server"} 4 {"Backup Domain Controller"} 5 {"Primary Domain Controller"}   lusrmgr.msc  sysdm.cpl  dsa.msc NTDS AND SYSVOL Folders

LibreNMS MS teams general error

Microsoft Teams Transport - Failed (General Error) On the file: /opt/librenms/LibreNMS/Alert/Transport/Msteams.php (Assuming that’s the path for your MSteams.php file) Where is: curl_setopt( $curl , CURLOPT_HTTPHEADER, [ 'Content-type' => 'application/json' , 'Expect:' , ]); Change it to: curl_setopt ( $curl , CURLOPT_HTTPHEADER, array ( 'Content-Type:application/json' , 'Expect:' ));

The following signatures were invalid: EXPKEYSIG B188E2B695BD4743 DEB.SURY.ORG Automatic Signing Key

 W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://packages.sury.org/php buster InRelease: The following signatures were invalid: EXPKEYSIG B188E2B695BD4743 DEB.SURY.ORG Automatic Signing Key <[email protected]> W: Failed to fetch https://packages.sury.org/php/dists/buster/InRelease  The following signatures were invalid: EXPKEYSIG B188E2B695BD4743 DEB.SURY.ORG Automatic Signing Key <[email protected]> W: Some index files failed to download. They have been ignored, or old ones used instead. To fix this problem use these commands: apt-get update apt-get -y install lsb-release ca-certificates curl curl -sSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb dpkg -i /tmp/debsuryorg-archive-keyring.deb sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /et...

Docker network not found

 Docker network not found   Failed to remove network <id>: Error response from daemon: network <id> not foundFailed to remove some resources from stack: <name> When using docker network ls, the network is indeed not removed, however, docker network rm <id> always results in the following: Error response from daemon: network <id> not found 1. If you are attempting to add a container to an existing network that no longer exists, then you can use docker-compose up --force-recreate.  2. Inspect the network which we are unable to delete docker network inspect <id> or <name> Disconnect the network docker network disconnect -f <networkID> <endpointName> or <endpointId> Delete unused networks docker network prune docker system prune will remove 'all networks not used by at least one container' allowing them to be recreated next docker-compose up

Postfix/sendmail fatal: User nginx is not allowed to submit mail

Postfix/sendmail fatal: User nginx is not allowed to submit mail   You need to edit /etc/postfix/main.cf    and find   authorized_submit_users = root,www-data   and add nginx.   After that reload postfix and now you can send emails from web php forms.