Skip to content

Instantly share code, notes, and snippets.

@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 / .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
@dmi3mis
dmi3mis / .vimrc
Created August 14, 2020 14:39
vim indentation for yaml files
syntax on
filetype plugin indent on
"Get the 2-space YAML as the default when hit carriage return after the colon
autocmd FileType yaml,yml setlocal ts=2 sts=2 sw=2 expandtab
" Highlight tabs as errors.
" https://vi.stackexchange.com/a/9353/3168
autocmd FileType yaml,yml match Error /\t/
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
@dmi3mis
dmi3mis / netrw.txt
Created April 8, 2020 06:49 — forked from danidiaz/netrw.txt
Vim's netrw commands.
--- ----------------- ----
Map Quick Explanation Link
--- ----------------- ----
< <F1> Causes Netrw to issue help
<cr> Netrw will enter the directory or read the file |netrw-cr|
<del> Netrw will attempt to remove the file/directory |netrw-del|
<c-h> Edit file hiding list |netrw-ctrl-h|
<c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
<c-r> Browse using a gvim server |netrw-ctrl-r|
<c-tab> Shrink/expand a netrw/explore window |netrw-c-tab|
az login
az group create --name sle1-rg --location westeurope --output table
az network vnet create --resource-group sle1-rg --name sle1-net --subnet-name Subnet --output table
az network server1-public-ip create --resource-group sle1-rg --name server1-sle1-PublicIP --dns-name server1-sle1-gate --allocation-method Static --output table
az network nsg create --resource-group sle1-rg --name server1-sle1-nsg --output table
az network nic create --resource-group sle1-rg --name server1-sle1-nic --vnet-name sle1-net --subnet Subnet --network-security-group server1-sle1-nsg --public-ip-address server1-sle1-PublicIP --output table
#az vm create --resource-group sle1-rg --name sle1-gate --nic sle1-nic --image CentOS --size Standard_B1s --admin-username student --admin-password PassforEducation1 --output table
az vm create --resource-group sle1-rg --name server1-sle1-gate --nic server1-sle1-nic --image "SUSE:openSUSE-Leap:15-1:2019.06.18" --size Standard_B1s --admin-username student --admin-password PassforEducatio
" open file vertically to the right
augroup netrw_mappings
autocmd!
autocmd filetype netrw call Netrw_mappings()
augroup END
function! OpenToRight()
:rightbelow vnew
:wincmd p
:normal P
endfunction
@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"
zypper in python3-kiwi git
git clone https://github.com/OSInside/kiwi-descriptions
kiwi-ng --profile Disk system build --description kiwi-descriptions/suse/x86_64/suse-leap-15.3 --target-dir /tmp/myimage
ls -lh /tmp/myimage/*.raw
cp /tmp/myimage/Leap-15.3_appliance.x86_64-1.15.3.raw /var/lib/libvirt/images/
@dmi3mis
dmi3mis / commands to build.history
Last active August 15, 2019 11:23
example of rpm build
gpg --gen-key
gpg --fingerprint
gpg -a -o ~/RPM-GPG-KEY-developer --export 3452df23
echo '%_gpg_name 3452df23' > ~/.rpmmacros
yum install rpm-build
rpmbuild test.spec
cp test.spec rpmbuild/SPECS