Skip to content

Instantly share code, notes, and snippets.

@Hexidaz
Hexidaz / xcp-ng-pci-passthrough.md
Created March 12, 2024 10:44
XCP-NG PCI Passthrough

XCP-NG PCI Passthrough

  1. Use lspci to find the pci device you want to passthough
  2. Ask dom0 to not use the pci device
    /opt/xensource/libexec/xen-cmdline --set-dom0 "xen-pciback.hide=(0000:<id from step 1>)"
    
  3. Reboot
  4. Check passthroughable device
@Hexidaz
Hexidaz / apacheLogToCSV.php
Created September 23, 2023 16:23
Convert default apache log to CSV file
<?php
/**
* Convert Apache access log into a CSV file
*
* @author Matthew Boynes
*
* Visit his repo at:
* https://github.com/mboynes/Apache-Access-Log-to-CSV-Converter
*/
@Hexidaz
Hexidaz / nginx-to-apache.sh
Created September 5, 2023 05:10
Script to convert Nginx to Apache (Cloud Panel)
# Disable nginx
sudo systemctl stop nginx
sudo systemctl disable nginx
# Install apache and certbot
sudo apt install apache2 libapache2-mod-php certbot python3-certbot-apache
sudo a2enconf php8.1-fpm
sudo a2enmod rewrite
echo -e "Installed success, now setup your site at \e[32m/etc/apache2/site-available\e[0m and \e[32m/etc/apache2/site-enabled\e[0m"
@Hexidaz
Hexidaz / hex-dec-conversion.ino
Created July 27, 2023 11:26
Arduino Hexadecimal (String) to Decimal Conversion
// Based on: https://github.com/benrugg/Arduino-Hex-Decimal-Conversion
// Converting from Hex to Decimal:
// NOTE: This function can handle a positive hex value from 0 - 65,535 (a four digit hex string).
// For larger/longer values, change "unsigned int" to "long" in both places.
unsigned int hexToDec(String hexString) {
unsigned int decValue = 0;
@Hexidaz
Hexidaz / install-pptp-ubuntu-18.04.sh
Last active November 2, 2023 08:26
Ubuntu 18.04 Install and Setup PPTP VPN
#!/bin/bash
# Tested on Ubuntu 18.04 and 20.04
echo -e "\033[0;31mThis script will assume you use a clean (new) VPS, run the script as root and make sure its network interface is on eth0\033[0m"
if [[ $(id -u) -ne 0 ]]; then
echo "Must be run as root"
exit
fi
sleep 10s

Keybase proof

I hereby claim:

  • I am hexidaz on github.
  • I am hexidaz (https://keybase.io/hexidaz) on keybase.
  • I have a public key ASD9YJAKR5mJZJuvtIZ1mvxTvuEgR81JAunBVkVDSThsGAo

To claim this, I am signing this object: