Skip to content

Instantly share code, notes, and snippets.

@Xeckt
Xeckt / smi-set-nv.ps1
Last active February 3, 2021 11:50
Set NVIDIA GPU to TCC or WDDM
$smi_location = ""
$smi_exe = "nvidia-smi.exe"
$global:gpu_id = ""
$tcc_id = 1
$wddm_id = 0
function get_gpu_uuid() {
Write-Output "Getting GPU UUID..."
$global:gpu_id = cd $smi_location | .\nvidia-smi.exe --query | findstr "UUID"
$global:gpu_id = $global:gpu_id -replace ".* "
@Xeckt
Xeckt / backup.sh
Created February 3, 2021 11:52
Bash backup
function backup_files() {
_backup_file="template-backup-["`date +"%Y-%m-%d-%m"`"].tar.gz"
echo 'Creating backup of:' $(pwd)
tar -czf $HOME/$_backup_file . &>> install/install.log
if [ $? -eq 0 ]; then
echo 'Backup seems to be successful.'
else
echo 'Something went wrong, exit code:' $?
echo 'Check ....'
fi
@Xeckt
Xeckt / adobe.ps1
Last active November 14, 2022 14:52
Adobe Tester
#Requires -Version 7.3
Write-Host -ForegroundColor Red -BackgroundColor Black @'
_ _ _____ _ _
/\ | | | | / ____| (_) | |
/ \ __| | ___ | |__ ___ | (___ ___ _ __ _ _ __ | |_
/ /\ \ / _` |/ _ \| '_ \ / _ \ \___ \ / __| '__| | '_ \| __|
/ ____ \ (_| | (_) | |_) | __/ ____) | (__| | | | |_) | |_
/_/ \_\__,_|\___/|_.__/ \___| |_____/ \___|_| |_| .__/ \__|
| |
@Xeckt
Xeckt / docker-compose.yml
Last active June 17, 2022 12:27
Docker Compose YML LEMP Stack
version: '3.2'
services:
website:
image: 'nginx:1.15.1-alpine'
ports:
- '123.23.43.54:80:80'
- '123.23.43.54:443:443'
volumes:
- type: bind
@Xeckt
Xeckt / dockerfile
Last active March 27, 2021 18:15
Phalcon PHP Dockerfile
FROM mileschou/phalcon:7.1-fpm
RUN apt-get update && apt-get install -y
wget \
sudo \
unzip \
zlib1g-dev \
libssl-dev \
libssh2-1 \
libssh2-1-dev \
@Xeckt
Xeckt / nginx.conf
Last active April 1, 2021 11:20
Nginx conf to work with Cloudflare routing
user nginx;
worker_processes 10;
pid /var/run/nginx.pid;
events {
worker_connections 8192;
}
http {
@Xeckt
Xeckt / p-bits.py
Last active April 26, 2022 10:46
Get Unix permission masks for file(s) in Python.
# https://docs.python.org/3/library/stat.html
import os as system
permission_index = {
0: 'st_mode',
1: 'st_ino',
2: 'st_dev',
3: 'st_nlink',
4: 'st_uid',
@Xeckt
Xeckt / default-site.nginx
Last active February 10, 2021 17:17
Nginx default-site config
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name something.com
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
@Xeckt
Xeckt / ipb-site.nginx
Last active March 1, 2021 13:42
Invision Powerboard Nginx Configuration
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name something.com;
return 301 https://$host$request_uri;
}
server {
# Server listen options
listen 443 ssl http2;
@Xeckt
Xeckt / auto-check-haf.ps1
Last active June 26, 2021 23:56
Hafnium 0-Day exploit checker
$CveCheckFile = "Test-ProxyLogon.ps1"
$ExchangeHealthCheckFile = "HealthChecker.ps1"
$IocChecker = "HAFNIUM-Exchange-IOC.ps1"
$WorkingDirectory = ""
$CurrentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
function Main() {
Clear-Host
CheckRights
Write-Host "[INFO] Starting Script `n" -ForegroundColor Yellow -BackgroundColor Black