Skip to content

Instantly share code, notes, and snippets.

@smx-smx
smx-smx / XZ Backdoor Analysis
Last active May 4, 2024 10:03
[WIP] XZ Backdoor Analysis and symbol mapping
XZ Backdoor symbol deobfuscation. Updated as i make progress
@ih2502mk
ih2502mk / list.md
Last active May 4, 2024 04:16
Quantopian Lectures Saved
@nadavrot
nadavrot / Matrix.md
Last active May 5, 2024 08:37
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@xsot
xsot / instructions.md
Last active March 3, 2024 13:42
sed maze solver

Usage

sed -E -f solver.sed input where input is a file containing the maze.

For best results, resize your terminal to match the height of the maze. To disable animations, delete the lines containing p.

Maze format

The solver assumes the following:

  • The maze only contains the characters # \nSE
  • Every line has the same number of characters
  • There is only one start (S) and end (E)
@louthy
louthy / CSharp Free Monad.cs
Last active April 2, 2022 16:20
C# Free Monad
//
// See https://github.com/louthy/language-ext
//
using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using LanguageExt;
using static LanguageExt.Prelude;

WannaCry|WannaDecrypt0r NSA-Cyberweapon-Powered Ransomware Worm

  • Virus Name: WannaCrypt, WannaCry, WanaCrypt0r, WCrypt, WCRY
  • Vector: All Windows versions before Windows 10 are vulnerable if not patched for MS-17-010. It uses EternalBlue MS17-010 to propagate.
  • Ransom: between $300 to $600. There is code to 'rm' (delete) files in the virus. Seems to reset if the virus crashes.
  • Backdooring: The worm loops through every RDP session on a system to run the ransomware as that user. It also installs the DOUBLEPULSAR backdoor. It corrupts shadow volumes to make recovery harder. (source: malwarebytes)
  • Kill switch: If the website www.iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com is up the virus exits instead of infecting the host. (source: malwarebytes). This domain has been sinkholed, stopping the spread of the worm. Will not work if proxied (source).

update: A minor variant of the viru

@fancellu
fancellu / TryFlatten.scala
Created April 11, 2017 00:44
A few ways to flatten down a Seq[Try] to only Success values
import scala.util.{Success, Failure}
val seq=Seq(Success(1), Failure(new Exception("bang")), Success(2))
// all emit List(1, 2)
seq.map(_.toOption).flatten
seq.flatMap(_.toOption)
seq.filter(_.isSuccess).map(_.get)
seq.collect{case Success(x) => x}

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@MasseGuillaume
MasseGuillaume / ProcessBuilder.md
Last active April 29, 2017 21:03
scala.sys.process.ProcessBuilder

ProcessBuilder

Signature Proposed Name Scaladoc
!(log: ProcessLogger): Int exitValue Starts the process represented by this builder, blocks until it exits, and returns the exit code.
!: Int exitValue Ibid.
!<(log: ProcessLogger): Int exitValueStdIn Ibid.
@jdegoes
jdegoes / Advanced Functional Programming in Scala Training - ScalaWorld 2016.md
Created July 21, 2016 14:19
Advanced Functional Programming in Scala Training - ScalaWorld 2016
  1. Kiss type confusion goodbye as you learn to understand complex type signatures: T[_[_, _], _], T[({type λ[A]=F[A, K]})#λ].
  2. Level up your ability to write higher-order functions and define combinators to construct larger programs from smaller ones
  3. Learn how you can use rank-N types to program at a higher-level of abstraction, with strong correctness guarantees
  4. Discover how existentials help you compose functionality without exploding the size of type signatures
  5. Master type classes to generate generic, testable code without the tangling and non-local reasoning of inheritance
  6. Use "functional design patterns" like a boss, including functors, applicatives, monads, profunctors, monoids, and others
  7. Have your immutable cake and eat it too with "optics" that let you manipulate complex data structures with ease
  8. Traverse your own data structures without writing any recursive code through powerful, composable, generic recursion schemes
  9. Model effects with powerful, purely functional techniq