Skip to content

Instantly share code, notes, and snippets.

View kj54321's full-sized avatar
🤠

Donny Jie kj54321

🤠
View GitHub Profile
@rafaeltuelho
rafaeltuelho / openshift-cheatsheet.md
Last active March 27, 2026 06:38
My Openshift Cheatsheet

My Openshift Cheatsheet

List all non openshift/kube namespaces

requires jq CLI

oc get namespaces -o json | jq '[.items[] | select((.metadata.name | startswith("openshift") | not) and (.metadata.name | startswith("kube-") | not) and .metadata.name != "default" and (true)) | .metadata.name ]'

Project Quotes, Limits and Templates

#!/bin/sh
MODEM="$(mmcli -L | grep -o '/org/freedesktop/ModemManager1/Modem/[0-9]*' | head -1)"
BEARER="$(mmcli -m $MODEM --list-bearers | grep -o '/org/freedesktop/ModemManager1/Bearer/[0-9]*' | head -1)"
mkdir -p /run/systemd/network
connect() {
MODEM="$(mmcli -L | grep -o '/org/freedesktop/ModemManager1/Modem/[0-9]*' | head -1)"
# hardcode all the things !! (this is for mobile vikings)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Ficapy
# Create: '16/3/4'
# !/usr/bin/env python
import ftplib
import hmac
import subprocess, json, base64, binascii, time, hashlib, re, copy, textwrap
<?php
/* MySQL 数据库名称 */
define('DB_NAME', 'wordpress');
/* MySQL 数据库用户名 */
define('DB_USER', 'root');
/* MySQL 数据库密码 */
define('DB_PASSWD', 'root');

原文

警告:请务必读完本文!全篇读完!

无论新老用户,都有可能掉进陷阱。 下面我们列出了常见的问题,并解释如何解决他们。 在 Freenode IRC 的 #nginx 频道,我们经常看到这些问题。

[TOC]

@drmalex07
drmalex07 / README-oneshot-systemd-service.md
Last active October 28, 2025 12:45
An example with an oneshot service on systemd. #systemd #systemd.service #oneshot

README

Services declared as oneshot are expected to take some action and exit immediatelly (thus, they are not really services, no running processes remain). A common pattern for these type of service is to be defined by a setup and a teardown action.

Let's create a example foo service that when started creates a file, and when stopped it deletes it.

Define setup/teardown actions

Create executable file /opt/foo/setup-foo.sh:

@epcim
epcim / ovpn_easyrsa_pki.md
Last active August 11, 2024 00:54
openvpn easy-rsa certs (+revoke)
@bigsnarfdude
bigsnarfdude / gist:b6ae4dbd1b9b60d40cba
Created January 7, 2016 17:23
incident report template
Example infrastructure outage incident report
Friday, May 13, 2077
By the Example Security Team
Earlier this week we experienced an outage in our API infrastructure. Today we’re providing an incident report that details the nature of the outage and our response.
The following is the incident report for the Example Security outage that occurred on April 30, 2077. We understand this service issue has impacted our valued developers and users, and we apologize to everyone who was affected.
@aweiteka
aweiteka / openshift2kube.md
Created December 23, 2015 15:21
Exporting OpenShift to Kubernetes

Exporting an application from OpenShift to Kubenetes

OpenShift v3 is based on Kubernetes, adding additional objects such as builds, routes and image streams.

Metadata

Common objects or data types

  • pods
  • replication controllers (rc)
@fuyufjh
fuyufjh / cheatsheet.py
Last active December 12, 2025 11:05
My Python Cheatsheet
Python Cheatsheet
=================
################################ Input & Output ###############################
name = input('please enter your name: ')
print('hello,', name)
ageStr = input('please enter your age: ')
age = int(ageStr)