sendgrid with wordpress

If your instance is not configured to send out email, you have several options to choose from. One option is to use a service called SendGrid. You can sign up on their site and obtain an API key. To start using with WordPress, you simply install a plugin called WP Mail SMTP and supply the API key on the plugin and off you go. I use Contact Form 7 to send out email from a form. There are no issues using Contact Form 7 and SendGrid. In addition to SendGrid, the plugin also works with other email providers such as AWS, Gmail, Outlook, Zoho, Mailgun to name just a few. ...

November 18, 2020 · 1 min · ulysses

encrypt samba share

Here’s how to turn on Samba encryption on a share. Edit /etc/samba/smb.conf on the Samba server. [global] server max protocol = SMB3 smb encrypt = required lanman auth = no Edit /etc/samba/smb.conf on the Samba clients. [global] smb encrypt = required client min protocol = SMB2 client max protocol = SMB3 To connect. smbclient -e -m SMB3 //xxx.xxx.xxx.xxx/share-name -U username

November 16, 2020 · 1 min · ulysses

ebs volume stuck in cloudformation

When running CloudFormation, all the resources are being created with no problem. However it seems to be getting stuck at creating or mounting a volume. The CloudFormation fails and initiates a rollback. This is the error I am getting. Volume attachment between volume-id vol-xxxxxxxx and instance-id i-xxxxxxx at device /dev/xvda is attaching This turned out to be a conflict on HVM EC2 instances because /dev/sda1 is being remapped to /dev/xvda. My second drive is also mapped to /dev/xvda. The fix was to simply to map it slightly different to avoid mapping conflict. ...

November 12, 2020 · 1 min · ulysses

aws cli using query

Instead of using AWS and JQ to get the snapshot names, you can do it with a single command using –query. Here are the previous commands. /usr/bin/aws lightsail get-instance-snapshots --region us-east-1 --profile default > $snaps cat $snaps | jq -r '.instanceSnapshots[] | .name' > $names Using query. aws lightsail get-instance-snapshots \ --query 'instanceSnapshots[*].[name]' \ --region us-east-1 \ --profile default \ --output text > $names

November 11, 2020 · 1 min · ulysses

sensor checks for crowdstrike

Here’s the Crowdstrike Falcon Sensor checks. #!/bin/bash if [ -e /etc/redhat-release ] ; then if egrep -q 'Ootpa|CentOS Linux release 8' /etc/redhat-release ; then OSver="el8" elif egrep -q 'Maipo|CentOS Linux release 7' /etc/redhat-release ; then OSver="el7" elif egrep -q 'Santiago|CentOS release 6' /etc/redhat-release ; then OSver="el6" fi fi if [ -e /etc/os-release ] ; then if grep VERSION /etc/os-release | grep -q 15 ; then OSver="suse15" elif grep VERSION /etc/os-release | grep -q 12 ; then OSver="suse12" elif grep VERSION /etc/os-release | grep -q 11 ; then OSver="suse11" elif grep -q 'Linux 2' /etc/os-release ; then OSver="amzn2" elif grep -q 'AMI' /etc/os-release ; then OSver="amzn1" fi fi if [[ -f "/opt/CrowdStrike/falconctl" ]]; then case $OSver in suse15) if [ -z "$(ss -tapn | grep falcon)" ]; then message="Not Connected"; else message="Connected"; fi if systemctl is-active --quiet falcon-sensor; then status="Running"; else status="Stopped"; fi ;; suse12) if [ -z "$(ss -tapn | grep falcon)" ]; then message="Not Connected"; else message="Connected"; fi if systemctl is-active --quiet falcon-sensor; then status="Running"; else status="Stopped"; fi ;; suse11) if [ -z "$(ss -tapn | grep falcon)" ]; then message="Not Connected"; else message="Connected"; fi if (( $(ps -ef | grep -v grep | grep falcon-sensor | wc -l) > 0 )); then status="Running"; else status="Stopped"; fi ;; el8) if [ -z "$(netstat -tapn | grep falcon)" ]; then message="Not Connected"; else message="Connected"; fi if systemctl is-active --quiet falcon-sensor; then status="Running"; else status="Stopped"; fi ;; el7) if [ -z "$(netstat -tapn | grep falcon)" ]; then message="Not Connected"; else message="Connected"; fi if systemctl is-active --quiet falcon-sensor; then status="Running"; else status="Stopped"; fi ;; el6) if [ -z "$(netstat -tapn | grep falcon)" ]; then message="Not Connected"; else message="Connected"; fi if (( $(ps -ef | grep -v grep | grep falcon-sensor | wc -l) > 0 )); then status="Running"; else status="Stopped"; fi ;; amzn2) if [ -z "$(netstat -tapn | grep falcon)" ]; then message="Not Connected"; else message="Connected"; fi if systemctl is-active --quiet falcon-sensor; then status="Running"; else status="Stopped"; fi ;; amzn1) if [ -z "$(netstat -tapn | grep falcon)" ]; then message="Not Connected"; else message="Connected"; fi if (( $(ps -ef | grep -v grep | grep falcon-sensor | wc -l) > 0 )); then status="Running"; else status="Stopped"; fi ;; *) ;; esac else message="Not installed" fi if [[ -f "/opt/CrowdStrike/falconctl" ]]; then version=$(/opt/CrowdStrike/falconctl -g --version | awk '{print $3}') else version="Not installed" fi if [ "$version" == "Not installed" ]; then status="Not installed"; fi echo $version '|' $status '|' $message

November 11, 2020 · 2 min · ulysses

audit log files

The /var/log/audit/audit.log files were not being rotated. The files in the directory grew so large that it created disk space issues on /. Here’s the fix. In the /etc/audit/auditd.conf file, change max_log_file_action from “ignore” to “rotate.” Instead of hundreds of files being kept, it will be rotated up to 5 files. max_log_file_action = rotate num_logs = 5 Restart service to take effect. The old files will be deleted. service auditd stop service auditd start service auditd status Disk space went from 82% down to 25%.

November 10, 2020 · 1 min · ulysses

ubuntu 20.04 lts lamp server

Here’s how to install a LAMP server on the latest Ubuntu 20.04 LTS. Install Apache. apt install apache2 systemctl status apache2 systemctl is-enabled apache2 Install MariaDB. apt install mariadb-server mariadb-client systemctl status mariadb systemctl is-enabled mariadb mysql_secure_installation Install PHP. apt install php libapache2-mod-php php-mysql systemctl restart apache2 Enable ssl and mod_rewrite. a2enmod ssl a2enmod rewrite systemctl restart apache2

November 10, 2020 · 1 min · ulysses

tar list of files

Here’s another way of creating a tar ball from a list of files. tar -cvf backup.tar.gz a.txt b.txt c.txt d.txt e.txt Here’s how to view files in a tarball. tar -tvf backup.tar.gz

November 8, 2020 · 1 min · ulysses

gcp ssl certificates

Here’s how to create a regional SSL Certificate. gcloud compute ssl-certificates create my-ssl-cert \ --description "describe ssl certificate" \ --domains=domain1.com,domain2.com \ --certificate=cert.pem \ --private-key=private.key \ --region=us-central1 List the SSL certificates. gcloud compute ssl-certificates list --project=project-id Describe the SSL certificate. gcloud compute ssl-certificates describe my-ssl-cert \ --region=us-central1 \ --project=project-id Delete SSL certificate. gcloud compute ssl-certificates delete my-ssl-cert \ --region=us-central1 \ --project=project-id

October 29, 2020 · 1 min · ulysses

check if domain joined

Here’s the command to check if instance is domain joined. realm discover domain.com To check if AD user is working. id user@ad.example.com To check if AD group is working. getent group ad-group

October 28, 2020 · 1 min · ulysses