Skip to content

Instantly share code, notes, and snippets.

View zubair1024's full-sized avatar
🎯
Focusing

Zubair Ahmed zubair1024

🎯
Focusing
View GitHub Profile
--- Statuses Changes
SELECT leads.Ref,
statuses.Name,
leads.StatusDate,
leads.StatusChangeReason,
users.Username AS 'Status Changed By'
FROM dbo.LEAD AS leads
INNER JOIN dbo.STATUS AS statuses ON leads.StatusID = statuses.ID
LEFT JOIN dbo.Users AS users ON leads.StatusChangedBy = users.ID
WHERE(leads.StatusDate >= '2019-12-04'
@zubair1024
zubair1024 / groupByRetentionTickets.sql
Last active November 29, 2019 20:51
[Group By Retention Tickets] #sql #247
SELECT SUM(CONVERT(DECIMAL(29, 4), retentions.PremiumPolicy)) AS 'OldValue',
SUM(CONVERT(DECIMAL(29, 4), retentions.Premium)) AS 'NewValue',
SUM(CONVERT(DECIMAL(29, 4), retentions.PremiumDiff)) AS 'PremiumDiff',
retentions.OutcomeID,
users1.Username,
users1.FirstName,
users1.LastName,
retentions.CreatedDate
FROM dbo.Retention AS retentions
-- LEFT JOIN dbo.LEAD AS leads ON retentions.LeadID = leads.ID
SELECT
*
FROM
dbo. STATUS;
SELECT
leads.Ref,

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by

1. Go to the Powerline Fonts Github page.

https://github.com/powerline/fonts

2. Click on the green “Clone or download” button.

3. Click “Download ZIP”

4. Save the file fonts-master.zip to your Downloads folder or wherever you want to put it.

5. Extract fonts-master.zip.

6. Go into the fonts-master folder and the other fonts-master folder inside that. Rather than opening each folder and trying to install each font file ending with .ttf or .otf with the Windows Font Viewer, we will use a PowerShell batch script ( .ps1) called install.ps1. But a few things need to be done to make it work.

export PATH=$PATH:"C:\Program Files\nodejs"
export PATH=$PATH:"C:\Program Files\Docker\Docker\resources\bin"
export PATH=$PATH:"C:\Users\<name>\AppData\Local\Programs\Microsoft VS Code"
  1. Open console.
  2. Run: git clone git://github.com/mhoofman/wordpress-heroku.git
  3. Run: cd wordpress-heroku
  4. Run: heroku addons:create heroku-postgresql
  5. Run: heroku pg:promote HEROKU_POSTGRESQL_INSTANCE (where HEROKU_POSTGRESQL_INSTANCE) is the result of the create code you ran before.
  6. Run: git push heroku
  7. Wait.
  8. Navigate to website.
  9. Go through instructions.
  10. Done.

The workflow is as follows:

1) Install Ngnix:

sudo apt update
sudo apt install nginx

2) Ensure NGINX is running and and enabled to start automatically on reboot:

The configuration file for the first node (node1.conf):

storage:
  dbPath: /var/mongodb/db/node1
net:
  bindIp: 192.168.103.100,localhost
  port: 27011
security:
  authorization: enabled
 keyFile: /var/mongodb/pki/m103-keyfile

Starting the three config servers:

mongod -f csrs_1.conf

mongod -f csrs_2.conf

mongod -f csrs_3.conf

Connect to one of the config servers: