Skip to content

Instantly share code, notes, and snippets.

@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%d@gmail.com -r 1
@phstudy
phstudy / AwsSignatureV4Utils.java
Created April 21, 2015 17:32
AWS Signature Version 4 Utils for Java
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import org.apache.shiro.codec.Hex;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
{
"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 / 01ssl.config
Created September 4, 2013 19:26
Manually enable Amazon Elastic Beanstalk Single instance type SSL
#
# This is the Apache server configuration file providing SSL support.
# It contains the configuration directives to instruct the server how to
# serve pages over an https connection. For detailing information about these
# directives see <URL:http://httpd.apache.org/docs/2.2/mod/mod_ssl.html>
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.
#
@phstudy
phstudy / ncdc.sh
Last active July 22, 2019 17:34 — forked from aligusnet/ncdc.sh
Download a weather dataset from the National Climatic Data Center (NCDC, http://www .ncdc.noaa.gov/). Prepare it for examples of "Hadoop: The Definitive Guide" book by Tom White. http://www.amazon.com/Hadoop-Definitive-Guide-Tom-White/dp/1449311520Usage:./ncdc.sh 1901 1930 # download wheather datasets for period from 1901 to 1930.
#!/usr/bin/env bash
# global parameters
g_tmp_folder="ncdc_tmp";
g_output_folder="ncdc_data";
g_remote_host="ftp.ncdc.noaa.gov";
g_remote_path="pub/data/noaa";
@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
@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: