Skip to content

Instantly share code, notes, and snippets.

@derekjhunt
derekjhunt / setupProxmoxIntelGPU.sh
Last active August 9, 2024 21:27
Setup Proxmox for passthrough of integrated Intel GPU (i915 / Intel IRIS graphics.)
#!/bin/bash
# Exit immediately if a command exits with a non-zero status
set -e
# Install Intel OpenCL ICD
echo "Installing Intel OpenCL ICD..."
apt update && apt install -y intel-opencl-icd
# Edit GRUB Configuration
@derekjhunt
derekjhunt / Mellanox OFED cheat sheet
Created January 25, 2024 23:14 — forked from githubfoam/Mellanox OFED cheat sheet
Mellanox OFED cheat sheet
--------------------------------------------------------------------------
# ofed_info -s
--------------------------------------------------------------------------
Find Mellanox Adapter Type and Firmware/Driver version
ConnectX-4 card
# lspci | grep Mellanox
0a:00.0 Network controller: Mellanox Technologies MT27500 Family [ConnectX-3]
# lspci -vv -s 0a:00.0 | grep "Part number" -A 3
# lspci | grep Mellanox | awk '{print $1}' | xargs -i -r mstvpd {}
@derekjhunt
derekjhunt / install-nginx-rtmp-module.sh
Created April 22, 2020 04:31 — forked from afriza/install-nginx-rtmp-module.sh
Install NGINX RTMP module with HLS support on Ubuntu 18.04
sudo apt install curl gnupg2 ca-certificates lsb-release
echo "deb http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" | sudo tee /etc/apt/sources.list.d/nginx.list
curl -fsSL https://nginx.org/keys/nginx_signing.key | sudo apt-key add -
sudo apt update
NGINX_VERSION=$(apt show nginx | grep "^Version" | cut -d " " -f 2 | cut -d "-" -f 1)
# take note of the nginx version in the "stable" release. e.g. 1.14.2
echo NGINX version $NGINX_VERSION
wget https://hg.nginx.org/pkg-oss/raw-file/default/build_module.sh
chmod a+x build_module.sh
@derekjhunt
derekjhunt / wp-permissions-script
Last active May 6, 2016 19:17 — forked from macbleser/wp-permissions-script
WordPress Permissions Configuration Script
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro
#
WP_OWNER=s_somwebdev # <-- wordpress owner
WP_GROUP=s_somwebdev # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@derekjhunt
derekjhunt / CVE-2014-6271.yml
Created September 27, 2014 01:02
Ansible Playbook to test for CVE-2014-6271 - ShellShocker
---
- hosts: [ 'all', '{{cli_target}}' ]
tasks:
- name: CVE-2014-6271
shell: env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
register: ex1
failed_when: ex1.stdout.find('vulnerable') != -1
changed_when: false
tags: CVE-2014-6271
@derekjhunt
derekjhunt / fixbash.sh
Last active August 29, 2015 14:06
Update bash for BSD systems for ShellShocker - adapted to use jot
#!/bin/sh
# fixbash.sh originally from shellshocker.net,
# adapted to use jot instead of seq - derek.hunt@gmail.com
# Updated: Sun Sep 28 15:17:58 EDT 2014 - added 27th patch.
cd ~/
mkdir bash
cd bash
wget https://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz
#download all patches
for i in $(jot -s " " -w '%03d' 27); do wget https://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-$i; done