Skip to content

Instantly share code, notes, and snippets.

@tva77
tva77 / main.cf
Created December 13, 2023 13:27
how to control outgoing emails on postfix
# add this in your /etc/postfix/main.cf
default_destination_rate_delay = 1s
initial_destination_concurrency = 1
default_destination_concurrency_limit = 1
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_invalid_helo_hostname,reject_non_fqdn_helo_hostname,reject_unknown_helo_hostname
relayhost = [smtp.sendgrid.net]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
@tva77
tva77 / dax studio queries.txt
Last active November 21, 2023 10:52
SSAS: Using DMV Queries to get Cube Metadata for Power BI Model
SSAS: Using DMV Queries to get Cube Metadata
SSAS Dynamic Management Views (DMV’s) are very useful to query metadata of a cube. For developers, this is quite handy to provide simple documentation for the cubes they build.
There are some excellent posts on SSAS DMVs by Yaniv Mor and Vidas Matelis
Given below are some of the queries which I found particularly useful. A complete reference to the DMV schema rowset is available in msdn – http://msdn.microsoft.com/en-us/library/ms126079.aspx. Execute these queries from SQL Server Management Studio (SSMS) using MDX or DMX query editor.
--All Cubes in database
SELECT [CATALOG_NAME] AS [DATABASE];CUBE_CAPTION AS [CUBE/PERSPECTIVE];BASE_CUBE_NAME
@tva77
tva77 / install sql server driver ubuntu plesk.txt
Last active November 5, 2023 11:46
how to install MS SQL SERVER driver in a ubuntu 22 with plesk
UBUNTU 22
sudo apt-get install apt-transport-https make gcc g++ unixodbc unixodbc-dev plesk-php82-dev
sudo curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
sudo curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
sudo apt-get update
@tva77
tva77 / clone.sh
Last active August 12, 2023 21:16
wordpress clone shell script
#!/bin/bash
# shell script to clone a wordpress installation on the same server, to another subdomain
# Source Settings
SOURCE_DIR="/var/www/vhosts/yourdomain.com/subdomain1.yourdomain.com/httpdocs"
SOURCE_DB_NAME="source_db_name"
SOURCE_DB_USER="source_db_user"
SOURCE_DB_PASS="source_db_pass"
SOURCE_SUBDOMAIN="subdomain1.yourdomain.com"
# Destination Settings