Skip to content

Instantly share code, notes, and snippets.

@pan-rui
pan-rui / debian-autostart.md
Created October 31, 2025 02:57 — forked from shui/debian-autostart.md
用update-rc.d命令给Debian添加开机启动项

用update-rc.d命令给Debian添加开机启动项 Linux系统设置开机启动有很多方法,网上也有许多详细教程。本文只关注用update-rc.d命令给Debian添加开机启动。

例如:将test.sh脚本添加到开机自启。

1.将test.sh脚本放到/etc/init.d/目录下

cp test.sh /etc/init.d/  
cd /etc/init.d/  
chmod +x test.sh 
@pan-rui
pan-rui / alpine-nfs.md
Created May 2, 2024 16:02 — forked from jnovack/alpine-nfs.md
Setting up an Alpine NFS v4 Server
Welcome to Alpine!

The Alpine Wiki contains a large amount of how-to guides and general
information about administrating Alpine systems.
See <http://wiki.alpinelinux.org>.

You can setup the system with the command: setup-alpine

You may change this message by editing /etc/motd.
@pan-rui
pan-rui / Hoverable.js
Created January 1, 2024 17:32 — forked from necolas/Hoverable.js
Hover styles in React Native for Web
import createHoverMonitor from './createHoverMonitor';
import { element, func, oneOfType } from 'prop-types';
import React, { Component } from 'react';
const hover = createHoverMonitor();
/**
* Use:
* <Hoverable>
* {(hover) => <View style={hover && styles.hovered} />}
@pan-rui
pan-rui / generate_kubeconfig.sh
Created December 26, 2023 15:20 — forked from hex108/generate_kubeconfig.sh
Generate kubeconfig for users with proper permissions and quota in the specified namespace.
#!/usr/bin/bash
set -e
set -u
set -o pipefail
#set -x
# Please set these variables first, then run the script on the master node.
APISERVER_ADDRESS="https://127.0.0.1:6443" # If you have a VIP for apiservers, use the VIP.
USER=test # user name
@pan-rui
pan-rui / make_cert.md
Created December 20, 2023 12:20 — forked from liuguangw/make_cert.md
使用openssl制作自定义CA、自签名ssl证书

自签名ssl证书生成

生成CA私钥

# 创建文件夹 ca 保存Ca相关
mkdir ca
cd ca
#创建私钥 (建议设置密码)
openssl genrsa -des3 -out myCA.key 2048
@pan-rui
pan-rui / gitlab-runner-admin.yml
Created December 19, 2023 11:50 — forked from alphajc/gitlab-runner-admin.yml
ERROR: Job failed (system failure): pods is forbidden: User "system:serviceaccount:gitlab:default" cannot create resource "pods" in API group "" in the namespace "gitlab"
# Source: gitlab-runner/templates/service-account.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: default
namespace: gitlab
---
# Source: gitlab-runner/templates/role.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: "ClusterRole"
@pan-rui
pan-rui / create-certs.sh
Created December 18, 2023 12:22 — forked from gesellix/create-certs.sh
add TLS/self-signed certificates to the Docker for Mac daemon
#!/bin/sh
mkdir -p certs
openssl req -x509 -days 365 -newkey rsa:4096 -nodes -sha256 -out certs/domain.crt -keyout certs/domain.key -subj "/C=DE/ST=Berlin/L=Berlin/O=IT/CN=docker.local"
@pan-rui
pan-rui / shell.sh
Created December 2, 2023 02:47 — forked from alexwebgr/shell.sh
Install MySQL on ubuntu 20.04 and set the root password
# Completely remove any previous config
sudo apt remove --purge mysql*
sudo apt autoremove
sudo find / -iname mysql
# install the server
sudo apt update
sudo apt install mysql-server
# run the wizard
sudo mysql_secure_installation
@pan-rui
pan-rui / Dockerfile
Last active May 2, 2024 02:26 — forked from WuSiYu/Dockerfile
A "full" ubuntu-server development environment docker image
FROM ubuntu:20.04
LABEL maintainer="SiYu Wu <[email protected]>"
ENV DEV_USER=user
ENV UID=1000
ENV GID=1000
ENV DEF_PASSWD=password
ENV TZ=Asia/Shanghai
ENV LANG=en_US.UTF-8
@pan-rui
pan-rui / gist:2c23d0e0820abbb92e035c246f162e44
Created August 6, 2023 15:57 — forked from lanrion/gist:9826458
ubuntu上安装 五笔输入法

基于 IBus 框架

 1、安裝IBus框架:

  在终端中输入:

         sudo apt-get install ibus ibus-clutter ibus-gtk ibus-gtk3 ibus-qt4

  有些版本自带了此输入法框架,则不需要安装。