Skip to content

Instantly share code, notes, and snippets.

View relvinhas's full-sized avatar

Pedro Rodrigues relvinhas

View GitHub Profile
@relvinhas
relvinhas / gist:80471ea965d292f9cb2ad02657adada4
Created September 30, 2020 01:42
Fedora Server - Virtualization Host - Nvidia passthrough
# Fedora 31 Server Edition - Virtualization Host
sudo dnf remove -y plymouth
# Upgrade packages
sudo dnf upgrade -y
# Install virtualization group
sudo dnf groupinstall "Virtualization" -y
@relvinhas
relvinhas / DANOS_VM_SETUP
Last active May 4, 2024 21:23
DANOS VM Setup - Passthrough and CPU pinning
virsh destroy edge-router
virsh undefine --nvram edge-router
virsh vol-delete edge-router --pool fast-storage
virt-install \
--name edge-router \
--cpu host-passthrough \
--vcpus=4,sockets=1,cores=4,threads=1 \
--ram 2048 \
--os-variant debian10 \
@relvinhas
relvinhas / DANOS_RAW_CONFIG
Last active December 7, 2022 21:01
DANOS configuration
configure
# Not working with DANOS 2005
# RFC 1918 private IP networks are set as blackhole routes
#
# set protocols static route 10.0.0.0/8 blackhole distance 254
# set protocols static route 172.16.0.0/12 blackhole distance 254
# set protocols static route 192.168.0.0/16 blackhole distance 254
# delete protocols static route 10.0.0.0/8
@relvinhas
relvinhas / update_pbr_route.sh
Created September 29, 2020 20:30
DANOS - Update PBR routing table
#!/bin/vbash
DHCP_INTERFACE=$1
ROUTING_TABLE=$2
DHCP_LEASES=/var/lib/dhcp/dhclient_${DHCP_INTERFACE}.leases
if ! [ -f $DHCP_LEASES ]; then
echo "Unable to find DHCP Lease for ${DHCP_INTERFACE}"
exit
#
# Original version by Grant Parnell is offline (http://digitaldj.net/2011/07/21/trim-enabler-for-lion/)
# Update July 2014: no longer offline, see https://digitaldj.net/blog/2011/11/17/trim-enabler-for-os-x-lion-mountain-lion-mavericks/
#
# Looks for "Apple" string in HD kext, changes it to a wildcard match for anything
#
# Alternative to http://www.groths.org/trim-enabler-3-0-released/
# Method behind this madness described: http://forums.macrumors.com/showthread.php?t=1409151&page=4
# See discussion in comments here: https://www.macupdate.com/app/mac/39654/lion-tweaks
# And here: http://forums.macrumors.com/showthread.php?t=1410459
#!/usr/bin/env python2
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
@relvinhas
relvinhas / gist:9762946
Created March 25, 2014 14:25
keybase.md
### Keybase proof
I hereby claim:
* I am relvinhas on github.
* I am relvinhas (https://keybase.io/relvinhas) on keybase.
* I have a public key whose fingerprint is 2EF5 466C CD8F 69F6 846D 4215 125F 58E1 26ED 2C2D
To claim this, I am signing this object:
# (c) 2013 www.nerdenmeister.org
diff -ur ./Core/Unix/MacOSX/CoreMacOSX.cpp ../truecrypt-7.1a-source-patched/Core/Unix/MacOSX/CoreMacOSX.cpp
--- ./Core/Unix/MacOSX/CoreMacOSX.cpp 2012-02-07 10:36:48.000000000 +0000
+++ ../truecrypt-7.1a-source-patched/Core/Unix/MacOSX/CoreMacOSX.cpp 2013-08-17 00:08:30.000000000 +0100
@@ -108,6 +108,7 @@
void CoreMacOSX::MountAuxVolumeImage (const DirectoryPath &auxMountPoint, const MountOptions &options) const
{
+#if 0
// Check FUSE version
<?php
class ReconnectingPDO
{
protected $dsn, $username, $password, $pdo, $driver_options;
public function __construct($dsn, $username = "", $password = "", $driver_options = array())
{
$this->dsn = $dsn;
$this->username = $username;
$this->password = $password;