Ubuntu Notes
Assigning static ip address
- Edit the /etc/network/interfaces file:
sudo vi /etc/network/interfaces
- Replace the dhcp configuration:
# The primary network interface auto eth0 iface eth0 inet dhcp
- With a static configuration:
auto eth0 iface eth0 inet static address 192.168.1.100 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255 gateway 192.168.1.1
- Setup the DNS entries in the /etc/resolv.conf:
sudo vi /etc/resolv.conf
- Confirm that there is an entry for your nameserver:
domain gordonturner.ca search gordonturner.ca nameserver 192.168.1.1
- Restart the network service:
sudo /etc/init.d/networking restart
Some packages are 'kept back' or 'on hold'
- During an apt-get update or apt-get upgrade not all packages get upgraded:
root@ubuntu:~# sudo apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done The following packages have been kept back: bind9-host dnsutils libbind9-30 libdns35 libisc35 libisccfg30 liblwres30 linux-image-server linux-server 0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded. root@ubuntu:~#
- There we can see four packages haven't been upgraded, even though newer packages are available.
- This is because two new packages were introduced, and these upgrades depend upon it.
- To correct this, run:
apt-get dist-upgrade
- This will install all dependencies and new packages.
Determine Ubuntu version
- To determine what version of Ubuntu is running, run:
$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 8.04.3 LTS Release: 8.04 Codename: hardy $
Determine version of package installed
- Run:
dpkg -l | grep grub
Determin what ports are open
- Run:
netstat -an | grep "LISTEN "
ssh tunneling
- Connects 5905 on your machine to 5900 on someserver.yourhost.com.
ssh -L 5905:localhost:5900 someserver.yourhost.com
Restart networking
- Run:
sudo /etc/init.d/networking restart
Apache2
- Apache2 has several command line tools to enable or disable features
- The commands a2enmod and a2ensite are particularly useful. http://old.nabble.com/a2ensite-koha-error-td26597287.html
Apache2 a2enmod
- Tool to enable a site:
http://manpages.ubuntu.com/manpages/karmic/en/man8/a2enmod.8.html
a2enmod is a script that enables the specified module within the
apache2 configuration. It does this by creating symlinks within
/etc/apache2/mods-enabled.
- Run:
sudo a2enmod ssl
Apache2 a2ensite
- Tool to enable a site:
http://manpages.ubuntu.com/manpages/karmic/en/man8/a2ensite.8.html
a2ensite is a script that enables the specified site (which contains a
<VirtualHost> block) within the apache2 configuration. It does this by
creating symlinks within /etc/apache2/sites-enabled.
- Run:
sudo a2ensite default-ssl
Disable default http / run only https
- First disable apache2 listening on port 80 and ensure that apache2 is listening on 443:
sudo vi /etc/apache2/ports.conf
... #NameVirtualHost *:80 #Listen 80 ... Listen 443 ...
- Second disable the default site for port 80:
sudo a2dissite default
- Finally reload apache2:
sudo /etc/init.d/apache2 reload
Enable frame buffer
- First install hwinfo
sudo aptitude install hwinfo
- Run hwinfo to detect available frame buffer modes
hwinfo --framebuffer
- Lookup in http://en.wikipedia.org/wiki/VESA_BIOS_Extensions#Linux_video_mode_numbers for a corresponding value.
- Valid values:
791 - 1024 x 768 @ 16
792 - 1024 x 768 @ 24
867 - 1400 x 900 @ 24
799 - 1600 x 1200 @ 24
| 791 is a safe value |
| The native resolution of my monitor is 1920 x 1200, so I use vga=867. At this resolution the text is the right size. |
- Edit /boot/grub/menu.lst and add to the end of the kernel line:
vga=791
- And update grub:
sudo update-grub