Skip to content

Instantly share code, notes, and snippets.

View zhangysh1995's full-sized avatar
🤣
I have a 150-star repo now!

Yushan zhangysh1995

🤣
I have a 150-star repo now!
  • Tencent
  • Shenzhen, China
  • 14:35 (UTC +08:00)
View GitHub Profile
@mahemoff
mahemoff / README.md
Last active April 6, 2024 00:38
Vim Terminal Mode - A short introduction

Vim has a Terminal Mode!

Since v8.1 (May 2018), Vim has shipped with a built-in terminal. See https://vimhelp.org/terminal.txt.html or type :help terminal for more info.

Why use this? Mainly because it saves you jumping to a separate terminal window. You can also use Vim commands to manipulate a shell session and easily transfer clipboard content between the terminal and files you're working on.

Key Bindings

@JonathanTurnock
JonathanTurnock / README.md
Created October 19, 2020 09:53
Get Current Jenkins Git Commit Hash

To Display the current git commit hash execute the following snipped:

git rev-parse --short HEAD

To Extract this to use in a Jenkinsfile use the sh function with the script and returnStdout parameter set to true:

def commitHash = sh(script: 'git rev-parse --short HEAD', returnStdout: true)
@zhangysh1995
zhangysh1995 / 下载zoom录像.txt
Created September 28, 2020 05:26
如何使用浏览器下载课程录像
1. 打开 Chrome 浏览器
2. 打开安装 Chrome 扩展页面
3. 安装 Zoom下载 扩展 https://chrome.google.com/webstore/detail/zoom-recording-video-down/ehioimgmdbbkmbbimfjcdmonjnjjhgng
4. 安装 解锁右键 扩展 https://chrome.google.com/webstore/detail/enable-right-click/bofdamlbkfkjnecfjbhpncokfalmmbii
5. 登录 Canvas 并打开 Previous Meeting 上课录像 (或打开其他录像链接)
6. 右上角找到鼠标形状的扩展按钮,点击一下,再点 Enable Right Click
7. Ctrl+R 刷新页面
8. 可以看到左下角蓝色的提示,在上面点右键,选择 将链接另存为
9. 愉快的下载看课程了~
@sgnl
sgnl / README.md
Last active February 10, 2022 11:25
Telegraf MySQL Plugin Installation Guide

Overview

The [MySQL Input Plugin][8] for Telegraf gathers data from a MySQL server.

Setup

Create user for the Telegraf agent to connect with

For connections that are local to the MySQL server, use localhost as your hostname:

@Mahedi-61
Mahedi-61 / cuda_11.8_installation_on_Ubuntu_22.04
Last active May 29, 2024 05:44
Instructions for CUDA v11.8 and cuDNN 8.9.7 installation on Ubuntu 22.04 for PyTorch 2.1.2
#!/bin/bash
### steps ####
# Verify the system has a cuda-capable gpu
# Download and install the nvidia cuda toolkit and cudnn
# Setup environmental variables
# Verify the installation
###
### to verify your gpu is cuda enable check
@alkrauss48
alkrauss48 / Dockerfile
Last active November 10, 2022 16:24
Running a docker container as a non-root user
# By default, Docker containers run as the root user. This is bad because:
# 1) You're more likely to modify up settings that you shouldn't be
# 2) If an attacker gets access to your container - well, that's bad if they're root.
# Here's how you can run change a Docker container to run as a non-root user
## CREATE APP USER ##
# Create the home directory for the new app user.
RUN mkdir -p /home/app
@luhn
luhn / README.md
Last active January 3, 2023 18:31
PostgreSQL memory leak

This was performed on Ubuntu 14.04 with a fresh install of PostgreSQL 9.3.14 directly from the official Postgres apt repo. It only works if the query planner chooses the attached plan (with HashAggregate).

Create and populate a new database:

psql -U postgres -c "create database test;"
psql -U postgres test < populate.sql

Open a connection to the database and execute query.sql. The Postgres worker memory usage will rise approximately 50MB and won't be released until the connection is closed.

@tdpreece
tdpreece / simple_http_server.sh
Created September 25, 2015 16:38
Running a Python SimpleHTTPServer in the background and killing it when doneSimpleHTTPServer
#!/usr/bin/env bash
# Create a page in the current dir
echo "My Test Page" > test.html
# Start server
python -m SimpleHTTPServer 8000 &> /dev/null &
pid=$!
# Give server time to start up
@alloy
alloy / README.markdown
Created August 8, 2014 09:56
Learn the LLVM C++ API by example.

The easiest way to start using the LLVM C++ API by example is to have LLVM generate the API usage for a given code sample. In this example it will emit the code required to rebuild the test.c sample by using LLVM:

$ clang -c -emit-llvm test.c -o test.ll
$ llc -march=cpp test.ll -o test.cpp