export OPT=/opt
export BUILDS=/some/where/mini_linux
mkdir -p $BUILDS
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
FROM ubuntu as base | |
LABEL maintainer="Ahmed Morsi" | |
ENV TZ Europe/Stockholm | |
ENV DEBIAN_FRONTEND noninteractive | |
# apps | |
RUN apt-get update && apt-get install -y curl tzdata nano htop cargo nodejs npm yarn build-essential git cmake locales zsh btop sudo iputils-ping wget tree jq python3 python3-pip | |
RUN apt-get -y autoremove | |
RUN apt-get -y clean |
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
n() { ndisasm -b64 tmp.bin; xxd -g1 tmp.bin; xxd -b tmp.bin; rm tmp.bin; } | |
a() { { echo "bits 64"; echo "$@"; } > tmp.s; nasm -f bin -D ARCH_x86_64 -o tmp.bin tmp.s; n; } | |
h() { printf '%s' "$@" | xxd -r -p > tmp.bin; n; } | |
b() { binary_value=$(echo "$@" | tr -d '[:space:]\n'); hex_value=$(printf '%0*X' $(((${#binary_value}+3)/4)) "$((2#$binary_value))"); h "$hex_value"; } | |
hx() { h "${@//[[:space:]]/}" ; } | |
# nasm_build() { | |
# ndisasm -b 64 tmp.bin | |
# xxd -g1 tmp.bin |
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
#include <stdint.h> | |
#include <stdio.h> | |
#include <sys/mman.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <sys/stat.h> |
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
# Remove telegram groups | |
# python3 -m pip install --upgrade telethon | |
from telethon import TelegramClient, sync | |
# get an Id from https://my.telegram.org/apps | |
api_id = 111111111111 | |
api_hash = 'xxxxxxxxxxxxx' | |
# List all the group names you want to keep, the script will delete other groups. | |
excluded_groups = ['gp1','gp2'] | |
class TelegramAPIs(object): |
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: echoserver | |
spec: | |
replicas: 2 | |
selector: | |
matchLabels: | |
app: echoserver | |
template: |
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 | |
set -e | |
set -o noglob | |
# Usage: ./install.sh [options] | |
# | |
# Example: | |
# Installing on first master node run: | |
# ./install --num 3 --vip 192.168.2.10 --iface eth0 | |
# Installing on other master nodes run: |
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/bash | |
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC='--flannel-backend=none --no-flannel' sh -s - \ | |
--disable-network-policy \ | |
--disable "servicelb" \ | |
--disable "traefik" \ | |
--disable "metrics-server" | |
sudo cat /etc/rancher/k3s/k3s.yaml > ~/.kube/config | |
kubectl create -f https://raw.githubusercontent.com/cilium/cilium/v1.7/install/kubernetes/quick-install.yaml |
default_kernel_opts="nomodeset quiet rootfstype=ext4 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory consoleblank=120"
update-extlinux && reboot
curl -sfL https://get.k3s.io | INSTALL_k3S_EXEC='--disable servicelb --no-deploy traefik --flannel-backend=none --disable-network-policy' sh -
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/bash | |
# Vorhandensein der Programme prüfen | |
MKISOFS=( $(which genisoimage mkisofs) ) | |
if ! [ -x "$MKISOFS" ]; then echo "genisoimage aka mkisofs is missing"; exit 1; fi | |
if ! [ -x "$(which gcc)" ]; then echo "gcc is missing"; exit 1; fi | |
if ! [ -x "$(which nasm)" ]; then echo "nasm is missing"; exit 1; fi | |
if ! [ -x "$(which cpio)" ]; then echo "cpio is missing"; exit 1; fi | |
if ! [ -x "$(which tar)" ]; then echo "tar is missing"; exit 1; fi |