Skip to content

miniHOWTO: Howto to create Windows Server 2016 Recovery Disk on USB ( Installation Disk )

  1. After successfull installation of the server, put the ISO file on it.
  2. Mount the ISO file and open Terminal (cmd) and goto your mounted ISO’s letter ( example g:\ )
  3. Put your USB Flash Drive and take attention on the dedicated device letter that windows selects for the USB Flash Drive.
  4. Now , inside the mounted ISO folder do the next commands:
 diskpart
    list disk # see the listing of all disk drives windows can see
    select disk # here select the letter of your usb flash drive
    clean # clean the selected disk on previous step
    create partition primary #create primary partition for booting
    select partition=1  # select first partition of the usb drive
    active # activate your selected partition , means choose it
    format fs=ntfs quick label="YOUR_DISK_LABEL" # formats disk partition
    exit   # exits diskpart

 

Now your USB Flash Drive is ready to be populated with Windows Server boot code and the windows server installation disk files.

5. Create the Boot sector and fill it with info: ( assumes you are still in the mounted ISO folder)

cd boot  # enter into boot directory of the mounted ISO structure
bootsect.exe /nt60 e:/ ( assuming your USB FLASH DRIVE windows letter is e:/ )

That’s enough for BOOTMGR to copy the bootcode to be able to boot your windows server 2016

6. Now you copy all the rest files from the mounted ISO into the Usb Flash Drive, now we assuming that the USB Flash Driver windows letter is still e:\ , and the ISO Mounted drive is g:\

xcopy  G:\*.*  E:\ /E /H /F  # this will use xcopy command to copy all the files from g:\ to e:\ ( the mounted iso files to usb flash drive )

This is long process and ones its over, you are ready with your windows server 2016 recovery and installation usb flash drive.

 

That’s all.

 

Advertisements

HOWTO: Linux iproute2 vlan configuration a.k.a. Using ip command for managing vlans on linux

  • Create new VLAN with id 100 and interface name eth0.100 , configure it over eth0 physical link and add INET settings on it:
# ip link add link eth0 name eth0.100 type vlan id 100
# ip link set dev eth0.100 up
# ip addr add a.b.c.1/24 brd 1.b.c.255 dev eth0.100
  • Bringing Down the vlan interface (device) and permanently remove vlan tag (vlan interface)
# ip link set dev eth0.100 down
# ip link delete eth0.100

     

  • Some Informational commands:
# ip -d link show eth0.100
# ip -d addr show

 

 

Bookmarks: https://wiki.archlinux.org/index.php/VLAN

QUICK HowTo: Linux Policy Routing by ip-src

Show and/or Listing the routing tables:

 # ip rule show
 # ip rule list
 # ip route list table local
 # cat /etc/iproute2/rt_tables

Add (append) route table with index number 100 to match before table: main and table: default

# echo 100 AS207172 >> /etc/iproute2/rt_tables
 # cat /etc/iproute2/rt_tables
 # ip rule add from A.B.C.0/25 table AS207172
 # ip rule list
 # ip route add default via A.B.C.2 dev eth1.100 table AS207172
 # ip rooute flush cache
 # ip route flush cache

Ping with src IP thru the new default gateway to confirm the ip-src routing:

# ping -I A.B.C.7 dir.bg

 

Use parameters:

  • Our new source network: A.B.C.0/25
  • Our new routing table name: AS207172

FIX (SOLUTION): Default perl version during portmaster -a upgrade mishmash and error: pkg-static: perl5-x.xx.x conflicts with perl5.xx-x.xx.x (installs files into the same place). Problematic file: /usr/local/bin/perl5.xx.x

The WARNING:

===> Cleaning for perl5.24-5.24.3
##################################################
This is *NOT* the DEFAULT perl version
It will *NOT* install /usr/local/bin/perl
It will *ONLY* install /usr/local/bin/perl5.24.3
The default Perl version currently is 5.20.
If you want to use this version as the default,
stop the build now, add this line to your
/etc/make.conf, and then restart the build.

DEFAULT_VERSIONS+=perl5=5.24

############################################

The PROBLEM:

 # cd /usr/ports/lang/perl5.24
 # make reinstall

===> Installing for perl5-5.24.3
===> Registering installation for perl5-5.24.3
[hostname] Installing perl5-5.24.3…
pkg-static: perl5-5.24.3 conflicts with perl5.24-5.24.3 (installs files into the same place). Problematic file: /usr/local/bin/perl5.24.3
*** Error code 70
Stop.
make[2]: stopped in /usr/ports/lang/perl5.24
*** Error code 1
Stop.
make[1]: stopped in /usr/ports/lang/perl5.24
*** Error code 1
Stop.
make: stopped in /usr/ports/lang/perl5.24

The SOLUTION / a.k.a. SOLVED:

# pkg version|grep perl

perl5.22-5.22.4 =
perl5.24-5.24.3 ?
# pkg set -n perl5.24=perl5
pkg: Wrong format for -n. Expecting oldname:newname, got: perl5.24=perl5

# pkg set -n perl5.24:perl5
 Change name from perl5.24 to perl5 for perl5.24-5.24.3? [y/N]: y

… and then

 # portmaster -a OR just make reinstall will succeed.

QUICK: FreeBSD csh shortcut (bindkey) for Delete button

Add  bindkey to your csh rc script for the delete-char, eg this line:  bindkey “\e[3~” delete-char , in this file: ~/.cshrc

For MAC keyboards the usual kbd-combo for Delete button is: fn+Backspac

 

Here is example of .cshrc file with the Delete button binding added.

# cat .cshrc

# $FreeBSD: releng/10.2/etc/root/dot.cshrc 243893 2012-12-05 13:56:39Z eadler $
#
# .cshrc – csh resource script, read at beginning of execution by each shell
#
# see also csh(1), environ(7).
# more examples available at /usr/share/examples/csh/
#

alias h history 25
alias j jobs -l
alias la ls -aF
alias lf ls -FA
alias ll ls -lAF

# A righteous umask
umask 22

set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin)

setenv EDITOR vi
setenv PAGER more
setenv BLOCKSIZE K

if ($?prompt) then
# An interactive shell — set some stuff up
set prompt = “%N@%m:%~ %# ”
set promptchars = “%#”

set filec
set history = 1000
set savehist = (1000 merge)
set autolist = ambiguous
# Use history to aid expansion
set autoexpand
set autorehash
set mail = (/var/mail/$USER)
if ( $?tcsh ) then
bindkey “^W” backward-delete-word
bindkey “\e[3~” delete-char
bindkey -k up history-search-backward
bindkey -k down history-search-forward
endif

endif

 

QUICK: let’s encrypt cert-auto : auto generate + config + run ssl certificates for nginx and apache on Linux Only

let’s encrypt cert-auto :

auto generate + config + run ssl certificates for nginx and apache on Linux Only

 

# curl https://dl.eff.org/certbot-auto -o certbot-auto

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 57312 100 57312 0 0 10055 0 0:00:05 0:00:05 –:–:– 13684

# chmod +x certbot-auto
# ./certbot-auto

Bootstrapping dependencies for Debian-based OSes… (you can skip this with –no-bootstrap)

Enter email address (used for urgent renewal and security notices) (Enter ‘c’ to
cancel): ……..@remote-admins.com

(A)gree/(C)ancel: A


(Y)es/(N)o: N

Which names would you like to activate HTTPS for?
——————————————————————————-
1: …………….
2: …………….
3: …………….
4: tickets.remote-admins.com
——————————————————————————-

Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter ‘c’ to cancel): 3 4

Obtaining a new certificate
Performing the following challenges:
tls-sni-01 challenge for …………………
tls-sni-01 challenge for tickets.remote-admins.com
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Waiting for verification…
Cleaning up challenges….

……… some other lines of info, if interaction: read and then do

…………………………………………………………………………………………………….
Created an SSL vhost at /etc/apache2/sites-enabled/004-tickets-le-ssl.conf
Deploying Certificate for tickets.remote-admins.com to VirtualHost /etc/apache2/sites-enabled/004-tickets-le-ssl.conf

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
——————————————————————————-
1: No redirect – Make no further changes to the webserver configuration.
2: Redirect – Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you’re confident your site works on HTTPS. You can undo this
change by editing your web server’s configuration.
——————————————————————————-

Select the appropriate number [1-2] then [enter] (press ‘c’ to cancel): 2

Redirecting vhost in /etc/apache2/sites-enabled/000-default.conf to ssl vhost in /etc/apache2/sites-enabled/000-………………….-le-ssl.conf
Redirecting vhost in /etc/apache2/sites-enabled/004-tickets.conf to ssl vhost in /etc/apache2/sites-enabled/004-tickets-le-ssl.conf

——————————————————————————-
Congratulations! You have successfully enabled https://………………………….
and https://tickets.remote-admins.com

and that’s all.

Thats a cheatsheet shit, please if you  copy/paste do not flood me with questions.

If anything goes wrong  you will have to search for sysadmin

FIX: GPG error: http://www.deb-multimedia.org jessie InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 5C808C2B65558117

……on the command line:

The Reason:

 # apt-get update

The Error:

  W: GPG error: http://www.deb-multimedia.org jessie InRelease: The following signatures   couldn't be verified because the public key is not available: NO_PUBKEY  5C808C2B65558117

The Solution:

 # apt-get install deb-multimedia-keyring
 # apt-get update