Skip to content

Instantly share code, notes, and snippets.

View Hexhu's full-sized avatar
😺
Studying!

Hexhu

😺
Studying!
  • AS25
View GitHub Profile
@katef
katef / cloud.vcl
Last active May 14, 2022 19:50
HTTP Moomin delivery
sub cloud_moomin {
set resp.http.moomin00 = " %1b[38;5;237m▄%1b[38;5;235m▄%1b[49m";
set resp.http.moomin01 = " %1b[38;5;237m▄%1b[48;5;237m%1b[38;5;249m▄%1b[38;5;236m▄%1b[49m %1b[48;5;239m%1b[38;5;16m▄%1b[48;5;237m%1b[38;5;253m▄%1b[38;5;247m▄%1b[48;5;234m%1b[38;5;16m▄%1b[49m";
set resp.http.moomin02 = " %1b[38;5;233m▄%1b[48;5;253m%1b[38;5;237m▄%1b[48;5;254m%1b[38;5;255m▄%1b[38;5;251m▄%1b[38;5;239m%1b[49m▄ %1b[38;5;237m▄ %1b[48;5;254m%1b[38;5;248m▄%1b[48;5;249m%1b[38;5;254m▄%1b[48;5;235m%1b[38;5;246m▄%1b[49m";
set resp.http.moomin03 = " %1b[38;5;235m▄%1b[48;5;250m%1b[38;5;242m▄%1b[48;5;231m %1b[48;5;247m%1b[38;5;231m▄%1b[48;5;252m▄%1b[48;5;253m▄%1b[48;5;254m▄%1b[48;5;253m▄%1b[48;5;249m▄%1b[48;5;188m▄%1b[48;5;245m%1b[38;5;251m▄%1b[49m";
set resp.http.moomin04 = "
@coolreader18
coolreader18 / segfault.py
Last active March 30, 2024 08:05
CPython segfault in 5 lines of code
class E(BaseException):
def __new__(cls, *args, **kwargs):
return cls
def a(): yield
a().throw(E)
@dlangille
dlangille / SATA connectors inside the case
Last active July 15, 2020 14:18
Dell R720 internal SATA drives
Says connectors 2 & 4
SATA connectors:
photo, see above left RAM: https://cdn.etb-tech.com/media/catalog/product/cache/68250b5260b930b2300bcc8422ca32a1/r/7/r720_r720xd_mb_h5j4j_v5_top_zoom.jpg
https://www.ixsystems.com/community/threads/how-to-install-internal-ssd-boot-drive-for-dell-r720.77745/
See p 129 on this manual https://topics-cdn.dell.com/pdf/poweredge-r720_owners-manual_en-us.pdf
// ==UserScript==
// @name NoPerformanceNow
// @namespace https://yuki.network/
// @version 0.2
// @description Disables performance.now() to make JavaScript exploits harder.
// @author ReimuNotMoe, ClassicOldSong
// @match *://*/*
// @grant unsafeWindow
// ==/UserScript==
class Weapon {
public:
virtual bool usable() const = 0;
virtual double attack() = 0;
};
class Sword : public Weapon {
private:
constexpr static auto startRatio = 0.2;
constexpr static auto wearRatio = 0.8;
@Mnkai
Mnkai / README.md
Last active April 13, 2024 14:11
TDP and turbo parameter modification with MSR on non-overclockable Intel CPU (such as Intel i7-8550U)

TDP and turbo parameter modification with MSR on non-overclockable CPU

Disclaimer

  • MSR modification may void your CPU's (or system board's) warranty. Proceed with care. I'm not responsible for any destruction caused by this article.
  • MSR address (greatly) differs from CPU to CPU. Check your own CPU's MSR address using Intel's documentation.
  • Only tested on Intel i7-8550U (Kaby Lake R).
  • This article is translation of this article. If you can understand Korean, I recommend reading that article, not this.

Start

import numpy as np
import math
def regression(points, A_funcs, b_func):
A = [[f(*p) for f in A_funcs] for p in points]
b = [b_func(*p) for p in points]
AT = np.transpose(A)
hat = np.dot(np.dot(np.linalg.inv(np.dot(AT, A)), AT), b)
e = b - np.dot(A, hat)
return list(hat), 1 - np.dot(e, e)
@ysc3839
ysc3839 / ITrayNotify.cpp
Created October 12, 2017 14:26
Undocumented API ITrayNotify.
#include <tchar.h>
#include <windows.h>
// The known values for NOTIFYITEM's dwPreference member.
enum NOTIFYITEM_PREFERENCE
{
// In Windows UI: "Only show notifications."
PREFERENCE_SHOW_WHEN_ACTIVE = 0,
// In Windows UI: "Hide icon and notifications."
PREFERENCE_SHOW_NEVER = 1,
@mo10
mo10 / ConvertPathToPolyline.js
Last active December 24, 2017 16:48
SVG Path To Polyline
function pathToPolygon(obj) {
var mypath = obj;
var pathLength = mypath.getTotalLength();
var pathWidth = parseFloat(obj.style.strokeWidth);
var polygonPoints= [];
var out="";
for (var i=0; i<pathLength; i++) {
var p = mypath.getPointAtLength(i);
polygonPoints.push(p.x);
polygonPoints.push(p.y);
@KazamaSion
KazamaSion / lbrl.php
Created February 6, 2017 06:33
A php script of Load balancing + Rate Limiting via memcache.
<?php
$_token = array("token1", "token2");
if (in_array($_GET["token"], $_token)) {
get_info_simple();
} else {
header("HTTP/1.0 404 Not Found");
die("404 Not Found");