Skip to content

Instantly share code, notes, and snippets.

@ustayready
ustayready / gpt.py
Created January 16, 2023 23:49
CloudGPT - Use ChatGPT to analyze AWS policies for vulnerabilities
import openai
import boto3
import json
import time
from typing import Dict, List
openai.api_key = '### SET YOUR OPENAPI API KEY HERE ###'
session = boto3.session.Session()
client = session.client('iam')
@mattifestation
mattifestation / SurfaceSIPolicy.xml
Created December 24, 2019 12:27
Since Windows 10 S won't update due to code signing issues, I rolled my own variant of the 10 S policy for my Surface device.
<?xml version="1.0"?>
<SiPolicy xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:schemas-microsoft-com:sipolicy">
<VersionEx>10.0.0.0</VersionEx>
<BasePolicyID>{A244370E-44C9-4C06-B551-F6016E563076}</BasePolicyID>
<PolicyID>{A244370E-44C9-4C06-B551-F6016E563076}</PolicyID>
<PlatformID>{2E07F7E4-194C-4D20-B7C9-6F44A6C5A234}</PlatformID>
<Rules>
<Rule>
<Option>Enabled:UMCI</Option>
</Rule>
@ghfields
ghfields / Ubuntu 19.10 zfs installer Encryption
Last active January 7, 2022 22:44
Fix Ubuntu 19.10 zfs installer /usr/share/ubiquity/zsys-setup (encryption)
1) Start in uefi mode.
At Line 216 use:
echo password | zpool create -f \
-o ashift=12 \
-O compression=lz4 \
-O acltype=posixacl \
-O xattr=sa \
-O relatime=on \
@ghfields
ghfields / Ubuntu 18.04.1 Rpool Encryption Trial.sh
Last active February 16, 2022 03:36
Change "zpool create" to more feature rich set with improved encryption algorithm
# Run as root
# sudo -i
# Prepare LiveCD Environment
add-apt-repository -y ppa:jonathonf/zfs
apt install -y zfs-dkms
systemctl stop zfs-zed.service
modprobe -r zfs
modprobe zfs
@mattifestation
mattifestation / DeviceGuard_Driver_Strict_Enforcement_policy.xml
Created November 20, 2017 00:38
File-based driver enforcement Device Guard policy for my Surface Laptop w/ Windows 10 Enterprise.
<?xml version="1.0" encoding="utf-8"?>
<SiPolicy xmlns="urn:schemas-microsoft-com:sipolicy">
<VersionEx>10.0.0.0</VersionEx>
<PolicyTypeID>{A244370E-44C9-4C06-B551-F6016E563076}</PolicyTypeID>
<PlatformID>{2E07F7E4-194C-4D20-B7C9-6F44A6C5A234}</PlatformID>
<Rules>
<Rule>
<Option>Enabled:Unsigned System Integrity Policy</Option>
</Rule>
<Rule>
@xahare
xahare / Docker-on-qubes.md
Last active April 3, 2024 12:43
How to run docker on Qubes-OS
@gregneagle
gregneagle / fancy_defaults_read.py
Last active February 6, 2024 15:14
fancy_defaults_read.py: Reads a preference, prints its value, type, and where it is defined.
#!/usr/bin/python
import os
import sys
from CoreFoundation import (CFPreferencesAppValueIsForced,
CFPreferencesCopyAppValue,
CFPreferencesCopyValue,
kCFPreferencesAnyUser,
kCFPreferencesAnyHost,
@osamu
osamu / sleep-bug.md
Last active March 14, 2020 07:02
スリープしない問題 (Macbook Pro 13-inch, 2016)

機種

  • MacBook Pro 13inch, 2016, Four Thunderbolt 3 Ports
  • CPU 3.3GHz Intel i7
  • MEM 16G
  • Intel Iris Graphics

現象

  • 満充電状態にして、100%充電状態であることを確認後、電源を外して、ラップトップの画面を閉じて持ち歩いたり、机に放置しおく
  • その後まったく使ってないのに残容量 0%だったり、少しだけ残ってる状態になる
  • 一日中、バックの中が生暖かく保たれる
@whizzzkid
whizzzkid / XPS-15 9560 Getting Nvidia To Work on KDE Neon
Last active December 3, 2022 15:43
[XPS 15 Early 2017 9560 kabylake] Making Nvidia Drivers + (CUDA 8 / CUDA 9 / CUDA 9.1) + Bumblebee work together on linux ( Ubuntu / KDE Neon / Linux Mint / debian )
# Instructions for 4.14 and cuda 9.1
# If upgrading from 4.13 and cuda 9.0
$ sudo apt-get purge --auto-remove libcud*
$ sudo apt-get purge --auto-remove cuda*
$ sudo apt-get purge --auto-remove nvidia*
# also remove the container directory direcotory at /usr/local/cuda-9.0/
# Important libs required with 4.14.x with Cuda 9.X
$ sudo apt install libelf1 libelf-dev