Monthly Archives: June 2015

solaris 11 update

pkg update
Packages to update: 8
Create boot environment: No
Create backup boot environment: Yes
DOWNLOAD PKGS FILES XFER (MB) SPEED
Completed 8/8 52/52 3.1/3.1 319k/s

PHASE ITEMS
Removing old actions 36/36
Installing new actions 42/42
Updating modified actions 35/35
Updating package state database Done
Updating package cache 8/8
Updating image state Done
Creating fast lookup database Done
Reading search index Done
Updating search index 8/8
Updating package cache 1/1

—————————————————————————
NOTE: Please review release notes posted at:

http://www.oracle.com/pls/topic/lookup?ctx=solaris11&id=SERNS

solaris 11 enable root ssh

vi /etc/ssh/sshd_config
PermitRootLogin yes

vi /etc/default/login
#CONSOLE=/dev/console

#Remove “;type=role” from the root entry in /etc/user_attr like this:
usermod -K type=normal root

svcadm restart svc:/network/ssh:default

Now we are in:

Last login: Tue Jun 16 11:05:14 2015
Oracle Corporation SunOS 5.11 11.2 June 2014

golang change text in file

This will replace string “katinas” with “super duper”.

package main

import (
"io/ioutil"
"log"
"strings"
)

func main() {

var file string
file = "test.txt"
input, err := ioutil.ReadFile(file)
if err != nil {
log.Fatalln(err)
}

lines := strings.Split(string(input), "\n")

for i, line := range lines {
if strings.Contains(line, "katinas") {
lines[i] = "super duper"
}
}
output := strings.Join(lines, "\n")
err = ioutil.WriteFile(file, []byte(output), 0644)
if err != nil {
log.Fatalln(err)
}
}

ipmi set boot device

ipmitool -H 127.0.0.1 -U USER chassis bootdev
Password:
bootdev [clear-cmos=yes|no]
bootdev [options=help,…]
none : Do not change boot device order
pxe : Force PXE boot
disk : Force boot from default Hard-drive
safe : Force boot from default Hard-drive, request Safe Mode
diag : Force boot from Diagnostic Partition
cdrom : Force boot from CD/DVD
bios : Force boot into BIOS Setup
floppy: Force boot from Floppy/primary removable media

ipmitool -H 127.0.0.1 -U USER chassis bootdev pxe
Password:
Set Boot Device to pxe