Skip to content

Instantly share code, notes, and snippets.

@shawmanz32na
shawmanz32na / Dockerfile
Last active July 11, 2023 17:18
mssql-docker with seed data
FROM microsoft/mssql-server-linux
COPY . /usr/src/app
ENTRYPOINT [ "/bin/bash", "/usr/src/app/docker-entrypoint.sh" ]
CMD [ "/opt/mssql/bin/sqlservr" ]
@tylerchr
tylerchr / Dockerfile
Created July 21, 2018 01:37
Compiling V8 for alpine (link against musl)
#
# Building V8 for alpine is a real pain. We have to compile from source, because it has to be
# linked against musl, and we also have to recompile some of the build tools as the official
# build workflow tends to assume glibc by including vendored tools that link against it.
#
# The general strategy is this:
#
# 1. Build GN for alpine (this is a build dependency)
# 2. Use depot_tools to fetch the V8 source and dependencies (needs glibc)
# 3. Build V8 for alpine
@janeczku
janeczku / 00-cloud-config.yml
Last active October 25, 2025 02:37
Annotated RancherOS Cloud-init configuration snippets
#cloud-config
# Set the hostname for this machine (takes precedence over hostname assigned by DHCP lease).
hostname: myhost
# Authorize SSH keys for the `rancher` sudoer user
ssh_authorized_keys:
- ssh-rsa AAA...ZZZ example1@rancher
.NET Core 2.2.0 (CoreCLR 4.6.27110.04, CoreFX 4.6.27110.04), 64bit RyuJIT
BranchmarkString.Benchmark.V6()
return string.Create(13, _id, (buffer, id) =>
^^^
{
^^^
var encode32CharsArray = _encode32CharsArray;
^^^
buffer[12] = encode32CharsArray[id & 31];
^^^
using System;
using System.IO;
using System.Net;
using System.Net.Security;
using System.Net.Sockets;
using System.Security.Cryptography.X509Certificates;
using System.Threading;
using System.Threading.Tasks;
namespace TlsSpy
@default-writer
default-writer / BufferSegment.cs
Created March 27, 2019 10:08
Queued ArrayPool<T> memory strings
public class BufferSegment : IDisposable
{
public BufferSegment(int size) => Buffer = ArrayPool<byte>.Shared.Rent(size);
public byte[] Buffer { get; }
public int ReadBytes { get; set; }
public int WrittenBytes { get; set; }

Various search databases and backends as alternatives to Elasticsearch.

Rust

@StephenCleary
StephenCleary / AsyncCache.cs
Last active April 15, 2024 10:22
Asynchronous cache
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Primitives;
using Nito.Logging;
@mgraupner
mgraupner / gist:e061079e96669b7b4ff2d1e64619f15a
Last active September 28, 2021 10:22
Create a Caddy 2 server HTTP Basic Authentication password
As there are no clear instructions on the Caddy Homepage on how to create a password
(without their own caddy tool, which might not be available) in the needed format,
I compiled a short list on how to do it the right way:
Replace password with your own password!
Create a BCrypt encrypted password in 10 rounds
htpasswd -bnBC 10 "" password
->
:$2y$10$ow7UC86yXaSoZSr0mcGxeOYK9DfqsnKnA9RoKR.nxUUXVbXqOibgm
@dr4k0nia
dr4k0nia / Suscall.cs
Created August 3, 2021 13:30
An example of using x64 syscall shellcode to call NtProtectVirtualMemory
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace Code_Projects
{
public unsafe class Suscall
{
[DllImport("kernel32", SetLastError = true)]