Skip to content

Instantly share code, notes, and snippets.

@pellaeon
pellaeon / -etc-nginx-conf.d-YOUR_UUID-user.conf
Last active June 3, 2024 19:59
Nextcloud configuration for Synology Webstation, using nginx
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
add_header Referrer-Policy no-referrer;
# Remove X-Powered-By, which is an information leak
fastcgi_hide_header X-Powered-By;
@pellaeon
pellaeon / packagexml_certs.sh
Last active July 16, 2020 23:11
Shell script that takes android /data/system/packages.xml as input and print the containing certificates
#!/bin/bash
input="$1"
while IFS= read -r line
do
line1=`echo "$line" | egrep 'cert index="[0-9]+" key="[0-9a-z]+"'`
if [ $? -eq 0 ]
then
index=`echo $line1 | grep -oP 'index="\K\d+'`
hex=`echo $line1 | grep -oP 'key="\K[0-9a-z]+'`
sslinfo=`echo $hex | xxd -p -r | openssl x509 -inform DER -in /dev/stdin -text`
@pellaeon
pellaeon / zsys-setup
Created December 23, 2021 10:10
Modified /usr/share/ubiquity/zsys-setup to make SWAP partition 33GB, zfs compression=zstd, zfs ashift=16
#!/bin/sh
#
# This script creates ZFS pools and dataset compatible with zsys
#
# Layout:
# bpool/BOOT/ubuntu_${UUID}
# rpool/ROOT/ubuntu_${UUID}
# rpool/ROOT/ubuntu_${UUID}/var -o canmount=off
@pellaeon
pellaeon / pin-opencc
Last active December 30, 2021 07:29
/etc/apt/preferences.d/pin-opencc settings to use opencc from jammy in impish
Explanation: Use opencc from jammy to fix rime issue https://github.com/rime/librime/issues/425
Package: *
Pin: release n=jammy
Pin-Priority: -10
Package: librime*
Pin: release n=jammy
Pin-Priority: 500
Package: opencc libopencc-data
@pellaeon
pellaeon / child-gating-poc.py
Created September 23, 2022 12:21
Frida child-gating and spawn-gating example
"""
This POC is based on example from https://frida.re/news/#child-gating
and is aimed to instrument child processes along with the main one.
"""
from __future__ import print_function
import frida
from frida_tools.application import Reactor
import threading
Scope (PCI0.LPC0.EC0.HKEY)
{
Method (GSSS, 1, NotSerialized)
{
Local0 = 0x00
If (((SHDW & 0x80) == 0x00))
{
Local0 |= 0x00010000
}
@pellaeon
pellaeon / user.css
Last active September 7, 2024 11:35 — forked from bef/user.css
darktable-theme
/* custom darktable theme on top of darktable-elegant-darker
created by BeF - 05/2024
see https://gist.github.com/bef/562f282d7157a7ef47b99dc91693fb5a
modified by pellaeon - 09/2024
*/
/* custom colors */
@define-color checked #3ea0d7;
@define-color visible-border @grey_60;
@define-color panel_bg @grey_05;
! name: Taiwan Research
! description: Uprank trustworthy or Taiwan sources, downrank CN sites except trusted ones.
! public: yes
! author: pellaeon
|*.edu^$boost=1
|*.gov^$boost=1
|*.tw^$boost=1
|*.gov.tw^$boost=2