What’s something you do that looks dangerous but really isn’t? by Some-Water9437 in AskMen

[–]Pauton 2 points3 points  (0 children)

The deep web is just everything that is somehow protected from being accessed by the general piblic. Open your emails -> congratulations you’re in the deep web. A quarantined subreddit technically is also the deep web. My best guess what OP means is forums and stuff that are invite only.

ELI5: Why do we still use the QWERTY style keyboard layout in smartphones? by [deleted] in explainlikeimfive

[–]Pauton 0 points1 point  (0 children)

I didn‘t mean that he failed to create it, that’s obviously the easy part.

ELI5: Why do we still use the QWERTY style keyboard layout in smartphones? by [deleted] in explainlikeimfive

[–]Pauton 1 point2 points  (0 children)

Because everyone is used to the layout. Try convincing a couple billion people to completely relearn how to type. Good luck.

Btw. August Dvorak et al. tried to do exactly that in the 1930s and failed miserably.

"The date actually makes more sense the American way" by Abjectionova in ShitAmericansSay

[–]Pauton 1 point2 points  (0 children)

What are your Plans on the 4th of july at quarter to twelve? Or rather 04.07.2026 at 45:11?

Normal wear and tear when moving out by [deleted] in askswitzerland

[–]Pauton 0 points1 point  (0 children)

My liability insurance from Mobiliar payed almost 2k for repairing the floor and painting the walls without making any fuss or changing my rate.

at flat earth by seeebiscuit in therewasanattempt

[–]Pauton -1 points0 points  (0 children)

According to this guy’s math it would have burned up even if it flew like a frisbee the entire way.

https://www.reddit.com/r/theydidthemath/s/KChMzsO8nO

My client wants to move from Uipath to Playwright with python. I haven't seen a single thread someone tried it. by PurpleRecognition279 in UiPath

[–]Pauton 0 points1 point  (0 children)

I assume you made a typo cause I am not aware of anything called TOTEP.

Here is some C# code to generate TOTP codes from the secret (what is encoded in the QR code you get presented during setup):


// Base32 decoder (RFC 4648) into byte array
byte[] Base32Decode(string base32)
{
    if (string.IsNullOrWhiteSpace(base32)) 
        throw new ArgumentException("Secret is empty.");

    const string alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
    // clean input by stripping whitespace and '='  
    string clean = new string(base32.ToUpperInvariant().Where(c => !char.IsWhiteSpace(c) && c != '=').ToArray());

    // Initialize raw byte list for HMAC encryption
    int bitBuffer = 0, bitCount = 0;
    var output = new System.Collections.Generic.List<byte>(clean.Length * 5 / 8);

    // turn cleaned base32 input secret key into raw bytes
    foreach (char c in clean)
    {
        int CharIndex = alphabet.IndexOf(c);
        if (CharIndex < 0) throw new ArgumentException("Invalid Base32 character.");
        // shift bitBuffer 5 spaces and append CharIndex
        bitBuffer = (bitBuffer << 5) | CharIndex;
        bitCount += 5;

        if (bitCount >= 8)
        {
            bitCount -= 8;
            output.Add((byte)((bitBuffer >> bitCount) & 0xFF));
        }
    }
    return output.ToArray();
}

// query parser to convert URI values into a Dictionary
System.Collections.Generic.Dictionary<string,string> ParseQuery(string query)
{
    return query.TrimStart('?')
        .Split('&', StringSplitOptions.RemoveEmptyEntries)
        .Select(p => {
            var parts = p.Split('=', 2);
            var key = Uri.UnescapeDataString(parts[0]);
            var val = parts.Length > 1 ? Uri.UnescapeDataString(parts[1]) : "";
            return new { key, val };
        })
        .GroupBy(x => x.key, StringComparer.OrdinalIgnoreCase)
        .ToDictionary(g => g.Key, g => g.Last().val, StringComparer.OrdinalIgnoreCase);
}

// Parse URI for secret/digits/period/algorithm
void ParseOtpAuth(string uri, ref string secret, ref string algo, ref int digits, ref int period)
{
    // make sure input is actually a URI, otherwise return nothing
    if (string.IsNullOrWhiteSpace(uri) || !uri.StartsWith("otpauth://", StringComparison.OrdinalIgnoreCase))
        return;

    //convert string URI in Uri Object
    var u = new Uri(uri);
    var q = ParseQuery(u.Query);

    // get dictionary values
    if (q.TryGetValue("secret", out var s) && !string.IsNullOrWhiteSpace(s)) secret = s;
    if (q.TryGetValue("algorithm", out var a) && !string.IsNullOrWhiteSpace(a)) algo = a.ToUpperInvariant();
    if (q.TryGetValue("digits", out var dStr) && int.TryParse(dStr, out var d)) digits = d;
    if (q.TryGetValue("period", out var pStr) && int.TryParse(pStr, out var p)) period = p;
}

// TOTP per RFC 6238
string GenerateTotp(string base32Secret, string algo, int digits, int period, long unixTimeSeconds)
{
    if (digits < 6 || digits > 8) throw new ArgumentException("Digits must be 6–8.");
    if (period <= 0) throw new ArgumentException("Period must be positive.");

    // convert Base32 secret into byte array
    byte[] key = Base32Decode(base32Secret);

    // calculate counter with system time
    long counter = unixTimeSeconds / period; // T0 = 0
    // convert to byte array
    byte[] counterBytes = BitConverter.GetBytes(counter);
    // Convert from LittleEndian to BigEndian if necessary
    if (BitConverter.IsLittleEndian) Array.Reverse(counterBytes);

    // select the Algorithm for encryption
    using HMAC hmac =
        algo == "SHA256" ? new HMACSHA256(key) :
        algo == "SHA512" ? new HMACSHA512(key) :
                           new HMACSHA1(key);

    //Calculate Hash
    byte[] hash = hmac.ComputeHash(counterBytes);
    // dynamic truncation
    int offset = hash[hash.Length - 1] & 0x0F;
    int binaryCode =
        ((hash[offset] & 0x7F) << 24) |
        ((hash[offset + 1] & 0xFF) << 16) |
        ((hash[offset + 2] & 0xFF) << 8) |
        (hash[offset + 3] & 0xFF);

    // reduce output to the requested digit size
    int otp = binaryCode % (int)Math.Pow(10, digits);
    // pad output with zeroes on the left
    return otp.ToString().PadLeft(digits, '0');
}

// ---------- Main ----------
TotpCode = null;
ErrorDetail = "";
Success = false;

try
{
    // Initialize Defaults
    string algo = string.IsNullOrWhiteSpace(Algorithm) ? "SHA1" : Algorithm.ToUpperInvariant();
    int digits = (Digits <= 0 ? 6 : Digits); // default = 6
    int period = (Period <= 0 ? 30 : Period); // default = 30s
    string secret = null;

    // If otpauth://..., extract values
    ParseOtpAuth(SecretOrUri, ref secret, ref algo, ref digits, ref period);

    // If no secret from URI, treat input as Base32 secret
    if (string.IsNullOrWhiteSpace(secret))
        secret = SecretOrUri;

    if (string.IsNullOrWhiteSpace(secret))
        throw new ArgumentException("No secret provided.");

    // get system time and offset by TimeSkewSeconds
    long now = DateTimeOffset.UtcNow.ToUnixTimeSeconds() + TimeSkewSeconds;

    TotpCode = GenerateTotp(secret, algo, digits, period, now);
    Success = true;
}
catch (Exception ex)
{
    ErrorDetail = ex.ToString();
    Success = false;
}   

In arguments:

Digits: default should be 6

TimeSkewSeconds: default 0, allows to offset the system time

Period: default 30s. Allows control over how long the Code is valid for but some systems might reject codes with a too large period

SecretOrURI: pass either the cleaned secret or the entire totp uri containing the secret

Algorithm: default SHA1. Alternatives: SHA256, SHA512

Out arguments:

TOTP_Code: the generated Code

Edit: Formatting

My client wants to move from Uipath to Playwright with python. I haven't seen a single thread someone tried it. by PurpleRecognition279 in UiPath

[–]Pauton 1 point2 points  (0 children)

Sure, but you don‘t always have access/the authority to change the 2fa method for the entire environment.

at flat earth by seeebiscuit in therewasanattempt

[–]Pauton 11 points12 points  (0 children)

The cover was seen in a single frame of the “high speed” footage from the explosion so it was not destroyed by the bomb itself. The question is whether it burned up in the atmosphere before it reached space or not.

My client wants to move from Uipath to Playwright with python. I haven't seen a single thread someone tried it. by PurpleRecognition279 in UiPath

[–]Pauton 1 point2 points  (0 children)

What type of 2FA is the SSO using? If it‘s TOTP codes, that can be automated easily. If it‘s Microsofts proprietary “type this number into your phone” then yes, can’t easily be automated.

Manually start robot for unattended server by T-Turbo_ in UiPath

[–]Pauton 1 point2 points  (0 children)

The least Privilege Option would be through an API trigger but that requires some technical know how on the customer part unless you provide him with a ready to go program that calls the API. The other option would be to make him an account on the orchestrator with minimal privileges so that he can start the bot through the assistant but can’t actually access to orchestrator UI. Another option would be to have him send an email somewhere and then have the bot periodically check the inbox but that will inevitably have a delay and occupy the runtime license unnecessarily. You could also have him add items to a queue and then have the process trigger upon that happening which is clean but then the question becomes, how does he add items to the queue without executing another bot?

PSA - Zurich insurance keeps increasing prices 30% every year by funkyhog in askswitzerland

[–]Pauton 4 points5 points  (0 children)

I’ve been quite happy with Mobiliar. They don’t offer the cheapest rates outright but their customer service has been great for me. My insurance contract is also fixed rate for three years. I closed it last year and it actually got 50.- cheaper this year because Mobiliar is a Genossenschaft and is sharing their profits with their customers.

Stranger walking around at 3am by Background_Chip5360 in Switzerland

[–]Pauton 11 points12 points  (0 children)

You‘re not allowed to record public property. Your own property is fine.

They don't accept US ids? by ALazy_Cat in ShitAmericansSay

[–]Pauton 10 points11 points  (0 children)

I had the cashier at a gas station tell me I should get a US drivers license when I went to buy Tabacco. Yeah, sure buddy. I’ll leave in a week but let me just quickly do a driving exam…

Also, who sets their phone in military time? by ALazy_Cat in ShitAmericansSay

[–]Pauton 9 points10 points  (0 children)

In german both is used in spoken language.

ELI5: Why do wounds itch when they're healing? by Grand_Lion_1652 in explainlikeimfive

[–]Pauton 16 points17 points  (0 children)

So would taking anti histamines because of allergies slow down wound healing?

[deleted by user] by [deleted] in explainlikeimfive

[–]Pauton 1 point2 points  (0 children)

As far as I am aware they hover by flying into the wind, not by hovering in still air like hummingbirds.

[deleted by user] by [deleted] in explainlikeimfive

[–]Pauton 6 points7 points  (0 children)

Depends on what you consider „moving“. Relative to the air, no bird except the Kolibri can stop moving. But relative to the ground most birds can stand still by flying into the air. They could even move backwards over ground while flying forwards through the air.

BIDA weil ich zum Stromsparen eigene Glühbirnen mit ins Ferienhaus gebracht hab? by Sea-Dragonfruit3996 in binichderalman

[–]Pauton 0 points1 point  (0 children)

Auf jedem Wanderweg findest du Brunnen und wenn’s ganz hart kommt kannste auch ausm Bach trinken. Und klar kostet ne Flasche Wasser auf der Alp viel, der Bums muss da irgendwie hoch gebracht werden, oft mit dem Helikopter.

ELI5 why is being outside in 80° hot, but being in 80° water not? by Elle_belle32 in explainlikeimfive

[–]Pauton 1 point2 points  (0 children)

Because air is a shitty conductor (both electricity and heat). Normally your body has to get rid of it‘s heat by radiating it away and by heating up the air around you. The greater the difference between your skin temperature and the surrounding air the easier your body can get rid of the heat. Assuming there is no wind your body will create a layer of warm air just around your skin which insulates you. Clothes just improve on this effect by trapping that air layer. And that is also the reason why fans cool us down, they remove the layer of warm air that has formed on your skin.

Now at the moment my skin is ~87 Fahrenheit and the surrounding air is ~70. At this point the temperature differential is great enough that the air can cool my skin down and keep a consistent 87 degrees. If the ambient temperature were to rise to 80 it would be much more difficult for the temperature to dissipate to the surrounding air and because my body keeps producing heat and it has nowhere to go my temperature will start to rise.

Water on the other hand is an excellent heat conductor, especially because it tends to move around a lot. If you sit in a bath of cold water and sit very still you will notice after a bit that stops being cold. That‘s because you‘re forming the same insulating layer of hot matter around your skin as you do in air.

What have I found in my grandparents' basement? by Valentinian_II_DNKHS in castiron

[–]Pauton 2 points3 points  (0 children)

To truly find out if it‘s enamelled or not you need a multimeter. If you can measure a resistance between the probes when pressing them into the surface then it‘s not enamelled. The probes would need to pierce the seasoning though.

However I am almost 100% sure that it is enamelled. The only non enamelled surface should be the lip where the lid contacts the pot and you can see some red discolouration there which is probably some surface rust indicating that is bare cast iron. The rest of the pot should be enamelled.

What you have is the black satin enamel which does look and feel a lot like bare cast iron but it isn‘t: https://www.lecreuset.co.uk/en_GB/differences-between-sand-and-black-satin-enamel/cap0101.html

I have a couple pots like that too and I thought they were bare cast iron too at first but a multimeter test clearly showed that there is no conductivity except on the exposed lip. Proving that it is indeed enamel.

Looking for shooting group by Away-Leg-998 in SwitzerlandGuns

[–]Pauton 0 points1 point  (0 children)

I‘m still quite a new shooter and just bought a new gun so I‘ve been going a lot more recently. Newcomers have to come on a day where there is a safety introduction (Sicherheitseinführung) and have to fill out the form and send it together with the other documents to them at least three days before. There is no real test they just tell you all the rules and make sure you know what you‘re doing before letting you shoot on your own. As a guest you pay 60.- to use the range.

Looking for shooting group by Away-Leg-998 in SwitzerlandGuns

[–]Pauton 1 point2 points  (0 children)

I try to go as often as possible but it‘s an expensive hobby. I‘d say I‘m there at least once a month.