Skip to content

Instantly share code, notes, and snippets.

View albohlabs's full-sized avatar

Daniel Pfefferkorn albohlabs

View GitHub Profile
{-# LANGUAGE FlexibleInstances, OverloadedStrings #-}
import Data.Function ((&))
import Data.String (IsString)
data X
data Y
data Z
data M a
@expelledboy
expelledboy / uninstall-nix-osx.sh
Last active November 26, 2023 15:53
Trying Nix
#!/bin/bash
# !!WARNING!!
# This will DELETE all efforts you have put into configuring nix
# Have a look through everything that gets deleted / copied over
nix-env -e '.*'
rm -rf $HOME/.nix-*
rm -rf $HOME/.config/nixpkgs
@rzeigler
rzeigler / reader-task-example.ts
Created June 25, 2019 14:02
Using ReaderTaskEither from fp-ts
import * as http from "http";
import { ReaderTaskEither } from "fp-ts/lib/ReaderTaskEither"
import { TaskEither, fromIO } from "fp-ts/lib/TaskEither";
import { IO } from "fp-ts/lib/IO";
import { Task } from "fp-ts/lib/Task";
import axios, { AxiosInstance } from 'axios';
import { Either, left, right } from "fp-ts/lib/Either";
export type Logger = (s: string) => TaskEither<never, void>;
@chshersh
chshersh / Comonad.hs
Created March 25, 2019 11:07
Comonadic builders
#!/usr/bin/env cabal
{- cabal:
build-depends:
, base ^>= 4.12.0.0
, comonad ^>= 5.0
, pretty-simple ^>= 2.2
, text
-}
{-# LANGUAGE OverloadedStrings #-}
@Willmo36
Willmo36 / queue-pf.ts
Created December 3, 2018 18:27
TypeScript (almost) point free Queue
import { head as headArr, reverse, snoc as snocArr, tail as tailArr } from "fp-ts/lib/Array";
import {
applyFlipped,
compose,
constant,
Curried2,
Curried3,
curry,
Endomorphism,
flip,
@spemer
spemer / customize-scrollbar.css
Last active May 4, 2024 06:37
✨ Customize website's scrollbar like Mac OS. Not supports in Firefox and IE.
/* Customize website's scrollbar like Mac OS
Not supports in Firefox and IE */
/* total width */
body::-webkit-scrollbar {
background-color: #fff;
width: 16px;
}
/* background of the scrollbar except button or resizer */
@amir-arad
amir-arad / lodash.d.ts
Last active January 11, 2022 17:24 — forked from albohlabs/lodash.d.ts
fixed to pass strict mode validation, plus some generic types here and there
// https://raw.githubusercontent.com/donnut/typescript-ramda/master/ramda.d.ts
// https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/lodash/lodash.d.ts
declare namespace fp {
interface Dictionary<T> {
[index: string]: T;
}
interface CurriedFunction1<T1, R> {
@chshersh
chshersh / ghci.conf
Last active December 5, 2023 00:19
Config for GHCi with pretty output
-- To run:
-- cabal repl -b pretty-simple
--
-- Colorizing and pretty-printing ghci output
-- requires: pretty-simple
:set -interactive-print=Text.Pretty.Simple.pPrint
-- green bold lambdas and multiline mode
:set prompt "\ESC[1;32mλ: \ESC[m"
:set prompt-cont "\ESC[1;32mλ| \ESC[m"

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