Skip to content

Instantly share code, notes, and snippets.

View fschiettecatte's full-sized avatar

François Schiettecatte fschiettecatte

  • FS Consulting, LLC
  • Seattle, WA
View GitHub Profile
@fschiettecatte
fschiettecatte / BootstrapModeSwitcher.md
Last active August 25, 2023 18:49
Automatically Setting and Switching Light / Dark Mode in Bootstrap

Automatically Setting and Switching Light / Dark Mode in Bootstrap

Bootstrap 5.3.0 introducted the concept of a theme to set the color mode of a website, ostensibly support light color mode and dark color mode.

The examples on the Bootstrap website show how to manually switch between modes but I wanted a way to automatically set the mode based on the operating system setting when the site loaded, and automatically switch the mode when the operating system switched from one mode to another.

So I put together an anonymous function which does the first and a window watcher which does the second.

This JavaScript should be included in the page itself, putting it in a separate file will cause the page to visibly switch modes when it is loaded which is pretty ugly.

@fschiettecatte
fschiettecatte / Samba_MacOS.md
Last active March 19, 2024 15:08
Setting up SAMBA for Linux / MacOS

Setting up Samba for Linux / MacOS

I recently switched from using Netatalk to Samba for file access from MacOS to linux.

Obviously the Samba is a great resource, on the Samba Wiki the Configure Samba to Work Better with Mac OS X was invaluable for setting up the /etc/samba/smb.conf file, and the vfs fruit man page contains documentation for all the options.

Here is the /etc/samba/smb.conf file I use:

[global]
@fschiettecatte
fschiettecatte / CleanRepo.md
Last active September 23, 2023 03:11
Removing all traces of a file from a GIT repository

Removing all traces of a file from a GIT repository

I recently had to remove all traces of a file from a GIT repository.

First clone the repository:

git clone ssh://francois@somehost.com/home/repositories/codebase codebase

@fschiettecatte
fschiettecatte / uptime.15m.py
Last active December 21, 2020 16:30
SwiftBar plugin to display a website status in the macOS menu bar
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#--------------------------------------------------------------------------
#
# Author: Francois Schiettecatte (FS Consulting LLC.)
# Creation Date: October 10, 2020
#
@fschiettecatte
fschiettecatte / epa.15.py
Last active December 21, 2020 16:30
SwiftBar plugin to get and display the Air Quality Index (AQI) in the macOS menu bar
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#--------------------------------------------------------------------------
#
# Author: Francois Schiettecatte (FS Consulting LLC.)
# Creation Date: October 10, 2020
#
@fschiettecatte
fschiettecatte / HighTrafficServerSettings.md
Last active January 22, 2024 21:31
High Traffic Server Settings on RHEL / AlmaLinux / Rocky / EuroLinux / CentOS 8

High Traffic Server Settings on RHEL / AlmaLinux / Rocky / EuroLinux / CentOS 8

I recently did some work to optimize the network configuration of an AlmaLinux 8 based web server that receives a lot of traffic.

Of course these settings also apply to RHEL / Rocky / EuroLinux / CentOS 8 (hereafter referred to as Linux 8.) I think these should also work on RHEL / AlmaLinux / Rocky / EuroLinux 9 as well but I have not yet tested them.

There is a lot of information on the web for this and it distills down to a minimum recommended configuration, and a recommended configuration.

The minimum recommended configuration should be sufficient for servers with less than 10Gb, and the recommended configuration should be sufficient for servers with 10Gb or more.

@fschiettecatte
fschiettecatte / SolrWar.md
Last active December 5, 2020 18:57
Creating a WAR file from the SOLR distribution

Creating a WAR file from the SOLR distribution

Since version 5 SOLR has been distributed as a stand-alone server running within Jetty. Some (like me) would prefer to run it within Tomcat which requires the creation of a WAR file.

Below are the steps to take do achieve this. I have successfully done this with SOLR 5 through SOLR 8.

Please note that this is not officially supported so may stop working at any time.

@fschiettecatte
fschiettecatte / 10GbNIC.md
Last active June 4, 2023 16:11
10Gb NIC on RHEL / AlmaLinux / Rocky / EuroLinux / CentOS 8

10Gb NIC on RHEL / AlmaLinux / Rocky / EuroLinux / CentOS 8

I have an AQC107 10Gb NIC installed in my PC running AlmaLinux 8. AlmaLinux 8 supports the card well enough but I found that a number of network settings need to be changed to get the best performance.

The driver is included in AlmaLinux 8 but you may want to install the current release which you can download from Marvell. Installation instructions for the driver are included in the download.

@fschiettecatte
fschiettecatte / InstallingCuda.md
Last active December 5, 2020 18:57
Installing CUDA, cuDNN and NCCL (Centos 8.2004)

Installing CUDA, cuDNN and NCCL (Centos 8.2004)

I have an NVIDIA graphics card that I use for TensorFlow work, I build TensorFlow from source and keep up with the current releases of CUDA, cuDNN and NCCL.

Configuration

I have the following configuration:

@fschiettecatte
fschiettecatte / InstallingTensorFlowFromSource.md
Last active December 5, 2020 18:57
Installing TensorFlow From Source (TF 2.4.0, Centos 8.2004)