demesisx

joined 2 years ago
MODERATOR OF
[–] demesisx@infosec.pub 1 points 2 months ago

You sound insecure. I wasn’t trying to bring you down. Be confident. Own your opinions.

Have a nice day.

[–] demesisx@infosec.pub 2 points 2 months ago* (last edited 2 months ago) (2 children)

Do you get though that I said “in my humble opinion” and posted a smile? Do you get, though, that other people may like Metallica and have different songs they like and would have the urge to reply to your comment as if it were the Metallica thread? Do you get that, though? Do you?

[–] demesisx@infosec.pub 3 points 2 months ago (2 children)

Yup. Very few bad songs too. They’re consistently great. Zionsville is my current high water mark for them. Just gorgeous. I never saw the appeal of the pedal steel guitar until that song.

[–] demesisx@infosec.pub 2 points 2 months ago

Wow. I’m so relieved he didn’t go to space. This is way cooler.

[–] demesisx@infosec.pub 2 points 2 months ago (4 children)

Don’t be. I’m just sharing an alternate opinion.

[–] demesisx@infosec.pub 3 points 2 months ago (6 children)

Orion and To Live Is To Die are better, IMHO. :)

[–] demesisx@infosec.pub 9 points 2 months ago (4 children)

Glass Beams

Khruangbin

[–] demesisx@infosec.pub 5 points 2 months ago

To start, I’d download nixpkgs. That would cover pretty much anything I could want.

[–] demesisx@infosec.pub 3 points 2 months ago

Do people in China pay rent? I heard that rent is based on income so if you lose your job, you pay no rent.

I’m genuinely curious about exactly how communist China is and what differences there are between US and Chinese society. Seems like a hybrid of capitalist and communist.

[–] demesisx@infosec.pub 25 points 2 months ago (5 children)

I think you need a lesson on recognizing cynical sarcasm.

[–] demesisx@infosec.pub 3 points 2 months ago* (last edited 2 months ago)

IMO, it’s a Red Herring, pushed by corrupt DNC operatives that seek to misdirect voter rage in order to perpetuate the closed two party system that enriches them.

The real culprit is #FPTP.

Honestly, I’d suggest that you convince your friend to stop misdirecting their energy toward something that won’t solve the two party issue for their paper and instead writing their paper with a focus on:

  1. eliminating FPTP
  2. Switching to ranked-choice voting
  3. Dismantling the DNC and GOP and forcing parties to adhere to election laws EVEN IN THEIR PRIMARIES.

This electoral college outrage feels like it comes from the same people that hang their hat on empty corporatist identity politics..and that should tell you everything you need to know. If Nancy Pelosi supports something, you know it’s corrupt.

[–] demesisx@infosec.pub 3 points 2 months ago* (last edited 2 months ago)

No hard feelings! :)

Yes. But it was pretty tough to use gvolpe’s config as he had all kinds of git-crypt stuff I needed to unravel. but I eventually got there and now I have a fleet of machines with configs based off of it with all kinds of idiosyncrasies depending on the machine. It’s quite elegant once you tame it to your will. I had a super smart German bud of mine almost give up but I kept helping him until it worked.

Haskell has a pretty tough dev experience if you don’t get Nix involved, IMO. I got involved in all of this because of Cardano, so I was instantly a flakes, Haskell, and NixOS advocate right away. It has the capability to tame incredibly complex stacks. If you revisit Haskell, do yourself a favor and do it from within a custom IOG Nix Devshell. Life is SO much more locked in there. Ps. Ghcup simply doesn’t work in NixOS because it flies counter to the NixOS way, though I’m pretty sure you could get it to work using fhs derivations or whatever. There’s a lot to relearn in the world of NixOS but, IMO, I’m just learning the RIGHT way and trying to drag the Docker fanboys along for the ride with me. :)

 

For me, it’s obviously Linux.

But after that, it has to be Haskell.

 

We present a real-world use-case of NixOS to manage an highly distributed fleet of servers & VMs in low-resource settings used for mission critical applications. After a brief overview of who MSF is and what we do, we'll dive into the technical details of how we manage our fleet with NixOS and the unique strengths that NixOS brings to the table.

 

Everything this guy does would be considered ambitious to anyone else. This guy is a genius.

 
11
UUID in Purescript (infosec.pub)
submitted 5 months ago* (last edited 5 months ago) by demesisx@infosec.pub to c/purescript@infosec.pub
 

I ran into a situation the other day where UUID was needed. Sadly, the UUID module in pursuit depends on an npm package. So, I rolled my own.

I’d be happy to hear of any holes in my implementation and any other critiques anyone has to offer.

Here’s the code:

module UUID where

import Prelude
import Data.Either (Either(..))
import Data.Int.Bits ((.|.))
import Data.Maybe (Maybe(..))
import Data.String (joinWith, length)
import Data.String.Regex (regex, test)
import Data.String.Regex.Flags (noFlags)
import Effect (Effect)
import Data.Int (floor, hexadecimal, toNumber, toStringAs)
import Effect.Random (random)
import Data.Array (replicate)

newtype UUID = UUID String

instance showUUID :: Show UUID where
  show (UUID uuid) = uuid
derive instance eqUUID :: Eq UUID
derive instance ordUUID :: Ord UUID

randomInt :: Int -> Int -> Effect Int
randomInt min max = do
  r <- random
  pure $ floor $ r * toNumber (max - min + 1) + toNumber min

padStart :: Int -> String -> String
padStart targetLength str =
  let
    paddingLength = max 0 (targetLength - length str) 
    padding = replicate paddingLength "0" 
  in joinWith "" padding <> str


parseUUID :: String -> Maybe UUID
parseUUID str = 
  case regex "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" noFlags of
    Left _ -> Nothing
    Right r -> if test r str
               then Just $ UUID str
               else Nothing

uuidToString :: UUID -> String
uuidToString (UUID uuid) = uuid

emptyUUID :: UUID
emptyUUID = UUID "00000000-0000-0000-0000-000000000000"

-- | Generate a UUID v4
genUUID :: Effect UUID
genUUID = do
  -- Generate random 16-bit integers for smaller chunks
  r1 <- randomInt 0 0xFFFF  -- First half of time_low
  r2 <- randomInt 0 0xFFFF  -- Second half of time_low
  r3 <- randomInt 0 0xFFFF  -- time_mid
  r4 <- randomInt 0 0x0FFF  -- time_hi (12 bits for randomness)
  r5 <- randomInt 0 0x3FFF  -- clock_seq (14 bits for randomness)
  r6 <- randomInt 0 0xFFFF  -- First part of node
  r7 <- randomInt 0 0xFFFF  -- Second part of node
  r8 <- randomInt 0 0xFFFF  -- Third part of node

  -- Set the version (4) and variant (10)
  let versioned = r4 .|. 0x4000  -- Set version to 4 (binary OR with 0100 0000 0000 0000)
      variant = r5 .|. 0x8000    -- Set variant to 10xx (binary OR with 1000 0000 0000 0000)

  -- Convert to hex and pad as needed
  let hex1 = padStart 4 (toHex r1) <> padStart 4 (toHex r2)  -- time_low
      hex2 = padStart 4 (toHex r3)                           -- time_mid
      hex3 = padStart 4 (toHex versioned)                    -- time_hi_and_version
      hex4 = padStart 4 (toHex variant)                      -- clock_seq
      hex5 = padStart 4 (toHex r6) <> padStart 4 (toHex r7) <> padStart 4 (toHex r8) -- node
      uuid = joinWith "-" [hex1, hex2, hex3, hex4, hex5]

  pure $ UUID uuid
  where
    toHex = toStringAs hexadecimal
 

It seems like the ultimate way to show WHY and HOW a company is poorly run… or the inverse.

 

This is an important video for the community. Charles (rightly) raises the alarm about lack of oversight on the Cardano board. Pay close attention. This is how an organization can co-opt an entire protocol.

We need to shore up this lack of community oversight ASAP.

 

#fp #functionalprogramming #purescript #scala

view more: ‹ prev next ›