Skip to content

Instantly share code, notes, and snippets.

// Startup.cs
public class Startup {
public void ConfigureServices(IServiceCollection services) {
services.AddGrpc();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseRouting();
app.UseEndpoints(endpoints =>
at System.Net.Security.SslStream.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, ExceptionDispatchInfo exception)
at System.Net.Security.SslStream.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslStream.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslStream.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslStream.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslStream.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslStream.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslStream.ProcessAuthentication(LazyAsyncResult lazyResult, CancellationToken cancellationToken)
at System.Net.Security.SslStream.Beg
@anlsh
anlsh / gist:a15adf2244a5e3fba74c4df0520e1f40
Created March 3, 2021 20:39
toy-dotnetcore-client.cs
class Program
{
public static X509Certificate2 GetCert() {
// Get the same cer the server is using... this function definitely works
}
static async Task Main(string[] args)
{
var handler = new HttpClientHandler();
handler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
The following packages have unmet dependencies:
libcupsimage2-dev:i386 : Depends: libpng-dev:i386 but it is not going to be installed
Depends: libjpeg-dev:i386
Depends: zlib1g-dev:i386 but it is not going to be installed
Recommends: libcupsfilters-dev:i386 but it is not installable
libfontconfig1-dev:i386 : Depends: libexpat1-dev:i386 but it is not going to be installed
Depends: uuid-dev:i386 but it is not going to be installed
libfreetype6-dev:i386 : Depends: libfreetype-dev:i386 (= 2.10.1-2) but it is not going to be installed
libgnutls28-dev:i386 : Depends: libc6-dev:i386 but it is not going to be installed or
libc-dev:i386
======================
Proton: 1591828072 proton-5.0-9
SteamGameId: 418530
Command: ['/home/anish/.local/share/Steam/steamapps/common/Spelunky 2/Spel2.exe', 'random']
Options: {'forcelgadd'}
======================
ERROR: ld.so: object '/home/anish/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/anish/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
ERROR: ld.so: object '/home/anish/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
ERROR: ld.so: object '/home/anish/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
======================
Proton: 1601295791 proton-tkg-5.18.r3.g9acfa3b8.release
SteamGameId: 418530
Command: ['/home/anish/.local/share/Steam/steamapps/common/Spelunky 2/Spel2.exe', 'random']
Options: {'winedxgi', 'logcommandtoprefix', 'nowinedbg', 'nonvapi'}
======================
ERROR: ld.so: object '/home/anish/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/anish/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
ERROR: ld.so: object '/home/anish/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
wine: failed to load /home/anish/.local/share/Steam/compatibilitytools.d/proton_5.0-1/dist/bin/../lib/wine/ntdll.dll.so: /lib/i386-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /home/anish/.local/share/Steam/compatibilitytools.d
@anlsh
anlsh / picl-generate-docs.sh
Last active July 6, 2020 18:10
Generates documentation for my repository's master branch on push and pushes it to github pages
#!/bin/sh
# prints a line accross the screen
git clone git@github.com:anlsh/anlsh.github.io.git /tmp/anlsh.github.io > /dev/null 2>&1
CURRHEAD=$(git rev-parse --abbrev-ref HEAD)
git stash > /dev/null
git checkout master > /dev/null 2>&1
rm -rf /tmp/anlsh.github.io/picl > /dev/null
sbcl \
--eval '(ql:quickload :staple)' \
@anlsh
anlsh / yodakenobi-revelations-review
Created May 6, 2020 01:58
YodaKenboi dissects Revelations and talks about Karen Traviss & Mandalorians in Star Wars
Post by user YodaKenobi on boards.theforce.net
Original url was http://boards.theforce.net/literature/b10003/28128642/p5 which is now 404'd
The post remains accessible at https://web.archive.org/web/20090917025847/http://boards.theforce.net/literature/b10003/28128642/p5
Post tagline: Date Posted: 3/2/08 6:50pm Subject: RE: The JC Lit Reviews Special: LEGACY OF THE FORCE: REVELATION (Spoilers) - Date Edited: 3/2/08 8:03pm (2 edits total) Edited By: YodaKenobi
Original post content follows
==================================================================================
I'll apologize now for the length of this post, but I have a lot I wanted to say and I want to explain this as clearly as possible. I've divided this review up in more sections than I normally would, simply because I'm afraid it becomes a jumble otherwise.
;; Reader macro for hash tables
;; Following code modified from https://news.ycombinator.com/item?id=1611090
(labels ((in-place-hash (stream char)
(declare (ignore char))
(let ((ls (read-delimited-list #\} stream t)))
(with-gensyms (table)
`(let ( (,table (make-hash-table :test #'equalp)))
,@(mapcar (lambda (p) `(setf (gethash ,(car p) ,table) ,(cadr p)))
ls)
import tensorflow as tf
import numpy as np
import gym
def ff_network(name, layer_dims):
layer_weight_list = [None] * len(layer_dims)
layers = [None] * len(layer_dims)
layers[0] = tf.placeholder('float', [None, layer_dims[0]])
layer_weight_list = [None] * (len(layer_dims) - 1)