Skip to content

Instantly share code, notes, and snippets.

View dlundquist's full-sized avatar

Dustin Lundquist dlundquist

  • Tempered Networks
  • Seattle, WA
View GitHub Profile
@neoxic
neoxic / udp_client.c
Last active July 19, 2024 21:03
SOCK_DGRAM: race between 'bind()' and 'connect()' leads to a connected socket receiving unfiltered datagrams
#include <err.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#define check(expr) if ((expr) == -1) err(1, "%s", #expr);
@Apsu
Apsu / ip a
Created June 2, 2014 19:41
ML2 + LinuxBridge + VXLAN
stack@apsu-ih-dev1:~/devstack$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet 169.254.169.254/32 scope link lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
@plentz
plentz / nginx.conf
Last active July 22, 2024 11:19
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@sampowers
sampowers / map_remote_ipmi_ports_to_loopback_ip.sh
Last active April 22, 2021 19:03
SSH tunnel 127.0.0.2 to supermicro IPMI system
#!/bin/bash
set -x
#
# Purpose: Run on a workstation to make a remote IPMI controller available at http://127.0.0.2:80/
# Only does port mapping. IPMI controllers may have their own taxing browser requirements.
# Requires that you have a shell on a host that is on the same network as your IPMI interface.
shell='user@ssh-host-on-ipmi-network'
@stevie-chambers
stevie-chambers / nx1k.rb
Created October 30, 2011 21:00
Basic Ruby interface to the Nexus 1000V
class NX1K
require 'net/ssh'
attr_writer :host, :user, :pwd
def send(xml)
session = Net::SSH.start(@host, @user, :password => @pwd, :timeout => 10, :verbose => :debug) do |session|
channel = session.open_channel do |channel|
channel.subsystem("xmlagent") do |xmlagent, success|
xmlagent.on_data do |xmlagent, data|