Skip to content

Instantly share code, notes, and snippets.

@ryerh
ryerh / tmux-cheatsheet.markdown
Last active April 2, 2025 04:28 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

Install Vulkan driver (AMD Only)

sudo pacman -S vulkan-radeon lib32-vulkan-radeon

Install Vulkan driver (NVIDIA Only)

sudo pacman -S nvidia-utils lib32-nvidia-utils

Setting Up MCP Servers on Windows

A step-by-step guide to setting up Model Context Protocol (MCP) servers for Claude Desktop on Windows.

Prerequisites

  1. Install Node.js (v18.x or later)
    • Download from: https://nodejs.org/
    • Verify installation by opening Command Prompt (CMD) and running:
      node --version
      npm --version

Act as an expert security researcher specializing in code auditing. You are tasked with conducting a thorough security audit of the provided codebase.

Objective: Identify, prioritize, and propose remediation strategies for high-priority security vulnerabilities that could lead to system compromise, data breaches, unauthorized access, denial of service, or other significant security incidents. Assume a realistic threat model appropriate for the type of application (if known, otherwise assume a web application handling sensitive data).


Phase 0: Scoping & Context Gathering (Crucial First Step)

  • Clarify Scope: Before analysis, please ask any necessary clarifying questions about:
  • The programming language(s) and framework(s) used.
@TylerWanner
TylerWanner / README.md
Last active April 2, 2025 04:15
Terraform Deploy Prefect Server to GCP

Provisioning Prefect Server on GCP using Terraform

Requirements: Terraform, GCP credentials with permission to create a project Tested with: Terraform v0.12.23, google cloud provider v3.26

To run:

You can use an environment variable to set which service account key to use during provisioning export GOOGLE_APPLICATION_CREDENTIALS=/path/to/key The service account you use must belong to a GCP project that has the necessary APIs enabled (such as billing and resource manager)--if it does not, you may have to enable these APIs manually along the way in those projects In this directory, run terraform init then terraform apply -- you will need to provide a billing_id and organization_id for your GCP project

Once successful, be sure to add the following to your ~/.prefect/config.toml

@paulromano
paulromano / totnu_develop.diff
Last active April 2, 2025 04:12
Changes in OpenMC to imitate MCNP's TOTNU option
diff --git a/src/nuclide.cpp b/src/nuclide.cpp
index ae3085aff2..13816f59a5 100644
--- a/src/nuclide.cpp
+++ b/src/nuclide.cpp
@@ -409,7 +409,7 @@ void Nuclide::create_derived(
for (int i = 0; i < n; ++i) {
double E = grid_[t].energy[i];
xs_[t](i, XS_NU_FISSION) =
- nu(E, EmissionMode::total) * xs_[t](i, XS_FISSION);
+ nu(E, EmissionMode::prompt) * xs_[t](i, XS_FISSION);
@NorbiPeti
NorbiPeti / IntelliJFlatpak.md
Last active April 2, 2025 04:12
IntelliJ IDEA Flatpak Setup Guide

IntelliJ IDEA Flatpak Setup Guide

In this guide I collect all the things I had to manually set up after installing IntelliJ using Flatpak on Linux. Also mostly applicable to other JetBrains IDEs like PHPStorm, WebStorm, Rider, PyCharm etc.

Java versions

Flatpak uses an isolated environment to install the latest version of (usually graphical) applications without having to rely on installed system libraries and such with varying versions.

@hellokaton
hellokaton / example_prd.txt
Created April 1, 2025 05:20
示例 PRD 文件及提问方式
<context>
# Overview
[Provide a high-level overview of your product here. Explain what problem it solves, who it's for, and why it's valuable.]
# Core Features
[List and describe the main features of your product. For each feature, include:
- What it does
- Why it's important
- How it works at a high level]
@thevipulvats
thevipulvats / where.sql
Created January 28, 2025 16:13
Filtering results (WHERE)
CREATE DATABASE bookstore;
USE bookstore;
CREATE TABLE books (
book_id INT PRIMARY KEY,
title VARCHAR(100),
author VARCHAR(50),
price DECIMAL(10,2),
publication_date DATE,
@leongjinqwen
leongjinqwen / upload-to-aws-flask.md
Created January 23, 2020 15:32
upload files to aws s3 bucket with flask

Upload files to AWS

Make sure you already have S3 bucket, access key and secret key before go through this notes.

How to connect to AWS?

Boto3 allows Python developers to write software that makes use of services like Amazon S3 and Amazon EC2.

Step 1: Install boto3 with pip

pip install boto3