# init q
Monday, November 1, 2010
slapd and me and inittab
And sometimes, you just want to reload inittab because svscan is being a punk...
Friday, October 29, 2010
solaris 10, i don't have a dvd drive and need to upgrade you
let's just throw an iso on you and do an upgrade.
first, look for a volume that has sufficient space for that 2G dvd iso. then scp it over. tmp is a good place. so, i put my iso in tmp.
# mount -F hsfs -o ro `lofiadm -a /tmp/sol-10-u8-ga-x86-dvd.iso` /mnt
# /mnt/installer
that's it.
first, look for a volume that has sufficient space for that 2G dvd iso. then scp it over. tmp is a good place. so, i put my iso in tmp.
# mount -F hsfs -o ro `lofiadm -a /tmp/sol-10-u8-ga-x86-dvd.iso` /mnt
# /mnt/installer
that's it.
Wednesday, October 13, 2010
paid three times this month?
well. maybe i will. i get paid every other friday, and since this month has five fridays....
here's how to determine all the other months with five fridays for the next 20years, (ba)shilifically:
here's how to determine all the other months with five fridays for the next 20years, (ba)shilifically:
#!/bin/sh
year=2010
month=1
x=1
while [ $x -le 20 ]
do
until [ $month -gt 12 ]
do
cal=`cal $month $year | grep ^31`
if [ -z "$cal" ]
then
echo -n ""
else
echo
cal $month $year
fi
month=`expr $month + 1`
done
month=1
year=`expr $year + 1`
x=$(( $x + 1 ))
done
Tuesday, September 7, 2010
rhel & changing network settings
I am not fond of GUIs and enjoy editing configuration files by hand; sure it can be dangerous if you don't know what you're doing - but if you do and don't like GUIs mangling stuff, hand confs are the way to go. Here's how to change RHEL's network conf files - notice the differences between RedHat and Ubuntu.
Edit configuration files stored in /etc/sysconfig/network-scripts/ , /etc/sysconfig & /etc First, edit network interface card files: * /etc/sysconfig/network-scripts/ifcfg-eth0 * /etc/sysconfig/network-scripts/ifcfg-eth1 &c. ## Intel Corporation 82573E Gigabit Ethernet Controller (Copper) DEVICE=eth0 BOOTPROTO=static DHCPCLASS= HWADDR=00:30:48:56:A6:2E IPADDR=192.168.10.3 NETMASK=255.255.255.192 ONBOOT=yes Edit the file which contains gatway and hostname: * /etc/sysconfig/network ## network NETWORKING=yes HOSTNAME=super.silly.domain.com GATEWAY=192.168.10.1 Edit DNS server configuration file: * /etc/resolv.conf file: ## resolv.conf search domain.com silly.domain.com nameserver 192.168.10.1 nameserver 192.168.10.2 domain domain.com Restart networking: # /etc/init.d/network restart Do a couple tests: $ ping 192.168.10.1 Output: PING 192.168.10.1 (192.168.10.1) 56(84) bytes of data. 64 bytes from 192.168.10.1: icmp_seq=1 ttl=251 time=0.972 ms 64 bytes from 192.168.10.1: icmp_seq=2 ttl=251 time=1.11 ms You can also check for Internet connectivity with nslookup or host command: $ nslookup not.silly.domain.com Output: Server: 192.168.10.1 Address: 192.168.10.1#53 Non-authoritative answer: Name: not.silly.domain.com Address:192.168.10.4
Wednesday, September 1, 2010
special crontab entries
I have a file I need to change perms on every time my system reboots - just because. While looking for a better way of checking the file's perms through as opposed to doing a perpetual scheduled "for and if" loop, I came across a neat cron (5) stub I'd really never noticed before:
Cool. Now all I need to do is have my script run on reboot (well, when cron restarts, but still).
Instead of the first five fields, one of eight special strings may
appear:
string meaning
------ -------
@reboot Run once, at startup.
@yearly Run once a year, "0 0 1 1 *".
@annually (same as @yearly)
@monthly Run once a month, "0 0 1 * *".
@weekly Run once a week, "0 0 * * 0".
@daily Run once a day, "0 0 * * *".
@midnight (same as @daily)
@hourly Run once an hour, "0 * * * *".
Cool. Now all I need to do is have my script run on reboot (well, when cron restarts, but still).
Thursday, August 26, 2010
solaris10 your environment is gone. say what?
What do you do if someone decides to run crle and boofs your Solaris system's runtime environment?
Easy!
First, here's a nice write up of crle...
Here's the fix:
Easy!
First, here's a nice write up of crle...
To configure runtime linking environment in Sun Solaris: # crle [-64] [-a name] [-c conf] [-e env] [-E env] [-f flags] [-i name] [-I name] [-g name] [-G name] [-l dir] [-o dir] [-s dir] [-t [ ELF | AOUT] ] [-u] [-v] Example to update a new default search path for ELF objects: # crle -u -l /local/lib Example to create a new default search path and new trusted directory for ELF objects: # crle -l /local/lib -l /usr/lib -s /local/lib Example to display search path: # crle Example of creation of a directory cache for ELF objects: # crle -i /usr/dt/lib -i /usr/openwin/lib -i /usr/lib -c config Example for creation of an alternative object cache for an ELF executable: # crle -c /local/$HOST/.xterm/ld.config.xterm -f RTLD_REL_ALL -G /usr/openwin/bin/xterm # ln -s /local/$HOST/.xterm/xterm /local/$HOST/xterm # ldd /usr/local/$HOST/xterm Example for setting replaceable and permanent environment variables: # crle -e LD_LIBRARY_PATH=/local/lib -E LD_PRELOAD=preload.so.1
Here's the fix:
* Boot into Single User Maintenance Mode off of the install media. * cd into /var/ld * remove ld.config * Once the system is live, advise someone to update crle (crle -u -l) and not create a brand new link (crle -l)
solaris8 & 10 emergency repair
Solaris8 SPARC/x86 booting system for emergency mode (via install CD media)
Solaris10 SPARC/x86 booting system for emergency mode (via install CD media)
* Boot from Solaris8 Install CD #1 * At Solaris Device Configuration Assistant, Press F2 key * Press ENTER key twice * At 'Identified Devices' screen, Press F2 key * At 'Boot Solaris' screen, select CD to boot system System will now ask about "Select the type of Installation" type argument b –s and press Enter key to boot system into 'Single User Maintenance Mode'. Do the following: # TERM=ansi ---> VT100 is not your friend # export TERM # mount /dev/dsk/c0t1d0s0 /a # cd /a Do stuff and then get out. # cd / # umount /a # init 6
Solaris10 SPARC/x86 booting system for emergency mode (via install CD media)
* Get to an OpenPROM prompt (Stop-A is a good means of getting there) and then... ok> boot cdrom -s The system should boot into single user mode. To work on the filesystem or do other emergency tasks, mount the system drive. Sometimes, if the system has jackrabbitted, you'll need to first fsck the disk prior to mounting. # TERM=vt100 # export TERM # fsck -y /dev/dsk/c0t1d0s0 # mount /dev/dsk/c0t1d0s0 /a # cd /a Do stuff and then get out. # cd / # umount /a # init 6
Subscribe to:
Posts (Atom)