CONFIGURING LINUX (OR AT LEAST PARTS OF IT) ******************************************* Adding A User To Sudo --------------------- Edit: /etc/sudoers Add: ALL=(ALL) NOPASSWD: ALL Custom Time Zones ----------------- Create a file (ex: PST-zic), and add lines similar to the following to it. Be there is an empty line (a la fstab) at the end of the file (otherwise zic will complain about the last line being too long). #Zone NAME GMTOFF RULES/SAVE FORMAT Zone PST -8:00 - PST Save the file and then run the following command: $ zic PST-zic You should now have a file called PST (the file is given a name that is the same as the value under the NAME field) in your home directory. Move it to /usr/share/zoneinfo (this isn't necessary, but it does keep things tidy). Now copy the file PST to /etc as localtime. Your clock should now be set to Pacific Standard Time, or whatever timezone you happened to use. Mounting FreeBSD Partitions --------------------------- For a default FreeBSD 7 installation, there will be four partitions ('slices' in BSD lingo) you can mount: /, /var, /tmp, /usr. Each of these will have an associated entry in your /dev folder (mine run from hda8 to hda12, with hda9 as FreeBSD's swap partition). To mount them add an entry for each in your fstab along the following lines (adjust them as your system requires): /dev/hda8 /freebsd/slice-a-root ufs auto,ro,ufstype=ufs2,nodev,nosuid,users 1 0 /dev/hda10 /freebsd/slice-d-var ufs auto,ro,ufstype=ufs2,nodev,nosuid,users 1 0 /dev/hda11 /freebsd/slice-e-tmp ufs auto,ro,ufstype=ufs2,nodev,nosuid,users 1 0 /dev/hda12 /freebsd/slice-f-usr ufs auto,ro,ufstype=ufs2,nodev,nosuid,users 1 0 You should now be able to mount the FreeBSD partitions as read-only (I still have not figured out a read-write setup). Mounting A Windows Partition ---------------------------- In: /mnt Add a new folder: /mnt/windows If Windows is installed on a FAT partition, edit: /etc/fstab Add: /dev/ /mnt/windows vfat defaults 1 0 Where is the partition or drive Windows is installed to. If Windows is installed on an NTFS partition, edit: /etc/fstab Add: /dev/ /win2k ntfs-3g rw,users,umask=1000 1 0 Remapping Keys In The Console ----------------------------- Using a keymap from the 0-15 range, start by deciding what keys you want to remap (ex: Escape, Caps Lock---which will be swapped---and the right Alt), and obtaining the appropriate keycode. To get the keycode, exit X and at the console run: $ showkey and than hit the key you want to get the keycode for and write the numbers that appear down (which in this case should be 1, 58, and 100, assuming you are using a standard US layout). Get a copy of your current keymap: $ dumpkeys > my-keys This will create a file in your home folder called my-keys. Edit my-keys, and swap the text entries, not the keycodes (those are carved in stone) for Escape and Caps_Lock. So the Escape entry will go from: keycode 1 = Escape Escape alt keycode 1 = Meta_Escape To: keycode 1 = Caps_Lock And the Caps_Lock entry will go from: keycode 58 = Caps_Lock To: keycode 58 = Escape Escape alt keycode 58 = Meta_Escape To turn the right Alt key (or AltGr) into a compose key, change: keycode 100 = AltGr To: keycode 100 = Compose shift control keycode 100 = AltGr Put my-keys some place you are unlikely to delete it (ex: /opt/system). Edit: /etc/rc.d/rc.local Add: loadkeys /opt/system/my-keys Using Accented Characters In The Console (Slackware) ---------------------------------------------------- The console font that Slackware uses has accented characters that can be typed using one of two compose sequences. The first compose sequence uses the "Ctrl" and "." keys. Using this sequence, to get é, you would type: Ctrl + . Followed by: ' + e Alternatively, ASCII keycodes can be used. Hold down the Alt key and type in the numeric code for a character and the release the Alt key to print the character. Borrowing from the previous example, é would be inputed using the following sequence: Alt + 233 If you have a laptop that you use a function key (Fn--like an Inspiron 8200) to access the number pad, you'll need to hold it down along with the Alt key while you type the keycode and then release both when you are done. The native font has some limitations though. The majority of capitalised accented characters do not display (though their value is actually inputed--ie: if you type É in vim on the console, even though all you see is E, if you save the document and open it under X, you will see É), which can be frustrating. The easiest solution I've found is to switch the console font you're using. Getting ALSA & Sound To Work ---------------------------- Run: $ alsamixer Adjust the columns using the up and down arrow keys to raise and lower the bars and the left and right arrow keys to switch between the different bars. When finished, hit ESC and run the following to save the settings: $ alsactl store If there is still no sound, execute the following: $ chmod 666 /dev/dsp* $ chmod 666 /dev/mixer* Rerun 'alsamixer' and 'alsactl store'. If after all of this (and maybe a reboot for good measure) you still do not have sound, there may be an incompatibility between the kernel you are using and the version of Alsa you're trying to run. Make sure that the build of Alsa you're using is compatible with your current kernel. Generally this can be determined if the version numbers of the two match. If they don't match, install a version of Alsa whose version number matches your kernel version number and try the above steps again. Enabling DVD Playback --------------------- Install: * libdvdcss - allows you to access DVDs as block devices without having to deal with encryption * libdvdplay - a library providing DVD navigation support * libdvdread - provides support for reading DVD-Video images If using xine, run: $ xine-check. If xine-check returns errors involving XVideo, then the XVideo module for Xorg is not installed (unlikely), there is an error, or missing statement in /etc/X11/xorg.conf (possible), or incorrect video drivers are being used (probable--it was what happened to me). Run: $ xvinfo This will give details about XVideo, and possibly clues as to the problem. To get further information, run: $ xdpyinfo | grep XV. If it returns with XVideo, then you likely have a driver problem. If it responds otherwise, you will likely need to add the following to /etc/X11/xorg.conf, under the "Modules" section: load "v41" Configuring A Gigabyte GN-WP01GS Wireless NIC (With WPA) -------------------------------------------------------- This had me stumped for the better part of three days as I chased any and every lead that crossed my path, all the while the answer was hovering right before me, for on Slackware this particular procedure entails the editing of only two configuration files and the execution of only one programme. Before we start, grab the ESSID of your wireless network and your WPA key (and if your wireless router/network restricts access by MAC address, you will need your wireless NIC's MAC address as well, so that it can be added to the router's/network's white list). Open /etc/rc.d/rc.inet1.conf and scroll down until you find the entries associated with wlan0 and uncomment the following lines: IFNAME[4]="wlan0" USE_DHCP[4]="yes" WLAN_RATE[4]="54 auto" WLAN_WPA[4]="wpa_supplicant" WLAN_WPADRIVER[4]="wext" Save, exit and from the command prompt run wpa_passphrase, appending your network's ESSID to the end of the command (and if you are using a WPA key that contains ONLY alpha-numeric characters, it too can be appended after the ESSID). Next, enter your unencrypted/unhexed WPA key and hit enter. You should end up with something along these lines: network={ ssid="notlocalhost" #psk="This is a test" psk=959e733f73b8e59f6b090ab46282be34838e7ce4823b2cb5de3672379d80fccd } Copy these lines (though the #psk entry is not strictly necessary), and paste them into /etc/wpa_supplicant, and remove any duplicate entries. Staying in wpa_supplicant, make sure that the remainder of the entries look something along these lines (assuming you are using WPA encryption): prot=WPA key_mgmt=WPA-PSK pairwise=CCMP TKIP group=CCMP TKIP WEP104 WEP40 Save, exit, and restart the machine if you are as lazy as me. If you have remembered everything, then you should now have internet access courtesy of your local network. Adding A Font To The Setconsolefont List ---------------------------------------- Some time ago, I stumbled upon probably the greatest bitmap font my eyes had ever seen: Terminus. I immediately downloaded it, and started using it just about everywhere. But there was one restriction that I could not breach: using Terminus on the console. Thus I began poking around, and in short order I discovered a) the setconsolefont command and b) where it was kept. And it was on that day that I got Terminus running on the console. The first step is to copy the bitmap fonts from the Terminus (or whatever other bitmap font you might want to use) installation directory to /usr/share/kbd/consolefonts. Next, go to /usr/bin and open setconsolefont in a text editor. Scroll down until you find a long list bitmap font files, and at the end of this list, add the files you want to be included. Save and exit. Finally, run setconsolefont and pick the font you want to use. It is that simple. Adding Fonts ------------ Start by editing your fonts.conf file. You can do this using fontconfig, or using and editor. I will demonstrate the latter. Find your fonts.conf file (probably located in /etc/fonts/ or something similar) and add a line to the directory where you have copied the fonts to. Mine is as follows: /usr/local/share/fonts You will want to add a similar line to your xorg.conf file (generally located in /etc/X11/). Scroll down until you find the "Files section" and add the following (replacing the directory indicated with the one you are using): FontPath "/usr/local/share/fonts" And now you are done, though you may have to restart whatever programme you are using in X for the changes to take effect.