Sturbi's Home

  • Gallery
  • Modellflug
  • Datenschutz
  • Impressum

Blog

  • Allgemein (8)
    • Sprüche (6)
  • Computer (24)
    • Linux (16)
      • Nagios (5)
      • Nginx (4)
      • Postfix (3)
      • Subversion (1)
    • VMware (3)
    • Windows (8)
      • Powershell (7)
  • Fotografie (24)
  • Reise (7)
    • Hawaii (4)
    • Irland (1)
Wenn du etwas so machst,
wie du es seit zehn Jahren gemacht hast,
dann sind die Chancen groß,
daß du es falsch machst.

Charles F. Kettering amerikanischer Ingenieur * 29.08.1876, † 25.11.1958

E-Mail bei Powershell Script Abbruch

16. Februar 2021 by Sturbi Kategorie: Powershell

Wer Powershell Scripte über den Windows Taskplaner zur Sicherung einsetzt, möchte vielleicht auch informiert werden, wenn das Script mit einem nicht behandelten Fehler abbricht.

function Send-Mail ($message) {
    $emailSmtpServer = "smtp.domain.tld"
    $emailFrom = "taskplaner@domain.tld"
    $emailTo = "admin@domain.tld"
    $emailSubject = "Backup Script fail"

    Send-MailMessage -To $emailTo -From $emailFrom -Subject $emailSubject -Body $message -SmtpServer $emailSmtpServer
}

$ErrorActionPreference = 'stop'
trap { 
    $ErrorActionPreference = 'Continue'
    Send-Mail -message $_.Exception.Message
    break
}

# ... ab hier das eigentliche Script ...

Floppy Image aus Ordner erstellen

7. Januar 2021 by Sturbi Kategorie: Linux

Wie erstelle ich mir ein Floppy Image um Windows Treiber bei der Installation im HPE Ilo zu laden

mkdir /tmp/floppy
cd /tmp/floppy
# 75MB sollten reichen
dd if=/dev/zero of=floppy.img bs=1024 count=76800
# /dev/loop30 sollte nicht in Benutzung sein ...
losetup /dev/loop30 floppy.img
mkfs.exfat /dev/loop30
mount /dev/loop30 /mnt
cp ~/data/* /mnt/
umount /mnt
losetup -d /dev/looop30

 

Gegenlicht

25. Oktober 2020 by Sturbi Kategorie: Fotografie

1_MG_2611
1_MG_2615
1_MG_2620
1_MG_2639
1_MG_2649
1_MG_2658
1_MG_2665
1_MG_2674
1_MG_2691
1_MG_2706
1_MG_2710
1_MG_2752
1_MG_2770

Hawaii 2019 / 2020

8. Februar 2020 by Sturbi Kategorie: Fotografie, Hawaii, Reise

Hawaii-2019-20-1
Hawaii-2019-20-2
Hawaii-2019-20-3
Hawaii-2019-20-4
Hawaii-2019-20-5
Hawaii-2019-20-6
Hawaii-2019-20-7
Hawaii-2019-20-8
Hawaii-2019-20-9
Hawaii-2019-20-10
Hawaii-2019-20-11
Hawaii-2019-20-12
Hawaii-2019-20-13
Hawaii-2019-20-14
Hawaii-2019-20-15
Hawaii-2019-20-16
Hawaii-2019-20-17
Hawaii-2019-20-18
Hawaii-2019-20-19
Hawaii-2019-20-20
Hawaii-2019-20-21
Hawaii-2019-20-22
Hawaii-2019-20-23
Hawaii-2019-20-24
12...18►

Mauna Kea

2. Januar 2020 by Sturbi Kategorie: Fotografie, Hawaii, Reise

Am 28.12.2019 war es soweit. Am letzten Tag auf Big Island war die Strasse offen und das Wetter entsprechend.

Also rauf auf den Berg!

Foreman VMware Cloud-Init

9. Oktober 2019 by Sturbi Kategorie: Linux, VMware

/etc/cloud/cloud.cfg

cloud_init_modules:
 - bootcmd

cloud_config_modules:
 - runcmd

cloud_final_modules:
 - scripts-per-once
 - scripts-per-boot
 - scripts-per-instance
 - scripts-user
 - resolv-conf
 - ca-certs
 - yum-add-repo
 - write-files
 - users-groups
 - package-update-upgrade-install
 - runcmd
 - puppet
 - phone-home

system_info:
  distro: rhel
  paths:
    cloud_dir: /var/lib/cloud
    templates_dir: /etc/cloud/templates
  ssh_svcname: sshd

# vim:syntax=yaml

#cloud-config
hostname: <%= @host.name %>
fqdn: <%= @host %>
manage_etc_hosts: true
users:
  - name: root
    ssh-authorized-keys:
      - ssh-ed25519 AAAA.....Vw4L0 sturbi@sturbi.de
      - ssh-rsa AAAAB3N....ji1pU4v foreman-proxy@foreman.sturbi.de

yum_repos:
    puppet6:
        baseurl: http://yum.puppetlabs.com/puppet/el/7/x86_64/
        enabled: true
        gpgcheck: false
        name: Puppet 6

package_update: true
package_upgrade: true

packages:
    - vim
    - tmux
    - mailx

package_reboot_if_required: true

<% if @host.puppetmaster -%>

packages:
    - puppet-agent

puppet:
    conf_file: '/etc/puppetlabs/puppet/puppet.conf'
    ssl_dir: '/opt/puppetlabs/puppet/ssl/'
    conf:
        agent:
            server: "<%= @host.puppetmaster %>"
            certname: "<%= @host.name %>"
        ca_cert: |
            -------BEGIN CERTIFICATE-------
            MIICIjAN.......ZwjH8CAwEAAQ==
            -------END CERTIFICATE-------

<% end %>

phone_home:
  url: <%= foreman_url('built') %>
  post: []
  tries: 10

# Template for VMWare customization via open-vm-tools
identity:
  LinuxPrep:
    domain: <%= @host.domain %>
    hostName: <%= @host.shortname %>
    hwClockUTC: true
    timeZone: 'Europe/Berlin'

globalIPSettings:
  dnsSuffixList: [<%= @host.domain %>]
  <%- @host.interfaces.each do |interface| -%>
  <%- next unless interface.subnet -%>
  dnsServerList: [<%= interface.subnet.dns_primary %>, <%= interface.subnet.dns_secondary %>]
  <%- end -%>

nicSettingMap:
<%- @host.interfaces.each do |interface| -%>
<%- next unless interface.subnet -%>
  - adapter:
      dnsDomain: <%= interface.domain %>
      dnsServerList: [<%= interface.subnet.dns_primary %>, <%= interface.subnet.dns_secondary %>]
      gateway: [<%= interface.subnet.gateway %>]
      ip: <%= interface.ip %>
      subnetMask: <%= interface.subnet.mask %>
<%- end -%>

  • 1
  • 2
  • 3
  • …
  • 10
  • Nächste Seite »

© 2021 · Sturbi's Home