Skip to content

Instantly share code, notes, and snippets.

@xerpi
xerpi / SceCompat.c
Last active July 31, 2021 14:36
PSVita Reverse Engineering
/*
* SceKermit (MIPS side):
* - https://gist.github.com/TheOfficialFloW/4fdec09e53a7c93a0d07d9e3e982dff4#file-kermit-c-L145
* - https://github.com/Total-Noob/kermit_reverse/blob/master/main.c
*/
/*
* Initial state:
* MIPS ARM
* Consumer ready = true Producer ready = true
@rmcdongit
rmcdongit / macOS_SytemPrefs.md
Last active June 14, 2024 06:30
Apple System Preferences URL Schemes

macOS 10.15 System Preference Panes

Below are a list of System Preference pane URLs and paths that can be accessed with scripting to assist users with enabling macOS security settings without having to walk them through launching System Preferences, finding panes, and scrolling to settings. Not all panes have an accessible anchor and some are OS specific.

To find the Pane ID of a specific pane, open the System Preferences app and select the desired Preference Pane. With the pane selected, open the ScriptEditor.app and run the following script to copy the current Pane ID to your clipboard and display any available anchors:

tell application "System Preferences"
	set CurrentPane to the id of the current pane
	set the clipboard to CurrentPane
@IanColdwater
IanColdwater / twittermute.txt
Last active May 23, 2024 18:37
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@xerpi
xerpi / PSVita_Linux_build_instructions.md
Last active April 1, 2024 12:51
PSVita Linux build instructions
@heyfluke
heyfluke / remap_docker_user_to_host_user.md
Last active May 10, 2024 21:57
remap docker user to host user.

Problem

When I use docker to work with the shared workspace with host under Ubuntu, I find that files created by docker user is owned by root. This is not the same with macOS.

Maybe this is becuase docker is run by root user and the default user mapping mechanism is to map container-root to host-user or host-root. So can I map the container-root or container-any-user to host-current-user?

Fortunately the latest docker supports the re-map the container user to any host user via Linux namespace. Refer to this.

Linux namespace

import argparse
import json
import os
import posixpath
import shutil
import subprocess
import tempfile
import requests
@bmaupin
bmaupin / open-source-sso.md
Last active April 11, 2024 09:36
Comparison of some open-source SSO implementations

ⓘ This list is not meant to be exhaustive and is not guaranteed to be maintained. See the comments for updates and alternative options.

(Items in bold indicate possible concerns)

Keycloak WSO2 Identity Server Gluu CAS OpenAM Shibboleth IdP
OpenID Connect/OAuth support yes yes yes yes yes yes
Multi-factor authentication yes yes yes yes yes yes
Admin UI yes yes yes yes yes no
OpenJDK support yes yes partial² yes
@xerpi
xerpi / vitafunctiondefs.py
Last active July 22, 2018 16:26
vitafunctiondefs.py
'''
vitafunctiondefs.py by xerpi
arm-vita-eabi-gcc -E $VITASDK/arm-vita-eabi/include/vitasdk.h -D"__attribute__(x)=" -D"__extension__(x)=" > preprocessor_user.h
arm-vita-eabi-gcc -E $VITASDK/arm-vita-eabi/include/vitasdkkern.h -D"__attribute__(x)=" -D"__extension__(x)=" > preprocessor_kern.h
'''
import sys
import os.path
import struct
@nocaoper
nocaoper / CapsLockCtrlEscape.ahk
Last active December 29, 2023 06:16 — forked from sedm0784/CapsLockCtrlEscape.ahk
Shift_CapsLock gives the original capsLock behaviour.... reload script on error
LShift & Capslock::
SetCapsLockState, % (State:=!State) ? "on" : "alwaysoff"
Return
g_AbortSendEsc := false
#InstallKeybdHook
SetCapsLockState, alwaysoff
Capslock::
g_DoNotAbortSendEsc := true
@ljharb
ljharb / array_iteration_thoughts.md
Last active May 22, 2024 09:22
Array iteration methods summarized

Array Iteration

https://gist.github.com/ljharb/58faf1cfcb4e6808f74aae4ef7944cff

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.

Intro

JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it mu