Skip to content

Instantly share code, notes, and snippets.

import usb.core
import usb.util
import struct
import time
import argparse
from Crypto.Cipher import DES
from PIL import Image
import time
import subprocess
from pathlib import Path
@phstudy
phstudy / how-to-install-ifuse-on-macos.md
Created December 29, 2024 16:13 — forked from cbatson/how-to-install-ifuse-on-macos.md
How To Install ifuse on macOS (Updated Nov 2023)
@phstudy
phstudy / windows_activation.md
Created November 6, 2024 00:30
Activate Windows for free

For Windows 10

Step 1 - Open PowerShell or Command Prompt as administrator

Step 2 - Install KMS client key

slmgr /ipk your_license_key

Replace your_license_key with following volumn license keys according to Windows Edition:

@phstudy
phstudy / POCO F5 Magisk Patched Boot.sh
Created November 8, 2023 04:19
POCO F5 Magisk Patched Boot
FILENAME=evolution_marble-ota-tq3c.230901.001.b1-11030926-unsigned.zip
OUTPUT_DIRECTORY=extracted_11030926
# Download ROM
```aria2c -x 10 https://zenlayer.dl.sourceforge.net/project/evolution-x/marble/13/${FILENAME}```
# Extract ROM
mkdir ${OUTPUT_DIRECTORY}
payload-dumper-go -output ${OUTPUT_DIRECTORY} ${FILENAME}
@phstudy
phstudy / parallels-reset.sh
Created June 29, 2023 06:30 — forked from gdurastanti/parallels-reset.sh
Reset Parallels' trial
#!/bin/sh
# Reset Parallels Desktop's trial and generate a casual email address to register a new user
rm /private/var/root/Library/Preferences/com.parallels.desktop.plist /Library/Preferences/Parallels/licenses.xml
jot -w pdu%[email protected] -r 1
{
"abilities": [
{
"abilityType": "BASIC",
"activated": true,
"balanceVars": [],
"castArea": "DEFAULT",
"detailsSortOrder": 0,
"exclusionGameMode": [],
"icon": "icons_units_bucket_o_soldiers_building/bucket_o_soldiers_building_basic",
@phstudy
phstudy / data-sketches.sql
Last active May 12, 2021 14:23
hive with data-sketches
# https://datasketches.github.io/docs/Theta/ThetaHiveUDFs.html
# sudo -u hive hadoop fs -mkdir /user/hive/auxjars
# sudo -u hive hadoop fs -copyFromLocal datasketches-hive-0.13.1-SNAPSHOT-with-shaded-core.jar /user/hive/auxjars/
CREATE FUNCTION data2sketch as 'com.yahoo.sketches.hive.theta.DataToSketchUDAF' USING JAR 'hdfs:///user/hive/auxjars/datasketches-hive-0.13.1-SNAPSHOT-with-shaded-core.jar';
CREATE FUNCTION unionSketches as 'com.yahoo.sketches.hive.theta.UnionSketchUDAF' USING JAR 'hdfs:///user/hive/auxjars/datasketches-hive-0.13.1-SNAPSHOT-with-shaded-core.jar';
CREATE FUNCTION estimate as 'com.yahoo.sketches.hive.theta.EstimateSketchUDF' USING JAR 'hdfs:///user/hive/auxjars/datasketches-hive-0.13.1-SNAPSHOT-with-shaded-core.jar';
CREATE FUNCTION union2 as 'com.yahoo.sketches.hive.theta.UnionSketchUDF' USING JAR 'hdfs:///user/hive/auxjars/datasketches-hive-0.13.1-SNAPSHOT-with-shaded-core.jar';
CREATE FUNCTION intersect2 as 'com.yahoo.sketches.hive.theta.IntersectSketchUDF' USING JAR 'hdfs:///user/
@phstudy
phstudy / k8s_tips.md
Created March 7, 2019 14:54
k8s_tips
@phstudy
phstudy / nginx-deployment.yaml.tmpl
Created March 7, 2019 14:44
nginx-deployment.yaml.tmpl
apiVersion: apps/v1
kind: Deployment
metadata:
name: ${DEPLOYMENT_NAME}
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
@phstudy
phstudy / cleanup_ovirt_vm.sh
Created February 19, 2019 07:50
Cleanup ovirt vm script
sudo -s
yum clean all
> /etc/machine-id
rm -f /etc/ssh/ssh_host_*
rm -rf /root/.ssh/
rm -f /root/anaconda-ks.cfg
rm -f /root/.bash_history
rm -f /home/tenmax_admin/.bash_history
rm -rf /home/tenmax_admin/.ssh/
unset HISTFILE