This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt update && apt upgrade -y | |
sudo apt install -y nginx git tmux iftop multitail nmap apt-transport-https certbot python-certbot-nginx curl | |
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg | |
sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/ | |
wget -q https://packages.microsoft.com/config/debian/9/prod.list | |
sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list | |
sudo chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg | |
sudo chown root:root /etc/apt/sources.list.d/microsoft-prod.list | |
sudo apt-get update | |
sudo apt-get install -y dotnet-sdk-2.1 libgdiplus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Route("qr/{value}")] | |
public IActionResult Qr(string value) | |
{ | |
var memoryStream = new MemoryStream(); | |
var qrGenerator = new QRCodeGenerator(); | |
var qrCodeData = qrGenerator.CreateQrCode(value, QRCodeGenerator.ECCLevel.L); | |
var qrCode = new QRCode(qrCodeData); | |
qrCode.GetGraphic(20).Save(memoryStream, ImageFormat.Png); | |
return File(memoryStream.ToArray(), "image/png"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static bool SendConfirmationEmail(string emailAddress, string activationLink) | |
{ | |
var client = new RestClient("https://api.sendinblue.com/v3/smtp/email"); | |
var sendInBlueRequest = new RestRequest(Method.POST); | |
sendInBlueRequest.AddHeader("api-key", "SENDINBLUE_API_KEY"); | |
sendInBlueRequest.AddHeader("Accept", "application/json"); | |
sendInBlueRequest.AddHeader("Content-Type", "application/json"); | |
sendInBlueRequest.AddParameter("undefined", $"{{\"tags\":[\"Activate account for {{emailAddress}}\"],\"sender\":{{\"email\":\"[email protected]\",\"name\":\"You\"}},\"htmlContent\":\"\",\"replyTo\":{{\"email\":\"[email protected]\",\"name\":\"You\"}},\"templateId\":2,\"to\":[{{\"email\":\"{emailAddress}\",\"name\":\"{emailAddress}\"}}],\"params\":{{\"ActivationLink\":\"{activationLink}\"}}}}", ParameterType.RequestBody); | |
var sendInBlueResponse = client.Execute(sendInBlueRequest); | |
return sendInBlueResponse.IsSuccessful; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Guid CreateCryptographicallySecureGuid() | |
{ | |
using (var provider = new RNGCryptoServiceProvider()) | |
{ | |
var bytes = new byte[16]; | |
provider.GetBytes(bytes); | |
return new Guid(bytes); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Guid CreateCryptographicallySecureGuid() | |
{ | |
using (var provider = new RNGCryptoServiceProvider()) | |
{ | |
var bytes = new byte[16]; | |
provider.GetBytes(bytes); | |
return new Guid(bytes); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm -rf quentin/chambre/* |
NewerOlder