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
var apolloUpdateAdjustment = new Apollo.UpdateAdjustment | |
{ | |
supply = record["SUPPLY"].ToString(), | |
prosales = record["ProSales"].ToString(), | |
release_date = record["Release Date"].ToString(), | |
reason_for_update = record["Reason For Update"].ToString(), | |
itemid = Convert.ToInt64(record["ItemID"].ToString()), | |
}; |
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
scp root@oldhost:/root/.bash_history /tmp/migrate.sh | |
sudo sh /tmp/migrate.sh |
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 class Startup | |
{ | |
public IConfigurationRoot Configuration { get; } | |
public ILoggerFactory LoggerFactory { get; } | |
public DbConnectionStringBuilder DbConnectionStringBuilder { get; } | |
public Startup() | |
{ | |
Configuration = new ConfigurationBuilder() | |
.AddEnvironmentVariables("TROICENET_") |
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 class StatusController : Controller | |
{ | |
public ILoggerFactory LoggerFactory { get; } | |
public DbConnectionStringBuilder ConnectionStringBuilder { get; } | |
public StatusController(DbConnectionStringBuilder connectionStringBuilder, ILoggerFactory loggerFactory) | |
{ | |
ConnectionStringBuilder = connectionStringBuilder; | |
LoggerFactory = loggerFactory; | |
} | |
} |
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
static class Program | |
{ | |
public static IConfigurationRoot Configuration { get; } | |
public static ILoggerFactory LoggerFactory { get; } | |
public static DbConnectionStringBuilder DbConnectionStringBuilder { get; } | |
static Program() | |
{ | |
Configuration = new ConfigurationBuilder() | |
.AddEnvironmentVariables("TROICENETDEV_") | |
.Build(); |
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
using System.Linq; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using Microsoft.AspNetCore.Routing; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; | |
namespace GithubPullerDemo | |
{ | |
public class GitHubRepo |
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
## General Stuff | |
### List of all tables | |
SELECT * FROM pg_catalog.pg_tables | |
### Create new user and give it superuser access | |
create user adminuser createuser password '1234Admin'; | |
alter user adminuser createuser; | |
### Create user without superuser privilege |
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 IActionResult WarehouseTransactions() | |
{ | |
dynamic logs = new ExpandoObject(); | |
try | |
{ | |
using (var athenaDb = LocalDB.GetConnection()) | |
using (var remoteDb = RemoteDB.GetConnection()) | |
{ | |
//download ids+lastmodified timestamp for source and destination | |
var sourceTransationState = athenaDb |
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
Log.Logger = new LoggerConfiguration() | |
.MinimumLevel.Debug() | |
.Destructure.ByTransforming<ExpandoObject>(JsonConvert.SerializeObject) | |
.WriteTo.AzureAnalytics( | |
workspaceId: Configuration["AZUREANALYTICS_WORKSPACEID"], | |
authenticationId: Configuration["AZUREANALYTICS_AUTHENTICATIONID"], | |
logName: "logTableName", | |
restrictedToMinimumLevel: LogEventLevel.Debug, | |
batchSize: 10) | |
.CreateLogger(); |