Skip to content

Instantly share code, notes, and snippets.

View tatdatpham's full-sized avatar
🎯
Focusing

Dat Pham Tat tatdatpham

🎯
Focusing
View GitHub Profile
@tatdatpham
tatdatpham / bypass-mdm.sh
Created October 2, 2023 14:10
The script that help bypass MDM for Venture & Sonoma. Please only use script when you can access to your device and run script with root.
#!/bin/bash
RED='\033[1;31m'
GRN='\033[1;32m'
BLU='\033[1;34m'
YEL='\033[1;33m'
PUR='\033[1;35m'
CYAN='\033[1;36m'
NC='\033[0m'
echo -e "${CYAN}*---------------------*----------------------*${NC}"
@tatdatpham
tatdatpham / get-zsclaler-ip
Last active August 31, 2023 06:17
The script to get list of Zscaler Egress IP ranges and Future Data Centers from https://config.zscaler.com/zscaler.net/cenr
import requests
response = requests.get('https://config.zscaler.com/api/getdata/zscaler.net/all/cenr?site=config.zscaler.com')
regions = response.json()['data'][6]['body']['json']['rows'][1:]
for region in regions:
region_name = region['region']
cols = region['cols']
for col in cols:
data = col['data']
@tatdatpham
tatdatpham / defaultSPLSyntax.json.js
Created November 16, 2022 14:44
Splunk SPL syntax
"use strict";
/* Copyright © 2020 Splunk Inc.
SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
in part without a valid written license from Splunk Inc. is PROHIBITED. */
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
#!/bin/bash
# shellcheck disable=SC1091,SC2164,SC2034,SC1072,SC1073,SC1009
# Secure OpenVPN server installer for Debian, Ubuntu, CentOS, Amazon Linux 2, Fedora, Oracle Linux 8, Arch Linux and Rocky Linux.
# https://github.com/angristan/openvpn-install
function isRoot() {
if [ "$EUID" -ne 0 ]; then
return 1
fi
@tatdatpham
tatdatpham / openvpn-create-user-ubuntu.sh
Last active August 10, 2022 16:29
Create openvpn user in Ubuntu server (include OTP)
# Check user exist
function checkUser() {
if getent passwd $1 > /dev/null 2>&1; then
echo "The user $1 exists in the system (not sure about VPN user)"
exit 1
else
echo "The user is available for VPN config creation!"
fi
}
kind: DaemonSet
apiVersion: extensions/v1beta1
metadata:
name: snat-iptables-rule
labels:
app: snat-iptables-rule
spec:
template:
metadata:
labels: