Kalle Hoffman
/photo_album/A_Day_in_the_Life/Laguna_Street_At_Night/pic_9046.jpg

Work
Resume
Notes

Fun Stuff
Indian Chief Projects
SFMC
Photography
Snowcamping
Saunas (FAQ)

Miscellaneous
Blog
Contact Me

     
Kalle Hoffman's Engineering Notes
 

$Revision: 1.68 $

Ok, I'm sick and tired of looking up these questions in my engineering notebook over and over so I have put them on the web. Now I don't need to search for them anymore and maybe they'll be useful to you too. If these notes are outdated or if you have notes you'll like to contribute feel free to contact me.


Table Of Contents



What are the most useful kubernetes command
Mon Jan 9 11:42:44 PST 2023

https://kubernetes.io/docs/reference/kubectl/cheatsheet/

    kubectl config get-contexts -o name list display list of contexts
    kubectl config use-context <context> set the default context to <context>
    kubectl -n <namespace> get pods List all pods in <namespace>
    kubectl -n <namespace> exec <container> -it -- bash start a shell in a container
    kubectl -n <namespace> logs <pod> <container> --since=24h show the last 24 hours of logs.

How do I set up 2-factor auth on laptop so I don't need to use my smartphone?
Fri Jul 29 15:52:40 PDT 2022

Companies are now moving to 2-factor authentication and expecting employees and contractors to store a secret on your phone and use an app like Google Authenticator on thier person devices for work purposes, generally referred to Bring Your Own Device. If you prefer not to use your personal device for work, you can use an app of your choice on the computer the company provided so long as it supports TOTP.

 
KeePassXC
• Install KeePassXC on your computer.
• In the app that requires 2-factor authentication select "Google Authenticator" in "Extra Verifcation".
• When prompted to scan the QR code select "Can't Scan".
• Decode the QR code. I used the camera app on my phone. You should get something like "otpauth://totp/FOO.BAR.com:USERNAME?secret=XXXXXXXXXXXXXXXX&issuer=FOO.BAR.com"
• In KeePassXC create a new entry with Username and Password.
• Under Advance "Additional Attributes" add "opt" and "otpauth://totp/FOO.BAR.com:USERNAME?secret=XXXXXXXXXXXXXXXX&issuer=FOO.BAR.com"
• Save/Ok 
• Right click on the entry -> TOTP -> Copy TOTP
• Paste as needed.  

What are some useful postgress commands?
Mon Jul 25 13:10:31 PDT 2022

    psql -h host -d database -U user -W Connect to a database that resides on another host
    \dt List all Tables
    \d table Describe a Table

What are some useful minikube and kubctl (kubernetes) commands?
Thu May 12 18:05:16 PDT 2022

    minikube delete --all --purge
    minikube start
    minikube dashboard
    minikube version
    kubectl version
    kubectl run my-nginx --image nginx
    kubectl get pods
    kubectl get all
    kubectl delete my-nginx
    kubectl logs my-nginx --follow -tail 1
    kubectl describe pod/my-apache

How do I examine a webservers Certificate Information?
Wed Feb 23 10:57:42 PST 2022

    # echo | openssl s_client -connect google.com:443 2>/dev/null | openssl x509 -noout -text

What are the most useful docker command
Fri Jan 7 10:42:32 PST 2022

    docker ps -aq all containers IDs
    docker ps -a --format "table {{.ID}}\t{{.Names}}\t{{.Status}}" all containers in a readable format
    docker stop $(docker ps -aq) stop all containers
    docker rm $(docker ps -aq) clean up all containers
    docker rmi $(docker images -qq) clean up images
    docker exec -ti bash start a bash session on the container

How do I copy a string to the clipboard on a mac (Darwin 18.6)
Mon Aug 5 10:14:19 PDT 2019

     # echo 'Kalle Hoffman' |
    pbcopy 

In git how do I create a new branch from develop?
Mon Aug 5 10:01:33 PDT 2019

     # git checkout develop #
    git pull # git checkout -b BRANCH # git push --set-upstream origin
    BRANCH 

In a git branch how do "rebase" to the develop branch?
Mon Aug 5 09:57:21 PDT 2019

    # BRANCH=`git rev-parse --abbrev-ref HEAD` 
    # git checkout -q develop 
    # git pull -q
    # git checkout -q $BRANCH 
    # git pull -q 
    # git merge -q develop 
    # git status -s 
    # git push -q 
    

In a git branch how do I combine commits (squash) to a single commit?
Thu Mar 29 13:17:45 PDT 2018

    # BRANCH=`git rev-parse --abbrev-ref HEAD` 
    # git checkout master 
    # git pull 
    # git checkout <branch name> 
    # git rebase -i master 
    # git push --force origin <branch name> 
    

What are the most useful git command
Wed Feb 24 15:00:34 PST 2016

    git clone user@repo check out a repo
    git add .
    git commit .
    git push
    push your change back to the repo
    rm FILENAME
    git checkout FILENAME
    revert the content of a file
    git checkout -b <branch name>
    git push origin <branch name>
    Create a new branch
    git checkout <branch name> Switch to another branch
    git branch --list List all branches
    git rev-parse --abbrev-ref HEAD get current branch

How do I share a Linux screen session?
Tue Dec 17 17:43:56 PST 2013

     session1# chmod 777 `tty` session1# sudo su -
    user session1# screen
    
    session2# sudo su - user
    session2# screen -ls
              There is a screen on:
                      19787.ttyp6.deeptht     (Attached)
              1 Socket in /tmp/screens/S-kalle/.
    session2# screen -x
    

What are the most useful rpm command
Fri Feb 18 13:44:06 PST 2011

    rpm -qa list installed rpms
    rpm -qlp file list the files in an rpm
    rpm -qRp file list an rpm dependencies
    rpm -qlp file list the files in an rpm
    rpm -qip file report the rpm info
    rpm -qf  file report the rpm that owns a file
    rpm -i   file install an rpm

Where can I download putty?
Wed Mar 11 17:57:20 PDT 2009


How do connect to a server via ssh without typing a password. (useful for rsync and cvs)
Fri Jul 28 12:04:02 2000

    If you are going to run cvs on a machine other than the server, you'll need to configure ssh. The following will allow you to run remote commands on a client without being prompted for a password. When prompted for a key from ssh-keygen just hit enter. Execute the following commands on the server and client in your home directory:
    server# mkdir $HOME/.ssh
    server# chmod 755 $HOME $HOME/.ssh
    server# ssh-keygen -t dsa
    server# mv $HOME/.ssh/id_dsa.pub $HOME/.ssh/authorized_keys
    server# chmod 644 $HOME/.ssh/authorized_keys
    server# scp -r $HOME/.ssh client:.
    server# ssh client chmod 755 . .ssh
    

How do I set up more then one machine to an adsl connection. How do I set up a gateway at home with an old 486 pc and Red Hat Linux 5.2.
Fri Aug 6 13:10:39 1999

    With DSL being so cheap ($50/month), my housemates and myself decided to drop our dial up isps and get a dsl line. Since we only get one IP address at this rate we set up an old 486/66, 16 mb memory and a 400 mb hard drive to act as a firewall at our place. There are tons of referances on the web, Here's a few you can read:


    Here's what I did:
    • I sent email to a list of friends and asked them to give me an old computer.
        Subject: computer, paper weight, door stopper
        To: <list of friends>
        Date: Fri, 9 Jul 1999 11:50:34 -0700 (PDT)
        From: Kalle Hoffman 
        
        Do you have an old pc I can have? I need to set up a gateway at my
        place. I'm willing to fill in the blanks or buy stuff to bring it up to
        what I need.
        
                i386+ Intel architecture
                16+ mb memory
                400+ mb hard drive
                2 ethernet cards 10 based t
                keyboard
        
        Kalle
        
        
    • After getting a free 486 from my friend I opened up the box and figured out what hardware the box had and made the following table.
        unit            irq     addr    dma
        ====            ===     ====    ===
        vga             2
        tty01 (com2)    3       2f8
        ethr0           3       300
        tty00 (com1)    4       3f8
        lpt1            5       378
        floppy          6       3f2-3f7 2
        _______         7
        smc/wdn         9       240-25f
        _______         8
        ethr1           10      2c0
        audio           11      344
        ps2_mouse       12   
        fpu             13
        ide             14      1f0-1f7
        _______         15
        lpt2                    278
        
    • I checked the Redhat Linux 5.2 hardware compatibility list and took out everything that wasn't on the list.
    • I bought two ne2000 compatible 10 based t ethernet cards ($7 each) and installed them using addr=0x300 irq=3 on the first and addr=0x2c0 irq=10 on the second. Pac bell will give a ethernet card but it may not be compatible with linux. I found it was easier to just buy two I knew were compatible. The ethernet cards I bought are plug and play but my pc wasn't so I had to use the dos utilities that came with the cards to change the settings on the second card. Since I was using two of the same cards I only had one installed when I ran the utility.
    • Then I installed Redhat Linux 5.2 on the box. When I was asked what packages to install i selected "everything".
    • After installing Linux I logged on as root and configured the ethernet cards by creating the following files.

        /etc/conf.modules
          alias eth0 ne 
          alias eth1 ne
          options ne io=0x300,0x2C0
          
        /etc/sysconfig/network-scripts/ifcfg-eth0
          DEVICE="eth0"
          IPADDR="63.193.123.42"
          NETMASK="255.255.255.0"
          NETWORK=63.193.123.0
          BROADCAST=63.193.123.255
          ONBOOT="yes"
          
        /etc/sysconfig/network-scripts/ifcfg-eth1
          DEVICE=eth1
          IPADDR=192.168.90.1
          NETMASK=255.255.255.0
          NETWORK=192.168.90.0
          BROADCAST=192.168.90.255
          GATEWAY=63.193.123.42
          ONBOOT=yes
          
    • Then I set up the name server by adding the following to /etc/named.conf and creating /var/named/fiftynine.com.

        /etc/named.conf
          zone "fiftynine.com" {
          	type master;
          	file "named.fiftynine.com";
          };
          
        /var/named/named.fiftynine.com
          @       IN      SOA     oak.fiftynine.com. (
                                  199802151       
                                  8H              
                                  2H              
                                  1W              
                                  1D )            
          
                          TXT     "fiftynine.com"
                          NS      63.193.123.42.              
                          NS      oak.fiftynine.com.
                          MX      10 mail         
          
          localhost       A       127.0.0.1
          
          oak             A       63.193.123.42
                          MX      10
          
          mail            CNAME   oak
          www             CNAME   oak
          mail            CNAME   oak
          ftp             CNAME   oak
          
          ;
          ; local network
          ;
          oak-local       A       192.168.90.1    
          fell            A       192.168.90.2    
          page            A       192.168.90.3    
          
    • Finally RedHat 5.2 comes with ip forwarding turn off. I added the following to my /etc/rc.d/rc.local to turn on masquerading and ip forwarding.

        /etc/rc.d/rc.local
          # enable ip forwarding
          echo 1 > /proc/sys/net/ipv4/ip_forward
          
          # enable 
          /sbin/depmod -a
          /sbin/modprobe ip_masq_ftp
          /sbin/modprobe ip_masq_raudio
          /sbin/modprobe ip_masq_irc
          /sbin/modprobe ip_masq_quake
          
          # Permit IP masquerading for the 192.168.90.-192.168.90.24 network
          /sbin/ipfwadm -F -p deny 
          /sbin/ipfwadm -F -a m -S 192.168.90.0/24 -D 0.0.0.0/0 -W eth0
          
    • As for the network inside our house I bought a 10 base t 8 port hub ($55), 250 feet of cat5 cable, rj-45 crimper, and a bunch of rj-45 ends.

      • Here's the topology of my network.
                    ________
                   /        \
                  | PAC BELL |
                   \________/
                       |                              +---------------+
                       |                  +-----------| (192.168.1.8) |
              +------------------+        |           +---------------+
              | adsl cable modem |        |
              +------------------+        |           +---------------+
                       |                  |+----------| (192.168.1.7) |
                       |                  ||          +---------------+
          +----------------------------+  ||
          |   oak     (63.193.123.42)  |  ||          +---------------+
          +----------------------------+  ||+---------| (192.168.1.6) |
          |                            |  |||         +---------------+
          |            CPU             |  |||     
          |                            |  |||         +---------------+
          +----------------------------+  |||+--------| (192.168.1.5) |
          |   oak-local(192.168.90.1)  |  ||||        +---------------+
          +----------------------------+  ||||     
                       |                  ||||        +---------------+
             +-----+   |                  ||||+-------| (192.168.1.4) |
             |     |---+                  |||||       +---------------+
             |     |----------------------+||||   
             |     |-----------------------+|||       +---------------+
             |     |------------------------+||+------| (192.168.1.3) |
             | hub |-------------------------+||      +---------------+
             |     |--------------------------+|            
             |     |---------------------------+      +---------------+
             |     |----------------------------------| (192.168.1.2) |
             +-----+                                  +---------------+
          
      • Here's the order of the wires when they go into the rj-45 plug. Only four wires are actually used.
          white/orange
          orange
          white/green
          blue
          white/blue
          green
          white/brown
          brown
          
    • Next I configured all of the machines on my local network.
        Domain Name:	fiftynine.com
        Gateway:	192.168.90.1
        DNS server:	192.168.90.1
        Net mask:	255.255.255.0
        
        Ip Addresses:	192.168.90.2
        		192.168.90.3
        		192.168.90.4
        		192.168.90.5
        		192.168.90.6
        		192.168.90.7
        		192.168.90.8
        
    • Lastly I rebooted my box and started surfing. Thats it!

How do I clone an OS disk on Solaris?
Mon Sep 22 20:26:30 1997

    Hey Kalle,

    Here's disk cloning in a nuthsell. I normally use it when I want to clone an OS disk, to save me the labor of patching it. If you're not going to boot off it, you can skip the installboot command. Of course, you'll want both drives on the same machine with different SCSI IDs. Copying the disk the system is booted off of is no problem. The relative drive sizes aren't that important, as long as the destination drive can hold all the data on the source. For example, if you have 200M of data on a 4.3G drive, it'll safely clone to a 480M drive.

    First, format the drive as necessary. So, put /, swap, backup and /usr partitions on t1. Write the lables to thie disk, and newfs the data partitions (/ and /usr here). If the partitions are over 1G, you might want to change the minfree of the newfs. I think keeping over 100M free on a drive is silly. it's the -m option of newfs, which defaults to 10.

    For this example, I'm going to clone a boot disk on c0t3d0s0 with a /usr partition on c0t3d0s6 onto the disk on c0t1d0s*.
      # newfs /dev/rdsk/c0t1d0s0 -m 5
      # newfs /dev/rdsk/c0t1d0s6
      
    Now, mount the destination partition
      # mount /dev/dsk/c0t1d0s0 /mnt
      
    Get creative with ufsdump/restore
      # ufsdump 0f - /dev/rdsk/c0t3d0s0 | (cd /mnt;ufsrestore rf -)
      
    Make the new root disk bootable
      # installboot /usr/platform/`uname -m`/lib/fs/ufs/bootblk /dev/rdsk/c0t1d0s0
      
    Repeat for different partitions
      # mount/dev/dsk/c0t1d0s6 /mnt/usr
      # ufsdump 0f /dev/rdsk/c0t3d0s6 | (cd /mnt/usr;ufsrestore rf -)
      
    You can see this would lend itself to scripting. It's also fairly easy to clone one disk onto several targets. It's not fast, it's not normally pretty, but when you don't want to send disgusting amounts of data over a network, it's useful. If you want to go from a drive with few partitions (say, / and swap) to a same-size or smaller disk with many partitions, this process will sometimes overfill the / partition. Extensive taring can get around that. Most people move to bigger disks anyway.

    Enjoy!

    Sam Rafter

How do I configure sendmail to add my domain to my return add ress Solaris 2.5.1?
Fri Sep 19 13:48:47 1997

    Lots of questions are answered in the Sendmail FAQ. One way to solve this problem is to copy /etc/mail/subsidiary.cf to /etc/mail/sendmail.cf and then make the following changes to /etc/mail/sendmail.cf.
    NOTE: the whitespace in the rule set MUST be tabs.
      S11
      R$*<@$+>$*	$@$1<@$2>$3		already ok
      R$=D		$@$1<@$w>		tack on my hostname
      R$+		$@$1<@kalle.com>	tack on my domain
      

How do I set up majordomo on Solaris 2.5.1?
Thu Sep 4 15:21:48 1997

    The majordomo FAQ is a good place to start. You'll need a C compiler and perl on the system your installing majordomo on. Then get sources for majordomo and put them in /tmp.


    Majordomo comes with rather extensive INSTALL and NEWLIST files. You should read these files completely. Then run the following commands as root:
      # useradd -c "majordomo" -d /usr/local/majordomo -g 12 \
      	-m -u 100 -s /usr/bin/csh majordomo
      # passwd majordomo
      
    Run the following commands to extract the majordomo source a the majordomo user.
      % cd /tmp
      % gunzip -c majordomo-1.94.4.tar.gz | tar -xvf -
      % cd majordomo-1.94.4
      
    Modify the following macros in /tmp/majordomo-1.94.4/Makefile:
      PERL = /opt/LWperl/bin/perl
      CC = /opt/SUNWspro/SC4.0/bin/cc
      W_HOME = /usr/local/majordomo
      W_USER = 100
      W_GROUP = 12
      
    Run the following commands as the majordomo user to install the majordomo software.
      % cd /tmp/majordomo-1.94.4
      % /usr/ccs/bin/make wrapper
      % /usr/ccs/bin/make install
      % su root -c "/usr/ccs/bin/make install-wrapper"
      % cd /usr/local/majordomo
      % cp sample.cf majordomo.cf
      
    Modify the following variables in /usr/local/majordomo/majordomo.cf:
      $whereami = "kalle.com";
      $homedir = "/usr/local/majordomo";
      
    Add the following lines to /etc/aliases:
      # majordomo mail aliases
      majordomo:          "|/usr/local/majordomo/wrapper majordomo"
      owner-majordomo:    kalle@kalle.com
      majordomo-owner:    kalle@kalle.com
      test-list:          :include:/usr/local/majordomo/lists/test
      owner-test:         kalle@kalle.com
      test-owner:         kalle@kalle.com
      test-request:       "|/usr/local/majordomo/wrapper majordomo -l test"
      test-approval:      kalle@kalle.com
      
    Run the following configuration test script as a regular, unprivileged user (not the majordomo user or root).
      % cd /usr/local/majordomo
      % ./wrapper config-test
      
    Run the following commands as majordomo to create a test list. The info file should have some useful information for the first time user of the list.
      % touch /usr/local/majordomo/lists/test
      % touch /usr/local/majordomo/lists/test.info
      % chmod 664 /usr/local/majordomo/lists/*
      
    Test the configuration:
      % echo 'lists' | mail majordomo
      

How do I set up the automounter on Solaris 2.5?
Mon Aug 11 14:22:12 1997

    You'll need to add the file /etc/auto_direct and update /etc/auto_master and /etc/auto_home. Sam Rafter comments that you'd prob'ly want to mount the directorys soft, or mount it with a low number of retries. If you mount it hard, and the system can't be reached, the machine won't finish loading the OS.
    Here's an example of the configuration files I've used in the past:

      /etc/auto_direct
        /home1 rw,soft abbott:/export/home1
        
      /etc/auto_home
        +auto_home
        kalle   abbott:/export/home/&
        
      /etc/auto_master
        +auto_master
        /net            -hosts          -nosuid
        /home           auto_home
        /xfn            -xfn
        /-              auto_direct
        
    Once the system files are set up restart the automounter with the following commands:
      # /etc/rc2.d/S74autofs stop
      # /etc/rc2.d/S74autofs start
      

What does big-endian and little-endian mean?
Thu Aug 7 16:23:32 1997

    The terms big-endian and little -endian come from Swift's `Gulliver's Travels' where big-endian refered to opening an egg at the big end and little-endian refered to opening an egg at the little end. The "endianness" of a computer's CPU is determined by how multi-byte data structures are stored. The paper by Danny Cohen that popularized these terms in connection with the LSB-first/MSB-first controversy was entitled "On oly Wars and a Plea for Peace".

    Here's a table to help you determine the endianness of your system.

    CPU Endianness
    Sparcbig
    Intellittle
    Motorolabig
    IBMbig
    MIPSlittle/big

    Here's a simple runtime check for endianness of your machine.
      is_little_endian()
      {
              int i=0;
      
              ((char *)(&i))[0] = 1;
              return i == 1;
      }
      
    Here's the source to a generic endian swapper.
      #define ENDIAN_SWAP(a)  endian_swap(&(a), sizeof(a))
      void
      endian_swap(void *v, int size)
      {
              int i;
              unsigned char *p = (unsigned char *) v, q;
       
              for(i=0; i<size/2; i++) {
                      q = p[i];
                      p[i] = p[(size-1)-i];
                      p[(size-1)-i] = q;
              }
      }
      

What is a simple program to controls screen movements?
Aug 1 11:15:14 1997

    The curses library routines give the user a terminal-independent method of updating character screens with reasonable optimization. Here's a trivial example of a C program that uses the curses library.
      % cc -o test test.c -lcurses -ltermcap
      % cat test.c
      /*******************************************************************
      *** test: Uses the curses library to move a curser on the screen.
      ***       Kalle Hoffman
      ***       (831) 458-0685
      ***       Aug  1 11:15:14 1997
      ***       www.kalle.com
      ***       kalle@kalle.com
      *******************************************************************/
       
      #include <curses.h>
       
      main() {
              int col=0, line=0, c=0;
       
              initscr(); cbreak(); noecho();  /* init curses and screen */
       
              do {
                      mvprintw(line, col, "     "); /* clear old curser */
                      switch (c) {
                              case 'k': line--; break;            /* up */
                              case 'j': line++; break;          /* down */
                              case 'h': col--; break;           /* left */
                              case 'l': col++; break;          /* right */
                      }
                      mvprintw(line, col, "%02d,%02d", line, col);
                      refresh();
              } while ((c=getch()) != 'q');
       
              move(LINES-1, 0);    /* leave curser in lower left corner */
              refresh();
              endwin();
              return 0;
      }
      

How do I copy a directory while preserving links, owner id, group id and timestamps?
Mon Jul 7 12:04:42 1997

    The GNU copy command (cp) supports the -a (archive) option which preserves as much as possible of the structure and attributes of the original files in the copy. This includes: copying symbolic links as symbolic links rather than copying the files that they point to, preserving hard link relationships between source files in the copies, preserving the original files' owner, group, permissions, and timestamps, and copying directories recursively (copying all nondirectories as if they were regular files).
      % cp -a SRC_DIR DEST_DIR
      
    The Solaris 2.5 copy command (cp) supports the -p option which preserves the owner id and group id, permissions modes, modification, access time, and ACLs if applicable. WARNING: This command won't copy links as links it copies the information the link points to.
      % cp -rp SRC_DIR DEST_DIR
      
    Another way to preserve file information and soft links when copying is by using tar.
      % mkdir DEST_DIR
      % cd SRC_DIR
      % tar -cf - . | ( cd DEST_DIR; tar -xvf - )
      
    I have written a shell script (tarcp.sh) that acts like cp but uses tar to copy directories. You can get a copy at: ftp://ftp.kalle.com/pub/tarcp.sh

How do I pass a variable number of arguments in c?
Wed Jul 2 18:43:23 1997

    #include <stdio.h>
    #include <stdarg.h>
     
    void
    my_printf(char *format, ...)
    {
            va_list ap;
            va_start(ap, format);
            vprintf(format, ap);
            va_end(ap);
    }
    

How do I add swap space (increase /tmp) on Solaris 2.5.1?
Wed Jul 2 18:13:04 1997

    First you'll need to allocate disk space (200 megabytes) on a local disk (/export/home) and create a swap file (/export/home/SWAP).
      # mkfile 200m /export/home/SWAP
      
    Then tell the memory manager about the new swap space.
      # swap -a /export/home/SWAP
      
    Last so the new swap space will be used the next time the system is rebooted update /etc/vfstab. Make sure the new swap entry comes after the disk it's allocated on.
      /etc/vfstab
        #device           device             mount         FS    fsck  mount    mount
        #to mount         to fsck            point         type  pass  at boot  options
        #========         =======           ======         ====  ====  =======  =======
        fd                -                  /dev/fd       fd     -    no       -
        /proc             -                  /proc         proc   -    no       -
        /dev/dsk/c1d0s1   -                  -             swap   -    no       -
        /dev/dsk/c1d0s0   /dev/rdsk/c1d0s0   /             ufs    1    no       -
        /dev/dsk/c1d0s6   /dev/rdsk/c1d0s6   /usr          ufs    1    no       -
        /dev/dsk/c1d0s7   /dev/rdsk/c1d0s7   /export/home  ufs    2    yes      -
        swap              -                  /tmp          tmpfs  -    yes      -
        /export/home/SWAP -                  -             swap   -    no       -
        

Where are the most useful search engines on the net?
Thu Jun 5 10:35:25 1997


Where can I get precompiled utilities like gcc, tcsh, and elm for Solaris 2.5 sparc and x86?
Thu Apr 22 15:22:38 1999


How do I get a Solaris 2.5.1 box to revert to a "blank" system?
Thu Jun 5 10:16:17 1997

    The way you can make a machine not have a name or know about other systems or networks is with sys-unconfig. Sam Rafter adds that a problem with sys-unconfig is that it removes the root password and if the machine was built from a server (as opposed to CDROM), it doesn't unconfig properly.
      # sys-unconfig
      

How do I configure a Solaris 2.5.1 box to talk to a network?
Thu Jun 5 10:36:41 1997

    First see blanking your system. Then you'll need to put the IP address of your systems default router or Gateway in /etc/defaultrouter. Put the domain name and DSN name servers IP address in /etc/resolv.conf. And you'll need to add dns to the hosts line of /etc/nsswitch.conf. Here's an example of files on a solaris 2.5.1 x86 box on a network of NT machines.
      /etc/defaultrouter
        192.122.209.42
        
      /etc/resolv.conf
        domain kalle.com
        nameserver 192.122.209.43
        nameserver 192.122.209.44
        
      /etc/nsswitch.conf
        passwd:         files
        group:          files
        hosts:          dns files
        networks:       files
        protocols:      files
        rpc:            files
        ethers:         files
        netmasks:       files	
        bootparams:     files
        publickey:      files
        netgroup:       files
        automount:      files
        aliases:        files
        services:       files
        sendmailvars:   files
        

How do I set up a trash directory so I can unremove files on UNIX using csh?
Thu Jun 5 10:56:58 1997

    Set up these aliases in your .cshrc and do the mkdir once.
      % mkdir ~/.trash
      % alias urm   "mv ~/.trash/\!* ."
      % alias rm    "mv -f \!* ~/.trash"
      % alias check "ls ~/.trash; du -s ~/.trash"
      % alias empty "/bin/rm -fr ~/.trash/{,.}*"
      

What can't I ftp to a Solaris 2.5.1 box when my login shell is tcsh?
Thu Jun 5 11:11:56 1997

    The solaris ftp daemon (in.ftpd) authenticates users according to the following rules:
    • The user name must be in the password data base, /etc/passwd.
    • The user name must have a password that is not null.
    • If the user name appears in the file /etc/ftpusers, ftp access is denied.
    • Ftp access is denied if the user's shell (from /etc/passwd) is not listed in the file /etc/shells. If the file /etc/shells does not exist, then the user's shell must be one of the following:
        /usr/bin/sh  /usr/bin/csh /usr/bin/ksh /usr/bin/jsh
        /bin/sh      /bin/csh     /bin/ksh     /bin/jsh
        /sbin/sh     /sbin/jsh
        
    • If the user name is "anonymous" or "ftp", an entry for the user name ftp must be present in the password and shadow files. The user is then allowed to log in by specifying any password

How do I get a new disk formatted, mounted, and exported on a Solaris 2.5.1 box?
Thu Jun 5 11:19:04 1997

    Turn your machine off and install the disk. In order to get Solaris to reconfigure your new hardware configuration you'll need to boot Solaris with the reconfigure option at the boot prompt. Some people like to do this operation in single user mode, you can do this by using the -s option.
      # b -r
      
    When the machine boots login as root and run the format command to partition the new device.
      # /etc/format
      format> fdisk
      format> label
      format> partition
      format> quit
      
    Now run newfs on the raw device. Here's an example of a disk on scsi controller 0, target 1, slice 0.
      # /usr/sbin/newfs /dev/dsk/c0t1d0s0
      
    Now edit the /etc/vfstab file so that the device will mount at boot time.
      /etc/vfstab
        #device           device             mount         FS    fsck  mount    mount
        #to mount         to fsck            point         type  pass  at boot  options
        #========         =======           ======         ====  ====  =======  =======
        fd                -                  /dev/fd       fd     -    no       -
        /proc             -                  /proc         proc   -    no       -
        /dev/dsk/c1d0s1   -                  -             swap   -    no       -
        /dev/dsk/c1d0s0   /dev/rdsk/c1d0s0   /             ufs    1    no       -
        /dev/dsk/c1d0s6   /dev/rdsk/c1d0s6   /usr          ufs    1    no       -
        /dev/dsk/c1d0s7   /dev/rdsk/c1d0s7   /export/home  ufs    2    yes      -
        swap              -                  /tmp          tmpfs  -    yes      -
        /dev/dsk/c0t1d0s0 /dev/rdsk/c0t1d0s0 /export/home1 ufs    2    yes      -
        
    If you want the device exported put the following in the dfstab file.
      /etc/dfs/dfstab
        share -F nfs /export/home1
        
    Now reboot the machine and the device will be mounted when you login.
      # sync; sync; sync;
      # reboot
      

How do I share file systems without rebooting on Solaris 2.5?
Tue Feb 27 16:44:26 1996

    It turns out that if /etc/dfs/dfstab is empty, nfsd and mountd are not started at boot time, so any share commands will not take effect. If you want to access files from a system that is not currently exporting any filesystems, you will have to explicitly start the nfs and mount daemons. Then the share command will make /export/home available for mounting by other machines.
      # /usr/lib/nfs/nfsd -a 16
      # /usr/lib/nfs/mountd
      # share -F nfs /export/home
      

Copyright © 1995-2022 Kalle Hoffman - All Rights Reserved.