Skip to content

Instantly share code, notes, and snippets.

@jabbany
jabbany / main.md
Last active July 19, 2025 11:30
Setting up podman + nvidia on F37 - F40 (Self notes)

Follow the following instructions:

  1. Install the C compiler through sudo dnf group install "C Development Tools and Libraries"
  2. Install the kernel headers sudo dnf install kernel-devel
  3. Download the latest drivers (replace with URL from nvidia website)
    wget https://us.download.nvidia.com/XFree86/Linux-x86_64/550.54.14/NVIDIA-Linux-x86_64-550.54.14.run
    chmod a+x NVIDIA-Linux-x86_64-550.54.14.run
    sudo ./NVIDIA-Linux-x86_64-550.54.14.run
    

HTTPS to HTTPS 301 Redirects with GoDaddy: Impossible

We had a client who needed to redirect an entire domain (we'll call it firstdomain.com) to a specific page on another domain (seconddomain.com/path/to/content) No problem, we thought. Their DNS was handled with GoDaddy, who offers a no-charge 301 forwarding service. A colleague of mine set up the redirect the way you'd expect, with all traffic to firstdomain.com being redirected to https://seconddomain.com/path/to/content. Then we encountered a problem.

We started getting ERR_CERT_COMMON_NAME_INVALID errors when we tried to visit firstdomain.com in desktop browsers. No redirect occurred. Some, but not all mobile browsers didn't have this issue. Stepping back to examine the problem, two mysteries became apparent to me:

  1. How does GoDaddy actually send a 301 status? You need a HTTP server for that.
  2. What is the purpose of the mysterious A record in the domain's DNS records that point to 184.168.131.241?

The mysterious A record in question was not ed

@Daniel-dk
Daniel-dk / espNow_broadcast
Created November 28, 2017 17:40
ESP-Now broadcast example
/**
ESPNOW - Basic communication - Broadcast
Date: 28th September 2017
Original Author: Arvind Ravulavaru <https://github.com/arvindr21>
modified by Daniel de kock
Purpose: ESPNow Communication using Broadcast
Resources: (A bit outdated)
a. https://espressif.com/sites/default/files/documentation/esp-now_user_guide_en.pdf
@kiichi
kiichi / ReduceChainExample.swift
Created February 1, 2016 02:39
A bit complicated reduce() example. This pass the previous element as the 2nd element of accumulator to calculate distance of two locations.
// arr is array of CLLocation.
// Regular For-Loop Version
for (var i=0; i<arr.count-1; i++) {
totalDistance += arr[i].distanceFromLocation(arr[i+1])
}
// Reduce Example 1: with argument. Note, passing total distance and first element as tuple.
totalDistance = arr.reduce((0,arr[0])) { (accum,elem) -> (Double,CLLocation) in
return (accum.0 + accum.1.distanceFromLocation(elem),elem)
@Albertoimpl
Albertoimpl / JavaTrampoline.java
Last active March 3, 2023 17:49
Java 8 Trampoline for Tail Call Recursion
import java.math.BigInteger;
public class TailCallRecursion {
@FunctionalInterface
public interface Trampoline<V> {
V trampoline();
default V call() {
{
"version": 1,
"allow_edit": true,
"plugins": [],
"panes": [
{
"title": "Lux",
"width": 1,
"row": {
"3": 1
@dannysmith
dannysmith / osx_setup.sh
Last active September 3, 2025 19:21
Sensible defaults for New Mac
#!/usr/bin/env bash
# ~/.osx — http://mths.be/osx
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
@jiananlu
jiananlu / gist:9258032
Last active May 11, 2023 00:14
upgrade openwrt kernel and reinstall all packages manual

upgrade the system

Make sure you can ssh to the router by root and type in the command:

cd /tmp
wget http://downloads.openwrt.org/snapshots/trunk/ar71xx/openwrt-ar71xx-generic-mw4530r-v1-squashfs-sysupgrade.bin
sysupgrade -v openwrt-ar71xx-generic-mw4530r-v1-squashfs-sysupgrade.bin
@lamprosg
lamprosg / 0.Maps.mm
Last active December 18, 2017 08:49
(iOS) Core Location & Map Kit
/**************************************/
//Annotation object
#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>
@interface MapViewAnnotation : NSObject <MKAnnotation>
@property (nonatomic,strong) NSString *title;
@property (nonatomic,strong) NSString *subtitle;
@property (nonatomic, assign) CLLocationCoordinate2D coordinate;
@wolever
wolever / ssh_control_socket.sh
Created October 3, 2011 06:50
Bash script to start and background an SSH ControlMaster to speed up SSH in the script
# Call `setup_ssh_socket` to setup the control socket (function will return once
# the socket is ready to go), and `ssh_target` will connect using the control socket.
# Assumes TARGET_HOST variable is set.
# The connection is automatically closed when the script exists.
# TARGET_HOST="wolever.net"
# setup_ssh_control_socket
# ssh_target "hostname"
debug() {
echo "DEBUG: $*"