User Tools

Site Tools


build:misc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
build:misc [2011/05/14 14:03]
Craig Buchek Install chkconfig instead of sysvconfig.
build:misc [2014/09/03 12:05] (current)
Admin Add email clients.
Line 4: Line 4:
  
 Note that some of these packages may get installed during the installation of the OS, depending on the revision and the options selected. Packages that we've seen get installed include ''​mailx'',​ ''​lsof'',​ ''​less'',​ ''​w3m'',​ ''​telnet'',​ ''​bc'',​ ''​file'',​ ''​nano'',​ and ''​at''​. Note that some of these packages may get installed during the installation of the OS, depending on the revision and the options selected. Packages that we've seen get installed include ''​mailx'',​ ''​lsof'',​ ''​less'',​ ''​w3m'',​ ''​telnet'',​ ''​bc'',​ ''​file'',​ ''​nano'',​ and ''​at''​.
 +
 +
 ===== System ===== ===== System =====
  
-The ''​chkconfig''​ command is used to set up the soft links in /etc/rc*.d directories,​ based on special comments in the startup scripts. The package also contains the ''​service''​ command, which provides a simple way to stop and start services. It'​s ​the same as running the startup scripts in ''​/etc/init.d'' ​manually, but with a nicer interface (and better command-line completion). Using ''​service''​ is now the preferred way to start and stop services in most Linux distros, including RHEL.+The ''​chkconfig''​ command is used to set up the soft links in /etc/rc*.d directories,​ based on special comments in the startup scripts. The Debian ​''​update-rc.d''​ command ​does the same thing as ''​chkconfig'',​ but ''​chkconfig''​ is more standard across various distributions. 
 <code bash> <code bash>
-sudo apt-get install ​-y chkconfig ​# Requires ​insserv package.+sudo apt-get install chkconfig 
 +</​code>​ 
 + 
 +We prefer to use the ''​service''​ command, which provides a simple way to stop and start services. It's the same as running the startup scripts in ''/​etc/​init.d''​ manually, but with a nicer interface (and better command-line completion). Using ''​service''​ is now the preferred way to start and stop services in most Linux distros, including RHEL. Debian Squeeze (6.0) includes the ''​service''​ command in the ''​sysvinit-utils''​ package. In previous versions, the ''​service''​ command was in the ''​insserv'' ​package. 
 + 
 +<code bash> 
 +sudo apt-get install sysvinit-utils
 </​code>​ </​code>​
  
 The ''​lsb-release''​ package (including the ''​lsb_release''​ command) lets scripts determine which version of which distro they'​re running on. The ''​lsb-release''​ package (including the ''​lsb_release''​ command) lets scripts determine which version of which distro they'​re running on.
 +
 <code bash> <code bash>
 sudo apt-get install lsb-release sudo apt-get install lsb-release
 </​code>​ </​code>​
  
-The ''​locate''​ program is great for finding files on the system, without ''​find''​ having to search through a bunch of directories. Debian 5.0 prefers use of the mlocate variant.+The ''​locate''​ program is great for finding files on the system, without ''​find''​ having to search through a bunch of directories. Debian 5.0 and newer prefers use of the mlocate variant. 
 <code bash> <code bash>
 sudo apt-get install mlocate sudo apt-get install mlocate
Line 23: Line 34:
  
 This resolves some issues with Perl complaining about ''​LC_ALL''/''​LANG''/''​LANGUAGE''​ when using ''​en_US.UTF-8''​ encoding. This resolves some issues with Perl complaining about ''​LC_ALL''/''​LANG''/''​LANGUAGE''​ when using ''​en_US.UTF-8''​ encoding.
 +
 <code bash> <code bash>
 sudo apt-get install locales locales-all sudo apt-get install locales locales-all
 </​code>​ </​code>​
  
-This program provides a utility to configure init files for various runlevels.+This program provides a TUI-based ​utility to configure init files for various runlevels. 
 <code bash> <code bash>
-sudo apt-get install ​-y sysv-rc-conf+sudo apt-get install sysv-rc-conf
 </​code>​ </​code>​
  
 This package is used by several web and email packages (Apache and PINE). This package is used by several web and email packages (Apache and PINE).
 +
 <code bash> <code bash>
 sudo apt-get install mime-support sudo apt-get install mime-support
Line 38: Line 52:
  
 We'll need OpenSSL and certificate management packages for web and email later (Apache and Postfix). We'll need OpenSSL and certificate management packages for web and email later (Apache and Postfix).
 +
 <code bash> <code bash>
 sudo apt-get install openssl ssl-cert ca-certificates sudo apt-get install openssl ssl-cert ca-certificates
Line 43: Line 58:
  
 The ''​psmisc''​ package includes some useful tools, including ''​pstree'',​ ''​killall'',​ and ''​fuser''​. The ''​psmisc''​ package includes some useful tools, including ''​pstree'',​ ''​killall'',​ and ''​fuser''​.
 +
 <code bash> <code bash>
 sudo apt-get install psmisc sudo apt-get install psmisc
Line 48: Line 64:
  
 The ''​lsof''​ program list files (and sockets) that are open, and which processes are using them. The ''​lsof''​ program list files (and sockets) that are open, and which processes are using them.
 +
 <code bash> <code bash>
 sudo apt-get install lsof sudo apt-get install lsof
Line 53: Line 70:
  
 The ''​htop''​ program is an enhanced version of ''​top''​. The ''​htop''​ program is an enhanced version of ''​top''​.
 +
 <code bash> <code bash>
 sudo apt-get install htop sudo apt-get install htop
 </​code>​ </​code>​
  
-The ''​strace''​ program allows you to trace all the system calls that a program calls.+The ''​strace''​ program allows you to trace all the system calls that a program calls. ​The ''​ltrace''​ program is similar, but traces library calls. 
 <code bash> <code bash>
-sudo apt-get install strace+sudo apt-get install strace ​ltrace
 </​code>​ </​code>​
  
 The ''​iotop''​ program allows you to monitor I/O with an interface similar to ''​top''​. The ''​iotop''​ program allows you to monitor I/O with an interface similar to ''​top''​.
 +
 <code bash> <code bash>
 sudo apt-get install iotop sudo apt-get install iotop
Line 68: Line 88:
  
 The ''​sysstat''​ package includes ''​sar'',​ ''​iostat'',​ and ''​mpstat'',​ programs used to more closely monitor system performance. Note that I've not yet enabled ''​sa1''​ to run from cron; I'll need to edit ''/​etc/​default/​sysstat''​ to enable that. The ''​sysstat''​ package includes ''​sar'',​ ''​iostat'',​ and ''​mpstat'',​ programs used to more closely monitor system performance. Note that I've not yet enabled ''​sa1''​ to run from cron; I'll need to edit ''/​etc/​default/​sysstat''​ to enable that.
 +
 <code bash> <code bash>
 sudo apt-get install sysstat sudo apt-get install sysstat
 </​code>​ </​code>​
 +
 +The ''​checkinstall''​ command lets you easily install packages from sources, and keeps the installation info in the packaging system, so that it can be easily uninstalled. To use it, you generally just build the software then run ''​sudo checkinstall make install''​.
 +
 +<code bash>
 +#sudo apt-get install checkinstall # Not installed in Squeeze, due to too many dependencies.
 +</​code>​
 +
  
 ==== mail command line utility ==== ==== mail command line utility ====
-The "mail" comand ​line utility ​was not installed ​which caused ​several scripts ​thet rely on that command ​to fail. It is part of the mailx package. NOTE: Wait until after installing Postfix to install this; otherwise, it will require ​exim4 to be installed.+ 
 +The ''​mail''​ command ​line utility ​is not installed ​by default, causing ​several scripts ​that rely on it to fail. Previously, we used the ''​mailx''​ variant, which is in the ''​bsd-mailx'' ​package ​in Debian Squeeze (6.0). For Debian Squeeze, we chose to go with the GNU ''​mailutils''​ package instead. It works with a wider range of mail sources, including Maildir folders, and even IMAP. The package also includes the ''​movemail''​ command and a ''​sieve''​ client for configuring mail filters over the SIEVE protocol. 
 + 
 +NOTE: Wait until after installing Postfix to install this; otherwise, it will force exim4 to be installed. 
 <code bash> <code bash>
-sudo apt-get install ​mailx liblockfile1+sudo apt-get install ​mailutils
 </​code>​ </​code>​
 +
  
 ===== Text Editors and Readers ===== ===== Text Editors and Readers =====
-NOTE: ''​nano'' ​and ''​file''​ get installed by default.+ 
 +Everyone has their preferred text editor. For servers, we ensure that nano and vim are available.
  
 <code bash> <code bash>
-sudo apt-get install -vim vim-doc ​vim-scripts+sudo apt-get install ​nano 
 +sudo apt-get install ​vim vim-doc
 sudo apt-get install less sudo apt-get install less
 sudo apt-get install pinfo sudo apt-get install pinfo
 </​code>​ </​code>​
 +
  
 ===== Console Tools ===== ===== Console Tools =====
 +
 +Midnight Commander is a TUI-based file manager. It comes in handy on occasion.
 +
 <code bash> <code bash>
-sudo apt-get install ​-y mc+sudo apt-get install mc
 </​code>​ </​code>​
 +
  
 ===== Packaging and Compression ===== ===== Packaging and Compression =====
 +
 <code bash> <code bash>
-sudo apt-get install unzip zip 
 sudo apt-get install bzip2 sudo apt-get install bzip2
 +sudo apt-get install unzip zip
 </​code>​ </​code>​
 +
  
 ===== Web-related ===== ===== Web-related =====
-NOTE: ''​wget''​ gets installed by default. 
  
 <code bash> <code bash>
-sudo apt-get install ​-y curl+sudo apt-get install curl
 sudo apt-get install links sudo apt-get install links
 sudo apt-get install lynx-cur ​ # Newer release of lynx sudo apt-get install lynx-cur ​ # Newer release of lynx
Line 108: Line 149:
 sudo apt-get install lftp sudo apt-get install lftp
 sudo apt-get install rsync sudo apt-get install rsync
-sudo apt-get install ​-y tidy tidy-doc +sudo apt-get install tidy tidy-doc 
-#sudo apt-get install elinks +sudo apt-get install elinks ​elinks-doc 
-#sudo apt-get install w3m+sudo apt-get install w3m
 </​code>​ </​code>​
  
  
 ===== Network Tools ===== ===== Network Tools =====
-Note that netcat apparently gets installed by default in Debian 5.0. 
  
 Tcpdump is a good tool for monitoring packets going across the wire. It's helpful when troubleshooting network protocol issues. Tcpdump is a good tool for monitoring packets going across the wire. It's helpful when troubleshooting network protocol issues.
 +
 <code bash> <code bash>
-sudo apt-get install ​-y tcpdump+sudo apt-get install tcpdump
 </​code>​ </​code>​
  
 Telnet is no longer good for connecting to remote systems to get shell access. (Always use SSH for remote shell access.) However, it's good for connecting to other ports to test network connectivity. (For example, it's the easiest way to test low-level SMTP functionality.) Telnet is no longer good for connecting to remote systems to get shell access. (Always use SSH for remote shell access.) However, it's good for connecting to other ports to test network connectivity. (For example, it's the easiest way to test low-level SMTP functionality.)
 +
 <code bash> <code bash>
 sudo apt-get install telnet sudo apt-get install telnet
 </​code>​ </​code>​
  
-The ''​mtr''​ program is an enhanced version of ''​traceroute'',​ with some additional features. We want the "​tiny" ​version, which does not require X11.+The ''​mtr''​ program is an enhanced version of ''​traceroute'',​ with some additional features. We want the "​tiny" ​variant, which does not require X11. 
 <code bash> <code bash>
 sudo apt-get install mtr-tiny sudo apt-get install mtr-tiny
Line 133: Line 176:
  
 ZModem isn't used much any more, but it can be used to send files across an existing SSH (or any other pty) connection. The ''​lrzsz''​ package supports ZModem -- use the ''​rz''​ command to receive a file. KDE's Konsole provides good ZModem upload support. ZModem isn't used much any more, but it can be used to send files across an existing SSH (or any other pty) connection. The ''​lrzsz''​ package supports ZModem -- use the ''​rz''​ command to receive a file. KDE's Konsole provides good ZModem upload support.
 +
 <code bash> <code bash>
 sudo apt-get install lrzsz sudo apt-get install lrzsz
 </​code>​ </​code>​
 +
  
 ===== Development Tools ===== ===== Development Tools =====
 +
 NOTE: There are a ton of ''​-dev''​ packages that we could install. Unless we find a development "​super-package",​ we'll have to install them as-needed. NOTE: There are a ton of ''​-dev''​ packages that we could install. Unless we find a development "​super-package",​ we'll have to install them as-needed.
 +
 <code bash> <code bash>
-sudo apt-get install ​binutils +sudo apt-get install ​build-essential 
-sudo apt-get install -y gcc cpp linux-kernel-headers +sudo apt-get install ​make autoconf automake autoconf-doc libtool libtool-doc # NOTE: make-doc was suggested by make, but does not exist. 
-sudo apt-get install -y g++ +sudo apt-get install ​flex bison m4 # NOTE: bison-doc was suggested by bison, but does not exist. 
-sudo apt-get install ​binutils-doc manpages-dev +sudo apt-get install ​diff diff-doc patch 
-sudo apt-get install -y gcc-doc cpp-doc +sudo apt-get install ​gnu-standards 
-sudo apt-get install ​make autoconf automake libtool flex bison m4 autotools-dev libc6-dev +sudo apt-get install ​manpages-dev 
-sudo apt-get install ​glibc-doc libtool-doc +sudo apt-get install ​linux-kernel-headers 
-sudo apt-get install ​gdb +sudo apt-get install ​binutils-doc glibc-doc # NOTE: gcc-doc and cpp-doc were suggested by build-essential,​ but do not exist. 
-sudo apt-get install patch +sudo apt-get install ​libc6-dev 
-sudo apt-get install ​build-essential dpkg-dev +sudo apt-get install ​gdb # NOTE: gdb-doc was suggested by gdb, but does not exist.
-sudo apt-get install ​diff-doc+
 </​code>​ </​code>​
 +
  
 ===== Revision Control ===== ===== Revision Control =====
 +
 These are various source code management (SCM) packages. These are various source code management (SCM) packages.
 +
 <code bash> <code bash>
 sudo apt-get install cvs sudo apt-get install cvs
-sudo apt-get install ​-y subversion subversion-tools ​db4.4-util +sudo apt-get install subversion subversion-tools 
-sudo sed -i -e 's/^# global-ignores.*$/​global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store/'​ \ +sudo sed -e 's/^# global-ignores.*$/​global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store/'​ \ 
-    /​etc/​subversion/​config +    ​-i /​etc/​subversion/​config 
-sudo apt-get install ​-y git-core git-doc git-svn ​gitweb +sudo apt-get install git-core git-doc git-svn
-sudo cp /​usr/​share/​doc/​git-core/​contrib/​completion/​git-completion.bash /​etc/​bash_completion.d/​git+
 </​code>​ </​code>​
  
  
 ===== Perl ===== ===== Perl =====
-NOTE: Perl gets installed by default now, along with ''​perl-modules''​.+
 <code bash> <code bash>
-sudo apt-get install perl-doc +sudo apt-get install ​perl perl-modules ​perl-doc 
-sudo apt-get install ​libcompress-zlib-perl  # Compress::​Zlib+</​code>​ 
 + 
 + 
 +===== Java ===== 
 + 
 +We want to install "​headless"​ JRE, so that we don't need X11 libraries. It'd be nice to have Java 7 in addition to Java 6, but Debian 6 does not have Java 7 packages available. We'd like to install the JDK, but it requires X11 for some reason, so we'll do all our development and compiling on our desktops. 
 + 
 +<code bash> 
 +sudo apt-get install ​openjdk-6-jre-headless openjdk-6-doc 
 +sudo sh -c 'cat > /​etc/​profile.d/​java.sh'​ <<​EOF 
 +JAVA_HOME='/​usr/​lib/​jvm/​java-6-openjdk'​ 
 +export JAVA_HOME 
 +EOF
 </​code>​ </​code>​
  
  
 ===== Shells ===== ===== Shells =====
-Install ​ksh93, tcsh, and csh using apt-get. Add sym links for path variations and add to /etc/shells if not done automatically.+ 
 +Install ​nearly every shell known to UNIX-kind. 
 <code bash> <code bash>
 sudo apt-get install ksh sudo apt-get install ksh
Line 180: Line 242:
 sudo apt-get install csh sudo apt-get install csh
 sudo apt-get install zsh zsh-doc sudo apt-get install zsh zsh-doc
-sudo ln -s /bin/bash /bin/csh /bin/ksh /bin/sh /bin/tcsh /​usr/​local/​bin 
-sudo ln -s /bin/bash /bin/csh /bin/sh /usr/bin 
-sudo ln -s /​usr/​bin/​perl ​ /​usr/​local/​bin 
-sudo ln -s /​usr/​bin/​perl ​ /bin 
 </​code>​ </​code>​
 +
 +
 +===== Email =====
 +
 +We're going to install a couple email clients, for those who like to read email via a TUI.
 +
 +<code bash>
 +sudo apt-get install mutt
 +sudo apt-get install nmh
 +</​code>​
 +
  
 ==== Auto-Logout on Idle Timeout ==== ==== Auto-Logout on Idle Timeout ====
Line 200: Line 269:
 EOF EOF
 sudo sh -c 'cat > /​etc/​profile.d/​autologout.csh'​ << EOF sudo sh -c 'cat > /​etc/​profile.d/​autologout.csh'​ << EOF
-# Automatically logout after 15 minutes idle at command prompt (unless in X).+# Automatically logout after 30 minutes idle at command prompt (unless in X).
 if ( ! $?DISPLAY ) then if ( ! $?DISPLAY ) then
   set -r autologout=30   set -r autologout=30
Line 206: Line 275:
 EOF EOF
 </​code>​ </​code>​
 +
  
 ===== Python ===== ===== Python =====
  
 <code bash> <code bash>
-sudo apt-get install ​-y python+sudo apt-get install python
 </​code>​ </​code>​
 +
  
 ===== Security ===== ===== Security =====
  
-GNU Privacy Guard is a clone of PGP. The command-line utility is called ''​gpg''​ and the package is called ''​gnupg''​. ​It's now installed by default.+GNU Privacy Guard is a clone of PGP. The command-line utility is called ''​gpg''​ and the package is called ''​gnupg''​. 
 + 
 +<code bash> 
 +sudo apt-get install gnupg 
 +</​code>​ 
  
 ===== Documentation ===== ===== Documentation =====
  
 <code bash> <code bash>
-sudo apt-get install ​-y doc-base+sudo apt-get install doc-base
 </​code>​ </​code>​
 +
  
 ===== Other ===== ===== Other =====
Line 229: Line 306:
 </​code>​ </​code>​
  
-''​bc''​ for doing simple math.+The ''​bc'' ​calculator is for doing simple math. (It's recommended to always start it with the ''​-l''​ option.)
  
 <code bash> <code bash>
Line 235: Line 312:
 </​code>​ </​code>​
  
-Deferred execution scheduler to supplement cron. NOTE: Wait until after installing Postfix to install this; otherwise, it will require exim4 to be installed.+Deferred execution scheduler to supplement cron. 
 + 
 +NOTE: Wait until after installing Postfix to install this; otherwise, it will require exim4 to be installed.
  
 <code bash> <code bash>
Line 246: Line 325:
 sudo apt-get install ack-grep sudo apt-get install ack-grep
 sudo ln -s /​usr/​bin/​ack-grep /​usr/​local/​bin/​ack sudo ln -s /​usr/​bin/​ack-grep /​usr/​local/​bin/​ack
 +sudo mkdir -p /​usr/​local/​share/​man/​man1
 +sudo ln -s /​usr/​share/​man/​man1/​ack-grep.1p.gz /​usr/​local/​share/​man/​man1/​ack.1p.gz
 </​code>​ </​code>​
 +
 +
 +===== Custom Scripts =====
 +
 +We've created some custom system administration scripts to make things easier for ourselves. We keep them on GitHub, but we'll download them as a ZIP file for simplicity'​s sake.
 +
 +<code bash>
 +wget https://​github.com/​boochtek/​sysadmin/​archive/​master.zip -O sysadmin.zip
 +unzip sysadmin.zip
 +sudo install -m 755 sysadmin-master/​sbin/​* /​usr/​local/​sbin/​
 +</​code>​
 +
  
 ===== TODO ===== ===== TODO =====
  
-There's no /etc/profile.d in Debian 5.0, so the idle auto-logout doesn't work.+  * Enabled ''​sa1''​ to run from cron; edit ''/etc/default/​sysstat'​' ​to enable that. 
 + 
 + 
build/misc.1305399788.txt.gz · Last modified: 2012/12/10 22:41 (external edit)