-
Current Situation:
- The system has multiple kernel versions installed:
- 4.9.127-32.el7.x86_64 (newest)
- 3.10.0-1160.11.1.el7.x86_64 (currently booting)
- 3.10.0-957.21.3.el7.x86_64 (your preferred version)
- Several debug kernels
- The system has multiple kernel versions installed:
-
The Issue:
- The
grubenv
file shows that the system is set to boot into the debug version of 3.10.0-1160.11.1 - This is likely happening because of the
savedefault
option in each menu entry, which saves the last booted entry as the default
- The
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import requests | |
from datetime import datetime | |
import json | |
class LegalServerAPI: | |
def __init__(self, site_name, api_key): | |
"""Initialize the API client |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Zoom Smart Chapters Downloader | |
// @namespace http://tampermonkey.net/ | |
// @version 1.2 | |
// @description Download Zoom Smart Chapters in JSON and Markdown formats | |
// @author Your name | |
// @match https://*.zoom.us/rec/play/* | |
// @match https://*.zoom.us/rec/share/* | |
// @grant none | |
// ==/UserScript== |
All of these diagrams are dynamically rendered during html display by Github, the images generated from text inside the Github-Flavored Markdown. None are static images. Mermaid support was released for Github on 2022-02-14
Pros & Cons:
- Pro: You don't need to care about the layout.
- Con: You cannot control the layout.
Notes:
- Not all the features of Mermaid (in particular symbols
B-->C[fa:fa-ban forbidden]
, hyperlink and tooltips) are supported by Github.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Overview: | |
# This script ensures that npm and the terser package are installed, | |
# and it converts a given JavaScript file into a bookmarklet. The | |
# output is saved as bmlet_<original_file_name>.js. The script does the following: | |
# 1. Checks if npm is installed. | |
# 2. Installs terser globally if not already installed. | |
# 3. Minifies the provided JavaScript file and converts it into a bookmarklet format. | |
# 4. Outputs the result into a new file named bmlet_<input_file_name>.js. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import sqlite3 | |
from tqdm import tqdm | |
def get_table_schema(cursor, table_name): | |
cursor.execute(f"PRAGMA table_info({table_name})") | |
return {col[1]: col[2] for col in cursor.fetchall()} |
Quick Start Tutorial: Setting Up SSH for a Mac Laptop to Access Remote Linux Environments
This tutorial will guide you through setting up SSH on a Mac laptop to securely connect to a remote Linux machine with two different user accounts. We'll cover SSH key generation, integrating keys with the Mac keychain, updating authorized keys on the remote machine, and configuring VS Code for seamless access.
- Open Terminal on your Mac.
- Generate a new SSH key pair:
ssh-keygen -t rsa -b 4096 -C "[email protected]"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------------------------------------------------------------------- | |
# AI-powered Git Commit Function | |
# Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcm` command. It: | |
# 1) gets the current staged changed diff | |
# 2) sends them to an LLM to write the git commit message | |
# 3) allows you to easily accept, edit, regenerate, cancel | |
# But - just read and edit the code however you like | |
# the `llm` CLI util is awesome, can get it here: https://llm.datasette.io/en/stable/ | |
gcm() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------------------------------------------------------------------- | |
# AI-powered Git Commit Function | |
# Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcom` command. | |
# or add it to ~/.oh-my-zsh/custom/plugins | |
# | |
# 1) gets the current staged changed diff | |
# 2) sends them to an LLM to write the git commit message | |
# 3) allows you to easily accept, edit, regenerate, cancel | |
# But - just read and edit the code however you like | |
# the `llm` CLI util is awesome, can get it here: https://llm.datasette.io/en/stable/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# turn GCP (Google Cloud Platform) metadata key/values into shell environment variables | |
# Function to fetch metadata and set as environment variable | |
fetch_and_export() { | |
local path=$1 | |
local value=$(curl "http://metadata.google.internal/computeMetadata/v1/${path}" -H "Metadata-Flavor: Google" --silent) | |
if [ $? -eq 0 ] && [ ! -z "$value" ]; then | |
# Convert metadata keys to uppercase and replace invalid characters for shell variable names |
NewerOlder