Skip to content

Instantly share code, notes, and snippets.

View spy86's full-sized avatar
🎯
Focusing

Maciej Michalski spy86

🎯
Focusing
View GitHub Profile
kind: ServiceAccount
apiVersion: v1
metadata:
name: restart-deploy
namespace: testns
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
#!/bin/bash
set -ex
mkdir certs && cd certs
echo "Creating server keys..."
echo 01 > ca.srl
openssl genrsa -des3 -out ca-key.pem
openssl req -new -x509 -days 3650 -key ca-key.pem -out ca.pem
openssl genrsa -des3 -out server-key.pem
openssl req -new -key server-key.pem -out server.csr
openssl x509 -req -days 365 -in server.csr -CA ca.pem -CAkey ca-key.pem \
#!/bin/bash
set -ex
systemctl stop docker
systemctl disable docker
echo "Copying scripts to /var/ssl/"
mkdir -p /var/ssl
cp ca.pem server-cert.pem server-key.pem /var/ssl/
cat<<-EOF > /etc/systemd/system/docker.service
[Unit]
Protection method Is safety ? Examle password
plain text insecure example:P@ssw0rd_123
crypt insecure example:$1$Z4iyFnl/$ZdbNEw8wcJeFkJmUUmQ6E1
sha1 insecure example:5b50e3ae27d51c44da3cee51552aa6f7cb805a56
apr1 insecure example:$apr1$8MMhB4DE$/r/lY2CQQgj61xPO7mBXu/
bcrypt secure example:$2y$12$dNP9/NOZg.My1a474if36eSk6TCFYyIKfHAWTKkCG.FJQjwHsrSVi
SHA512 secure example:453d6168242737b3b1b9f3fb360c8d1afc00a349abe6b617a6c4e57f14a38f400c83e0468d41350c2d3483d8a76b8789a6ac2ad9d63893c208785f8535a89241
#!/bin/bash
echo "DOCKER"
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common -y
#!/bin/bash
echo "DOCKER and DOCKER-COMPOSE"
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common -y
@spy86
spy86 / DaemonSet.yaml
Last active February 5, 2023 10:59
Change kernel parameters
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: example
namespace: kube-system
labels:
app: example
spec:
template:
metadata:
@spy86
spy86 / wpa_supplicant.conf
Created April 5, 2020 19:19
Raspberry Pi4 connected to WiFi of WPA2 (medium article)
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=JP
network = {
ssid = "<SSID name to connect>"
proto = RSN
key_mgmt = WPA - EAP
pairwise = CCMP
auth_alg = OPEN
node {
boolean isSuccess = true
try {
stage( 'Build' ) {
build job: "Build", parameters: [[$class: 'StringParameterValue', name: 'Branch', value: "${Branch}"]]
}
stage( 'Test' ) {
build job: "Test", parameters: []
}
stage( 'Deploy' ) {
##(1)
node {
##(2)
stage('Build') {
...
}
...
}