This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
constexpr uint8_t m_len = 40; | |
constexpr uint8_t crc_len = 7; | |
constexpr uint8_t msb_shift = m_len + crc_len - 1; | |
constexpr uint8_t g_len = 8; | |
constexpr uint8_t g_shift = m_len + crc_len - g_len; | |
constexpr uint8_t g = (1 << 7) | (1 << 3) | (1 << 0); // G(x) = x^7 + x^3 + 1 | |
constexpr uint8_t crc7_impl(uint64_t crc, uint64_t msb, uint64_t msk, uint8_t iter) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <assert.h> | |
#include <SystemConfiguration/SystemConfiguration.h> | |
static CFStringRef CopyCurrentConsoleUsername(SCDynamicStoreRef store) | |
// Returns the name of the current console user, or NULL if there is | |
// none. store may be NULL, in which case a transient dynamic store | |
// session is used. | |
{ | |
CFStringRef result; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Delegate: NSObject, URLSessionDelegate { | |
public func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { | |
let serverTrust = challenge.protectionSpace.serverTrust! | |
let exceptions = SecTrustCopyExceptions(serverTrust) | |
SecTrustSetExceptions(serverTrust, exceptions) | |
completionHandler(.performDefaultHandling, URLCredential(trust: serverTrust)) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2022-02-14 21:50:03 [ INFO] Vagrant version: 2.2.19 | |
2022-02-14 21:50:03 [ INFO] Ruby version: 2.7.4 | |
2022-02-14 21:50:03 [ INFO] RubyGems version: 3.1.6 | |
2022-02-14 21:50:03 [ INFO] VAGRANT_EXECUTABLE="/opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/bin/vagrant" | |
2022-02-14 21:50:03 [ INFO] VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/embedded" | |
2022-02-14 21:50:03 [ INFO] VAGRANT_INSTALLER_ENV="1" | |
2022-02-14 21:50:03 [ INFO] VAGRANT_INSTALLER_VERSION="2" | |
2022-02-14 21:50:03 [ INFO] VAGRANT_LOG="debug" | |
2022-02-14 21:50:03 [ INFO] VAGRANT_LOG_TIMESTAMP="1" | |
2022-02-14 21:50:03 [ WARN] resolv replacement has not been enabled! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Hulu AdBlocker | |
// @namespace https://gist.github.com/t0rr3sp3dr0 | |
// @version 0.0.1 | |
// @author t0rr3sp3dr0 | |
// @description Block Ads on Hulu | |
// @updateURL https://gist.github.com/t0rr3sp3dr0/af7824f6968e5190d276507fa7ac603c/raw | |
// @downloadURL https://gist.github.com/t0rr3sp3dr0/af7824f6968e5190d276507fa7ac603c/raw | |
// @match https://www.hulu.com/* | |
// @run-at document-end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const fs = require('fs'); | |
const os = require('os'); | |
const path = require('path'); | |
const dlnacasts = require('dlnacasts')(); | |
const express = require('express'); | |
const mime = require('mime-types'); | |
const tmp = require('tmp'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const run = (glue, stdin, stdout, stderr) => { | |
const iframe = document.createElement('iframe'); | |
iframe.setAttribute('style', 'display: none; '); | |
iframe.src = 'about:blank'; | |
iframe.onload = () => { | |
iframe.contentWindow.Module = { | |
preRun: [ | |
() => { | |
const _in = new TextEncoder('ascii').encode(stdin).values(); | |
iframe.contentWindow.FS.init(() => _in.next().value, null, null); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function DF { | |
CMD="$(declare -f DF);$(declare -f $1);$1" | |
gnome-terminal -e "bash -ic '${CMD//\'/\'\"\'\"\'}'" | |
} | |
function MAIN { | |
{ | |
while true; do | |
echo `expr $RANDOM \% 100` | |
for (( I = 0; I < 32; ++I )); do |
This file has been truncated, but you can view the full file.