➜ uname -r
# get installed kernel version
➜ pacman -S linux-headers
# select kernel version
import StringUtils.encodeHex | |
import java.io.File | |
import java.io.FileInputStream | |
import java.io.InputStream | |
import java.security.MessageDigest | |
object HashUtils { | |
const val STREAM_BUFFER_LENGTH = 1024 |
➜ uname -r
# get installed kernel version
➜ pacman -S linux-headers
# select kernel version
suspend fun <T> Task<T>.awaitTask(): T? = suspendCoroutine { continuation -> | |
this.addOnCompleteListener { task -> | |
if (task.isSuccessful) { | |
continuation.resume(task.result) | |
} else { | |
continuation.resumeWithException(task.exception!!) | |
} | |
} | |
} |
MIT License | |
Copyright (c) 2020 Rithvik Vibhu | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
/* | |
* Copyright [2019] [Tobias Boehm] | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
//probably this should be something like a JavaEE Singleton... | |
object PasswordUtils { | |
val random = SecureRandom() | |
fun generateSalt(): ByteArray { | |
val salt = ByteArray(16) | |
random.nextBytes(salt) | |
return salt | |
} |
inline fun <reified T> isNullable(): Boolean = null is T |
import requests | |
import base64 | |
from tqdm import tqdm | |
master_json_url = 'https://178skyfiregce-a.akamaihd.net/exp=1474107106~acl=%2F142089577%2F%2A~hmac=0d9becc441fc5385462d53bf59cf019c0184690862f49b414e9a2f1c5bafbe0d/142089577/video/426274424,426274425,426274423,426274422/master.json?base64_init=1' | |
base_url = master_json_url[:master_json_url.rfind('/', 0, -26) + 1] | |
resp = requests.get(master_json_url) | |
content = resp.json() |