Skip to content

Instantly share code, notes, and snippets.

@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/
@dmi3mis
dmi3mis / bind_and_others.txt
Last active June 13, 2020 10:52
Some files to work with on LL-103
[root@server0 ~]# yum install bind bind-utils -y
[root@server0 ~]# vim /etc/named.conf
:set number
11 #listen-on port 53 { ; };
12 #listen-on-v6 port 53 { ::1; };
17 #allow-query { localhost; };
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
@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|
#The is almost the same like '05 SQL Server and client, domain joined.ps1' but installs an Exchange 2013 server instead
#of a SQL Server.
#
# IMPORTANT NOTE: Make sure you have installed at least the CU KB3206632 before installing Exchange 2016, this is a requirement.
# Refer to the introduction script '11 ISO Offline Patching.ps1' for creating a new ISO that contains patches.
#
# You will need 5 files to download before start this script
# 1. AutomatedLab latest https://github.com/AutomatedLab/AutomatedLab/releases
# Download msi and just install wherever folder you like. ( C:\LabSources for example )
@dmi3mis
dmi3mis / silent_install.bat
Created September 24, 2018 08:17
Vagrant Virtualbox vbox extpack silent install
VirtualBox-5.2.18-124319-Win.exe --silent
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" extpack install --replace Oracle_VM_VirtualBox_Extension_Pack-5.2.18.vbox-extpack --accept-license=56be48f923303c8cababb0bb4c478284b688ed23f16d775d729b89a2e8e5f9eb
msiexec /qb /i vagrant_2.1.5_x86_64.msi
" 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 / 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
@dmi3mis
dmi3mis / rpm-digital-signature.sh
Created August 14, 2019 14:41 — forked from fernandoaleman/rpm-digital-signature.sh
How to sign your custom RPM package with GPG key
# How to sign your custom RPM package with GPG key
# Step: 1
# Generate gpg key pair (public key and private key)
#
# You will be prompted with a series of questions about encryption.
# Simply select the default values presented. You will also be asked
# to create a Real Name, Email Address and Comment (comment optional).
#
# If you get the following response:
@dmi3mis
dmi3mis / SCAP-CentOS-NotApplicable.md
Created April 25, 2019 07:54 — forked from gregelin/SCAP-CentOS-NotApplicable.md
Explanation of SCAP, CentOS and tests Not Applicable

This note explains the common issue of "notapplicable" results when running openSCAP and SCAP-Security-Guide on CentOS.

SCAP seems like it should be easy because it is "just XML". Then you dig into looking for a test and it gets confusing fast. So it is good to have some background.

SCAP (Security Content Automation Protocol) is actually a set of multiple standards and specifications that are used together to enable automatically testing hundreds of nerd settings. Let me emphasize that: SCAP is not a single XML specification -- SCAP is multiple standards and specs. Whenever you give "SCAP Content" to a scanner to check a system configurations you are giving the scanner multiple XML files representing multiple standards.