Skip to content

Instantly share code, notes, and snippets.

@mbuotidem
mbuotidem / PerfRev.cs
Last active February 27, 2019 04:21
PerfRev Application Review Controller and Model
//GET: Review
[HttpGet, ActionName("Review")]
public async Task<IActionResult> Review(int? id)
{
if (id == null)
{
return NotFound();
}
@mbuotidem
mbuotidem / Install.md
Last active February 27, 2019 09:02
Instructions to install LibreHealth Toolkit on Ubuntu / Linux

Install LibreHealth Toolkit on Ubuntu via Docker

What is Docker

Docker is a tool that makes it easy to run software. It does so by reducing the steps needed to setup the software through the use of containers. You can think of a container as a virtual computer that runs inside your computer. Given its virtual nature, it can be shared with others through the internet simply by having them download a file. That file specifies how to rebuild the virtual computer to match its source. Therefore, when you download and run a Docker container, it will look and function exactly the way the sender designed it to function. Everyone who uses that container will thus have the exact same experience. This is especially helpful because it ensures that you have all the dependencies required for the software to run properly. In addition, it ensures reproducibility of bugs which aids in the software development process. As such, the LibreHealth Team is phasing out the old installation process in favor of using Docke

Install LibreHealth Toolkit on Windows via Docker

What is Docker

Docker is a tool that makes it easy to run software. It does so by reducing the steps needed to setup the software through the use of containers. You can think of a container as a virtual computer that runs inside your computer. Given its virtual nature, it can be shared with others through the internet simply by having them download a file. That file specifies how to rebuild the virtual computer to match its source. Therefore, when you download and run a Docker container, it will look and function exactly the way the sender designed it to function. Everyone who uses that container will thus have the exact same experience. This is especially helpful because it ensures that you have all the dependencies required for the software to run properly. In addition, it ensures reproducibility of bugs which aids in the software development process. As such, the LibreHealth Team is phasing out the old installation process in favor of using Dock

@mbuotidem
mbuotidem / mysql-docker.sh
Created March 3, 2019 17:29 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@mbuotidem
mbuotidem / MyDbContext.cs
Created February 16, 2020 06:16 — forked from hikalkan/MyDbContext.cs
How to map a dictionary property of an entity to a string field of a table in Entity Framework Core v2.1+
public class MyDbContext : DbContext
{
public DbSet<User> Users { get; set; }
public MyDbContext(DbContextOptions<MyDbContext> options)
: base(options)
{
}
@mbuotidem
mbuotidem / installJekyllAmazonLinux
Last active March 29, 2021 14:40
Install Jekyll on Amazon Linux
sudo amazon-linux-extras install -y ruby2.4
sudo yum install -y gcc ruby-devel libxml2 libxml2-devel libxslt libxslt-devel patch redhat-rpm-config sqlite-devel
sudo gem install jekyll bundler
To run Jekyll, I had to do so via bundle exec instead of jekyll s
bundle exec jekyll serve
@mbuotidem
mbuotidem / setBased.sql
Created May 27, 2020 02:35
Set-based SQL solution
IF OBJECT_ID(N'tempdb..#TempTest') IS NOT NULL
BEGIN
DROP TABLE #TempTest
END
GO
WITH WK_RN AS
(
SELECT ROW_NUMBER() OVER (ORDER BY Id, Rev) AS ROWID, *
FROM Test
@mbuotidem
mbuotidem / curlPostAzFunc
Created May 27, 2020 21:49
AzureFunctionsCurlPOST
curl --header "Content-Type:application/json" --request POST --data {} http://localhost:7071/admin/functions/SaveItems
@mbuotidem
mbuotidem / locustfile.py
Created November 18, 2020 05:41
sample aws iot-core locustfile with stop on web gui not working
import time
import os
import json
import ssl
import paho.mqtt.client as mqtt
from locust import User, task, events
# this value is the number of seconds to be used before retrying operations
@mbuotidem
mbuotidem / WindowsTerminal.md
Created March 23, 2021 20:42 — forked from dahlsailrunner/WindowsTerminal.md
Customization and Setup notes for Windows Terminal