Skip to content

Instantly share code, notes, and snippets.

View ceiphr's full-sized avatar

Ari Birnbaum ceiphr

View GitHub Profile
@apple1417
apple1417 / blackmarkets.py
Last active May 13, 2023 06:03
simulate bl3 black market locations/pools
import struct
from datetime import datetime, timedelta
# See this sheet for what locations these actually line up to
# https://docs.google.com/spreadsheets/d/1RFsSUkvAmFWdS_b5Umfl9hDRUfcTLcRcA3kBUAN1nFY/edit#gid=0
SPAWNERS = (
"/Game/PatchDLC/SubmapPatch/Maps/Zone_0/Prologue/Prologue_SubmapPatch.Prologue_SubmapPatch:PersistentLevel.OakSpawner_0",
"/Game/PatchDLC/SubmapPatch/Maps/Zone_0/Prologue/Prologue_SubmapPatch.Prologue_SubmapPatch:PersistentLevel.OakSpawner_0",
"/Game/PatchDLC/SubmapPatch/Maps/Zone_0/Prologue/Prologue_SubmapPatch.Prologue_SubmapPatch:PersistentLevel.OakSpawner_1",
"/Game/PatchDLC/SubmapPatch/Maps/Zone_0/Sacrifice/Sacrifice_SubmapPatch.Sacrifice_SubmapPatch:PersistentLevel.OakSpawner_5",
@kelvie
kelvie / 0001-Add-a-lockdown_hibernate-parameter.patch
Created October 2, 2022 23:39
Enable hibernate during lockdown
From e4db4f07e77feb1c126e7afbf441e9eae34b4e57 Mon Sep 17 00:00:00 2001
From: Kelvie Wong <kelvie@kelvie.ca>
Date: Sun, 2 Oct 2022 13:23:25 -0700
Subject: [PATCH] Add a lockdown_hibernate parameter
This allows the user to tell the kernel that they know better (namely,
they secured their swap properly), and that it can enable hibernation.
Signed-off-by: Kelvie Wong <kelvie@kelvie.ca>
---
@moyix
moyix / killbutmakeitlooklikeanaccident.sh
Created February 5, 2022 22:51
Script to inject an exit(0) syscall into a running process. NB: only x86_64 for now!
#!/bin/bash
gdb -p "$1" -batch -ex 'set {short}$rip = 0x050f' -ex 'set $rax=231' -ex 'set $rdi=0' -ex 'cont'
@eloylp
eloylp / Fedora35Hibernation.md
Last active July 10, 2024 11:16
Fedora 35 hibernation with swapfile, only for hibernation and resume

Fedora35 hibernation

This guide helps to configure the hibernation on a default Fedora35 (also worked fine in previous Fedora34) installation by using a swap file. The Fedora35 installation comes with btrfs as default filesystem. Also, it comes with a zram swap device:

$ swapon
NAME       TYPE      SIZE USED PRIO
/dev/zram0 partition   8G   0B  100
@laymonage
laymonage / Giscus.tsx
Last active July 4, 2021 16:11
giscus React component, install https://www.npmjs.com/package/iframe-resizer-react first
import { useEffect, useState } from 'react';
import IframeResizer from 'iframe-resizer-react';
const GISCUS_SESSION_KEY = 'giscus-session';
const GISCUS_ORIGIN = 'https://giscus.app';
const ERROR_SUGGESTION = `Please consider reporting this error at https://github.com/laymonage/giscus/issues/new.`;
function formatError(message: string) {
return `[giscus] An error occurred. Error message: "${message}".`;
}
@wlib
wlib / LICENSE
Last active April 30, 2024 17:07
Run a shell script with bash, line-by-line, prompted on each command. Useful for running unknown scripts or debugging. Not a secure substitute for understanding a script beforehand.
MIT License
Copyright (c) 2021 Daniel Ethridge
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:
@dhh
dhh / Gemfile
Created June 24, 2020 22:23
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@mayneyao
mayneyao / notion2blog.js
Last active July 19, 2024 02:12
Notion.so > Personal Blog | custom domain + disqus comment
const MY_DOMAIN = "agodrich.com"
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2"
const DISQUS_SHORTNAME = "agodrich"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
import { useState, useCallback, useRef } from "react";
// Usage
function App() {
const [hoverRef, isHovered] = useHover();
return (
<div ref={hoverRef}>
{isHovered ? '😁' : '☹️'}
</div>
@xmeng1
xmeng1 / wsl2-network.ps1
Created July 14, 2019 06:50
WSL2 Port forwarding port to linux
$remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '"
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if( $found ){
$remoteport = $matches[0];
} else{
echo "The Script Exited, the ip address of WSL 2 cannot be found";
exit;
}