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 | |
set -ex | |
NAMESPACE="default" | |
NAME="admin" | |
SECRET_NAME="admin-secret" | |
kubectl create serviceaccount -n $NAMESPACE $NAME | |
kubectl create clusterrolebinding $NAMESPACE-$NAME --clusterrole=cluster-admin --serviceaccount=$NAMESPACE:$NAME |
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
version: '3' | |
services: | |
redis: | |
image: redis:5.0.0 | |
container_name: master | |
ports: | |
- "6379:6379" | |
networks: | |
- redis-replication |
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
# Beware! This file is rewritten by htop when settings are changed in the interface. | |
# The parser is also very primitive, and not human-friendly. | |
fields=0 48 17 18 38 39 40 2 46 47 49 1 | |
sort_key=46 | |
sort_direction=-1 | |
tree_sort_key=0 | |
tree_sort_direction=1 | |
hide_kernel_threads=1 | |
hide_userland_threads=0 | |
shadow_other_users=0 |
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
[plugins.opt] | |
path = "/var/lib/rancher/k3s/agent/containerd" | |
[plugins.cri] | |
stream_server_address = "127.0.0.1" | |
stream_server_port = "10010" | |
enable_selinux = false | |
enable_unprivileged_ports = false | |
enable_unprivileged_icmp = false |
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/sh | |
#Check the Drive Space Used by Cached Files | |
du -sh /var/cache/apt/archives | |
#Clean all the log file | |
#for logs in `find /var/log -type f`; do > $logs; done | |
logs=`find /var/log -type f` | |
for i in $logs |
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
# https://elinux.org/Jetson/FAQ/BSP/RootFS_Reduction#Remove_installed_deb_packages | |
## Step 1, safe | |
sudo apt update | |
sudo apt autoremove -y | |
sudo apt clean | |
sudo apt remove thunderbird libreoffice-* -y | |
## Step 2, still safe but not recommended for dev use | |
# samples |
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
### 1: Drop invalid packets ### | |
/sbin/iptables -t mangle -A PREROUTING -m conntrack --ctstate INVALID -j DROP | |
### 2: Drop TCP packets that are new and are not SYN ### | |
/sbin/iptables -t mangle -A PREROUTING -p tcp ! --syn -m conntrack --ctstate NEW -j DROP | |
### 3: Drop SYN packets with suspicious MSS value ### | |
/sbin/iptables -t mangle -A PREROUTING -p tcp -m conntrack --ctstate NEW -m tcpmss ! --mss 536:65535 -j DROP | |
### 4: Block packets with bogus TCP flags ### |
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
function getLinK(fileID) { | |
let response = await fetch(`https://localhost:3000/${fileID}?output=json`); | |
let data = await response.json() | |
return data; | |
} | |
function generateM3U8Content(m3u8Header, chunks) { | |
let lines = m3u8Header.split("\n"); | |
let content = m3u8Header + "\n"; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>HLS Demo</title> | |
<link rel="stylesheet" href="https://cdn.plyr.io/1.8.2/plyr.css"> | |
</head> | |
<body> | |
<video preload="none" id="player" autoplay controls crossorigin></video> | |
<script src="https://cdn.plyr.io/1.8.2/plyr.js"></script> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>HLS Demo</title> | |
<link rel="stylesheet" href="https://cdn.plyr.io/1.8.2/plyr.css"> | |
</head> | |
<body> | |
<video preload="none" id="player" autoplay controls crossorigin></video> | |
<script src="https://cdn.plyr.io/1.8.2/plyr.js"></script> |
NewerOlder