Skip to content

Instantly share code, notes, and snippets.

View eddywebs's full-sized avatar

Adi eddywebs

View GitHub Profile
Pricebook2 pb = new Pricebook2(Name = 'Standard Price Book 2009', Description = 'Price Book 2009 Products', IsActive = true );
insert pb;
Product2 prod = new Product2(Name = 'SLA: Bronze', IsActive = true);
insert prod;
// First insert a price for the standard price book
Pricebook2 standardPB = [select id from Pricebook2 where isStandard=true];
PricebookEntry standardPBE = new PricebookEntry(Pricebook2Id = standardPB.Id, Product2Id = prod.Id, UnitPrice = 1000, IsActive = true);
insert standardPBE;
PricebookEntry pbe = new PricebookEntry(Pricebook2Id = pb.Id, Product2Id = prod.Id, UnitPrice = 1000, IsActive = true);
insert pbe;
#the follow file ends with .conf and needs to be in the /etc/rsyslog.d dir
*.* @<GRAYLOG SERVER>:<PORT>;RSYSLOG_SyslogProtocol23Format
FOR E.G. *.* @192.168.0.1:5514;RSYSLOG_SyslogProtocol23Format
@eddywebs
eddywebs / self-signed-certificate-with-custom-ca.md
Created March 9, 2018 20:25 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@eddywebs
eddywebs / gist:52080a1535f8014bae035dbd42cf9008
Created November 16, 2022 20:07 — forked from dancinllama/gist:8f789e759dda1ce0a883
Thou shalt not put queries in loops (good example)
List<Account> accList = new List<Account>(
[Select
Id
,Name
,(Select
Email
From
Contacts
)
From Account]