Skip to content

Instantly share code, notes, and snippets.

View dbsanfte's full-sized avatar
😆
😄

David Sanftenberg dbsanfte

😆
😄
  • Cardano UK
  • United Kingdom
View GitHub Profile
#!/bin/bash
# run_mpi.sh - Generic MPI launcher with optimal OpenMP/MPI settings
#
# This wrapper provides consistent performance configuration for MPI applications:
# * One MPI rank per socket by default
# * Threads pinned to sockets; OpenMP restricted to physical cores
# * Automatic CPU topology detection
# * Optimal OpenMP and MPI environment settings
#
# Usage: ./run_mpi.sh <mpi-processes> <executable> [args...]
### Run this script on Windows (outside of the devcontainer!) to clear out Docker data and shrink the Docker VHD.
# Check if running as administrator, if not, relaunch as admin
if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
Write-Host "Script requires administrator privileges. Relaunching as administrator..." -ForegroundColor Yellow
# Get the current script path
$scriptPath = $MyInvocation.MyCommand.Path
# Relaunch the script as administrator
version: '2'
services:
logstash-collector-config:
image: rancher/logstash-config:v0.2.0
links:
- redis:redis
labels:
io.rancher.scheduler.global: 'true'
io.rancher.container.hostname_override: container_name
elasticsearch:
@dbsanfte
dbsanfte / yarn.lock
Created April 11, 2018 08:16
`nsp --preprocessor yarn` fails on this lockfile
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
abab@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.3.tgz#b81de5f7274ec4e756d797cd834f303642724e5d"
abbrev@1:
version "1.0.9"
@dbsanfte
dbsanfte / log.txt
Created October 3, 2017 07:53
CLI broken in Java 9
[owasp-scan_daily-owasp-scan-6YQSI42VZ5DPTHRBYI5CVLUY5LOKOL32XD6D4H6YEDSUXKUJNDCA] Running shell script
+ ./dependency-check/bin/dependency-check.sh --updateonly --dbDriverName org.postgresql.Driver --dbDriverPath ./postgresql.jar --connectionString 'jdbc:postgresql://*********.postgres.database.azure.com:5432/owasp?ssl=true' --dbUser **** --dbPassword ****
Exception in thread "main" java.lang.ClassCastException: jdk.internal.loader.ClassLoaders$AppClassLoader (in module: java.base) cannot be cast to java.net.URLClassLoader (in module: java.base)
at org.owasp.dependencycheck.data.nvdcve.DriverLoader.load(DriverLoader.java:99)
at org.owasp.dependencycheck.data.nvdcve.ConnectionFactory.initialize(ConnectionFactory.java:123)
at org.owasp.dependencycheck.data.nvdcve.ConnectionFactory.getConnection(ConnectionFactory.java:223)
at org.owasp.dependencycheck.data.nvdcve.CveDB.open(CveDB.java:241)
at org.owasp.dependencycheck.data.nvdcve.CveDB.<init>(CveDB.java:211)
at org.owasp.dependencycheck.Engine.openDatabas
@dbsanfte
dbsanfte / smb.conf
Created June 5, 2017 16:13
smb.conf with performance tweaks
# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it.
[global]
workgroup = SAMBA
security = user
passdb backend = tdbsam
SET GLOBAL innodb_file_format=Barracuda;
SET GLOBAL innodb_default_row_format=DYNAMIC;
CREATE DATABASE IF NOT EXISTS cattle COLLATE = 'utf8_general_ci' CHARACTER SET = 'utf8';
CREATE USER IF NOT EXISTS 'cattle'@'%' IDENTIFIED BY 'cattle';
GRANT ALL ON cattle.* TO 'cattle'@'%';