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.IO; | |
using System.IO.Compression; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.Extensions.Primitives; | |
namespace SecretNest.Helper | |
{ |
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.IO; | |
using System.IO.Compression; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.Extensions.Primitives; | |
namespace SecretNest.Helpers | |
{ |
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; | |
namespace SecretNest.Text | |
{ | |
internal static class SecondExtensions | |
{ | |
public static string ToTimeText(this long second) | |
{ | |
switch (second) | |
{ |
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
namespace SecretNest.Text | |
{ | |
internal static class SizeTextExtension | |
{ | |
/* | |
<0B | |
0B | |
00B | |
000B | |
0000B |
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.Collections.Generic; | |
namespace SecretNest.Collections | |
{ | |
internal static class ReadOnlyListIndexOfExtensions | |
{ | |
public static int IndexOf<T>(this IReadOnlyList<T> readOnlyList, T element) | |
{ | |
if (readOnlyList is IList<T> list) return list.IndexOf(element); |
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
#!/bin/sh | |
# test and mount | |
function Test_n_Mount() { | |
sudo mkdir $MountPointTest | |
for SDDEV in /dev/sd? | |
do | |
for PARTITION in $SDDEV* | |
do | |
if [ "$PARTITION" != "$SDDEV" ] |
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 ExportRSAPublicKeyExtension | |
{ | |
public static byte[] ExportRSAPublicKey(this RSA rsa) | |
{ | |
const byte tagSequence = 0x30, tagInteger = 0x2; | |
var parameter = rsa.ExportParameters(false); | |
byte[] modulus = AddIntUnsignedMark(parameter.Modulus); | |
byte[] modulusLength = GetAsn8BitLength(modulus.LongLength); |