Skip to content

Instantly share code, notes, and snippets.

@dmi3mis
dmi3mis / pod.yaml
Created September 20, 2021 12:07
simple pod yaml
apiVersion: v1
kind: Pod
metadata:
name: pod
labels:
app: podapp
spec:
containers:
@dmi3mis
dmi3mis / freeipa_auth_suse.md
Created June 23, 2021 17:56 — forked from Aethylred/freeipa_auth_suse.md
Setting up FreeIPA authentication onf SUSE/SLE 12 SP2

This is the manual process for enrolling a host running SUSE/SLE 12 SP2 with FreeIPA.

The following reference documentation was used to create this process:

I do not recommend using yast to set this up, however it is useful to check if the configuration is valid. SUSE/SLE has all the required packages to use FreeIPA but does not have the conveinent ipa-client tools, such as ipa-client-install.

Pre-Requisites

#!/bin/bash
sshpass -p redhat ssh -o StrictHostKeyChecking=no root@workstation 'wget -c https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/latest/openshift-client-linux.tar.gz'
sshpass -p redhat ssh -o StrictHostKeyChecking=no root@workstation 'tar -xvf openshift-client-linux.tar.gz --overwrite -C /usr/local/bin/'
#!/bin/bash
# this sample script is ping computers in loop.
# It uses conditional expression with color echo
for HOST in $(seq $1 $2)
do
echo -en "\nlets try ping $HOST: "
if ping -c 1 -W 1 f${HOST} >/dev/null 2>&1
then
echo -e "\e[1;32m alive \e[0m"
@dmi3mis
dmi3mis / tmux-cheatsheet.markdown
Created May 10, 2021 13:30 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@dmi3mis
dmi3mis / -setup-windows-wsl-devenv.md
Created May 3, 2021 14:37 — forked from leodutra/-setup-windows-wsl-devenv.md
Install and Setup Windows Subsystem 2 for Linux, Hyper, ZSH + Oh My Zsh + Powerlevel9k + plugins, FNM + VSCode (+ext) and Nerd Font

Setup Windows Subsystem 2 for Linux

Windows Subsystem 2 for Linux, Hyper, ZSH + Oh My Zsh + Powerlevel9k + plugins, FNM + VSCode (+ext) and Nerd Font

To setup native Linux, see this gist

Preview

Requirements

@dmi3mis
dmi3mis / podman-login-and-pull-fix
Last active April 14, 2021 22:32
RH134-RHEL8.2-en-1-20200928 podman login fix
[kiosk@foundation0 ~]$ ssh root@utility
[root@utility ~]# cd /etc/pki/CA/
[root@utility ~]# openssl genrsa -out /etc/pki/CA/private/registry.lab.example.com.key 2048
Generating RSA private key, 2048 bit long modulus (2 primes)
......................................+++++
......................................................+++++
e is 65537 (0x010001)
[root@utility ~]# openssl req -new -subj "/C=US/ST=North Carolina/L=Raleigh/O=Red Hat/CN=registry.lab.example.com" -key /etc/pki/CA/private/registry.lab.example.com.key -out /etc/pki/CA/csr/registry.lab.example.com.csr
[root@utility ~]# openssl x509 -req -in /etc/pki/CA/csr/registry.lab.example.com.csr -CA /etc/pki/CA/cacert.pem -CAkey /etc/pki/CA/private/cakey.pem -CAcreateserial -out /etc/pki/CA/certs/registry.lab.example.com.crt --days 3650 -sha256
@dmi3mis
dmi3mis / better_history.sh
Last active February 21, 2021 12:59
tools_to_demonstrate
HISTCONTROL=ignoredups
HISTIGNORE=?:??
shopt -s histappend
shopt -s cmdhist
shopt -s lithist
export PROMPT_COMMAND="${PROMPT_COMMAND:+${PROMPT_COMMAND}$"\n"}history -a; history -r"
@dmi3mis
dmi3mis / .vimrc
Last active February 19, 2021 20:35 — forked from dragonken/.vimrc
YAML space indent for vim
syntax on
filetype plugin indent on
"Get the 2-space YAML as the default when hit carriage return after the colon
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
if &diff
" change vimdiff color scheme https://stackoverflow.com/questions/2019281/load-different-colorscheme-when-using-vimdiff
for host in master node1 node2 services workstation; do
echo "Changing date on ${host} ..."
case ${host} in
services)
sshpass -p redhat ssh -o StrictHostKeyChecking=no root@${host} 'systemctl stop mariadb'
;;
esac
sshpass -p redhat ssh -o StrictHostKeyChecking=no root@${host} 'systemctl disable --now chronyd && timedatectl set-time "2020-07-05 `date +%T`" && reboot'
done