Index:


Applications and Utilities    Return to Index

======================================================================
FIREFOX - save multiple tabs in Firefox 4+

In about:config
	browser.showQuitWarning should be changed to "true"
	- this seems to be the critical setting

The following should also be checked as, or changed to, "true":
	browser.warnonQuit
	browser.warnonRestart

On Mac OS:
	browser.showQuitWarning setting does not exist
	use: History
		Recently Closed Windows
			Restore All Windows

	this should also work on other platforms on which
	browser.showQuitWarning is set to "false"

Code    Return to Index

Python    Return to Index
chopmoduli.py
# chopmoduli.py - removes less secure ssh encryption profiles
# for python3 - 3.4 specifically
#
# assumes that /etc/ssh/moduli has been copied to /root/etc_ssh_moduli.original
# using cp -p /etc/ssh/moduli /root/etc_ssh_moduli.original
#
# outputs to /root/etc_ssh_moduli.chopped
# then issue cp -p /root/etc_ssh_moduli.chopped /etc/ssh/moduli

lines_in = []
lines_out = []

with open('/root/etc_ssh_moduli.original', 'r') as f_in:
#	for line_in in f_in:
	lines_in = f_in.readlines()
	for line_in in lines_in:
		if line_in[:1] == '#':
			pass
		elif int(line_in[23:27]) < 2047:
			continue
		lines_out.append(line_in)

with open('/root/etc_ssh_moduli.chopped', 'w') as f_out:
	for line_out in lines_out:
		f_out.write(line_out)

Daemons, Services, System Infrastructure    Return to Index

Apache    Return to Index
SSL
===

Enabling SSL
------------

To enable SSL, type (as user root):

	a2ensite default-ssl
	a2enmod ssl

If you want to use self-signed certificates, you should install the ssl-cert
package (see below). Otherwise, just adjust the SSLCertificateFile and
SSLCertificateKeyFile directives in /etc/apache2/sites-available/default-ssl to
point to your SSL certificate. Then restart apache:

	/etc/init.d/apache2 restart

The SSL key file should only be readable by root, the certificate file may be
globally readable. These files are read by the Apache parent process which runs
as root. Therefore it is not necessary to make the files readable by the
www-data user.

Creating self-signed certificates
---------------------------------

If you install the ssl-cert package, a self-signed certificate will be
automatically created using the hostname currently configured on your computer.
You can recreate that certificate (e.g. after you have changed /etc/hosts or
DNS to give the correct hostname) as user root with:

	make-ssl-cert generate-default-snakeoil --force-overwrite

To create more certificates with different host names, you can use

	make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /path/to/cert-file.crt

This will ask you for the hostname and place both SSL key and certificate in
the file /path/to/cert-file.crt . Use this file with the SSLCertificateFile
directive in the Apache config (you don't need the SSLCertificateKeyFile in
this case as it also contains the key). The file /path/to/cert-file.crt should
only be readable by root. A good directory to use for the additional
certificates/keys is /etc/ssl/private .
Webserver: "Could not reliably determine the server's FQDN"

Create file /etc/apache2/httpd.conf (if necessary) and add:
	ServerName	localhost

On Mint17, httpd.conf was not recognised.
It was necessary to rename it to fqdn.conf and move it to
conf-available, then issue the command:
	a2enconf fqdn.conf
resulting in a prompt to issue the command:
	service apache2 reload
If conf-available does not exist, it will be necessary to place fqdn.conf
in mods-available, and manually create a link to it in mods-enabled.
fqdn.conf
ServerName	localhost
CUPS    Return to Index
DNS-DHCP    Return to Index
File System - mounting - fstab etc    Return to Index
File System Types    Return to Index
Fonts    Return to Index
======================================================================
MICROSOFT TRUETYPE CORE FONTS

Installer fails due to WGET failing to download one or more files
from sourceforge - if any file fails, no fonts are extracted into
the /usr/share/fonts/truetype/msttcorefonts directory

Solution 1:
As root, use rsync to copy font files from another computer
- it may be necessary to update the font cache

Solution 2:
As root: dpkg-reconfigure ttf-mscorefonts-installer
GRUB    Return to Index
======================================================================
GRUB1:

To alter default settings, edit the file /boot/grub/menu.lst
then issue the command grub-install (device)

Issue the command update-grub to create or refresh menu.lst

======================================================================
GRUB2:

To alter default settings, edit the file /etc/default/grub
then issue the command update-grub
Logging    Return to Index
======================================================================
bootlogd - logging shutdown as well as boot messages (LXF152)

In /etc/default/bootlogd:
	Set BOOTLOGD_ENABLE=Yes

To add bootlogd to the list of services started on boot:
"Ubuntu 11.04 doesn't have a startup manager installed by default,
so install bum (Boot-Up Manager)" and activate bootlogd.

According to LXF, the log is kept in /var/log/boot
Mail systems    Return to Index
MYSQL-PHP    Return to Index
SSH-Rsync    Return to Index
Systemd    Return to Index

Package Management    Return to Index

Pacman    Return to Index
Debian family - APT etc    Return to Index

List installed packages (this alias should be included in bash_aliases):

alias pkgs='dpkg --get-selections | grep -v deinstall'

Proxy for apt-cacher-ng: save the following as /etc/apt/apt.conf.d/03proxy

/etc/apt/apt.conf.d/03proxy
Acquire::http { Proxy "http://aptcache:3142"; };

apt-cacher-ng: location of cache

On chloe: /srv/cache/apt-cacher-ng/

Mint 17 mergelist errors:

From Menu: Software Sources, -> Administration -> Fix MergeList Problems
-- sometimes fixes mergelist errors

Distro-specific notes    Return to Index
======================================================================
IDENTIFYING UBUNTU VERSION - both numeric and codename:

	cat /etc/lsb-release

This file does not exist in Debian 6.0

======================================================================
IDENTIFYING DEBIAN/UBUNTU VERSION:

- cat /etc/issue

- for Ubuntu ... System > About Ubuntu
                 System > System Monitor

- for Debian ... Applications > System Tools > System Monitor

Gui configuration and personalisation    Return to Index

Background colours    Return to Index
======================================================================
Desktop Background Colours

#E6A027	emily - Ubuntu Studio
#B06840 emily - Mint 13 -- also paula Ubuntu 10.04
#152233	Xubuntu
#DA9833 shuttle - Ubuntu 10.04
#B76537 alina - Ubuntu 10.10

Desktop Background Image

emily - Mint 13 - JKHP_ubuntu800.jpg
paula - Ubuntu - JKHP_ubuntu640.jpg
alina - Ubuntu - JKHP_ubuntu640.jpg

Login Environment    Return to Index

Bash - LS - aliases etc    Return to Index
======================================================================
LS - Linux

alias ls='ls --group-directories-first --time-style=long-iso'
# modification time is apparently the default time displayed
# creation time does not seem to be an option

# long-iso seems to be the default time-style in US11.04,
# but not in Mint13

-n, --numeric-uid-gid
              like -l, but list numeric user and group IDs

-L, --dereference
              when showing file information for a symbolic link, show
              information for the file the link references rather than
              for the link itself

# to un-alias a command like ls, prefix with a backslash, e.g. \ls
Fragments to set ls major options - use in .bashrc or in /etc/bash.bashrc
    alias ls='ls --color=auto --group-directories-first --time-style=long-iso'
else
    alias ls='ls --group-directories-first --time-style=long-iso'
/etc/bash_aliases
# Adam's aliases
alias ..='cd ..'
alias cppt='cp --preserve=timestamps'
alias ll='ls -lF'
alias la='ls -AlF'
# -L derefences links
alias lll='ls -lLF'
alias lal='ls -AlLF'
# leave 'l' free for DirB
alias lscf='ls -CF'
alias hosts='cat /home/adamb/Archive/_config/hosts-local'
alias os='cat /etc/os-release'
alias motd='cat /etc/motd'
alias pkgs='dpkg --get-selections | grep -v deinstall'
bash.bashrc_extend

# Alias definitions.
# You may want to put all your additions into a separate file like
# /etc/bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f /etc/bash_aliases ]; then
    . /etc/bash_aliases
fi
# For Mint; the following as root:

# to install /etc/bash_aliases
cp --preserve=timestamps /home/share/Archive/_config/mint/etc/bash_aliases /etc

# to activate /etc/bash_aliases
cat /home/share/Archive/_config/mint/etc/bash.bashrc_extend >> bash.bashrc

# to add ls alias setting lines for replacement or addition
cat /home/share/Archive/_config/mint/etc/bash.bashrc_edit >> bash.bashrc
.bashrc for Mint, modified for .bashDirB
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

source ~/.bashDirB

# any output from shell init files prevents rsync from working
# so the following had to be commented out
# echo 'ls -L' to de-reference links ~~ alias: lll
Locale    Return to Index
To check current settings, issue locale
To check available locales, issue locale -a
To check individual settings, issue e.g. locale -ck LC_PAPER

To alter locale setting, edit the file:
- /etc/default/locale	(Mint)
- /etc/locale.conf	(Arch)

LC_COLLATE="C"		# more rational collation of files/directories
LC_TIME="en_DK.UTF-8"	# short date iso-like

Locales defined in	/usr/share/i18n/locales	(Mint13)

Mint/Ubuntu: if a large file locale-archive exists in /usr/lib/locale,
locales have been generated in archive form.

If locales have been generated only in archive form, the individual
files can be generated by issuing, as root, the following command:
locale-gen --purge --no-archive
MOTD    Return to Index

When MOTD is constructed by PAM, personalisation is by means of creating a file /etc/motd.tail, such as one containing the following:

/etc/motd.tail
ls -L to de-reference links
ls -n to display numeric uid/gid
stat  for full info including octal permissions
getfacl  for full permissions including ACLs if any
PAM    Return to Index
Permissions, Umask    Return to Index
======================================================================
DEFAULT PERMISSIONS:

Flash! (2016-01-13): It is best not to interfere with root's umask,
which is usually 0022, which is also usually the system default,
set in /etc/login.defs and picked up by pam_umask.

Anything different from this is best set in the individual user's
.profile - this will also be picked up by pam_umask and will
override what is set in /etc/login.defs.

Older distributions required adding pam_umask.so to common-session,
(see below) but it is included with more recent editions of Mint
and Ubuntu.

When retaining the default umask, it is not necessary to interfere
with the pam_umask entry in common-session.

------------------------------------------------------------
To cause the default permissions of user-created files to be rw-rw-r--
	in file /etc/profile
		set umask 002
	if it appears, and is not commented out
(the commonly-found setting of 022 causes permissions to be rw-r--r--

In Debian 6, search for UMASK in /etc/login.defs

The following line in login.defs
	USERGROUPS_ENAB yes
needs to be changed to
	USERGROUPS_ENAB no

Also, in /etc/adduser.conf:
# If DIR_MODE is set, directories will be created with the specified
# mode. Otherwise the default mode 0755 will be used.
Change
	DIR_MODE=0755
to
	DIR_MODE=0775
And change
	USERGROUPS=yes
to
	USERGROUPS=no

But see the following about pam_umask

Despite all this, in Mint, it seems to be necessary for local logins
to set umask in ~/.profile (not necessary for SSH logins).

======================================================================
LIBPAM-UMASK:

Adding the following line to /etc/pam.d/login would set the user-specific
umask at login:
	session optional pam_umask.so umask=002

However, adding this line to /etc/pam.d/common-session also covers
ssh logins

# apparently required (at least) for ssh logins - added by Adam
session	optional	pam_umask.so	umask=002

# update 2012-09-24 - fresh install of Xubuntu 12.04.1
# the following line exists in common-session:
session	optional	 pam_umask.so
# "umask=002" needs to be appended

If pam_umask is active, it would seem that /etc/profile is ignored,
but /etc/login.defs is checked (though /etc/pam.d/login has priority)
- actually, priority is not clear

Documentation for pam_umask refers to "UMASK=" entry in
/etc/default/login, but this file does not exist in Ubuntu or Debian
Usergroup    Return to Index
======================================================================
DEFAULT USERGROUP:

To cause the main group of newly created users to be 'users' (GID 100)
	in file /etc/adduser.conf
		set USERGROUPS=no
(a group with the same name as the user's login name is not then created)

Also, in Debian 6, search for USERGROUPS_ENAB in /etc/login.defs

Networking    Return to Index

NFS    Return to Index
======================================================================
NFS

showmount -e 	# show NFS exports from 

exportfs	# display current exports
exportfs -v	# display current exports with applied options
exportfs -a	# export or unexport defined file systems
exportfs -r	# re-export defined file systems
exportfs -ar	# should have the effect of re-initialising exports
		# all the above options act on exports defined in
		# /etc/exports and /etc/exports.d/

# nfs v4: the export with option fsid=0 becomes the root of the
# exported filesystems; sub-directories may be created under this
# root, which must be individually exported (each can have its own
# options) - filesytems elsewhere on the system may be bound to these
# export points; clients only need to mount the root export.
Samba    Return to Index

UPS notes - NUT etc    Return to Index


Sundry notes    Return to Index

======================================================================
UPDATE-NOTIFIER:

gconftool -s --type bool /apps/update-notifier/auto_launch false

======================================================================