Skip to content

Instantly share code, notes, and snippets.

View t0rr3sp3dr0's full-sized avatar

Pedro Tôrres t0rr3sp3dr0

View GitHub Profile
@t0rr3sp3dr0
t0rr3sp3dr0 / dlna_streamer.js
Last active July 21, 2018 22:00
node ./dlna_streamer.js video.mp4
#!/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');
@t0rr3sp3dr0
t0rr3sp3dr0 / Hulu-AdBlocker.user.js
Last active July 29, 2024 02:39
Block Ads on Hulu via UserScript
// ==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
@t0rr3sp3dr0
t0rr3sp3dr0 / busybox
Last active January 17, 2022 07:20
busybox-static_1.30.1-7+b2_amd64
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!
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))
}
}
@t0rr3sp3dr0
t0rr3sp3dr0 / console_user.c
Last active July 18, 2022 19:05
https://developer.apple.com/library/archive/qa/qa1133/_index.html clang -framework CoreFoundation -framework SystemConfiguration ./console_user.c
#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;
#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) {

README.md

https://download-cdn.jetbrains.com/toolbox/feeds/v1/release.feed.xz.signed
GET
0
HTTP/1.1 200 OK
17
Content-Type: binary/octet-stream
Content-Length: 170516
Connection: keep-alive
Accept-Ranges: bytes
Date: Sun, 28 Aug 2022 13:01:29 GMT
package main
import (
"io/fs"
"os"
"path"
)
var (
osFiles = []*os.File{os.Stdin, os.Stdout, os.Stderr}