Skip to content

Instantly share code, notes, and snippets.

@b9chris
b9chris / BaseController.cs
Last active August 20, 2019 16:10
Asp.Net MVC BaseController that fixes a number of problems with the default MVC implementation
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Web;
using System.Web.Mvc;
@SeanSobey
SeanSobey / portainer.md
Last active June 12, 2024 07:40
Portainer Setup on Windows 10

Portainer on Windows 10

Here I have 2 methods for running portainer on windows, a quick, preferred method only requiring a fairly recent version of docker, or a more complicated method to try if that does not work.

Using host.docker.internal

This setup will let you run Portainer on windows by using the host.docker.internal endpoint (docker.for.win.localhost is depricated since docker version 3.2.1, but older versions may use this instead).

Please note:

@agross
agross / Dockerfile
Last active November 7, 2023 01:44
Synology DS2415+ docker 17.05 does not support --build-arg
FROM busybox
ARG FOO
RUN env && echo $FOO
@LGM-AdrianHum
LGM-AdrianHum / JunctionPoint.cs
Last active July 15, 2025 15:14
Create, Delete and Examine Junction Points in C#
// File: RollThroughLibrary/CreateMaps/JunctionPoint.cs
// User: Adrian Hum/
//
// Created: 2017-11-19 2:46 PM
// Modified: 2017-11-19 6:10 PM
using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Runtime.InteropServices;
@sasjo
sasjo / drain_jenkins.groovy
Last active June 29, 2025 17:15
Drain Jenkins build queue and stop all running jobs
Jenkins.instance.queue.items.findAll { !it.task.name.contains("Extenda") }.each {
println "Cancel ${it.task.name}"
Jenkins.instance.queue.cancel(it.task)
}
Jenkins.instance.items.each {
stopJobs(it)
}
def stopJobs(job) {
if (job in jenkins.branch.OrganizationFolder) {
// Git behaves well so no need to traverse it.
@ThomasLeister
ThomasLeister / rspamd-whitelisting.md
Last active February 15, 2025 06:19
How to whitelist IP addresses or domains in Rspamd

Whitelist IP addresses based on pre-filter policy

/etc/rspamd/local.d/multimap.conf:

  IP_WHITELIST {
      type = "ip";
      prefilter = true;
      map = "/${LOCAL_CONFDIR}/local.d/ip_whitelist.map";
 action = "accept";
@hlaueriksson
hlaueriksson / Examples.cs
Last active November 12, 2023 21:19
PuppeteerSharp Documentation
using System;
using System.Threading.Tasks;
using NUnit.Framework;
namespace PuppeteerSharp.Contrib.Sample
{
public class Examples
{
async Task<IBrowser> Browser()
{
@nour-s
nour-s / IQueryableExtensions
Last active January 30, 2020 14:02 — forked from rionmonster/IQueryableExtensions
Resolve the SQL being executed behind the scenes in Entity Framework Core
using System.Reflection;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Query;
using Microsoft.EntityFrameworkCore.Query.Internal;
using Microsoft.EntityFrameworkCore.Storage;
public static class IQueryableExtensions
{
private static readonly TypeInfo QueryCompilerTypeInfo = typeof(QueryCompiler).GetTypeInfo();
@jwill9999
jwill9999 / README.md
Last active February 19, 2025 03:36
asp.net core
@goyalmohit
goyalmohit / compare-database-using-liquibase
Last active May 19, 2022 16:22
Liquibase command to compare databases
liquibase
--driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
--classpath="C:\\Program Files\\Microsoft JDBC Driver 6.0 for SQL Server\\sqljdbc_6.0\\enu\\jre8"
--url="jdbc:sqlserver://localhost:1433;databaseName=AdventureWorksProd;integratedSecurity=false;"
--username=liquibase
--password=liquibase@123
--logLevel=debug
diff
--referenceUrl="jdbc:sqlserver://localhost:1433;databaseName=AdventureWorks2017;integratedSecurity=false;"
--referenceUsername=liquibase