https://wiki.archlinux.org/api.php?action=feedcontributions&user=SkonesMickLoud&feedformat=atom
ArchWiki - User contributions [en]
2024-03-29T14:06:08Z
User contributions
MediaWiki 1.41.0
https://wiki.archlinux.org/index.php?title=Dm-crypt&diff=91119
Dm-crypt
2010-01-05T23:33:25Z
<p>SkonesMickLoud: /* Encrypted swap with suspend-to-disk support */</p>
<hr />
<div>[[Category:Security (English)]]<br />
[[Category:File systems (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
== Why Encryption? ==<br />
Encryption is useful for two (related) reasons. Firstly, it prevents anyone with physical access to your computer, and your hard drive in particular, from getting the data from it (unless they have your passphrase/key). Secondly, it allows you to wipe the data on your hard drive with far more confidence in the event of you selling or discarding your drive.<br />
<br />
Basically, it supplements the access control mechanisms of the operating system (like file permissions) by making it harder to bypass the operating system by inserting a boot CD, for example. Encrypting the root partition prevents anyone from using this method to insert viruses or trojans onto your computer.<br />
<br />
Note that we're not encrypting the boot partition - the bootloader needs to read that one!<br />
<br />
'''ATTENTION: Having encrypted partitions does not protect you from all possible attacks. The encryption is only as good as your key management, and there are other ways to break into computers while they are running. Read the CAVEATS section below!'''<br />
<br />
== Why LUKS for dm-crypt? ==<br />
There are either 3 or 4 rival disk encryption standards in Linux, depending on how you count them.<br />
<br />
The old cryptoloop is deprecated: it's old, insecure and unreliable.<br />
<br />
A much better version, loop-AES (http://loop-aes.sourceforge.net/), was created but, due to politics, never became favorable with the kernel developers. It's far more secure than either cryptoloop or straight device-mapper encryptions (and probably faster than any of the other 3 options), but is not user-friendly. It also requires non-standard kernel support, which ARCH's kernel26 doesn't have.<br />
<br />
The standard device-mapper encryption ([http://www.saout.de/misc/dm-crypt/ dm-crypt]) is another choice.<br />
<br />
[http://code.google.com/p/cryptsetup/ LUKS] essentially makes management of encrypted partitions easier. Without going into the hairy details (check out the [http://code.google.com/p/cryptsetup/ LUKS home page] if you're interested), it stores all the needed setup information on the disk itself. All you need then is the password, which can be in a separate file if you like. The Linux implementation uses dm-crypt and it can have up to eight different passwords, which can be changed or revoked easily. It is also supported by mkinitcpio in ARCH linux, which is nice.<br />
<br />
== Caveats ==<br />
<br />
=== Security (encryption) ===<br />
<br />
Disk encryption is not the be-all and end-all of security. Why not? Well, for a start, it won't prevent people from hacking into a running computer (either over the network or at a console) if there is a security hole to exploited (and there invariably is). There are a dozen and one things you can (and should) do to secure your computer against this type of attack, but they are all outside the scope of this document.<br />
<br />
What's more, even in situations this type of encryption is useful for (physical access to storage media), it isn't worth a thing if someone has your key. In other words, if someone finds out or guesses your passphrase, or gets access to your external key file if you're using one, they can unlock the encryption on the hard drive in exactly the same way that you can.<br />
<br />
What does this mean for you? Well, if you use an external key file, keep the device it is on '''SAFE'''. Attach it to your keyring or whatever. If you use a passphrase, '''make it hard to guess'''. There are [http://www.google.co.uk/search?q=create+secure+password hundreds of documents] all over the internet telling you how to come up with a secure passphrase; we're not going to go over it here. Note, however, that we use the term "passphrase": '''it doesn't have to be a single word'''.<br />
<br />
== Getting started ==<br />
If you're not starting from an unused hard drive, '''BACK UP YOUR DATA!''' I cannot stress this enough. Ideally, you should be doing this regularly anyway, and it's particularly important with an encrypted hard drive. But beware: if you have unencrypted backups, is there any point in having an encrypted hard drive? Think about where you store your backups.<br />
<br />
'''Note:''' if you want to have encrypted swap, read the section below about Encrypted Swap and decide how you want to set it up ''before'' you start the rest of this HOWTO.<br />
<br />
== Preparation ==<br />
=== Overwriting ===<br />
Repartitioning and formatting your drive will only remove the filesystem metadata and will mostly leave the actual data intact, allowing determined attackers to recover data using tools like [http://foremost.sourceforge.net/ Foremost]. If your harddisk contained sensitive data from previous use, you might want to overwrite this data. Contrary to popular believe overwriting several times or using random data as source serves no purpose. Data won't be recoverable after being overwritten by zeros. [http://www.springerlink.com/content/408263ql11460147/]<br />
<br />
To overwrite your disk with zeros you can use<br />
# dd if=/dev/zero of=/dev/sda bs=1M<br />
<br />
If you want to check for bad blocks while writing you can use badblocks. <br />
The <tt>badblocks</tt> command will check your disk for bad blocks while writing random data. The pseudorandom algorithm used by this command is faster (although "less random") than <tt>/dev/urandom</tt>, so it can be useful for large disks. [[frandom]] is a fast random generator you might want to use for large disk.<br />
<br />
# badblocks -c 10240 -w -t random -s -v /dev/sda<br />
This will test blocks in groups of 10240 (i.e. 10MB) at a time, writing over them with random data and showing progress as it goes.<br />
<br />
However it should be noted that the pseudo random data generated by badblocks does not serve any other purpose than slowing down the wiping of your drive.<br />
<br />
=== Partitioning ===<br />
Next, set up your partitions as you want. Make sure you have a separate partition for /boot. If you think about it, this is absolutely necessary. If your /boot partition was encrypted, then your bootloader wouldn't be able to read the kernel image and you would not get far.<br />
# cfdisk /dev/sda<br />
<br />
The following - indicative - partition layout will be used:<br />
/dev/sda1 -> /boot<br />
/dev/sda2 -> swap<br />
/dev/sda3 -> /<br />
/dev/sda4 -> /home<br />
/dev/sda5 -> /tmp # especially useful if you don't want to encrypt the entire root (/) partition<br />
<br />
== Loading kernel modules ==<br />
'''Note:''' this article will use XTS-AES as encryption algorithm because it was standardized as IEEE P1619 Standard for Cryptographic Protection of Data on Block-Oriented Storage Devices and it is quite secure, however the XTS mode is still flagged as "experimental" in the Linux kernel, so if you want something less secure but more proven, you should go with the CBC-ESSIV mode. The XTS mode is supported by Linux 2.6.24 upwards (ISO of Arch 2008.06 upwards).<br />
<br />
'''Note:''' The XTS mode uses two keys of the same size, therefore available sizes (using XTS-AES) are 256 (128 * 2), 384 (192 * 2) and 512 (256 * 2).<br />
<br />
Load the dm-crypt and the optimized AES module:<br />
# modprobe dm-crypt<br />
# modprobe aes-i586<br />
<br />
'''Note:''' x86_64 users can also try the "aes-x86_64" optimized module instead of "aes-i586".<br />
<br />
== Mapping partitions ==<br />
==== Passphrase ====<br />
Use this to create a password to unlock your encrypted partions with:<br />
<br />
Create your new LUKS encrypted partitions:<br />
# cryptsetup -c aes-xts-plain -y -s 512 luksFormat /dev/sda3<br />
Enter passphrase: mypassword<br />
Verify passphrase: mypassword<br />
# cryptsetup -c aes-xts-plain -y -s 512 luksFormat /dev/sda4<br />
Enter passphrase: myotherpassword<br />
Verify passphrase: myotherpassword<br />
# cryptsetup -c aes-xts-plain -y -s 512 luksFormat /dev/sda5<br />
Enter passphrase: myotherpassword<br />
Verify passphrase: myotherpassword<br />
<br />
Then open the newly created LUKS partitions:<br />
# cryptsetup luksOpen /dev/sda3 root<br />
Enter any LUKS passphrase: mypassword<br />
key slot 0 unlocked.<br />
Command successful.<br />
# cryptsetup luksOpen /dev/sda4 home<br />
Enter any LUKS passphrase: myotherpassword<br />
key slot 0 unlocked.<br />
Command successful.<br />
# cryptsetup luksOpen /dev/sda5 tmp<br />
Enter any LUKS passphrase: myotherpassword<br />
key slot 0 unlocked.<br />
Command successful.<br />
<br />
==== Keyfile (visible on external USB stick) ====<br />
You can also do the following to create a keyfile on a USB stick to unlock your encrypted partions with:<br />
<br />
<br />
Mount your USB stick<br />
mkdir /mnt/usbstick<br />
mount -t vfat /dev/sdb1 /mnt/usbstick<br />
<br />
Create the keyfile on the USB stick<br />
#cd /mnt/usbstick<br />
#dd if=/dev/urandom of=mykeyfile bs=512 count=4<br />
<br />
<br />
Create your new LUKS encrypted partitions:<br />
# cryptsetup -c aes-xts-plain -s 512 -v luksFormat /dev/sda3 /mnt/usbstick/mykeyfile<br />
# cryptsetup -c aes-xts-plain -s 512 -v luksFormat /dev/sda4 /mnt/usbstick/mykeyfile<br />
# cryptsetup -c aes-xts-plain -s 512 -v luksFormat /dev/sda5 /mnt/usbstick/mykeyfile<br />
<br />
Then open the newly created LUKS partitions:<br />
# cryptsetup -d /mnt/usbstick/mykeyfile luksOpen /dev/sda3 root<br />
key slot 0 unlocked.<br />
Command successful.<br />
# cryptsetup -d /mnt/usbstick/mykeyfile luksOpen /dev/sda4 home<br />
key slot 0 unlocked.<br />
Command successful.<br />
# cryptsetup -d /mnt/usbstick/mykeyfile luksOpen /dev/sda5 tmp<br />
key slot 0 unlocked.<br />
Command successful.<br />
<br />
<br />
''[reference to how to implement the usbkey method should be inserted here, i.e - automount of usbstick and usage of the keyfile on bootup to mount the dm_srypt partitions]''<br />
<br />
=== Explanation ===<br />
Now you should have a device called <tt>/dev/mapper/root</tt>, another one called <tt>/dev/mapper/home</tt> and another one called <tt>/dev/mapper/tmp</tt>. These are block devices like any other, but with a neat twist: whenever you write to them, the data is actually written to <tt>/dev/sda3</tt>, <tt>/dev/sda4</tt> or <tt>/dev/sda5</tt> respectively, but it is encrypted first! The only way to access the data on this encrypted partition is to re-create that <tt>/dev/mapper/root</tt>, <tt>/dev/mapper/home</tt> etc. device with cryptsetup each time you boot. With LUKS, you can use <tt>cryptsetup luksAddKey /dev/sda3</tt> to add a new password or <tt>cryptsetup luksDelKey /dev/sda3</tt> to revoke a password. Type <tt>cryptsetup -?</tt> or <tt>man cryptsetup</tt> (once you've booted your new Arch installation) for more info.<br />
<br />
'''Note:''' With LUKS, if you enter the wrong password, it will reject it. You don't have to worry about it possibly destroying your data.<br />
<br />
'''Note:''' You might also want to replace /var/tmp/ with a symbolic link to /tmp.<br />
<br />
'''Note:''' If you've decided to go for option two for encrypted swap (see Encrypted Swap below), you should set up <tt>/dev/mapper/swap</tt> in a similar way as you've just set up <tt>/dev/mapper/home</tt>. See Encrypted Swap below for details.<br />
<br />
== Arch Linux Installer ==<br />
Now that <tt>/dev/mapper/root</tt> and <tt>/dev/mapper/home</tt> are in place, we can enter the regular Arch setup script and it will do the rest, as it normally would.<br />
# /arch/setup<br />
'''Note:''' Most of the installation can be carried out normally. However, there are a few areas where it is important to make certain selections these are marked below.<br />
<br />
=== Prepare hard drive ===<br />
Skip the Partitioning and Auto-Prepare business and go straight to "Set Filesystem Mountpoints".<br />
When asked for your / (root) partition, do NOT select <tt>/dev/sda3</tt> as you normally would. Select <tt>/dev/mapper/root</tt> instead. Similarly, use <tt>/dev/mapper/home</tt> instead of <tt>/dev/sda4</tt> as the partition to be mounted as /home. The same is valid for a swap partition which is set up like the home partition. Make sure you mount <tt>/dev/sda1</tt> as the /boot partition or else the installer will not properly set up the bootloader.<br />
<br />
=== Select packages ===<br />
The base package contains all required programs. If you want you can add others but it is not required.<br />
<br />
'''Note:''' If you are installing from a release predating Voodoo (which you really shouldn't) you need to install the <tt>system/cryptsetup</tt> package.<br />
<br />
=== Install packages ===<br />
Let the setup install the packages.<br />
<br />
=== Configure System ===<br />
'''Attention:''' You need to answer the question ''Do you need support for booting from encrypted volumes?'' with ''yes''. This choice is obsolete in newer setup CDs for arch linux. You have to put the right hooks in <tt>mkinitcpio.conf</tt> yourself (See below).<br />
<br />
Let the <tt>hwdetect</tt> program detect your hardware and answer the questions asked suiting your needs, respecting the above mentioned option.<br />
<br />
'''Note: ''encrypt'' hook is only needed if your root partition is a ''LUKS'' partition (or for a LUKS partition that needs to be mounted ''before'' root). If it is a ''swap'' or ''any other partition'', all is taken care by ''rc.sysinit'' and ''/etc/crypttab'' file'''<br />
<br />
Afterwards you can check the files presented to you by the installer, the most important one being <tt>/etc/mkinitcpio.conf</tt>. For detailed info on mkinitcpio (and its configuration) refer to [[Mkinitcpio]].You have to make sure that your <tt>HOOKS</tt> looks somehow like this:<br />
HOOKS="... encrypt ... filesystems ..."<br />
It is important that the <tt>encrypt</tt> hook comes before the <tt>filesystems</tt> one. If you store your key on an external USB device (e.g. a USB stick), you need to add the USB hook too:<br />
HOOKS="... usb encrypt ... filesystems ..."<br />
For safety, add in usb before encrypt; not sure if they're run in the order they appear in mkinitcpio.conf or not. <br />
If you need support for foreign keymaps for your encryption password you have to specify the hook 'keyboard' as well. I suggest to put this in <tt>mkinitcpio.conf</tt> right before 'encrypt'.<br />
<br />
=== Install Kernel ===<br />
Select the kernel and follow the instructions presented to you by the installer.<br />
When asked to check over the <tt>/mnt/etc/mkinitcpio.d/kernel26-fallback.conf</tt> file make sure the <tt>HOOKS</tt> line looks the same as mentioned above.<br />
<br />
=== Install Bootloader ===<br />
'''GRUB:''' You have to make some small changes to the entries generated by the installer by replacing <tt>/dev/mapper/root</tt> with <tt>/dev/sda3</tt>. The corrected config looks like this:<br />
# (0) Arch Linux<br />
title Arch Linux<br />
root (hd0,0)<br />
kernel /vmlinuz26 root=/dev/sda3 ro<br />
initrd /kernel26.img<br />
For kernel >= 2.6.30:<br />
# (0) Arch Linux<br />
title Arch Linux<br />
root (hd0,0)<br />
kernel /vmlinuz26 cryptdevice=/dev/sda3:root root=/dev/mapper/root ro<br />
initrd /kernel26.img<br />
<br />
'''LILO:''' On Lilo, edit the Arch Linux section on /etc/lilo.conf and include a line for append option, over the initrd, with the "root=/dev/sda3" param. The append section make the same kernel line on grub. Also, you can ommit the root option, over the image option. The section look like this:<br />
# Arch Linux lilo section<br />
image = /vmlinuz26<br />
# root = /dev/sda3<br />
label = Arch<br />
initrd = /kernel26.img<br />
append = "root=/dev/sda3"<br />
read-only<br />
<br />
=== Exit Install ===<br />
Now that the install is finished the only thing left to do is add entries to the <tt>/etc/crypttab</tt> file so you don't have to enter the passphrase for all encrypted partitions. This works only for non-root partitions e.g. /home, swap, etc.<br />
# vi /mnt/etc/crypttab<br />
Add the following line for the <tt>/home</tt> partition<br />
home /dev/sda4 "myotherpassword"<br />
<br />
If you want to use a key file, generate a key and add it to the LUKS partition by executing the following:<br />
# head -n 220 /dev/urandom | tail -n 200 > /mnt/etc/home.key<br />
# cryptsetup luksAddKey /dev/sda4 /mnt/etc/home.key<br />
Enter any LUKS passphrase: myotherpassword<br />
Verify passphrase: myotherpassword<br />
key slot 0 unlocked.<br />
Command successful.<br><br />
Then add the following information to the <tt>/etc/crypttab</tt> file for automounting:<br />
home /dev/sda4 /etc/home.key<br />
<br />
After rebooting you should now be presented with the text<br />
A password is required to access the root filesystem:<br />
followed by a prompt for any LUKS password. Type it in and everything should boot.<br />
Once you've logged in, have a look at your mounted partitions by typing <tt>mount</tt>. You should have <tt>/dev/mapper/root</tt> mounted at <tt>/</tt> and, if you set up a separate encrypted home partition, <tt>/dev/mapper/home</tt> mounted at <tt>/home</tt>. If you set up encrypted swap, <tt>swapon -s</tt> should have <tt>/dev/mapper/swap</tt> listed as your swap partition.<br />
<br />
== Encrypting swap partition ==<br />
Sensitive data stored in memory may be written to swap at any time. If you've gone to the trouble of encrypting your root and home partitions, you should encrypt your swap as well. There are two options here: random encryption on each boot (better security), or the same encryption each time. We won't cover the second option here, as it is pretty much identical to how you set up the /home partition above. Just replace all references to home with swap, and sda4 with sda2.<br />
<br />
Arch Linux provides a convenient way for the first option, which uses dm-crypt directly without LUKS. If you're still in the archsetup process, just switch to a different virtual console (ALT+F2). If you've exited already, the new root will have been unmounted. Use <tt>mount /dev/mapper/root /mnt</tt> to mount it again.<br />
<br />
Now add an entry to the cryptsetup file:<br />
# echo swap /dev/sda2 SWAP "-c aes-xts-plain -h whirlpool -s 512" >> /mnt/etc/crypttab<br />
<br />
'''Note:''' Recommended hash algorithms are "whirlpool" (patent free), "sha256", "sha384" or "sha512". Default is "ripemd160" (not recommended).<br />
<br />
'''Note:''' Please take extra care to put the right partition here. The startup script won't ask before overwriting the provided device, destroying '''all''' data on it, unless it has a LUKS header, then it simply won't work. If you have been following these instructions closely, then in the section "Mapping Partitions" above you put a LUKS header on your swap partition. Erase it with something like the command below, replacing /dev/sda2 with the appropriate swap device:<br />
# dd if=/dev/zero of=/dev/sda2<br />
<br />
From now on, each time you boot, the partition will be encrypted automatically with a random key, and will then be formated with mkswap.<br />
<br />
Now all you have to do is adjust the corresponding entry in /etc/fstab:<br />
/dev/mapper/swap swap swap defaults 0 0<br />
<br />
And you're done! Carry on with installation or, if you've already finished, <tt>umount /mnt</tt>.<br />
<br />
== Encrypted swap with suspend-to-disk support ==<br />
To be able to resume after suspending the computer to disk (hibernate), it is required to keep the swap filesystem intact. Therefore, it is required to have a LUKS swap partition with a persistent key, which can be stored on the disk or input manually at startup. Because the resume takes place before the crypttab can be used, it is required to create a hook in mkinitcpio.conf to open the swap LUKS device before resuming.<br />
<br />
If you want to use a partition which is currently used by the system, you have to disable it, first:<br />
# swapoff /dev/<device><br />
To create the swap partition, follow steps similar to those described in [[System_Encryption_with_LUKS_for_dm-crypt#Mapping_partitions | mapping partitions]] above. Omit steps 1 and 2 if you don't intend to use a saved key file.<br><br><br />
1. Generate a random key file <b>in a safe place</b> - encrypted root partition like my examples or secure USB stick.<br />
# dd if=/dev/urandom bs=1 count=512 of=/etc/keys/swap.key<br />
2. For security reasons, no user except root should have read-access to this file.<br />
# chown root:root /etc/keys/swap.key<br />
# chmod go-rwx /etc/keys/swap.key<br />
3. Format the partition you want to use as swap with '''cryptsetup''', using the key stored previously. For performance reasons, you might want to use different ciphers with different key sizes. A benchmark can be found [http://www.saout.de/tikiwiki/tiki-index.php?page=UserPageChonhulio here].<br />
# cryptsetup -c aes-xts-plain -s 256 -v luksFormat /dev/<device> /etc/keys/swap.key<br />
* as stated in discussion: the -h parameter to specify hash function is (in this case) ignored, also the default hash - ripemd - is not recommended (citation needed). use aes-xts-plain:whirlpool , or aes-xts-sha256 instead. <br />
* check result with # cryptsetup luksDump /dev/<device>(sda3)<br />
<br />
If you don't use a saved key file, use this command:<br />
# cryptsetup -c aes-xts-plain -s 256 -v luksFormat /dev/<device><br />
4. Open the partition in ''/dev/mapper'' using the key:<br />
# cryptsetup luksOpen /dev/<device> swapDevice -d /etc/keys/swap.key<br />
If you don't use a saved key file, use this command:<br />
# cryptsetup luksOpen /dev/<device> swapDevice<br />
5. Create a swap filesystem inside the mapped partition:<br />
# mkswap /dev/mapper/swapDevice<br />
Now you should have a LUKS swap partition which uses the key file stored in ''/etc/keys/swap.key'' or asks for the passphrase before mounting, depending on your choice. Make sure you remove any line in ''/etc/crypttab'' which uses this device. Now you have to create a hook to open the swap at boot time.<br><br><br />
6. Create a file ''/lib/initcpio/hooks/openswap'' containing the open command:<br />
# vim: set ft=sh:<br />
run_hook ()<br />
{<br />
cryptsetup luksOpen /dev/<device> swapDevice -d /etc/keys/swap.key<br />
}<br />
If you don't use a saved key file, ''openswap'' should instead contain:<br />
# vim: set ft=sh:<br />
run_hook ()<br />
{<br />
cryptsetup luksOpen /dev/<device> swapDevice<br />
}<br />
7. Then create and edit the hook setup file ''/lib/initcpio/install/openswap'' as:<br />
# vim: set ft=sh:<br />
<br />
install ()<br />
{<br />
MODULES=""<br />
BINARIES=""<br />
add_file "/etc/keys/swap.key"<br />
FILES=""<br />
SCRIPT="openswap"<br />
}<br />
<br />
help ()<br />
{<br />
cat<<HELPEOF<br />
This opens the swap encrypted partition /dev/<device> in /dev/mapper/swapDevice<br />
HELPEOF<br />
}<br />
If you don't use a saved key file, remove unnecessary line '''add_file "/etc/keys/swap.key"''' from the file above.<br><br><br />
8. Add the hook ''openswap'' in the HOOKS array in ''/etc/mkinitcpio.conf'', before ''filesystem'', but '''after''' ''encrypt'' which is mandatory as well.<br><br><br />
9. Regenerate the boot image:<br />
# mkinitcpio -p kernel26<br />
10. Add the mapped partition to ''/etc/fstab'':<br />
/dev/mapper/swapDevice swap swap defaults 0 0<br />
11. Set-up your system to resume from ''/dev/mapper/swapDevice''. For example, if you use GRUB with kernel hibernation support, add "resume=/dev/mapper/swapDevice" to the kernel line in ''/boot/grub/menu.lst''. A line with encrypted root and swap partitions can look like this:<br />
kernel /vmlinuz26 cryptdevice=/dev/sda2:rootDevice root=/dev/mapper/rootDevice resume=/dev/mapper/swapDevice ro<br />
At boot time, the ''openswap'' hook will open the swap partition so the kernel resume may use it. If you use special hooks for resuming from hibernation, make sure they stand '''after''' ''openswap'' in the HOOKS array. Please note that because of initrd opening swap there is no entry for swapDevice in /etc/crypttab needed in this case.<br />
<br />
== Storing the key externally (USB stick) ==<br />
''[Consistency with the other paragraphs should be improved]''<br />
<br />
A quick method (as opposed to setting up a udev rule) involves referencing your removable device by its label (or UUID). To find your label or UUID, plug in your USB drive and run dmesg to see where the device is located in /dev (/dev/sdd in my case).<br />
<br />
Next look in /dev/disk to find a symlink to your USB drive. In my case I labeled the vfat partition on my USB drive as "Keys" so my device is always symlinked in /dev/disk/by-label/Keys, or If I had wanted to use the UUID I would find /dev/disk/by-uuid/4803-8A7B. This allows me to have a consistent naming of my USB devices regardless of the order they are plugged into the system. These device names can be used in the "cryptkey" kernel option or any where else. Filesystem UUIDs are stored in the filesystem itself, meaning that the UUID will be the same if you plug it into any other computer, and that a dd backup of it will always have the same UUID since dd does a bitwise copy.<br />
<br />
Optionally you may choose to set up your stick with an udev rule. There's some documentation in the Arch wiki about that already, if you want more in-depth, structural info, read [http://reactivated.net/writing_udev_rules.html this guide]. Here's quickly how it goes.<br />
<br />
Get the serial number from your USB stick:<br />
lsusb -v | grep -A 5 Vendor<br />
Create a udev-rule for it:<br />
echo 'KERNEL=="sd*", ATTRS{serial}=="$SERIAL", SYMLINK+="$SYMLINK%n"' > /etc/udev/rules.d/8-usbstick.rules<br />
Replace $SYMLINK and $SERIAL with their respective values. %n will expand to the partition (just like sda is subdivided into sda1, sda2, ...). You do not need to go with the 'serial' attribute, if you have a custom rule of your own, you can put it in as well (e.g. using the vendor name). <br />
<br />
Rescan your sysfs:<br />
udevadm trigger<br />
Now check the contents of dev:<br />
ls /dev<br />
It should show your device with your desired name. <br />
<br />
Generate a temporary keyfile:<br />
dd if=/dev/urandom of=secretkey bs=512 count=4<br />
<br />
To store the key file, you have two options. The first is less risky than the other :-). We assume you are using a FAT-formatted USB stick here, if not, change the MODULES=() line in /etc/mkinitcpio.conf accordingly to provide support for your device.<br />
<br />
Now you have to add two extra modules in your /etc/mkinitcpio.conf, one for the stick's file system and one for the codepage:<br />
further you should tell mkinitcpio about your udev-rule:<br />
MODULES="ata_generic ata_piix nls_cp437 vfat"<br />
FILES="/etc/udev/rules.d/8-usbstick.rules"<br />
Replace those module names if you use another file system on your USB stick (e.g. ext2) or another codepage. Users running the stock Arch kernel should stick to the codepage mentioned here.<br />
<br />
Generate a new image (maybe you should take a copy of your old kernel26.img before):<br />
mkinitcpio -g /boot/kernel26.img<br />
<br />
=== Storing the key as plain (visible) file ===<br />
Be sure to choose a plain name for your key - a bit of 'security through obscurity' is always nice ;-). Avoid using dots (hidden files) and similar characters - the encrypt hook will fail to find the keyfile during the boot process.<br />
<br />
You have to add a kernel parameter in your menu.lst (grub), it should look something like this:<br />
kernel /vmlinuz26 root=/dev/hda3 ro vga=791 cryptkey=/dev/usbstick1:vfat:/secretkey<br />
This assumes /dev/usbstick1 is the FAT partition of your choice.<br />
<br />
That's all, reboot and have fun!<br />
<br />
=== Storing the key between MBR and 1st partition ===<br />
Add the temporary keyfile we created before with cryptsetup:<br />
cryptsetup luksAddKey /dev/hda3 secretkey<br />
<br />
That should return you output like this:<br />
Enter any LUKS passphrase:<br />
key slot 0 unlocked.<br />
Command successful.<br />
<br />
Next you'll have to write the key directly between MBR and first partition.<br />
<br />
WARNING: you should only follow this step if you know what you are doing - <b>it can cause data loss and damage your partitions or MBR on the stick!</b><br />
<br />
If you have a bootloader installed on your drive you have to adjust the values. E.g. Grub needs the first 16 sectors, you would have to replace seek=4 with seek=16; otherwise you would overwrite parts of your Grub installation. When in doubt, take a look at the first 64 sectors of your drive and decide on your own where to place your key. <br />
<br />
<i>Optional</i><br />
dd if=/dev/usbstick of=64sectors bs=512 count=64 # gives you copy of your first 64 sectors<br />
hexcurse 64sectors # determine free space<br />
<br />
Write your key to the disk:<br />
dd if=secretkey of=/dev/usbstick bs=512 seek=4<br />
<br />
If everything went fine you can now overwrite and delete your temporary secretkey:<br />
shred --remove --zero secretkey<br />
You should not simply use rm as the keyfile would only be unlinked from your filesystem and be left physically intact.<br />
<br />
Now you have to add a kernel parameter in your menu.lst (Grub), it should look something like this:<br />
kernel /vmlinuz26 root=/dev/hda3 ro vga=791 cryptkey=/dev/usbstick:2048:2048<br />
Format for the cryptkey option:<br />
cryptkey=BLOCKDEVICE:OFFSET:SIZE<br />
OFFSET and SIZE match in this example, but this is coincidence - they can differ (and often will). An other possible example could be<br />
kernel /vmlinuz26 root=/dev/hda3 ro vga=791 cryptkey=/dev/usbstick:8192:2048<br />
That's all, reboot and have fun! And look if your partitions still work after that ;-).<br />
<br />
== Backup the cryptheader ==<br />
<br />
When the header of your crypted partition was destroyed, you will not be able to decrypt your data.<br />
So creating a backup of the headers and storing them on another disk might be a good idea.<br />
<br />
=== Backup ===<br />
<br />
First you have to find out the payload offset of the crypted partition (replace sdaX with the corresponding partition)<br />
cryptsetup luksDump /dev/sdaX | grep "Payload offset"<br />
Payload offset: 4040<br />
Now that you know the value, you can backup the header with a simple dd command<br />
dd if=/dev/sdaX of=./backup.img bs=512 count=4040<br />
<br />
=== Restore ===<br />
<br />
Be careful before restore: make sure that you chose the right partition (again replace sdaX with the corresponding partition).<br />
Restoring the wrong header or restoring to an unencrypted partition will cause data loss.<br />
dd if=./backup.img of=/dev/sdX bs=512 count=4040<br />
<br />
== Encrypting a loopback filesystem ==<br />
<br />
''[This paragraph has been merged from another page; its consistency with the other paragraphs should be improved]<br />
<br />
=== Preparation and mapping ===<br />
So, let's start by creating an encrypted container!<br />
<br />
dd if=/dev/zero of=/bigsecret bs=1M count=10 # you can also use if=/dev/urandom, if you're really paranoid<br />
<br />
This will create the file 'bigsecret' with a size of 10 megabytes.<br />
<br />
losetup /dev/loop0 /bigsecret<br />
<br />
This will create the device node /dev/loop0, so that we can mount/use our container. (Note: if it gives you the error "/dev/loop0: No such file or directory", you need to first load the kernel module with <tt>modprobe loop</tt>)<br />
<br />
cryptsetup luksFormat /dev/loop0<br />
<br />
This will ask you for a password for your new container file. (Note: if you get an error like "Command failed: Failed to setup dm-crypt key mapping. Check kernel for support for the aes-cbc-essiv:sha256 cipher spec and verify that /dev/loop0 contains at least 133 sectors", then run <tt>modprobe dm-mod</tt>)<br />
<br />
cryptsetup luksOpen /dev/loop0 secret<br />
<br />
The encrypted container is now available through the devicefile /dev/mapper/secret.<br />
Now we are able to create a partition in the container:<br />
<br />
mkfs.ext2 /dev/mapper/secret<br />
<br />
and mount it...<br />
<br />
mkdir /mnt/secret<br />
mount -t ext2 /dev/mapper/secret /mnt/secret<br />
<br />
We can now use the container as if it was a normal partition!<br />
To unmount the container:<br />
<br />
umount /mnt/secret<br />
cryptsetup luksClose secret<br />
losetup -d /dev/loop0 # free the loopdevice.<br />
<br />
so, if you want to mount the container again, you just apply the following commands:<br />
<br />
losetup /dev/loop0 /bigsecret<br />
cryptsetup luksOpen /dev/loop0 secret<br />
mount -t ext2 /dev/mapper/secret /mnt/secret<br />
<br />
Pretty easy, huh?<br />
<br />
=== Encrypt using a key-file ===<br />
Let's first generate a 2048 Byte random keyfile :<br />
<br />
dd if=/dev/urandom of=keyfile bs=1k count=2<br />
<br />
We can now format our container using this key<br />
<br />
cryptsetup luksFormat /dev/loop0 keyfile<br />
<br />
or our partition : <br />
<br />
cryptsetup luksFormat /dev/hda2 keyfile<br />
<br />
Once formatted, we can now open the luks device using the key:<br />
<br />
cryptsetup -d keyfile luksOpen /dev/loop0 container<br />
<br />
You can now like before format the device /dev/mapper/container with your favorite filesystem and then mount it just as easily.<br />
<br />
The keyfile is now the only key to your file. I personally advise to encrypt your keyfile using your private GPG key and storing an offsite secured copy of the file.<br />
<br />
== Encrypting a LVM setup ==<br />
It's really easy to use encryption together with LVM. We are not going to cover the process of setting up LVM here as there is already a guide for that ([[Installing_with_Software_RAID_or_LVM]]).<br />
<br />
The best method and easier method to follow for a laptop is to set up the LVM on top of the encrypted partition instead of the other way around. This link here is easy to follow and explains everything: [http://www.pindarsign.de/webblog/?p=767 Arch Linux: LVM on top of an encrypted partition]<br />
<br />
To use encryption on top of LVM, you have to first setup your lvm volumes and then use them as base for the encrypted partitions. That means in short that you have to setup lvm at first. Then follow this guide, but replace all occurrences of /dev/sdXy in the guide with its lvm counterpart. (eg: /dev/sda4 -> /dev/<volume group name>/home).<br />
<br />
Don't forget to add the "lvm2" hook in /etc/mkinitcpio.conf '''before''' the "encrypt" hook. And you will have to change USELVM in /etc/rc.conf to yes.<br />
<br />
== Applying this to a non-root partition ==<br />
You might get tempted to apply all this fancy stuff to a non-root partition. Arch does not support this out of the box, however, you can easily change the cryptdev and cryptname values in /lib/initcpio/hooks/encrypt (the first one to your /dev/sd* partition, the second to the name you want to attribute). That should be enough.<br><br />
The big advantage is you can have everything automated, while setting up /etc/crypttab with an external key file (i.e. not on any internal HD partition) can be a pain - you need to make sure the USB/FireWire/... device gets mounted before the encrypted partition, which means you have to change fstab order (at least).<br><br />
Of course, if the cryptsetup package gets upgraded, you will have to change this script again. However, this solution is to be preferred over hacking rc.sysinit or similar files. Unlike /etc/crypttab, only one partition is supported, but with some further hacking one should be able to have multiple partitions unlocked.<br />
<br />
<br />
If you want to do this on a software RAID partition, there's one more thing you need to do. Just setting the /dev/mdX device in /lib/initcpio/hooks/encrypt is not enough; the encrypt hook will fail to find the key for some reason, and not prompt for a passphrase either. It looks like the RAID devices aren't brought up until after the encrypt hook is run. You can solve this by putting the RAID array in /boot/grub/menu.lst, like <br />
kernel /boot/vmlinuz26 md=1,/dev/hda5,/dev/hdb5<br />
<br />
If you set up your root partition as a RAID array you will notice the similarities with that setup ;-). Grub can handle multiple array definitions just fine:<br />
kernel /boot/vmlinuz26 root=/dev/md0 ro md=0,/dev/sda1,/dev/sdb1 md=1,/dev/sda5,/dev/sdb5,/dev/sdc5<br />
== Short version ==<br />
=== Notes ===<br />
==== LVM ====<br />
If you're enough smart enough for this, you'll be smart enough to ignore/replace LVM-specific things if you don't want to use LVM.<br />
<br />
=== Partitioning scheme ===<br />
/dev/sda1 -> /boot<br />
/dev/sda2 -> LVM<br />
=== The commands ===<br />
cryptsetup -d /dev/random -c aes-xts-plain -s 512 create lvm /dev/sda2<br />
dd if=/dev/urandom of=/dev/mapper/lvm<br />
cryptsetup remove lvm<br />
lvm pvcreate /dev/sda2<br />
lvm vgcreate lvm /dev/sda2<br />
lvm lvcreate -L 10G -n root lvm<br />
lvm lvcreate -L 500M -n swap lvm<br />
lvm lvcreate -L 500M -n tmp lvm<br />
lvm lvcreate -l 100%FREE -n home lvm<br />
cryptsetup luksFormat -c aes-xts-plain -s 512 /dev/lvm/root<br />
cryptsetup luksOpen /dev/lvm/root root<br />
mkreiserfs /dev/mapper/root<br />
mount /dev/mapper/root /mnt<br />
dd if=/dev/zero of=/dev/sda1 bs=1M<br />
mkreiserfs /dev/sda1<br />
mkdir /mnt/boot<br />
mount /dev/sda1 /mnt/boot<br />
mkdir -p -m 700 /mnt/etc/luks-keys<br />
dd if=/dev/random of=/mnt/etc/luks-keys/home bs=1 count=256<br />
=== Install Arch Linux ===<br />
/arch/setup<br />
=== Configuration ===<br />
==== /etc/rc.conf ====<br />
Change ''USELVM="no"'' to ''USELVM="yes"''.<br />
==== /etc/mkinitcpio.conf ====<br />
Put ''lvm2 encrypt'' before ''filesystems.<br />
==== /boot/grub/menu.lst ====<br />
Change ''root=/dev/hda3'' to ''root=/dev/lvm/root''.<br><br />
For kernel >= 2.6.30, you should change ''root=/dev/hda3'' to:<br />
''cryptdevice=/dev/lvm/root:root root=/dev/mapper/root''<br />
<br />
==== /etc/fstab ====<br />
/dev/mapper/root / reiserfs defaults 0 1<br />
/dev/sda1 /boot reiserfs defaults 0 2<br />
/dev/mapper/tmp /tmp tmpfs defaults 0 0<br />
/dev/mapper/swap none swap sw 0 0<br />
<br />
==== /etc/crypttab ====<br />
swap /dev/lvm/swap SWAP -c aes-xts-plain -h whirlpool -s 512<br />
tmp /dev/lvm/tmp /dev/urandom -c aes-xts-plain -s 512<br />
<br />
=== After reboot ===<br />
==== The commands ====<br />
cryptsetup luksFormat -c aes-xts-plain -s 512 /dev/lvm/home /etc/luks-keys/home<br />
cryptsetup luksOpen -d /etc/luks-keys/home /dev/lvm/home home<br />
mkreiserfs /dev/mapper/home<br />
mount /dev/mapper/home /home<br />
==== /etc/crypttab ====<br />
home /dev/lvm/home /etc/luks-keys/home<br />
==== /etc/fstab ====<br />
/dev/mapper/home /home reiserfs defaults 0 0<br />
<br />
== / on lvm on luks ==<br />
Make sure your kernel commandline looks like this:<br />
root=/dev/mapper/<volume-group>-<logical-volume> cryptdevice=/dev/<luks-part>:<volume-group><br />
for example:<br />
root=/dev/mapper/vg-arch cryptdevice=/dev/sda4:vg<br />
<br />
Or like this:<br />
cryptdevice=/dev/<volume-group>/<logical-volume>:root root=/dev/mapper/root</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=Audacious&diff=79959
Audacious
2009-10-22T07:14:01Z
<p>SkonesMickLoud: /* New UI in Audacious 2 */</p>
<hr />
<div>[[Category: Audio/Video (English)]]<br />
=Description=<br />
[http://audacious-media-player.org/ Audacious] is an advanced fork of Beep Media Player. It is free, lightweight, based on GTK2 and is focused on audio quality and supporting a wide range of audio codecs. Audacious is extensible through third-party plugins.<br />
<br />
Features:<br />
*Large amount of audio codecs supported (and even more with [http://aur.archlinux.org/packages.php?ID=13050 xmp] plugin),<br />
*PulseAudio, ALSA, OSS, Crossfade output (also file and null),<br />
*WAV, Vorbis, Mp3, FLAC transcoding,<br />
*Sound effects,<br />
*Visualization,<br />
*Scrobbler plugin, OSD, EvDev, status icon, alarm,<br />
*Streaming support<br />
<br />
=Installation=<br />
Audacious 2.1.0 is available from official repository. To install it, use [[Pacman]]:<br />
<br />
pacman -Sy audacious<br />
<br />
=Audtool=<br />
Audacious is shipped with powerful management tool called Audtool. Audtool could be used to retrieve information or to control the player.<br />
<br />
For example, to retrieve current song title or artist you can use:<br />
<br />
audtool current-song<br />
<br />
audtool current-song-tuple-data artist<br />
<br />
There are also functions to control playback, to manipulate playlist, equalizer and main window. For the whole option list see<br />
<br />
audtool --help<br />
<br />
'''Note:''' for Audacious2 audtool application is called '''audtool2'''.<br />
<br />
=New UI in Audacious 2=<br />
Audacious 2 has an option to use alternative UI's. To use new GTK user interface, launch audacious2 with<br />
<br />
audacious2 -i newui<br />
<br />
If that doesn't work, try<br />
<br />
audacious2 -i gtkui<br />
<br />
=Standard UI skins=<br />
Audacious supports Winamp classic skins, so you can use any of them with Audacious. Launch Audacious with:<br />
<br />
audacious2 -i skinned<br />
<br />
There are some places where skins could be found:<br />
<br />
[http://www.customize.org/list/winamp2 http://www.customize.org/list/winamp2]<br />
<br />
[http://www.deviantart.com/#catpath=customization/skins/media/winamp/classic http://www.deviantart.com/#catpath=customization/skins/media/winamp/classic]<br />
<br />
=Play Audio CD=<br />
pacman -S libcdio<br />
After install libcdio can play Audio CD via Main menu (right click) > Plugin Services > Add CD.<br />
<br />
Reference:<br />
http://bbs.archlinux.org/viewtopic.php?id=40075</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=RTorrent&diff=76952
RTorrent
2009-10-03T03:27:30Z
<p>SkonesMickLoud: /* Send Text Message Upon Torrent Completion Using GMail */</p>
<hr />
<div>[[Category:Internet and Email (English)]]<br />
[[Category:Utilities (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|RTorrent}}<br />
{{i18n_entry|Español|RTorrent - cliente de bittorrent en línea de órdenes (Español)}}<br />
{{i18n_entry|简体中文|RTorrent (简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
'''''[http://libtorrent.rakshasa.no/ rTorrent]''''' is a very simple, elegant and ultra-light bittorent client. It is written in C++ and uses ncurses, so it is completely text based and runs entirely in a console. rTorrent is ideal for low-end systems and with the addition of GNU Screen and openssh it is convenient as a remote bittorrent client. <br />
<br />
== Installing ==<br />
<br />
pacman -S rtorrent<br />
You can also install the SVN version from the AUR:<br />
yaourt -S rtorrent-svn<br />
<br />
== Configuring ==<br />
<br />
Before running rTorrent, the first step is to copy the default configuration file which is available at the rTorrent [http://libtorrent.rakshasa.no/browser/trunk/rtorrent/doc/rtorrent.rc?format=raw project page] and save the file as .rtorrent.rc into your home directory. <br />
<br />
Once the file has been saved, open it with your preferred text editor and make any necessary changes. Simply uncomment the options you wish to enable/utilize. For more detailed information on the options available, visit [http://libtorrent.rakshasa.no/wiki/RTorrentCommonTasks rTorrent Common Tasks]<br />
<br />
=== Recommended Configuration ===<br />
<br />
These values in the following are subjective and dependent upon your own system and Internet connection speed. To find the optimal settings for you to use, visit the following website and follow the instructions: [http://torrentfreak.com/optimize-your-BitTorrent-download-speed Optimize Your BitTorrent Download Speed]<br />
<br />
<pre><br />
# Maximum and minimum number of peers to connect to per torrent.<br />
#min_peers = 40<br />
max_peers = 52<br />
<br />
# Same as above but for seeding completed torrents (-1 = same as downloading)<br />
#min_peers_seed = 10<br />
max_peers_seed = 52<br />
<br />
# Maximum number of simultanious uploads per torrent.<br />
max_uploads = 8<br />
<br />
# Global upload and download rate in KiB. "0" for unlimited.<br />
download_rate = 200<br />
upload_rate = 28<br />
</pre><br />
<br />
This option below will determine where your torrents data will be saved. Change the default save directory to whatever you wish to use. Be sure to enter the absolute path; there is an odd bug with rTorrent ''sometimes'' does not respect relative paths (i.e. ~/torrents):<br />
<br />
<pre><br />
# Default directory to save the downloaded torrents.<br />
directory = /home/[user]/torrents/<br />
</pre><br />
<br />
This option will allow rTorrent to save the progess of your torrents. Be sure to create a directory called .session (simply run as normal user:''mkdir ~/.session''):<br />
<br />
<pre><br />
# Default session directory. Make sure you don't run multiple instance<br />
# of rtorrent using the same session directory. Perhaps using a<br />
# relative path?<br />
session = /home/[user]/.session/<br />
</pre><br />
<br />
The following option will have rTorrent "watch" a particular directory for new .torrent files. Using your browser, when you find a .torrent file you would like to download, just save the file into this directory and rTorrent will automatically start the torrent. Be sure to create the directory that will be watched (simply run as normal user:''mkdir ~/watch''): <br />
<br />
<pre><br />
# Watch a directory for new torrents, and stop those that have been<br />
# deleted.<br />
#schedule = watch_directory,5,5,load_start=./watch/*.torrent<br />
#schedule = untied_directory,5,5,stop_untied=<br />
schedule = watch_directory,5,5,load_start=/home/[user]/watch/*.torrent<br />
schedule = untied_directory,5,5,stop_untied=<br />
schedule = tied_directory,5,5,start_tied=<br />
</pre><br />
<br />
This option below will stop rTorrent from downloading any further when disk space is low. This is particuarly useful with a [http://en.wikipedia.org/wiki/Seedbox Seedbox] where disk space is quite limited. Change the value as you like: <br />
<br />
<pre><br />
# Close torrents when diskspace is low.<br />
schedule = low_diskspace,5,60,close_low_diskspace=100M<br />
</pre><br />
<br />
This option will set what port to use for listening. It is recommended to use a port that is higher than 49152. rTorrent allows the use of a single port rather than a range; a single port rather than an actual range is recommended.<br />
<br />
<pre><br />
# Port range to use for listening.<br />
port_range = 49164-49164<br />
</pre><br />
<br />
The following option allow for a hash check whenever a torrent is complete or whenever rTorrent is restarted. This will make sure there are no errors with your acquired/seeding files. <br />
<br />
<pre><br />
# Check hash for finished torrents. Might be usefull until the bug is<br />
# fixed that causes lack of diskspace not to be properly reported.<br />
check_hash = yes<br />
</pre><br />
<br />
The following option allows for the enabling of encryption. This is very important to enable, if not for yourself, but for others in the torrent swarm; people might need to obscure their bandwidth usage from their ISP. Does not hurt you to enable even if you do not need such protection. More information: [http://en.wikipedia.org/wiki/BitTorrent_protocol_encryption Bittorrent Protocol Encryption]<br />
<br />
<pre><br />
# Encryption options, set to none (default) or any combination of the following:<br />
# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext<br />
#<br />
# The example value allows incoming encrypted connections, starts unencrypted<br />
# outgoing connections but retries with encryption if they fail, preferring<br />
# plaintext to RC4 encryption after the encrypted handshake<br />
#<br />
# encryption = allow_incoming,enable_retry,prefer_plaintext<br />
encryption = allow_incoming,try_outgoing,enable_retry<br />
</pre><br />
<br />
The following is for DHT support. If you use public trackers, you'll want to enable DHT to acquire more peers. If you use only private trackers, '''do not enable DHT''' as this will reduce your speeds and can create a privacy risk. Some private trackers will even warn you if you use DHT. <br />
<br />
<pre><br />
# Enable DHT support for trackerless torrents or when all trackers are down.<br />
# May be set to "disable" (completely disable DHT), "off" (do not start DHT),<br />
# "auto" (start and stop DHT as needed), or "on" (start DHT immediately).<br />
# The default is "off". For DHT to work, a session directory must be defined.<br />
# <br />
# dht = auto<br />
<br />
# UDP port to use for DHT. <br />
# <br />
# dht_port = 6881<br />
<br />
# Enable peer exchange (for torrents not marked private)<br />
#<br />
# peer_exchange = yes<br />
</pre><br />
<br />
Be sure to forward the proper port(s) with your router if you use one. A decent guide per router make/model can be found [http://portforward.com/english/routers/port_forwarding/routerindex.htm here].<br />
<br />
== Controls ==<br />
<br />
rTorrent relies exclusively on keyboard shortcuts for user input.<br />
A complete guide is available on the main site: [http://libtorrent.rakshasa.no/wiki/RTorrentUserGuide rTorrent User Guide]<br />
<br />
Here are the basics for quick reference:<br />
<br />
*Control-q : closes rTorrent, done twice makes the program shutdown without waiting to send stopping information to the trackers.<br />
*Left arrow : returns to the previous screen.<br />
*Right arrow : goes to the next screen.<br />
*a|s|d : increase global upload throttle about 1|5|50 KB/s<br />
*A|S|D : increase global download throttle about 1|5|50 KB/s<br />
*z|x|c : decrease global upload throttle about 1|5|50 KB/s<br />
*Z|X|C : decrease global download throttle about 1|5|50 KB/s<br />
*Control-S : starts download<br />
*Control-D : stops an active download, removes a stopped download.<br />
*+ or - : changes the download priority of selected torrent.<br />
*Backspace : adds the specified .torrent. After pressing this button write full path or URL of .torrent file. You can use Tab and other tricks from bash.<br />
<br />
== Use rTorrent with Screen ==<br />
<br />
Screen is a program that will allow CLI applications to be run in the background and without X running. <br />
<br />
To install:<br />
<br />
<pre><br />
pacman -S screen<br />
</pre><br />
<br />
and then copy screenrc to your home directory as normal user:<br />
<br />
<pre><br />
cp /etc/screenrc ~/.screenrc<br />
</pre><br />
<br />
To have rTorrent always start with screen, add the following to your .screenrc file:<br />
<br />
<pre><br />
screen -t rtorrent rtorrent <br />
</pre><br />
<br />
To start screen + rTorrent, simply run ''screen'' from a terminal. Control-a followed by d will detach screen, and running ''screen -r'' will open screen again.<br />
<br />
===On a remote machine===<br />
Most setups of rTorrent on a remote machine involve using Screen. Supposing you have a detached Screen session with rtorrent on the remote machine (and the option to [[SSH]] into it), you can gain access to it using:<br />
<pre>/usr/bin/ssh -t -p <ssh port on remote machine> <user>@<remote machine> screen -RD</pre><br />
If you want immediate access on startup, you will need to [http://bloggerdigest.blogspot.com/2006/11/ssh-auto-login-or-passwordless-login.html upload a key] from your machine to remote host (so you will not be prompted for a password) and setup a terminal to run the command above. An inittab example using [http://aur.archlinux.org/packages.php?ID=19631 rungetty] on virtual console 4:<br />
<pre>sam:45:respawn:/sbin/rungetty tty4 -u <local user> -- /usr/bin/ssh -t -p <ssh port on remote machine> <remote user>@<remote machine> screen -RD</pre><br />
<br />
===rtorrent Daemon with screen===<br />
<br />
I use this on my home server to run rtorrent w/ screen as a daemon. With the username ''rtorrent''<br />
Just create an ''rtorrent'' file in your ''/etc/rc.d/'' and add the following code.<br />
<br />
<pre><br />
#!/bin/bash<br />
<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
case "$1" in<br />
start)<br />
stat_busy "Starting rtorrent"<br />
su rtorrent -c 'screen -d -m rtorrent' &> /dev/null<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
add_daemon rtorrent<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping rtorrent"<br />
killall -w -s 2 /usr/bin/rtorrent &> /dev/null<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon rtorrent<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
exit 0<br />
</pre><br />
<br />
On a remote computer I use the following script to connect to the server's daemon process:<br />
<br />
<pre><br />
ssh -t rtorrent@192.168.1.10 'screen -r'<br />
</pre><br />
<br />
== Additional Tips ==<br />
<br />
*To use rTorrent with a tracker that uses https, do the following as root:<br />
<br />
<pre><br />
cd /etc/ssl/certs<br />
wget --no-check-certificate https://www.geotrust.com/resources/root_certificates/certificates/Equifax_Secure_Global_eBusiness_CA-1.cer<br />
mv Equifax_Secure_Global_eBusiness_CA-1.cer Equifax_Secure_Global_eBusiness_CA-1.pem<br />
c_rehash<br />
</pre><br />
<br />
And from now on run rTorrent with:<br />
<br />
<pre><br />
rtorrent -o http_capath=/etc/ssl/certs<br />
</pre><br />
<br />
Be sure to change .screenrc to reflect this change if you use screen:<br />
<br />
<pre><br />
screen -t rtorrent rtorrent -o http_capath=/etc/ssl/certs<br />
</pre><br />
<br />
<br />
*To create .torrent files, I recommend [http://aur.archlinux.org/packages.php?do_Details=1&ID=10635&O=0&L=0&C=0&K=mktorrent&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd mktorrent] for commandline interface or [http://benclarke.ca/rubytorrent/ RubyTorrent] for GUI. <br />
<br />
<br />
===Send Text Message Upon Torrent Completion Using GMail===<br />
<br />
Cell phone providers allow you to "email" your phone:<br />
<pre><br />
Verizon: 10digitphonenumber@vtext.com<br />
Former AT&T customers: 10digitphonenumber@mmode.com<br />
Sprint: 10digitphonenumber@messaging.sprintpcs.com<br />
T-Mobile: 10digitphonenumber@tmomail.net<br />
Nextel: 10digitphonenumber@messaging.nextel.com<br />
Cingular: 10digitphonenumber@cingularme.com<br />
Virgin Mobile: 10digitphonenumber@vmobl.com<br />
Alltel: 10digitphonenumber@alltelmessage.com OR<br />
10digitphonenumber@message.alltel.com<br />
CellularOne: 10digitphonenumber@mobile.celloneusa.com<br />
Omnipoint: 10digitphonenumber@omnipointpcs.com<br />
Qwest: 10digitphonenumber@qwestmp.com<br />
</pre><br />
If you have Verizon, your cell phone's "email" is 5551234567@vtext.com<br />
<br />
*Install '''Heirloom's mailx''' program:<br />
<pre><br />
pacman -Sy mailx-heirloom<br />
</pre><br />
<br />
*Clear the /etc/nail.rc file and enter:<br />
<pre><br />
set smtp=smtp.gmail.com:587<br />
set smtp-use-starttls<br />
set ssl-verify=ignore<br />
set ssl-auth=login<br />
set smtp-auth-user=USERNAME@gmail.com<br />
set smtp-auth-password=PASSWORD<br />
</pre><br />
<br />
Now to send the text, we must pipe a message to the mailx program.<br />
*Make a bash script (/path/to/mail.sh):<br />
<pre><br />
echo "$@: Done" | mailx 5551234567@vtext.com<br />
</pre><br />
Where the $@ is a variable holding all the arguments passed to our script.<br />
<br />
*And finally, add the important ~/.rtorrent.rc line:<br />
<pre><br />
on_finished = notify_me,"execute=/path/to/mail.sh,$d.get_name="<br />
</pre><br />
Breaking it down:<br />
<br />
<code>notify_me</code> is the command id, which may be used by other commands, it can be just about anything you like, so long as it is unique.<br><br />
<br />
<code>execute=</code> is the rtorrent command, in this case to execute a shell command.<br><br />
<br />
<code>/path/to/mail.sh</code> is the name of our script (or whatever command you want to execute) followed by a comma separated list of all the switches/arguments to be passed.<br><br />
<br />
<code>$d.get_name=</code> 'd' is an alias to whatever download triggered the command, get_name is a function which returns the name of our download, and the '$' tells rtorrent to replace the command with its output before it calls execute.<br><br />
<br />
The end result? When that torrent, 'All Live Nudibranches', that we started before leaving for work finishes, we'll be texted:<br />
<pre>All Live Nudibranches: Done</pre><br />
<br />
=== See Also ===<br />
<br />
[[Screen Tips|Screen Tips]]<br />
<br />
A Detailed Intro to Bittorrent including definition of terms [http://www.dessent.net/btfaq/#terms terms]<br />
<br />
== Web GUI Clients for RTorrent ==<br />
* [[WTorrent]] a web interface to rtorrent programmed in php using Smarty templates and XMLRPC for PHP library.<br />
* [http://code.google.com/p/ntorrent/ nTorrent] A graphical user interface client to rtorrent (a cli torrent client) written in java.<br />
* [http://projects.cyla.homeip.net/rtwi/ rTWi] a simple rTorrent web interface written in PHP.<br />
* [http://code.google.com/p/rtgui/ rtGui] a web based front end for rTorrent written in PHP and uses XML-RPC to communicate with the rTorrent client.</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=Arch_is_the_best&diff=74761
Arch is the best
2009-08-28T03:19:57Z
<p>SkonesMickLoud: /* Translations */</p>
<hr />
<div>[[Category:About Arch (English)]]<br />
<br />
==Purpose==<br />
The '''Arch is the best''' project is a very sophisticated and exquisite, ego-boosting and mind-blowing (albeit perhaps a bit over-engineered) project which aims to prove Arch's superiority.<br />
<br />
==History==<br />
The project was initiated in April 2008 by long time Arch community member [http://bbs.archlinux.org/profile.php?id=2529 lucke] as a simple shell script which provided irrefutable proof that "Arch is the best". Over the following weeks, this project gathered momentum and was ported to multiple different languages, both programming and verbal.<br />
<br />
==The Code==<br />
The "Arch is the best" project is ported to many programming languages.<br />
<br />
'''Ada''' - A pascal dialect<br />
<br />
with Ada.Text_IO;<br />
use Ada.Text_IO;<br />
procedure ArchIsTheBest is<br />
begin<br />
Put_Line("Arch is the best!");<br />
end HelloWorld;<br />
<br />
'''Awk'''<br />
<br />
BEGIN {<br />
print "Arch is the best!"<br />
}<br />
<br />
'''Portable GNU assembler''' - as -o arch.o arch.s && ld -o arch -O0 arch.o<br />
<br />
.section .data<br />
archIsBest: <br />
.ascii "Arch is the best!\n"<br />
archIsBest_len:<br />
.long . - archIsBest<br />
.section .text<br />
.globl _start<br />
_start:<br />
xorl %ebx, %ebx<br />
movl $4, %eax <br />
xorl %ebx, %ebx<br />
incl %ebx <br />
leal archIsBest, %ecx<br />
movl archIsBest_len, %edx <br />
int $0x80 <br />
xorl %eax, %eax<br />
incl %eax<br />
xorl %ebx, %ebx <br />
int $0x80<br />
<br />
'''Bash''' - the original program, should be compatible with any shell<br />
#!/bin/bash<br />
<br />
echo "Arch is the best!"<br />
<br />
'''Bash (Alternate)''' - handy for piping the output to your favourite IRC/email/IM client. Should work with any shell.<br />
#!/bin/bash<br />
yes Arch is the best!<br />
<br />
'''C''' - note the three space indenting used in this project, much like that used by other superior beings.<br />
#include <stdio.h><br />
#include <stdlib.h><br />
int main (int argc, char *argv[]) <br />
{<br />
fprintf("Arch is the best!\n");<br />
exit(EXIT_SUCCESS);<br />
}<br />
<br />
'''C++''' - Arch == Linux++<br />
#include <iostream><br />
#include <cstdlib><br />
int main (int argc, char *argv[])<br />
{<br />
std::cout << "Arch is the best!" << std::endl;<br />
exit(EXIT_SUCCESS);<br />
}<br />
<br />
'''Clojure''' - A Lisp dialect that runs on the JVM<br />
(def translations {"english" "Arch is the best!",<br />
"german" "Arch ist das Beste!",<br />
"australian" "Arch is fair dinkum, mate!",<br />
"h4x0r" "arhc 51 7he be57!",<br />
"spanish" "¡Arch es el mejor!"})<br />
<br />
(defn arch-is-the-best<br />
"Asks for a language and prints the corresponding translation. <br />
Loops until input is 'quit'"<br />
[]<br />
(println "Available languages: ")<br />
(doseq [language (keys translations)]<br />
(println (str "\t" language)))<br />
(flush)<br />
(loop []<br />
(print "Enter language, or quit: ")<br />
(flush)<br />
(let [input (. (read-line) toLowerCase)]<br />
(if (= input "quit")<br />
(println "Goodbye!")<br />
(do<br />
(println (translations input "Bad input!"))<br />
(recur))))))<br />
<br />
'''Common Lisp''' - Tested on SBCL, feel free to add more of the translations in<br />
#!/usr/bin/sbcl --script<br />
(defparameter *best-list* '((English "Arch is the best!")<br />
(Chinese "Arch, 她出类拔萃!")<br />
(German "Arch ist das Beste!")<br />
(Greek "Το Arch είναι το καλύτερο!")))<br />
(defun aitb ()<br />
(format t "Available languages: ~{~{~@(~a~)~*~}~^, ~}.~%" *best-list*)<br />
(loop for input = (progn (format t "~&Input the desired language, (or 'quit'): ~%")<br />
(force-output)<br />
(read-line))<br />
if (string-equal input "quit")<br />
do (loop-finish)<br />
else<br />
do (let ((language-def<br />
(assoc input *best-list*<br />
:key (lambda (lang) (symbol-name lang))<br />
:test #'string-equal)))<br />
(if language-def<br />
(format t "~&~A~%" (second language-def))<br />
(format t "~&Invalid language.~%"))))<br />
(format t "~&May the Arch be with you!~%"))<br />
(aitb)<br />
<br />
'''Haskell''' - The language where IO is easy and unproblematic<br />
main = print "Arch is the best!"<br />
<br />
'''Python''' - a python version<br />
#!/usr/bin/env python<br />
<br />
print 'Arch is the best!'<br />
<br />
'''Ruby''' - a Ruby version<br />
#!/usr/bin/ruby -w<br />
<br />
puts 'Arch is the best!'<br />
<br />
'''Perl''' - a Perl version<br />
#!/usr/bin/perl<br />
<br />
print "Arch is the best!\n";<br />
<br />
'''Prolog''' - a version in Prolog<br />
format('Arch is the best~n',[]).<br />
<br />
'''Common Lisp''' - should run on any implementation (Clisp, Allegro, SBCL...)<br />
(princ "Arch is the best!")<br />
<br />
'''brainf*ck''' - doesn't the language name exaplain it?<br />
++>++++++>+++++<+[>[->+<]<->++++++++++<]>>.<[-]>[-<++>]<br />
<----------------.---------------.+++++.<+++[-<++++++++++>]<.<br />
>>+.++++++++++.<<.>>+.------------.---.<<.>>---.<br />
+++.++++++++++++++.+.<<+.[-]++++++++++.<br />
<br />
'''LOLCODE''' - why not?<br />
HAI<br />
CAN HAS STDIO?<br />
VISIBLE "ARCH IS TEH PWNZ LOL!"<br />
KTHXBYE<br />
<br />
'''Befunge''' - believed to be the first two-dimensional, ASCII-based, general-purpose (in the sense of "you could plausibly write Hunt the Wumpus in it") programming language<br />
<v"Arch is the best!"0<br />
<,_@#:<br />
<br />
'''PHP''' - a PHP version<br />
<?<br />
print 'Arch is the best!'<br />
?><br />
<br />
'''JavaScript''' - a JavaScript version<br />
<script type="text/javascript><br />
alert('Arch is the best!');<br />
</script><br />
<br />
'''Java''' - an extremely portable language, this will run on pretty much anything, it might even run on your toaster!<br />
public class ArchIsTheBest {<br />
public static void main(String[] args) {<br />
System.out.println("Arch is the best!");<br />
}<br />
}<br />
<br />
'''Scheme''' - a dialect of Lisp<br />
(display "Arch is the best!\n")<br />
<br />
'''R''' - a language for statistical computing (and much more!).<br />
archIsBest <- function() { cat("Arch is the best!\n") }<br />
archIsBest()<br />
<br />
'''Tcl/Tk'''<br />
#!/usr/bin/env tclsh<br />
puts "Arch is the best!"<br />
<br />
'''Pixilang''' - make me pixels<br />
print("Arch is the best!",0,0,#1897D1)<br />
frame<br />
<br />
==Translations==<br />
'''Arabic'''<br />
ارتش هو الأفضل<br />
<br />
'''Australian'''<br />
Arch is fair dinkum, mate!<br />
<br />
'''Bahasa Indonesia'''<br />
Arch terbaik!<br />
<br />
'''Basque'''<br />
Arch onena da!<br />
<br />
'''Bengali'''<br />
Arch shobcheye bhalo!<br />
<br />
'''Binary ASCII'''<br />
0100000101110010011000110110100000100000011010010111001100100000011101000110100001100101001000000110001001100101011100110111010000100001<br />
<br />
'''British'''<br />
Arch is simply spiffing.<br />
<br />
'''Bulgarian'''<br />
Арч е най-добрия!<br />
<br />
'''Chinese (Simplified)'''<br />
Arch 是最牛逼的!<br />
<br />
'''Ancient Chinese'''<br />
Arch 者,大善也。<br />
<br />
'''Czech'''<br />
Arch je nejlepší!<br />
<br />
'''Danish'''<br />
Arch er bedst!<br />
<br />
'''Desrever (Reversed)'''<br />
!tseb eht si hcrA<br />
<br />
'''Dutch'''<br />
Arch is de beste!<br />
<br />
'''Filipino'''<br />
Mabuhay ang Arch!<br />
<br />
'''French'''<br />
Arch est le meilleur!<br />
<br />
'''Galician'''<br />
Arch é o mellor!<br />
<br />
'''German'''<br />
Arch ist das Beste!<br />
<br />
'''Greek'''<br />
Το Arch είναι το καλύτερο!<br />
<br />
'''h4x0r'''<br />
arhc 51 7he be57!<br />
<br />
'''Hantec'''<br />
Arch je nejbetélnější!<br />
<br />
'''Hebrew'''<br />
ארצ' זה הכי אחי!<br />
<br />
'''Hindi'''<br />
आर्ख सब से अच्छा है ।<br />
<br />
'''Hungarian'''<br />
Az Arch a legjobb!<br />
<br />
'''Japanese'''<br />
Archが一番ですよ!<br />
<br />
'''Latvian'''<br />
Arch ir labākais!<br />
<br />
'''Norwegian'''<br />
Arch er best!<br />
<br />
'''Polish'''<br />
Arch jest najlepszy!<br />
<br />
'''Portuguese'''<br />
Arch é o melhor!<br />
<br />
'''Québécois'''<br />
Arch est le plus meilleure du monde!<br />
<br />
'''Romanian'''<br />
Аrch e cel mai bun!<br />
<br />
'''Russian'''<br />
Арч - лучший!<br />
<br />
'''Serbian'''<br />
Arch je najbolji!<br />
<br />
'''Slovenian'''<br />
Arch je najboljši!<br />
<br />
'''Spanish'''<br />
¡Arch es el mejor!<br />
<br />
'''Swedish'''<br />
Arch är bäst!<br />
<br />
'''Turkish'''<br />
Arch en iyisidir!<br />
<br />
'''Morse Code'''<br />
.- .-. -.-. .... / .. ... / - .... . / -... . ... -<br />
<br />
==Links==<br />
* [http://bbs.archlinux.org/viewtopic.php?id=47306 forum Thread]<br />
* [http://arch.yarrt.com Unofficially Official Project Website]</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=Arch_is_the_best&diff=74760
Arch is the best
2009-08-28T03:19:04Z
<p>SkonesMickLoud: /* Translations */</p>
<hr />
<div>[[Category:About Arch (English)]]<br />
<br />
==Purpose==<br />
The '''Arch is the best''' project is a very sophisticated and exquisite, ego-boosting and mind-blowing (albeit perhaps a bit over-engineered) project which aims to prove Arch's superiority.<br />
<br />
==History==<br />
The project was initiated in April 2008 by long time Arch community member [http://bbs.archlinux.org/profile.php?id=2529 lucke] as a simple shell script which provided irrefutable proof that "Arch is the best". Over the following weeks, this project gathered momentum and was ported to multiple different languages, both programming and verbal.<br />
<br />
==The Code==<br />
The "Arch is the best" project is ported to many programming languages.<br />
<br />
'''Ada''' - A pascal dialect<br />
<br />
with Ada.Text_IO;<br />
use Ada.Text_IO;<br />
procedure ArchIsTheBest is<br />
begin<br />
Put_Line("Arch is the best!");<br />
end HelloWorld;<br />
<br />
'''Awk'''<br />
<br />
BEGIN {<br />
print "Arch is the best!"<br />
}<br />
<br />
'''Portable GNU assembler''' - as -o arch.o arch.s && ld -o arch -O0 arch.o<br />
<br />
.section .data<br />
archIsBest: <br />
.ascii "Arch is the best!\n"<br />
archIsBest_len:<br />
.long . - archIsBest<br />
.section .text<br />
.globl _start<br />
_start:<br />
xorl %ebx, %ebx<br />
movl $4, %eax <br />
xorl %ebx, %ebx<br />
incl %ebx <br />
leal archIsBest, %ecx<br />
movl archIsBest_len, %edx <br />
int $0x80 <br />
xorl %eax, %eax<br />
incl %eax<br />
xorl %ebx, %ebx <br />
int $0x80<br />
<br />
'''Bash''' - the original program, should be compatible with any shell<br />
#!/bin/bash<br />
<br />
echo "Arch is the best!"<br />
<br />
'''Bash (Alternate)''' - handy for piping the output to your favourite IRC/email/IM client. Should work with any shell.<br />
#!/bin/bash<br />
yes Arch is the best!<br />
<br />
'''C''' - note the three space indenting used in this project, much like that used by other superior beings.<br />
#include <stdio.h><br />
#include <stdlib.h><br />
int main (int argc, char *argv[]) <br />
{<br />
fprintf("Arch is the best!\n");<br />
exit(EXIT_SUCCESS);<br />
}<br />
<br />
'''C++''' - Arch == Linux++<br />
#include <iostream><br />
#include <cstdlib><br />
int main (int argc, char *argv[])<br />
{<br />
std::cout << "Arch is the best!" << std::endl;<br />
exit(EXIT_SUCCESS);<br />
}<br />
<br />
'''Clojure''' - A Lisp dialect that runs on the JVM<br />
(def translations {"english" "Arch is the best!",<br />
"german" "Arch ist das Beste!",<br />
"australian" "Arch is fair dinkum, mate!",<br />
"h4x0r" "arhc 51 7he be57!",<br />
"spanish" "¡Arch es el mejor!"})<br />
<br />
(defn arch-is-the-best<br />
"Asks for a language and prints the corresponding translation. <br />
Loops until input is 'quit'"<br />
[]<br />
(println "Available languages: ")<br />
(doseq [language (keys translations)]<br />
(println (str "\t" language)))<br />
(flush)<br />
(loop []<br />
(print "Enter language, or quit: ")<br />
(flush)<br />
(let [input (. (read-line) toLowerCase)]<br />
(if (= input "quit")<br />
(println "Goodbye!")<br />
(do<br />
(println (translations input "Bad input!"))<br />
(recur))))))<br />
<br />
'''Common Lisp''' - Tested on SBCL, feel free to add more of the translations in<br />
#!/usr/bin/sbcl --script<br />
(defparameter *best-list* '((English "Arch is the best!")<br />
(Chinese "Arch, 她出类拔萃!")<br />
(German "Arch ist das Beste!")<br />
(Greek "Το Arch είναι το καλύτερο!")))<br />
(defun aitb ()<br />
(format t "Available languages: ~{~{~@(~a~)~*~}~^, ~}.~%" *best-list*)<br />
(loop for input = (progn (format t "~&Input the desired language, (or 'quit'): ~%")<br />
(force-output)<br />
(read-line))<br />
if (string-equal input "quit")<br />
do (loop-finish)<br />
else<br />
do (let ((language-def<br />
(assoc input *best-list*<br />
:key (lambda (lang) (symbol-name lang))<br />
:test #'string-equal)))<br />
(if language-def<br />
(format t "~&~A~%" (second language-def))<br />
(format t "~&Invalid language.~%"))))<br />
(format t "~&May the Arch be with you!~%"))<br />
(aitb)<br />
<br />
'''Haskell''' - The language where IO is easy and unproblematic<br />
main = print "Arch is the best!"<br />
<br />
'''Python''' - a python version<br />
#!/usr/bin/env python<br />
<br />
print 'Arch is the best!'<br />
<br />
'''Ruby''' - a Ruby version<br />
#!/usr/bin/ruby -w<br />
<br />
puts 'Arch is the best!'<br />
<br />
'''Perl''' - a Perl version<br />
#!/usr/bin/perl<br />
<br />
print "Arch is the best!\n";<br />
<br />
'''Prolog''' - a version in Prolog<br />
format('Arch is the best~n',[]).<br />
<br />
'''Common Lisp''' - should run on any implementation (Clisp, Allegro, SBCL...)<br />
(princ "Arch is the best!")<br />
<br />
'''brainf*ck''' - doesn't the language name exaplain it?<br />
++>++++++>+++++<+[>[->+<]<->++++++++++<]>>.<[-]>[-<++>]<br />
<----------------.---------------.+++++.<+++[-<++++++++++>]<.<br />
>>+.++++++++++.<<.>>+.------------.---.<<.>>---.<br />
+++.++++++++++++++.+.<<+.[-]++++++++++.<br />
<br />
'''LOLCODE''' - why not?<br />
HAI<br />
CAN HAS STDIO?<br />
VISIBLE "ARCH IS TEH PWNZ LOL!"<br />
KTHXBYE<br />
<br />
'''Befunge''' - believed to be the first two-dimensional, ASCII-based, general-purpose (in the sense of "you could plausibly write Hunt the Wumpus in it") programming language<br />
<v"Arch is the best!"0<br />
<,_@#:<br />
<br />
'''PHP''' - a PHP version<br />
<?<br />
print 'Arch is the best!'<br />
?><br />
<br />
'''JavaScript''' - a JavaScript version<br />
<script type="text/javascript><br />
alert('Arch is the best!');<br />
</script><br />
<br />
'''Java''' - an extremely portable language, this will run on pretty much anything, it might even run on your toaster!<br />
public class ArchIsTheBest {<br />
public static void main(String[] args) {<br />
System.out.println("Arch is the best!");<br />
}<br />
}<br />
<br />
'''Scheme''' - a dialect of Lisp<br />
(display "Arch is the best!\n")<br />
<br />
'''R''' - a language for statistical computing (and much more!).<br />
archIsBest <- function() { cat("Arch is the best!\n") }<br />
archIsBest()<br />
<br />
'''Tcl/Tk'''<br />
#!/usr/bin/env tclsh<br />
puts "Arch is the best!"<br />
<br />
'''Pixilang''' - make me pixels<br />
print("Arch is the best!",0,0,#1897D1)<br />
frame<br />
<br />
==Translations==<br />
'''Arabic'''<br />
ارتش هو الأفضل<br />
<br />
'''Australian'''<br />
Arch is fair dinkum, mate!<br />
<br />
'''Bahasa Indonesia'''<br />
Arch terbaik!<br />
<br />
'''Basque'''<br />
Arch onena da!<br />
<br />
'''Bengali'''<br />
Arch shobcheye bhalo!<br />
<br />
'''Binary ASCII'''<br />
0100000101110010011000110110100000100000011010010111001100100000011101000110100001100101001000000110001001100101011100110111010000100001<br />
<br />
'''British'''<br />
Arch is simply spiffing.<br />
<br />
'''Bulgarian'''<br />
Арч е най-добрия!<br />
<br />
'''Chinese (Simplified)'''<br />
Arch 是最牛逼的!<br />
<br />
'''Ancient Chinese'''<br />
Arch 者,大善也。<br />
<br />
'''Czech'''<br />
Arch je nejlepší!<br />
<br />
'''Danish'''<br />
Arch er bedst!<br />
<br />
'''Desrever (Reversed)'''<br />
!tseb eht si hcrA<br />
<br />
'''Dutch'''<br />
Arch is de beste!<br />
<br />
'''Filipino'''<br />
Mabuhay ang Arch!<br />
<br />
'''French'''<br />
Arch est le meilleur!<br />
<br />
'''Galician'''<br />
Arch é o mellor!<br />
<br />
'''German'''<br />
Arch ist das Beste!<br />
<br />
'''Greek'''<br />
Το Arch είναι το καλύτερο!<br />
<br />
'''h4x0r'''<br />
arhc 51 7he be57!<br />
<br />
'''Hantec'''<br />
Arch je nejbetélnější!<br />
<br />
'''Hebrew'''<br />
ארצ' זה הכי אחי!<br />
<br />
'''Hindi'''<br />
आर्ख सब से अच्छा है ।<br />
<br />
'''Hungarian'''<br />
Az Arch a legjobb!<br />
<br />
'''Japanese'''<br />
Archが一番ですよ!<br />
<br />
'''Latvian'''<br />
Arch ir labākais!<br />
<br />
'''Norwegian'''<br />
Arch er best!<br />
<br />
'''Polish'''<br />
Arch jest najlepszy!<br />
<br />
'''Portuguese'''<br />
Arch é o melhor!<br />
<br />
'''Québécois'''<br />
Arch est le plus meilleure du monde!<br />
<br />
'''Romanian'''<br />
Аrch e cel mai bun!<br />
<br />
'''Russian'''<br />
Арч - лучший!<br />
<br />
'''Serbian'''<br />
Arch je najbolji!<br />
<br />
'''Slovenian'''<br />
Arch je najboljši!<br />
<br />
'''Spanish'''<br />
¡Arch es el mejor!<br />
<br />
'''Swedish'''<br />
Arch är bäst!<br />
<br />
'''Turkish'''<br />
Arch en iyisidir!<br />
<br />
'''Morse Code'''<br />
.- .-. -.-. .... / .. ... / - .... . / -... . ...<br />
<br />
==Links==<br />
* [http://bbs.archlinux.org/viewtopic.php?id=47306 forum Thread]<br />
* [http://arch.yarrt.com Unofficially Official Project Website]</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=Arch_is_the_best&diff=74759
Arch is the best
2009-08-28T03:18:22Z
<p>SkonesMickLoud: /* Translations */</p>
<hr />
<div>[[Category:About Arch (English)]]<br />
<br />
==Purpose==<br />
The '''Arch is the best''' project is a very sophisticated and exquisite, ego-boosting and mind-blowing (albeit perhaps a bit over-engineered) project which aims to prove Arch's superiority.<br />
<br />
==History==<br />
The project was initiated in April 2008 by long time Arch community member [http://bbs.archlinux.org/profile.php?id=2529 lucke] as a simple shell script which provided irrefutable proof that "Arch is the best". Over the following weeks, this project gathered momentum and was ported to multiple different languages, both programming and verbal.<br />
<br />
==The Code==<br />
The "Arch is the best" project is ported to many programming languages.<br />
<br />
'''Ada''' - A pascal dialect<br />
<br />
with Ada.Text_IO;<br />
use Ada.Text_IO;<br />
procedure ArchIsTheBest is<br />
begin<br />
Put_Line("Arch is the best!");<br />
end HelloWorld;<br />
<br />
'''Awk'''<br />
<br />
BEGIN {<br />
print "Arch is the best!"<br />
}<br />
<br />
'''Portable GNU assembler''' - as -o arch.o arch.s && ld -o arch -O0 arch.o<br />
<br />
.section .data<br />
archIsBest: <br />
.ascii "Arch is the best!\n"<br />
archIsBest_len:<br />
.long . - archIsBest<br />
.section .text<br />
.globl _start<br />
_start:<br />
xorl %ebx, %ebx<br />
movl $4, %eax <br />
xorl %ebx, %ebx<br />
incl %ebx <br />
leal archIsBest, %ecx<br />
movl archIsBest_len, %edx <br />
int $0x80 <br />
xorl %eax, %eax<br />
incl %eax<br />
xorl %ebx, %ebx <br />
int $0x80<br />
<br />
'''Bash''' - the original program, should be compatible with any shell<br />
#!/bin/bash<br />
<br />
echo "Arch is the best!"<br />
<br />
'''Bash (Alternate)''' - handy for piping the output to your favourite IRC/email/IM client. Should work with any shell.<br />
#!/bin/bash<br />
yes Arch is the best!<br />
<br />
'''C''' - note the three space indenting used in this project, much like that used by other superior beings.<br />
#include <stdio.h><br />
#include <stdlib.h><br />
int main (int argc, char *argv[]) <br />
{<br />
fprintf("Arch is the best!\n");<br />
exit(EXIT_SUCCESS);<br />
}<br />
<br />
'''C++''' - Arch == Linux++<br />
#include <iostream><br />
#include <cstdlib><br />
int main (int argc, char *argv[])<br />
{<br />
std::cout << "Arch is the best!" << std::endl;<br />
exit(EXIT_SUCCESS);<br />
}<br />
<br />
'''Clojure''' - A Lisp dialect that runs on the JVM<br />
(def translations {"english" "Arch is the best!",<br />
"german" "Arch ist das Beste!",<br />
"australian" "Arch is fair dinkum, mate!",<br />
"h4x0r" "arhc 51 7he be57!",<br />
"spanish" "¡Arch es el mejor!"})<br />
<br />
(defn arch-is-the-best<br />
"Asks for a language and prints the corresponding translation. <br />
Loops until input is 'quit'"<br />
[]<br />
(println "Available languages: ")<br />
(doseq [language (keys translations)]<br />
(println (str "\t" language)))<br />
(flush)<br />
(loop []<br />
(print "Enter language, or quit: ")<br />
(flush)<br />
(let [input (. (read-line) toLowerCase)]<br />
(if (= input "quit")<br />
(println "Goodbye!")<br />
(do<br />
(println (translations input "Bad input!"))<br />
(recur))))))<br />
<br />
'''Common Lisp''' - Tested on SBCL, feel free to add more of the translations in<br />
#!/usr/bin/sbcl --script<br />
(defparameter *best-list* '((English "Arch is the best!")<br />
(Chinese "Arch, 她出类拔萃!")<br />
(German "Arch ist das Beste!")<br />
(Greek "Το Arch είναι το καλύτερο!")))<br />
(defun aitb ()<br />
(format t "Available languages: ~{~{~@(~a~)~*~}~^, ~}.~%" *best-list*)<br />
(loop for input = (progn (format t "~&Input the desired language, (or 'quit'): ~%")<br />
(force-output)<br />
(read-line))<br />
if (string-equal input "quit")<br />
do (loop-finish)<br />
else<br />
do (let ((language-def<br />
(assoc input *best-list*<br />
:key (lambda (lang) (symbol-name lang))<br />
:test #'string-equal)))<br />
(if language-def<br />
(format t "~&~A~%" (second language-def))<br />
(format t "~&Invalid language.~%"))))<br />
(format t "~&May the Arch be with you!~%"))<br />
(aitb)<br />
<br />
'''Haskell''' - The language where IO is easy and unproblematic<br />
main = print "Arch is the best!"<br />
<br />
'''Python''' - a python version<br />
#!/usr/bin/env python<br />
<br />
print 'Arch is the best!'<br />
<br />
'''Ruby''' - a Ruby version<br />
#!/usr/bin/ruby -w<br />
<br />
puts 'Arch is the best!'<br />
<br />
'''Perl''' - a Perl version<br />
#!/usr/bin/perl<br />
<br />
print "Arch is the best!\n";<br />
<br />
'''Prolog''' - a version in Prolog<br />
format('Arch is the best~n',[]).<br />
<br />
'''Common Lisp''' - should run on any implementation (Clisp, Allegro, SBCL...)<br />
(princ "Arch is the best!")<br />
<br />
'''brainf*ck''' - doesn't the language name exaplain it?<br />
++>++++++>+++++<+[>[->+<]<->++++++++++<]>>.<[-]>[-<++>]<br />
<----------------.---------------.+++++.<+++[-<++++++++++>]<.<br />
>>+.++++++++++.<<.>>+.------------.---.<<.>>---.<br />
+++.++++++++++++++.+.<<+.[-]++++++++++.<br />
<br />
'''LOLCODE''' - why not?<br />
HAI<br />
CAN HAS STDIO?<br />
VISIBLE "ARCH IS TEH PWNZ LOL!"<br />
KTHXBYE<br />
<br />
'''Befunge''' - believed to be the first two-dimensional, ASCII-based, general-purpose (in the sense of "you could plausibly write Hunt the Wumpus in it") programming language<br />
<v"Arch is the best!"0<br />
<,_@#:<br />
<br />
'''PHP''' - a PHP version<br />
<?<br />
print 'Arch is the best!'<br />
?><br />
<br />
'''JavaScript''' - a JavaScript version<br />
<script type="text/javascript><br />
alert('Arch is the best!');<br />
</script><br />
<br />
'''Java''' - an extremely portable language, this will run on pretty much anything, it might even run on your toaster!<br />
public class ArchIsTheBest {<br />
public static void main(String[] args) {<br />
System.out.println("Arch is the best!");<br />
}<br />
}<br />
<br />
'''Scheme''' - a dialect of Lisp<br />
(display "Arch is the best!\n")<br />
<br />
'''R''' - a language for statistical computing (and much more!).<br />
archIsBest <- function() { cat("Arch is the best!\n") }<br />
archIsBest()<br />
<br />
'''Tcl/Tk'''<br />
#!/usr/bin/env tclsh<br />
puts "Arch is the best!"<br />
<br />
'''Pixilang''' - make me pixels<br />
print("Arch is the best!",0,0,#1897D1)<br />
frame<br />
<br />
==Translations==<br />
'''Arabic'''<br />
ارتش هو الأفضل<br />
<br />
'''Australian'''<br />
Arch is fair dinkum, mate!<br />
<br />
'''Bahasa Indonesia'''<br />
Arch terbaik!<br />
<br />
'''Basque'''<br />
Arch onena da!<br />
<br />
'''Bengali'''<br />
Arch shobcheye bhalo!<br />
<br />
'''Binary ASCII'''<br />
0100000101110010011000110110100000100000011010010111001100100000011101000110100001100101001000000110001001100101011100110111010000100001<br />
<br />
'''British'''<br />
Arch is simply spiffing.<br />
<br />
'''Bulgarian'''<br />
Арч е най-добрия!<br />
<br />
'''Chinese (Simplified)'''<br />
Arch 是最牛逼的!<br />
<br />
'''Ancient Chinese'''<br />
Arch 者,大善也。<br />
<br />
'''Czech'''<br />
Arch je nejlepší!<br />
<br />
'''Danish'''<br />
Arch er bedst!<br />
<br />
'''Desrever (Reversed)'''<br />
!tseb eht si hcrA<br />
<br />
'''Dutch'''<br />
Arch is de beste!<br />
<br />
'''Filipino'''<br />
Mabuhay ang Arch!<br />
<br />
'''French'''<br />
Arch est le meilleur!<br />
<br />
'''Galician'''<br />
Arch é o mellor!<br />
<br />
'''German'''<br />
Arch ist das Beste!<br />
<br />
'''Greek'''<br />
Το Arch είναι το καλύτερο!<br />
<br />
'''h4x0r'''<br />
arhc 51 7he be57!<br />
<br />
'''Hantec'''<br />
Arch je nejbetélnější!<br />
<br />
'''Hebrew'''<br />
ארצ' זה הכי אחי!<br />
<br />
'''Hindi'''<br />
आर्ख सब से अच्छा है ।<br />
<br />
'''Hungarian'''<br />
Az Arch a legjobb!<br />
<br />
'''Japanese'''<br />
Archが一番ですよ!<br />
<br />
'''Latvian'''<br />
Arch ir labākais!<br />
<br />
'''Norwegian'''<br />
Arch er best!<br />
<br />
'''Polish'''<br />
Arch jest najlepszy!<br />
<br />
'''Portuguese'''<br />
Arch é o melhor!<br />
<br />
'''Québécois'''<br />
Arch est le plus meilleure du monde!<br />
<br />
'''Romanian'''<br />
Аrch e cel mai bun!<br />
<br />
'''Russian'''<br />
Арч - лучший!<br />
<br />
'''Serbian'''<br />
Arch je najbolji!<br />
<br />
'''Slovenian'''<br />
Arch je najboljši!<br />
<br />
'''Spanish'''<br />
¡Arch es el mejor!<br />
<br />
'''Swedish'''<br />
Arch är bäst!<br />
<br />
'''Turkish'''<br />
Arch en iyisidir!<br />
<br />
'''Morse Code'''<br />
.- .-. -.-. .... / .. ... / - .... . / -... . ...<br />
<br />
==Links==<br />
* [http://bbs.archlinux.org/viewtopic.php?id=47306 forum Thread]<br />
* [http://arch.yarrt.com Unofficially Official Project Website]</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=Arch_is_the_best&diff=74758
Arch is the best
2009-08-28T03:17:59Z
<p>SkonesMickLoud: /* Translations */</p>
<hr />
<div>[[Category:About Arch (English)]]<br />
<br />
==Purpose==<br />
The '''Arch is the best''' project is a very sophisticated and exquisite, ego-boosting and mind-blowing (albeit perhaps a bit over-engineered) project which aims to prove Arch's superiority.<br />
<br />
==History==<br />
The project was initiated in April 2008 by long time Arch community member [http://bbs.archlinux.org/profile.php?id=2529 lucke] as a simple shell script which provided irrefutable proof that "Arch is the best". Over the following weeks, this project gathered momentum and was ported to multiple different languages, both programming and verbal.<br />
<br />
==The Code==<br />
The "Arch is the best" project is ported to many programming languages.<br />
<br />
'''Ada''' - A pascal dialect<br />
<br />
with Ada.Text_IO;<br />
use Ada.Text_IO;<br />
procedure ArchIsTheBest is<br />
begin<br />
Put_Line("Arch is the best!");<br />
end HelloWorld;<br />
<br />
'''Awk'''<br />
<br />
BEGIN {<br />
print "Arch is the best!"<br />
}<br />
<br />
'''Portable GNU assembler''' - as -o arch.o arch.s && ld -o arch -O0 arch.o<br />
<br />
.section .data<br />
archIsBest: <br />
.ascii "Arch is the best!\n"<br />
archIsBest_len:<br />
.long . - archIsBest<br />
.section .text<br />
.globl _start<br />
_start:<br />
xorl %ebx, %ebx<br />
movl $4, %eax <br />
xorl %ebx, %ebx<br />
incl %ebx <br />
leal archIsBest, %ecx<br />
movl archIsBest_len, %edx <br />
int $0x80 <br />
xorl %eax, %eax<br />
incl %eax<br />
xorl %ebx, %ebx <br />
int $0x80<br />
<br />
'''Bash''' - the original program, should be compatible with any shell<br />
#!/bin/bash<br />
<br />
echo "Arch is the best!"<br />
<br />
'''Bash (Alternate)''' - handy for piping the output to your favourite IRC/email/IM client. Should work with any shell.<br />
#!/bin/bash<br />
yes Arch is the best!<br />
<br />
'''C''' - note the three space indenting used in this project, much like that used by other superior beings.<br />
#include <stdio.h><br />
#include <stdlib.h><br />
int main (int argc, char *argv[]) <br />
{<br />
fprintf("Arch is the best!\n");<br />
exit(EXIT_SUCCESS);<br />
}<br />
<br />
'''C++''' - Arch == Linux++<br />
#include <iostream><br />
#include <cstdlib><br />
int main (int argc, char *argv[])<br />
{<br />
std::cout << "Arch is the best!" << std::endl;<br />
exit(EXIT_SUCCESS);<br />
}<br />
<br />
'''Clojure''' - A Lisp dialect that runs on the JVM<br />
(def translations {"english" "Arch is the best!",<br />
"german" "Arch ist das Beste!",<br />
"australian" "Arch is fair dinkum, mate!",<br />
"h4x0r" "arhc 51 7he be57!",<br />
"spanish" "¡Arch es el mejor!"})<br />
<br />
(defn arch-is-the-best<br />
"Asks for a language and prints the corresponding translation. <br />
Loops until input is 'quit'"<br />
[]<br />
(println "Available languages: ")<br />
(doseq [language (keys translations)]<br />
(println (str "\t" language)))<br />
(flush)<br />
(loop []<br />
(print "Enter language, or quit: ")<br />
(flush)<br />
(let [input (. (read-line) toLowerCase)]<br />
(if (= input "quit")<br />
(println "Goodbye!")<br />
(do<br />
(println (translations input "Bad input!"))<br />
(recur))))))<br />
<br />
'''Common Lisp''' - Tested on SBCL, feel free to add more of the translations in<br />
#!/usr/bin/sbcl --script<br />
(defparameter *best-list* '((English "Arch is the best!")<br />
(Chinese "Arch, 她出类拔萃!")<br />
(German "Arch ist das Beste!")<br />
(Greek "Το Arch είναι το καλύτερο!")))<br />
(defun aitb ()<br />
(format t "Available languages: ~{~{~@(~a~)~*~}~^, ~}.~%" *best-list*)<br />
(loop for input = (progn (format t "~&Input the desired language, (or 'quit'): ~%")<br />
(force-output)<br />
(read-line))<br />
if (string-equal input "quit")<br />
do (loop-finish)<br />
else<br />
do (let ((language-def<br />
(assoc input *best-list*<br />
:key (lambda (lang) (symbol-name lang))<br />
:test #'string-equal)))<br />
(if language-def<br />
(format t "~&~A~%" (second language-def))<br />
(format t "~&Invalid language.~%"))))<br />
(format t "~&May the Arch be with you!~%"))<br />
(aitb)<br />
<br />
'''Haskell''' - The language where IO is easy and unproblematic<br />
main = print "Arch is the best!"<br />
<br />
'''Python''' - a python version<br />
#!/usr/bin/env python<br />
<br />
print 'Arch is the best!'<br />
<br />
'''Ruby''' - a Ruby version<br />
#!/usr/bin/ruby -w<br />
<br />
puts 'Arch is the best!'<br />
<br />
'''Perl''' - a Perl version<br />
#!/usr/bin/perl<br />
<br />
print "Arch is the best!\n";<br />
<br />
'''Prolog''' - a version in Prolog<br />
format('Arch is the best~n',[]).<br />
<br />
'''Common Lisp''' - should run on any implementation (Clisp, Allegro, SBCL...)<br />
(princ "Arch is the best!")<br />
<br />
'''brainf*ck''' - doesn't the language name exaplain it?<br />
++>++++++>+++++<+[>[->+<]<->++++++++++<]>>.<[-]>[-<++>]<br />
<----------------.---------------.+++++.<+++[-<++++++++++>]<.<br />
>>+.++++++++++.<<.>>+.------------.---.<<.>>---.<br />
+++.++++++++++++++.+.<<+.[-]++++++++++.<br />
<br />
'''LOLCODE''' - why not?<br />
HAI<br />
CAN HAS STDIO?<br />
VISIBLE "ARCH IS TEH PWNZ LOL!"<br />
KTHXBYE<br />
<br />
'''Befunge''' - believed to be the first two-dimensional, ASCII-based, general-purpose (in the sense of "you could plausibly write Hunt the Wumpus in it") programming language<br />
<v"Arch is the best!"0<br />
<,_@#:<br />
<br />
'''PHP''' - a PHP version<br />
<?<br />
print 'Arch is the best!'<br />
?><br />
<br />
'''JavaScript''' - a JavaScript version<br />
<script type="text/javascript><br />
alert('Arch is the best!');<br />
</script><br />
<br />
'''Java''' - an extremely portable language, this will run on pretty much anything, it might even run on your toaster!<br />
public class ArchIsTheBest {<br />
public static void main(String[] args) {<br />
System.out.println("Arch is the best!");<br />
}<br />
}<br />
<br />
'''Scheme''' - a dialect of Lisp<br />
(display "Arch is the best!\n")<br />
<br />
'''R''' - a language for statistical computing (and much more!).<br />
archIsBest <- function() { cat("Arch is the best!\n") }<br />
archIsBest()<br />
<br />
'''Tcl/Tk'''<br />
#!/usr/bin/env tclsh<br />
puts "Arch is the best!"<br />
<br />
'''Pixilang''' - make me pixels<br />
print("Arch is the best!",0,0,#1897D1)<br />
frame<br />
<br />
==Translations==<br />
'''Arabic'''<br />
ارتش هو الأفضل<br />
<br />
'''Australian'''<br />
Arch is fair dinkum, mate!<br />
<br />
'''Bahasa Indonesia'''<br />
Arch terbaik!<br />
<br />
'''Basque'''<br />
Arch onena da!<br />
<br />
'''Bengali'''<br />
Arch shobcheye bhalo!<br />
<br />
'''Binary ASCII'''<br />
0100000101110010011000110110100000100000011010010111001100100000011101000110100001100101001000000110001001100101011100110111010000100001<br />
<br />
'''British'''<br />
Arch is simply spiffing.<br />
<br />
'''Bulgarian'''<br />
Арч е най-добрия!<br />
<br />
'''Chinese (Simplified)'''<br />
Arch 是最牛逼的!<br />
<br />
'''Ancient Chinese'''<br />
Arch 者,大善也。<br />
<br />
'''Czech'''<br />
Arch je nejlepší!<br />
<br />
'''Danish'''<br />
Arch er bedst!<br />
<br />
'''Desrever (Reversed)'''<br />
!tseb eht si hcrA<br />
<br />
'''Dutch'''<br />
Arch is de beste!<br />
<br />
'''Filipino'''<br />
Mabuhay ang Arch!<br />
<br />
'''French'''<br />
Arch est le meilleur!<br />
<br />
'''Galician'''<br />
Arch é o mellor!<br />
<br />
'''German'''<br />
Arch ist das Beste!<br />
<br />
'''Greek'''<br />
Το Arch είναι το καλύτερο!<br />
<br />
'''h4x0r'''<br />
arhc 51 7he be57!<br />
<br />
'''Hantec'''<br />
Arch je nejbetélnější!<br />
<br />
'''Hebrew'''<br />
ארצ' זה הכי אחי!<br />
<br />
'''Hindi'''<br />
आर्ख सब से अच्छा है ।<br />
<br />
'''Hungarian'''<br />
Az Arch a legjobb!<br />
<br />
'''Japanese'''<br />
Archが一番ですよ!<br />
<br />
'''Latvian'''<br />
Arch ir labākais!<br />
<br />
'''Norwegian'''<br />
Arch er best!<br />
<br />
'''Polish'''<br />
Arch jest najlepszy!<br />
<br />
'''Portuguese'''<br />
Arch é o melhor!<br />
<br />
'''Québécois'''<br />
Arch est le plus meilleure du monde!<br />
<br />
'''Romanian'''<br />
Аrch e cel mai bun!<br />
<br />
'''Russian'''<br />
Арч - лучший!<br />
<br />
'''Serbian'''<br />
Arch je najbolji!<br />
<br />
'''Slovenian'''<br />
Arch je najboljši!<br />
<br />
'''Spanish'''<br />
¡Arch es el mejor!<br />
<br />
'''Swedish'''<br />
Arch är bäst!<br />
<br />
'''Turkish'''<br />
Arch en iyisidir!<br />
<br />
''''Morse Code''''<br />
.- .-. -.-. .... / .. ... / - .... . / -... . ...<br />
<br />
==Links==<br />
* [http://bbs.archlinux.org/viewtopic.php?id=47306 forum Thread]<br />
* [http://arch.yarrt.com Unofficially Official Project Website]</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=OpenSSH&diff=68277
OpenSSH
2009-05-06T03:03:02Z
<p>SkonesMickLoud: /* Configuring the SSH server */</p>
<hr />
<div>[[Category:Daemons_and_system_services (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|Русский|SSH_(Русский)}}<br />
{{i18n_entry|English|SSH}}<br />
{{i18n_entry|简体中文|SSH_(简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
= Introduction =<br />
Secure Shell or SSH is a network protocol that allows data to be exchanged over a secure channel between two computers. Encryption provides confidentiality and integrity of data. SSH uses public-key cryptography to authenticate the remote computer and allow the remote computer to authenticate the user, if necessary.<br />
<br />
SSH is typically used to log into a remote machine and execute commands, but it also supports tunneling, forwarding arbitrary TCP ports and X11 connections; it can transfer files using the associated SFTP or SCP protocols.<br />
<br />
An SSH server, by default, listens on the standard TCP port 22. An ssh client program is typically used for establishing connections to an sshd daemon accepting remote connections. Both are commonly present on most modern operating systems, including Mac OS X, Linux, Solaris and OpenVMS. Proprietary, freeware and open source versions of various levels of complexity and completeness exist.<br />
<br />
= OpenSSH =<br />
<br />
OpenSSH (OpenBSD Secure Shell) is a set of computer programs providing encrypted communication sessions over a computer network using the ssh protocol. It was created as an open source alternative to the proprietary Secure Shell software suite offered by SSH Communications Security. OpenSSH is developed as part of the OpenBSD project, which is led by Theo de Raadt.<br />
<br />
OpenSSH is occasionally confused with the similarly-named OpenSSL; however, the projects have different purposes and are developed by different teams, the similar name is drawn only from similar goals.<br />
<br />
== Installing OpenSSH ==<br />
# pacman -Sy openssh<br />
<br />
== Configuring the SSH server ==<br />
To configure you must edit the configuration file:<br />
$ su -c 'nano /etc/ssh/sshd_config'<br />
<br />
You may want to change the default port from 22 to any higher port (see [http://en.wikipedia.org/wiki/Security_through_obscurity security through obscurity]). <br />
<br />
Even though the port ssh is running on could be detected by using a port-scanner like nmap, changing it will reduce the number of log entries caused by automated authentication attempts.<br />
<br />
===Adjust the configuration===<br />
The configuration file can be found at ''/etc/ssh/ssh_config'' and the basic version looks like this:<br />
<br />
<pre><br />
# $OpenBSD: sshd_config,v 1.75 2007/03/19 01:01:29 djm Exp $<br />
<br />
# This is the ssh client system-wide configuration file. See<br />
# ssh_config(5) for more information. This file provides defaults for<br />
# users, and the values can be changed in per-user configuration files<br />
# or on the command line.<br />
<br />
# Configuration data is parsed as follows:<br />
# 1. command line options<br />
# 2. user-specific file<br />
# 3. system-wide file<br />
# Any configuration value is only changed the first time it is set.<br />
# Thus, host-specific definitions should be at the beginning of the<br />
# configuration file, and defaults at the end.<br />
<br />
# Site-wide defaults for various options<br />
<br />
# Host *<br />
# ForwardAgent no<br />
# ForwardX11 no<br />
# RhostsRSAAuthentication no<br />
# RSAAuthentication yes<br />
# PasswordAuthentication yes<br />
# HostbasedAuthentication no<br />
# BatchMode no<br />
# CheckHostIP yes<br />
# AddressFamily any<br />
# ConnectTimeout 0<br />
# StrictHostKeyChecking ask<br />
# IdentityFile ~/.ssh/identity<br />
# IdentityFile ~/.ssh/id_rsa<br />
# IdentityFile ~/.ssh/id_dsa<br />
# Port 22<br />
# Protocol 2,1<br />
# Cipher 3des<br />
# Ciphers aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc<br />
# EscapeChar ~<br />
</pre><br />
<br />
It is recommended to change the Protocol line into this:<br />
Protocol 2<br />
<br />
That means that only Protocol 2 will be used, since Protocol 1 is considered somewhat insecure.<br />
<br />
Of course there is also a configuration file for the SSH daemon. It's called ''/etc/ssh/sshd_config'' and looks like this:<br />
<pre><br />
# $OpenBSD: sshd_config,v 1.75 2007/03/19 01:01:29 djm Exp $<br />
<br />
# This is the sshd server system-wide configuration file. See<br />
# sshd_config(5) for more information.<br />
<br />
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin<br />
<br />
# The strategy used for options in the default sshd_config shipped with<br />
# OpenSSH is to specify options with their default value where<br />
# possible, but leave them commented. Uncommented options change a<br />
# default value.<br />
<br />
#Port 22<br />
#Protocol 2,1<br />
ListenAddress 0.0.0.0<br />
#ListenAddress ::<br />
<br />
# HostKey for protocol version 1<br />
#HostKey /etc/ssh/ssh''host''key<br />
# HostKeys for protocol version 2<br />
#HostKey /etc/ssh/ssh''host''rsa_key<br />
#HostKey /etc/ssh/ssh''host''dsa_key<br />
<br />
# Lifetime and size of ephemeral version 1 server key<br />
#KeyRegenerationInterval 1h<br />
#ServerKeyBits 768<br />
<br />
# Logging<br />
#obsoletes ~QuietMode and ~FascistLogging<br />
#SyslogFacility AUTH<br />
#LogLevel INFO<br />
<br />
# Authentication:<br />
<br />
#LoginGraceTime 2m<br />
#PermitRootLogin yes<br />
#StrictModes yes<br />
#MaxAuthTries 6<br />
<br />
#RSAAuthentication yes<br />
#PubkeyAuthentication yes<br />
#AuthorizedKeysFile .ssh/authorized_keys<br />
<br />
# For this to work you will also need host keys in /etc/ssh/ssh''known''hosts<br />
#RhostsRSAAuthentication no<br />
# similar for protocol version 2<br />
#HostbasedAuthentication no<br />
# Change to yes if you don't trust ~/.ssh/known_hosts for<br />
# RhostsRSAAuthentication and HostbasedAuthentication<br />
#IgnoreUserKnownHosts no<br />
# Don't read the user's ~/.rhosts and ~/.shosts files<br />
#IgnoreRhosts yes<br />
<br />
# To disable tunneled clear text passwords, change to no here!<br />
#PasswordAuthentication yes<br />
#PermitEmptyPasswords no<br />
<br />
# Change to no to disable s/key passwords<br />
#ChallengeResponseAuthentication yes<br />
<br />
# Kerberos options<br />
#KerberosAuthentication no<br />
#KerberosOrLocalPasswd yes<br />
#KerberosTicketCleanup yes<br />
#KerberosGetAFSToken no<br />
<br />
# GSSAPI options<br />
#GSSAPIAuthentication no<br />
#GSSAPICleanupCredentials yes<br />
<br />
# Set this to 'yes' to enable PAM authentication, account processing,<br />
# and session processing. If this is enabled, PAM authentication will<br />
# be allowed through the ~ChallengeResponseAuthentication mechanism.<br />
# Depending on your PAM configuration, this may bypass the setting of<br />
# PasswordAuthentication, ~PermitEmptyPasswords, and<br />
# "PermitRootLogin without-password". If you just want the PAM account and<br />
# session checks to run without PAM authentication, then enable this but set<br />
# ChallengeResponseAuthentication=no<br />
#UsePAM no<br />
<br />
#AllowTcpForwarding yes<br />
#GatewayPorts no<br />
#X11Forwarding no<br />
#X11DisplayOffset 10<br />
#X11UseLocalhost yes<br />
#PrintMotd yes<br />
#PrintLastLog yes<br />
#TCPKeepAlive yes<br />
#UseLogin no<br />
#UsePrivilegeSeparation yes<br />
#PermitUserEnvironment no<br />
#Compression yes<br />
#ClientAliveInterval 0<br />
#ClientAliveCountMax 3<br />
#UseDNS yes<br />
#PidFile /var/run/sshd.pid<br />
#MaxStartups 10<br />
<br />
# no default banner path<br />
#Banner /some/path<br />
<br />
# override default of no subsystems<br />
Subsystem sftp /usr/lib/ssh/sftp-server<br />
<br />
</pre><br />
<br />
To allow access only for some users add this line:<br />
AllowUsers user1 user2<br />
<br />
You might want to change some lines so that they look as following:<br />
<pre><br />
Protocol 2<br />
.<br />
.<br />
.<br />
LoginGraceTime 120<br />
.<br />
.<br />
.<br />
PermitRootLogin no # (put yes here if you want root login)<br />
</pre><br />
<br />
You could also uncomment the BANNER option and edit ''/etc/issue'' for a nice welcome message.<br />
<br />
===Allowing others in===<br />
{{Box Note | You have to adjust this file to remotely connect to your machine since the file is empty by default}}<br />
<br />
To let other people ssh to your machine you need to adjust ''/etc/hosts.allow'', add the following:<br />
<br />
<pre><br />
# let everyone connect to you<br />
sshd: ALL<br />
<br />
# OR you can restrict it to a certain ip<br />
sshd: 192.168.0.1<br />
<br />
# OR restrict for an IP range<br />
sshd: 10.0.0.0/255.255.255.0<br />
<br />
# OR restrict for an IP match<br />
sshd: 192.168.1.<br />
</pre><br />
<br />
Now you should check your ''/etc/hosts.deny'' for the following line and make sure it looks like this:<br />
ALL: ALL: DENY<br />
<br />
That's it. You can SSH out and others should be able to SSH in :).<br />
<br />
To start using the new configuration, restart the daemon:<br />
$ su -c '/etc/rc.d/sshd restart'<br />
<br />
== Managing SSHD Daemon ==<br />
Just add sshd to the "DAEMONS" section of your /etc/[[rc.conf]]:<br />
DAEMONS=(... ... '''sshd''' ... ...)<br />
<br />
To start/restart/stop the daemon, use the following:<br />
# /etc/rc.d/sshd {start|stop|restart}<br />
<br />
==Connecting to the server==<br />
To connect to a server, run:<br />
$ ssh -p port user@server-address<br />
<br />
= Tips and Tricks =<br />
<br />
== Encrypted Socks Tunnel ==<br />
This is highly useful for laptop users connected to various unsafe wireless connections. The only thing you need is an SSH server running at a somewhat secure location, like your home or at work. It might be useful to use a dynamic DNS service like [http://www.dyndns.org/ DynDNS] so you don't have to remember your IP-address.<br />
<br />
=== Step 1: Start the Connection ===<br />
You only have to execute this single command in your favorite terminal to start the connection:<br />
$ ssh -ND 4711 user@host<br />
where "user" is your username at the SSH server running at the "host". It will ask for your password, and then you're connected! The "N" flag disables the interactive prompt, and the "D" flag specifies the local port on wich to listen on (you can choose any port number if you want).<br />
<br />
One way to make this easier is to put an alias line in your ~/.bashrc file as following:<br />
alias sshtunnel="ssh -ND 4711 -v user@host"<br />
It's nice to add the verbose "-v" flag, because then you can verify that it's actually connected from that output. Now you just have to execute the "sshtunnel" command :)<br />
<br />
=== Step 2: Configure your Browser (or other programs) ===<br />
<br />
The above step is completely useless if you don't configure your web browser (or other programs) to use this newly created socks tunnel. <br />
<br />
* For Firefox: ''Edit -> Preferences -> Advanced -> Network -> Connection -> Setting'':<br />
: Check the "Manual proxy configuration" radio button, and enter "localhost" in the "SOCKS host" text field, and then enter your port number in the next text field (I used 4711 above).<br />
<br />
: Make sure you select SOCKS4 as the protocol to use. This procedure will not work for SOCKS5.<br />
<br />
Enjoy your secure tunnel!<br />
<br />
== X11 Forwarding ==<br />
<br />
To run graphical programs through a SSH connection you can enable X11 forwarding. An option needs to be set in the configuration files on the server and client.<br />
<br />
Install xorg-xauth on the server:<br />
# pacman -Sy xorg-xauth<br />
<br />
* Enable the ''X11Forwarding'' option in ''sshd_config'' on the server.<br />
* Enable the ''ForwardX11'' option in ''ssh_config'' on the client.<br />
<br />
''In order to have this work with an Ubuntu server on my machine I needed to install xorg-xauth as well as enable ForwardX11Trusted in ssh_config on the (Arch) client''<br />
<br />
== Mounting a Remote Filesystem with SSHFS ==<br />
<br />
Install sshfs<br />
# pacman -Sy sshfs<br />
<br />
Add the user that we want to give the permission to mount SSH folders to the fuse group <br />
<br />
# gpasswd -a USER fuse<br />
<br />
Load the fuse module (in /etc/rc.conf for example)<br />
<br />
And then, after logging in, we can try to mount a remote folder using sshfs:<br />
# mkdir ~/remote_folder<br />
# sshfs USER@remote_server:/tmp ~/remote_folder<br />
<br />
The command above will cause the folder /tmp on the remote server to be mounted as ~/remote_folder on the local machine. Copying any file to this folder will result in transparent copying over the network using SCP. Same concerns direct file editing, creating or removing.<br />
<br />
When we’re done working with the remote filesystem, we can unmount the remote folder by issuing:<br />
# fusermount -u ~/remote_folder<br />
<br />
If we work on this folder on a daily basis, it is wise to add it to the /etc/fstab table. This way is can be automatically mounted upon system boot or mounted manually (if noauto option is chosen) without the need to specify the remote location each time. Here is a sample entry in the table:<br />
sshfs#USER@remote_server:/tmp /full/path/to/directory fuse defaults,auto 0 0<br />
<br />
= Links & References =<br />
*[http://www.soloport.com/iptables.html A Cure for the Common SSH Login Attack]<br />
*[[Using SSH Keys]]<br />
*[http://www.la-samhna.de/library/brutessh.html Defending against brute force ssh attacks]</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=Wmii&diff=67141
Wmii
2009-04-19T07:03:23Z
<p>SkonesMickLoud: /* WMII filesystem */</p>
<hr />
<div>[[Category:Desktop environments (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
==Introduction==<br />
[http://www.suckless.org/wmii/ wmii] (window manager improved 2) is a dynamic window manager for X11. It supports classic and dynamic window management with extended keyboard, mouse, and filesystem based remote control. It replaces the workspace paradigm with a new tagging approach. <br />
<br />
The following tips are intended to help the user get started with wmii. While wmii can be configured in almost any language, this article will focus on using the '''wmiirc''' configuration file, which is simply a shell script. Please see the [[ruby-wmii]] article to see how to configure wmii in ruby.<br />
<br />
==Installation==<br />
wmii is available from the '''extra''' repository. You can install it by issuing the following command:<br />
<br />
pacman -Sy wmii<br />
<br />
Alternatively, you can get the [http://aur.archlinux.org/packages.php?ID=3497 latest development version] which is available from the [[AUR]].<br />
<br />
Next you will need to edit your '''~/.xinitrc''' to enable you to start wmii with '''startx''':<br />
<br />
exec wmii<br />
<br />
To allow for starting wmii without logging off or killing the X session, add the following in the ~/.xinitrc<br />
until wmii; do<br />
true<br />
done<br />
Upon your first login, you will be greeted with the wmii welcome message, which also includes a short tutorial on wmii. Completing this tutorial will give you a good idea on how wmii works.<br />
{{Box Note|If the welcome message does not show up, make sure you have '''xmessage''' installed from the '''xorg-apps''' package. Then you can read the welcome by pressing $MODKEY-a and selecting 'welcome'.}}<br />
<br />
==Configuration==<br />
The easiest way to start configuring wmii, is to copy the default wmiirc file to your home directory and changing it to your needs. <br />
mkdir ~/.wmii-3.5<br />
cp /etc/wmii-3.5/wmiirc ~/.wmii-3.5/<br />
By editing this file, you can change things such as color, background, modkey, etc. Keep in mind that wmiirc uses tabbed indentation in case your editor of choice is configured to only produce spaces. Mixing the two indenting styles may cause unexpected behavior.<br />
====Configuration Variables====<br />
# Configuration Variables<br />
MODKEY=Mod1<br />
UP=k<br />
DOWN=j<br />
LEFT=h<br />
RIGHT=l<br />
Change Mod1 to Mod4 if you want to use Windows key instead of Alt. You can also change h, j, k, l, if you like.<br />
<br />
====Window Colors====<br />
# Colors tuples: "<text> <background> <border>"<br />
WMII_NORMCOLORS='#ffffff #000000 #ffffff'<br />
WMII_FOCUSCOLORS='#ffffff #5c0000 #ffffff'<br />
<br />
WMII_BACKGROUND='#333333'<br />
WMII_FONT='fixed'<br />
Colors of unselected window are in NORMCOLORS variable. Colors of selected window are in FOCUSCOLOR variable. You can change the background color (if you use transparent terminal) with the WMII_BACKGROUND variable.<br />
<br />
==== For Laptop Users====<br />
<br />
If you are using wmii on laptop, it may be convenient to display useful items such as battery info, wireless quality, and cpu frequency in the status bar.<br />
<br />
''note: this requires you to install acpi<br />
pacman -Sy acpi''<br />
<br />
# Status Bar Info<br />
status() {<br />
echo -n ' Wlan0:' $(iwconfig wlan0 | sed 's/ /\n/g' | grep Quality) '|' $(acpi) '|'' Core MHz:' $(cat /proc/cpuinfo | grep 'cpu MHz' | sed 's/.*: //g; s/\..*//g;') '|' $(uptime | sed 's/.*://; s/,//g') '|' $(date) }<br />
<br />
By default the status bar only shows date and an uptime pager (displays system load average for the last 1, 5, 15 minutes)<br />
<br />
==Usage==<br />
<br />
If you are not familiar with tiling WMs, it's not really easy to begin with it. You have to learn a few basic hotkeys to launch programs and place or resize windows. By default, the "Mod" key is Alt. Some default hotkeys are :<br />
* Mod+Enter -> Terminal<br />
* Mod+p -> dmenu : a menu appears, just type the beginning of the name of the application to open it<br />
* Mod+d -> default layout : windows are divided on screen<br />
* Mod+s -> stacked layout : the selected window take all the screen, we just see the title bar of the others<br />
* Mod+j -> select the window below<br />
* Mod+k -> select the window above<br />
* Shift+Mod+j -> move the window down<br />
* Shift+Mod+k -> move the window up<br />
* Mod+a -> Actions menu : choose "quit" to quit<br />
<br />
By default, only one column is used by the desktop (i.e. the entire screen). It's possible to use several columns with h and l :<br />
<br />
* Mod+Shift+h : move the selected window left<br />
* Mod+Shift+l : move the selected window right<br />
* Mod+h : select the column on the left<br />
* Mod+l : select the column on the right <br />
<br />
Columns are created automatically, with your placements of the windows. You can make them bigger or smaller, clicking beetween two columns.<br />
<br />
===Layouts===<br />
<br />
You begin in "default" layout : all windows take the same space. You can make them bigger or smaller by clicking in the little square in the title bar of a window.<br />
<br />
* "stacked" layout (Mod+s) : the selected window takes the entire column, but you can see the title bar of the other windows<br />
* "maximum" layout (Mod+m) : the selected window takes the entire column, you don't see other windows.<br />
* "fullscreen" layout (Mod+f) : the selected window takes runs in full screen.<br />
<br />
====Floating layout====<br />
<br />
You can place your windows like a classic window manager. It's called floating layout. It's useful for some applications, like the Gimp, mplayer, vlc etc.<br />
<br />
* Mod+Shift+Space : Move selected window in floating layout.<br />
* Mod+Space : switch between floating layout and normal layout. <br />
<br />
In the floating layout, we can select a window with Mod+j and Mod+k. We can change dimensions of the window, by dragging, like in any other window manager. But we can use hotkeys for that as well :<br />
<br />
* Mod+Left click : move window<br />
* Mod+Right click : change dimensions of the window (you can use it in other layouts too)<br />
<br />
===Views and Tagging===<br />
Tagging in wmii is very similar to the concept of virtual desktops in other window managers. However, tagging is slightly more powerful. By default, when you first start up wmii you will see the word 'nil' in the lower left corner. You are at the 'nil' view. The first application you start (such as a terminal: Mod+Enter) will automatically be tagged with a "1" and you will be automatically switched to view "1". Views can be navigated or changed with built in keybindings:<br />
<br />
* Mod+Shift+2 : tag selected window to view "2"<br />
* Mod+2 : this switches you to view "2" where you can see all windows tagged with "2"<br />
<br />
It's the same thing for all numbers, from 0 to 9. But you can also use names :<br />
<br />
* Mod+t : views menu : you can select a tag with right and left keys, or type the name of the tag (or just a part of the name, if it was created)<br />
* Mod+Shift+t : this retags the currently selected window with whatever you type into the menu.<br />
<br />
You can tag windows with multiple views by using a '+' between the tag names :<br />
<br />
* Mot+Shift+t foo+bar+2 : this tags the currently selected window to the views "foo", "bar" and "2"<br />
<br />
Tags can be set for specific applications in the wmiirc configuration file.<br />
<br />
# Tagging Rules<br />
wmiir write /tagrules <<!<br />
/Firefox.*/ -> ~+2<br />
/Gimp.*/ -> ~+3<br />
/.*/ -> sel<br />
/.*/ -> 1<br />
!<br />
<br />
With the above tag rules, firefox starts in floating mode (~) on view "2". Gimp starts in floating mode on view "3".<br />
<br />
==WMII filesystem==<br />
<br />
WMII's filesystem is based on the [http://en.wikipedia.org/wiki/9P 9P protocol]. Every element (windows, statusbar, ...) is represented as a file. This makes several cool things possible. For example you can display the song you're currently listening to in the statusbar (for example with MPD and MPC).<br />
<br />
{{Box Note|This filesystem is not permanent and you have to set up everything again after reboot. To make your changes "permanent" simply write the right commands into your wmiirc.}}<br />
<br />
You can access the filesystem with the ''wmiir'' command. For instance, you can list the root directory with ''wmiir ls /''<br />
<br />
client/<br />
colrules<br />
ctl<br />
event<br />
keys<br />
lbar/<br />
rbar/<br />
tag/<br />
tagrules<br />
<br />
You can use ''wmiir read'' to look into files: ''wmiir read /tag/sel/index''<br />
<br />
# ~ 1280 785<br />
~ 0x160000d 731 394 486 332 xterm:XTerm:~<br />
# 1 0 1280<br />
1 0x800003 0 785 opera:Opera:Editing Wmii - Preview - ArchWiki - Opera<br />
<br />
So this is the info for the '''sel'''ected (current) tag. As you can see, I've got one floating xterm and Opera running on this tag. The first number in this output indicates the column of the window. ~ is the floating column and 1 ist (obviously) the first column. The second column is the XServer-ID for the client. The next columns are the coordinates and the size of the window. The last column ist the titlebar of the window.<br />
<br />
You can create new files with ''wmiir create'':<br />
<br />
echo Arch is best | wmiir create /rbar/arch<br />
<br />
Now you should see "Arch is best" in your statusbar<br />
<br />
"wmiir create" reads from STDIN. So you can pipe any information you like into your statusbar. "wmiir write" works in a similar fashion but doesn't create new files.<br />
<br />
{{Box Note|Note for /rbar and /lbar:The elements in those status bars are in alphabetical order.}}<br />
<br />
You can remove files with rm or remove<br />
<br />
If you like to have a program on several tags you can use:<br />
echo "3+5+8" | wmiir write /client/0x800003/tags<br />
<br />
Now my Opera window appears on Tags 3,5 and 8.<br />
<br />
But there are easier ways to accomplish this ;)<br />
Just type MOD+shift+t and enter "3+5+8" and you get the same result for the currently selected client.<br />
<br />
{{Box Note| There's also the possibility to mount WMII's filesystem. Have a look at the [http://wmii.suckless.org/9p official documentation]. }}<br />
<br />
==Other nice stuff==<br />
<br />
===Terminal Title===<br />
If you would like to have the current directory stack in you xterm's titlebar, then add this to your .bashrc<br />
if [ "$TERM" != "Linux" ]; then<br />
PROMPT_COMMAND='dirs | wmiir write /client/sel/label'<br />
fi<br />
With this you can shorten you shell prompt and have more horizontal space to type.The test prevents you from getting a "WMII_ADRESS not set" in the console.<br />
<br />
===Weechat Highlight Notification===<br />
If you use weechat and want to know when you have been messaged without always having to be looking at the weechat window, you can use the ''sound.pl'' plugin to send a notice to the bar. You first need to create a script that sends your desired notice. Here is very simple one:<br />
<br />
#!/bin/bash<br />
echo :: NEW MESSAGE :: | wmiir create /lbar/alert<br />
sleep 8<br />
wmiir remove /lbar/alert<br />
<br />
Then start weechat and load the plugin.<br />
<br />
/perl load sound.pl<br />
<br />
Then type the following command from the Weechat FAQ into weechat:<br />
<br />
/setp perl.sound.cmd_highlight = "/path/to/yourscript"<br />
<br />
Now, :: NEW MESSAGE :: will appear in the left corner of your bar whenever you have a message highlight. Make sure to place ''sound.pl'' the perl/autoload directory so that it starts when weechat starts.<br />
<br />
===Mod4 on an old Thinkpad===<br />
<br />
Although Wmii defaults to Mod1, using Mod4 reduces conflicts in keybindings with many terminal applications. There is a snag for old Thinkpad users, however. They don't have a Mod4 key. To get one, another key has to be assigned to it using xmodmap. To do it, make an ''.Xmodmap'' file in your home directory and add this to it:<br />
keycode 64 = Super_L<br />
add Mod4 = Super_L<br />
remove Mod1 = Super_L<br />
<br />
You will need to replace 64 with whatever ''xev'' tells you is the keycode of the key you want to replace. In the above example, I replace left Alt (and use right alt for applications).<br />
<br />
==Other Resources==<br />
* [http://www.suckless.org/wmii/ wmii] -- the official website of wmii<br />
* [[dmenu]] -- a simple application launcher which binds well with dwm and wmii</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=Wmii&diff=67140
Wmii
2009-04-19T06:58:31Z
<p>SkonesMickLoud: /* Usage */</p>
<hr />
<div>[[Category:Desktop environments (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
==Introduction==<br />
[http://www.suckless.org/wmii/ wmii] (window manager improved 2) is a dynamic window manager for X11. It supports classic and dynamic window management with extended keyboard, mouse, and filesystem based remote control. It replaces the workspace paradigm with a new tagging approach. <br />
<br />
The following tips are intended to help the user get started with wmii. While wmii can be configured in almost any language, this article will focus on using the '''wmiirc''' configuration file, which is simply a shell script. Please see the [[ruby-wmii]] article to see how to configure wmii in ruby.<br />
<br />
==Installation==<br />
wmii is available from the '''extra''' repository. You can install it by issuing the following command:<br />
<br />
pacman -Sy wmii<br />
<br />
Alternatively, you can get the [http://aur.archlinux.org/packages.php?ID=3497 latest development version] which is available from the [[AUR]].<br />
<br />
Next you will need to edit your '''~/.xinitrc''' to enable you to start wmii with '''startx''':<br />
<br />
exec wmii<br />
<br />
To allow for starting wmii without logging off or killing the X session, add the following in the ~/.xinitrc<br />
until wmii; do<br />
true<br />
done<br />
Upon your first login, you will be greeted with the wmii welcome message, which also includes a short tutorial on wmii. Completing this tutorial will give you a good idea on how wmii works.<br />
{{Box Note|If the welcome message does not show up, make sure you have '''xmessage''' installed from the '''xorg-apps''' package. Then you can read the welcome by pressing $MODKEY-a and selecting 'welcome'.}}<br />
<br />
==Configuration==<br />
The easiest way to start configuring wmii, is to copy the default wmiirc file to your home directory and changing it to your needs. <br />
mkdir ~/.wmii-3.5<br />
cp /etc/wmii-3.5/wmiirc ~/.wmii-3.5/<br />
By editing this file, you can change things such as color, background, modkey, etc. Keep in mind that wmiirc uses tabbed indentation in case your editor of choice is configured to only produce spaces. Mixing the two indenting styles may cause unexpected behavior.<br />
====Configuration Variables====<br />
# Configuration Variables<br />
MODKEY=Mod1<br />
UP=k<br />
DOWN=j<br />
LEFT=h<br />
RIGHT=l<br />
Change Mod1 to Mod4 if you want to use Windows key instead of Alt. You can also change h, j, k, l, if you like.<br />
<br />
====Window Colors====<br />
# Colors tuples: "<text> <background> <border>"<br />
WMII_NORMCOLORS='#ffffff #000000 #ffffff'<br />
WMII_FOCUSCOLORS='#ffffff #5c0000 #ffffff'<br />
<br />
WMII_BACKGROUND='#333333'<br />
WMII_FONT='fixed'<br />
Colors of unselected window are in NORMCOLORS variable. Colors of selected window are in FOCUSCOLOR variable. You can change the background color (if you use transparent terminal) with the WMII_BACKGROUND variable.<br />
<br />
==== For Laptop Users====<br />
<br />
If you are using wmii on laptop, it may be convenient to display useful items such as battery info, wireless quality, and cpu frequency in the status bar.<br />
<br />
''note: this requires you to install acpi<br />
pacman -Sy acpi''<br />
<br />
# Status Bar Info<br />
status() {<br />
echo -n ' Wlan0:' $(iwconfig wlan0 | sed 's/ /\n/g' | grep Quality) '|' $(acpi) '|'' Core MHz:' $(cat /proc/cpuinfo | grep 'cpu MHz' | sed 's/.*: //g; s/\..*//g;') '|' $(uptime | sed 's/.*://; s/,//g') '|' $(date) }<br />
<br />
By default the status bar only shows date and an uptime pager (displays system load average for the last 1, 5, 15 minutes)<br />
<br />
==Usage==<br />
<br />
If you are not familiar with tiling WMs, it's not really easy to begin with it. You have to learn a few basic hotkeys to launch programs and place or resize windows. By default, the "Mod" key is Alt. Some default hotkeys are :<br />
* Mod+Enter -> Terminal<br />
* Mod+p -> dmenu : a menu appears, just type the beginning of the name of the application to open it<br />
* Mod+d -> default layout : windows are divided on screen<br />
* Mod+s -> stacked layout : the selected window take all the screen, we just see the title bar of the others<br />
* Mod+j -> select the window below<br />
* Mod+k -> select the window above<br />
* Shift+Mod+j -> move the window down<br />
* Shift+Mod+k -> move the window up<br />
* Mod+a -> Actions menu : choose "quit" to quit<br />
<br />
By default, only one column is used by the desktop (i.e. the entire screen). It's possible to use several columns with h and l :<br />
<br />
* Mod+Shift+h : move the selected window left<br />
* Mod+Shift+l : move the selected window right<br />
* Mod+h : select the column on the left<br />
* Mod+l : select the column on the right <br />
<br />
Columns are created automatically, with your placements of the windows. You can make them bigger or smaller, clicking beetween two columns.<br />
<br />
===Layouts===<br />
<br />
You begin in "default" layout : all windows take the same space. You can make them bigger or smaller by clicking in the little square in the title bar of a window.<br />
<br />
* "stacked" layout (Mod+s) : the selected window takes the entire column, but you can see the title bar of the other windows<br />
* "maximum" layout (Mod+m) : the selected window takes the entire column, you don't see other windows.<br />
* "fullscreen" layout (Mod+f) : the selected window takes runs in full screen.<br />
<br />
====Floating layout====<br />
<br />
You can place your windows like a classic window manager. It's called floating layout. It's useful for some applications, like the Gimp, mplayer, vlc etc.<br />
<br />
* Mod+Shift+Space : Move selected window in floating layout.<br />
* Mod+Space : switch between floating layout and normal layout. <br />
<br />
In the floating layout, we can select a window with Mod+j and Mod+k. We can change dimensions of the window, by dragging, like in any other window manager. But we can use hotkeys for that as well :<br />
<br />
* Mod+Left click : move window<br />
* Mod+Right click : change dimensions of the window (you can use it in other layouts too)<br />
<br />
===Views and Tagging===<br />
Tagging in wmii is very similar to the concept of virtual desktops in other window managers. However, tagging is slightly more powerful. By default, when you first start up wmii you will see the word 'nil' in the lower left corner. You are at the 'nil' view. The first application you start (such as a terminal: Mod+Enter) will automatically be tagged with a "1" and you will be automatically switched to view "1". Views can be navigated or changed with built in keybindings:<br />
<br />
* Mod+Shift+2 : tag selected window to view "2"<br />
* Mod+2 : this switches you to view "2" where you can see all windows tagged with "2"<br />
<br />
It's the same thing for all numbers, from 0 to 9. But you can also use names :<br />
<br />
* Mod+t : views menu : you can select a tag with right and left keys, or type the name of the tag (or just a part of the name, if it was created)<br />
* Mod+Shift+t : this retags the currently selected window with whatever you type into the menu.<br />
<br />
You can tag windows with multiple views by using a '+' between the tag names :<br />
<br />
* Mot+Shift+t foo+bar+2 : this tags the currently selected window to the views "foo", "bar" and "2"<br />
<br />
Tags can be set for specific applications in the wmiirc configuration file.<br />
<br />
# Tagging Rules<br />
wmiir write /tagrules <<!<br />
/Firefox.*/ -> ~+2<br />
/Gimp.*/ -> ~+3<br />
/.*/ -> sel<br />
/.*/ -> 1<br />
!<br />
<br />
With the above tag rules, firefox starts in floating mode (~) on view "2". Gimp starts in floating mode on view "3".<br />
<br />
==WMII filesystem==<br />
<br />
WMII's filesystem is based on the [http://en.wikipedia.org/wiki/9P 9P protocol]. Every element (windows, statusbar, ...) is represented as a file. This makes several cool things possible. For example you can display the song you're currently listening to in the statusbar (for example with MPD and MPC).<br />
<br />
{{Box Note|This filesystem is not permanent and you have to set up everything again after reboot. To make your changes "permanent" simply write the right commands into your wmiirc.}}<br />
<br />
You can access the filesystem with the ''wmiir'' command. For instance, you can list the root directory with ''wmiir ls /''<br />
<br />
client/<br />
colrules<br />
ctl<br />
event<br />
keys<br />
lbar/<br />
rbar/<br />
tag/<br />
tagrules<br />
<br />
You can use ''wmiir read'' to look into files: ''wmiir read /tag/sel/index''<br />
<br />
# ~ 1280 785<br />
~ 0x160000d 731 394 486 332 xterm:XTerm:~<br />
# 1 0 1280<br />
1 0x800003 0 785 opera:Opera:Editing Wmii - Preview - ArchWiki - Opera<br />
<br />
So this is the info for the '''sel'''ected (current) tag. As you can see, I've got one floating xterm and Opera running on this tag. The first number in this output indicates the column of the window. ~ ist the floating column and 1 ist (obviously) the first column. The second column is the XServer-ID for the client. The next columns are the coordinates and the size of the window. The last column ist the titlebar of the window.<br />
<br />
You can create new files with ''wmiir create'':<br />
<br />
echo Arch is best | wmiir create /rbar/arch<br />
<br />
Now you should see "Arch is best" in your statusbar<br />
<br />
"wmiir create" reads from STDIN. So you can pipe any information you like into your statusbar. "wmiir write" works in a similar fashion but doesn't create new files.<br />
<br />
{{Box Note|Note for /rbar and /lbar:The elements in those status bars are in alphabetical order.}}<br />
<br />
You can remove files with rm or remove<br />
<br />
If you like to have a program on several tags you can use:<br />
echo "3+5+8" | wmiir write /client/0x800003/tags<br />
<br />
Now my Opera window appears on Tags 3,5 and 8.<br />
<br />
But there are easier ways to accomplish this ;)<br />
Just type MOD+shift+t and enter "3+5+8" and you get the same result for the currently selected client.<br />
<br />
{{Box Note| There's also the possibility to mount WMII's filesystem. Have a look at the [http://wmii.suckless.org/9p official documentation]. }}<br />
<br />
==Other nice stuff==<br />
<br />
===Terminal Title===<br />
If you would like to have the current directory stack in you xterm's titlebar, then add this to your .bashrc<br />
if [ "$TERM" != "Linux" ]; then<br />
PROMPT_COMMAND='dirs | wmiir write /client/sel/label'<br />
fi<br />
With this you can shorten you shell prompt and have more horizontal space to type.The test prevents you from getting a "WMII_ADRESS not set" in the console.<br />
<br />
===Weechat Highlight Notification===<br />
If you use weechat and want to know when you have been messaged without always having to be looking at the weechat window, you can use the ''sound.pl'' plugin to send a notice to the bar. You first need to create a script that sends your desired notice. Here is very simple one:<br />
<br />
#!/bin/bash<br />
echo :: NEW MESSAGE :: | wmiir create /lbar/alert<br />
sleep 8<br />
wmiir remove /lbar/alert<br />
<br />
Then start weechat and load the plugin.<br />
<br />
/perl load sound.pl<br />
<br />
Then type the following command from the Weechat FAQ into weechat:<br />
<br />
/setp perl.sound.cmd_highlight = "/path/to/yourscript"<br />
<br />
Now, :: NEW MESSAGE :: will appear in the left corner of your bar whenever you have a message highlight. Make sure to place ''sound.pl'' the perl/autoload directory so that it starts when weechat starts.<br />
<br />
===Mod4 on an old Thinkpad===<br />
<br />
Although Wmii defaults to Mod1, using Mod4 reduces conflicts in keybindings with many terminal applications. There is a snag for old Thinkpad users, however. They don't have a Mod4 key. To get one, another key has to be assigned to it using xmodmap. To do it, make an ''.Xmodmap'' file in your home directory and add this to it:<br />
keycode 64 = Super_L<br />
add Mod4 = Super_L<br />
remove Mod1 = Super_L<br />
<br />
You will need to replace 64 with whatever ''xev'' tells you is the keycode of the key you want to replace. In the above example, I replace left Alt (and use right alt for applications).<br />
<br />
==Other Resources==<br />
* [http://www.suckless.org/wmii/ wmii] -- the official website of wmii<br />
* [[dmenu]] -- a simple application launcher which binds well with dwm and wmii</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=TrueCrypt&diff=66181
TrueCrypt
2009-04-03T16:39:02Z
<p>SkonesMickLoud: /* Installation */</p>
<hr />
<div>[[Category:Security (English)]]<br />
[[Category:File systems (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
==Overview==<br />
'''TrueCrypt''' is a free open source on-the-fly encryption (OTFE) program. Some of its features are:<br />
* Virtual encrypted disks within files that can be mounted as real disks.<br />
* Encryption of an entire hard disk partition or a storage device/medium.<br />
* All encryption algorithms use the LRW mode of operation, which is more secure than CBC mode with predictable initialization vectors for storage encryption.<br />
* "Hidden volumes" within a normal "outer" encrypted volume. A hidden volume can not be distinguished from random data without access to a passphrase and/or keyfile.<br />
<br />
== Installation ==<br />
Type as root in a terminal:<br />
# pacman -Sy truecrypt<br />
If you use any kernel other than kernel26 install the corresponding kernel module, e.g. kernel26beyond -> truecrypt-beyond.<br />
<br />
If you are using truecrypt to encrypt a virtual filesystem (e.g. a file), the module will be automatically loaded whenever you run the <code>truecrypt</code> command. You will need the "loop" module though. Add it to the MODULES array in /etc/rc.conf.<br />
<br />
If you are using truecrypt to encrypt a physical device (e.g. a hard disk or usb drive), you will likely want to load the module during the boot sequence:<br />
<br />
Add the module to /etc/rc.conf:<br />
MODULES=('''truecrypt''' ...)<br />
<br />
== Encrypting a file as a virtual volume ==<br />
The following instructions will create a file that will act as a virtual filesystem, allowing you to mount it and store files within the encrypted file. This is a convenient way to store sensitive information, such as financial data or passwords, in a single file that can be accessed from Linux, Windows, or Macs.<br />
<br />
To create a new truecrypt file interactively, type the following in a terminal:<br />
$ truecrypt -c<br />
<br />
{{Box Note | This command won't work in newer version of truecrypt. Type "truecrypt" instead and manage your encrypted volumes from the GUI or specify the necessary options to work in the command line. (truecrypt -h)}}<br />
<br />
Follow the instructions, choosing the default values unless you know what you're doing:<br />
<br />
Volume type:<br />
1) Normal<br />
2) Hidden<br />
Select [1]: 1<br />
<br />
Enter file or device path for new volume: /home/user/myEncryptedFile.tc<br />
<br />
Filesystem:<br />
1) FAT<br />
2) None<br />
Select [1]: 1<br />
<br />
Enter volume size (bytes - size/sizeK/sizeM/sizeG): 32M<br />
<br />
Hash algorithm:<br />
1) RIPEMD-160<br />
2) SHA-1<br />
3) Whirlpool<br />
Select [1]: 1 <br />
<br />
Encryption algorithm:<br />
1) AES<br />
2) Blowfish<br />
3) CAST5<br />
4) Serpent<br />
5) Triple DES<br />
6) Twofish<br />
7) AES-Twofish<br />
8) AES-Twofish-Serpent<br />
9) Serpent-AES<br />
10) Serpent-Twofish-AES<br />
11) Twofish-Serpent<br />
Select [1]: 1<br />
<br />
Enter password for new volume '/home/user/myEncryptedFile.tc': *****************************<br />
Re-enter password: *****************************<br />
<br />
Enter keyfile path [none]: <br />
<br />
TrueCrypt will now collect random data.<br />
Is your mouse connected directly to computer where TrueCrypt is running? [Y/n]: <br />
Please move the mouse randomly until the required amount of data is captured...<br />
Mouse data captured: 100% <br />
<br />
Done: 32.00 MB Speed: 10.76 MB/s Left: 0:00:00 <br />
Volume created.<br />
<br />
[user@host:~] $<br />
<br />
You can now mount the new encrypted file to a previously-created directory:<br />
$ truecrypt /home/user/myEncryptedFile.tc /home/user/myEncryptedFileFolder<br />
<br />
'''''Note:''' Truecrypt requires root privileges and as such, running the above command as a user will attempt to use ''<tt>sudo</tt>'' for authentication. To work with files as a regular user, please see the appropriate section below.<br />
<br />
Once mounted, you can copy or create new files within the encrypted directory as if it was any normal directory. When you are you ready to re-encrypt the contents and unmount the directory, run:<br />
$ truecrypt -d<br />
<br />
Again, this will require administrator privileges through the use of <tt>sudo</tt>.<br />
<br />
For more information about truecrypt in general, run:<br />
$ man truecrypt<br />
<br />
Several options can be passed at the command line, making automated access and creation a simple task. The man page is highly recommended reading.<br />
<br />
== Encrypting a physical volume ==<br />
If you want to use a keyfile, create one with this command:<br />
truecrypt --keyfile-create /etc/disk.key<br />
By default both passphrase and key will be needed to unlock the volume.<br />
<br />
Create a new volume in the device /dev/sda1:<br />
truecrypt --type normal -c /dev/sda1<br />
<br />
Map the volume to /dev/mapper/truecrypt1:<br />
truecrypt -N 1 /dev/sda1<br />
<br />
If you want to use another file system than ext3 simply format the disk like you normally would, except use the path /dev/mapper/truecrypt1.<br />
mkfs.ext3 /dev/mapper/truecrypt1<br />
<br />
Mount the volume:<br />
mount /dev/mapper/truecrypt1 /media/disk<br />
<br />
Map and mount a volume:<br />
truecrypt /dev/sda1 /media/disk<br />
<br />
Unmount and unmap a volume:<br />
truecrypt -d /dev/sda1<br />
<br />
== Creating a hidden volume ==<br />
First, create a normal outer volume as described above.<br />
<br />
Map the outer volume to /dev/mapper/truecrypt1:<br />
truecrypt -N 1 /dev/sda1<br />
<br />
Create a hidden truecrypt volume in the free space of the outer volume:<br />
truecrypt --type hidden -c /dev/sda1<br />
You need to use another passphrase and/or keyfile here than the one you used for the outer volume.<br />
<br />
Unmap the outer truecrypt volume and map the hidden one:<br />
truecrypt -d /dev/sda1<br />
truecrypt -N 1 /dev/sda1<br />
Just use the passphrase you chose for the hidden volume and TrueCrypt will automatically choose it before the outer.<br />
<br />
Create a file system on it (if you have not already) and mount it:<br />
mkfs.ext3 /dev/mapper/truecrypt1<br />
mount /dev/mapper/truecrypt1 /media/disk<br />
<br />
Map and mount the outer volume with the hidden write-protected:<br />
truecrypt -P /dev/sda1 /media/disk<br />
<br />
==Mount a special filesystem==<br />
In my example I want to mount a ntfs-volume, but truecrypt doesn't use ntfs-3g by default (so there is no write access; checked in version 6.1).<br />
The following command works for me:<br />
truecrypt --filesystem=ntfs-3g --mount /file/you/want/to/mount<br />
<br />
==Mount volumes as a normal user==<br />
<br />
TrueCrypt needs root privileges to work: this procedure will allow normal users to use it, also giving writing permissions to mounted volumes.<br />
<br />
Both methods below require [[Sudo]]. Make sure it is configured before proceeding.<br />
<br />
===Method 1 (Add a truecrypt group)===<br />
<br />
Create a new group called truecrypt and give it the necessary permissions. Any users that will belong to that group, will be able to use TrueCrypt.<br />
# groupadd truecrypt<br />
<br />
Edit the sudo configuration:<br />
# visudo<br />
<br />
Append the following lines at the bottom of the sudo configuration file:<br />
# Users in the truecrypt group are allowed to run TrueCrypt as root.<br />
%truecrypt ALL=(root) NOPASSWD:/usr/bin/truecrypt<br />
<br />
Before adding our users to the truecrypt group we still have to do something in order to make mounted volumes writable from normal users. To do this just open the system-wide bashrc file:<br />
# nano /etc/bash/bashrc<br />
<br />
And add these few lines to it:<br />
alias tc='sudo truecrypt'<br />
alias tcm='tc -M uid=$(id -u),gid=$(id -g)'<br />
<br />
You can now add your users to the truecrypt group:<br />
# gpasswd -a USER_1 truecrypt<br />
# gpasswd -a USER_2 truecrypt<br />
...<br />
<br />
'''''Note:''' In order to make these changes active, any user that has been added to the truecrypt group have to logout.''<br />
<br />
===Method 2 (sudo simplified)===<br />
Simply enable desired user to run truecrypt without a password:<br />
# visudo<br />
<br />
Append the following:<br />
USERNAME ALL = (root) NOPASSWD:/usr/bin/truecrypt<br />
<br />
alternatively, if you make use of the wheel group:<br />
%wheel ALL = (root) NOPASSWD:/usr/bin/truecrypt<br />
<br />
If you have any difficulties with permissions as a normal user, just add the '-u' flag to the truecrypt mount command, for example:<br />
$ truecrypt -u /home/user/myEncryptedFile.tc /home/user/myEncryptedFileFolder<br />
<br />
==Related links==<br />
* [http://www.truecrypt.org/ TrueCrypt Homepage]<br />
* [http://www.gentoo-wiki.info/HOWTO_Truecrypt HOWTO: Truecrypt Gentoo wiki (old version from a Backup. New Version not written yet)]<br />
* [http://www.howtoforge.com/truecrypt_data_encryption Truecrypt Tutorial on HowToForge]</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=64-bit_FAQ&diff=66091
64-bit FAQ
2009-04-02T03:13:26Z
<p>SkonesMickLoud: /* Does 64-bit mean a great speed improvement? */</p>
<hr />
<div>[[Category:Arch64 (English)]]<br />
[[Category:FAQs (English)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|Česky|Arch64 FAQ (Česky)}}<br />
{{i18n_entry|English|Arch64 FAQ}}<br />
{{i18n_entry|Español|Arch64 FAQ (Español)}}<br />
{{i18n_entry|Ελληνικά|Arch64 FAQ (Ελληνικά)}}<br />
{{i18n_entry|Français|Arch64 FAQ (Français)}}<br />
{{i18n_entry|Italiano|Arch64 FAQ (Italiano)}}<br />
{{i18n_entry|简体中文|Arch64问答_(简体中文)}}<br />
{{i18n_entry|Русский|Arch64 FAQ (Русский)}}<br />
{{i18n_links_end}}<br />
<br />
Below is a list of frequently asked questions about Arch64.<br />
<br />
==How can I install Arch64?==<br />
Just use our [http://www.archlinux.org/download/ official install ISO CD].<br />
<br />
==How complete is the port?==<br />
The port is ready for daily use in a desktop or server environment.<br />
<br />
==Will I have all the packages from my 32-bit Arch I am used to?==<br />
The Core and Extra repositories are ported and almost everything is up to date. At most, the x86_64 versions are only hours or a few days behind the i686 ones.<br />
<br />
Occationally, a package in AUR will only have 'i686' listed, but often they work for 64-bit too, just try adding 'x86_64'.<br />
<br />
==Does 64-bit mean a great speed improvement?==<br />
For applications using the 64-bit CPU registers (large databases and such) this is true in most cases. Some multimedia applications will also run noticeably faster. If you know an application which is known to be much faster when using SSE3 extensions you can rebuild the package yourself. We ''only'' compile with SSE2 support (from march=x86_64) and -O2 optimizations.<br />
For more read http://forums.gentoo.org/viewtopic.php?t=221045 or http://www.thejemreport.com/mambo/content/view/74/74/ .<br />
<br />
For the rest of the system: It doesn't make any difference if the keyboard waits. <br />
<br />
For further details watch our [[Arch64_ToDoS]]. There you will find a list comparing arch32/arch64 package versions.<br />
<br />
For certain boot problems try these special kernel boot flags: http://www.x86-64.org/lists/discuss/msg03747.html (dead link)<br />
<br />
I have three 64-bit Archies running now, and they perform noticeably better under heavy load. It just seems to deliver more punch.<br />
<br />
==How can I file bugs?==<br />
Simply use Arch's flyspray but select x86_64 in the Architecture field if you think it's a port-related problem!<br />
<br />
==What repos should I set up for pacman to use?==<br />
All repos are supported for the port.<br />
<br />
==How can I patch existing PKGBUILDs for use with Arch64?==<br />
We add to all ported packages this variable:<br />
arch=('i686' 'x86_64') <br />
Add small patches directly to the sources and md5sums area but use for complete different sources:<br />
[ "$CARCH" = "x86_64" ] && source=(${source[@]} 'other source')<br />
[ "$CARCH" = "x86_64" ] && md5sums=(${md5sums[@]} 'other md5sum')<br />
For any small fix use this in the build area:<br />
[ "$CARCH" = "x86_64" ] && (patch -Np0 -i ../foo_x86_64.patch || return 1)<br />
Or when you need more changes:<br />
if [ "$CARCH" = "x86_64" ]; then<br />
configure/patch/sed # for x86_64<br />
else configure/patch/sed # for i686<br />
fi<br />
<br />
==What will I miss in Arch64?==<br />
Not much.<br />
<br />
Wine, Skype and Zsnes were problematic previously, but they are easy to install with [[Yaourt]]:<br />
yaourt -S bin32-wine bin32-skype zsnes<br />
<br />
Some closed source apps and emulators may be problematic, though.<br />
* TeamSpeak?<br />
* SysLinux?<br />
<br />
Almost everything that isn't closed source or contain x86 assembly (like many emulators) should be portable. If you miss any Arch32 package in our port and you know that it will compile on x86_64 (e.g. you have found it in another 64-bit distribution without using multilibs), just contact the devs.<br />
<br />
==Can I build 32-bit packages for i686 inside Arch64?==<br />
<br />
Yes. You need a working i686 chroot (installation with i686 iso "quickinstall" is recommended for the quick way to install it inside Arch64 or see [[Arch64 Install bundled 32bit system]]). Install "linux32" wrapper pkg from current to make the chroot behave like a real i686 system. Then use this script to login into the chroot environment as root:<br />
<br />
#!/bin/bash<br />
mount --bind /dev /path-to-your-chroot/dev<br />
mount --bind /dev/pts /path-to-your-chroot/dev/pts<br />
mount --bind /dev/shm /path-to-your-chroot/dev/shm<br />
mount -t proc none /path-to-your-chroot/proc<br />
mount -t sysfs none /path-to-your-chroot/sys<br />
linux32 chroot /path-to-your-chroot<br />
<br />
If you keep the sources on the x86_64 host system you can add<br />
"mount --bind /path-to-your-stored-sources /path-to-your-chroot/path-to-your-stored-sources" <br />
to share sources from host to chroot system for pkg building used in /etc/makepkg.conf.<br />
<br />
==Can I run 32-bit apps inside Arch64?==<br />
Yes! <br />
<br />
# You can install lib32-* libs from comunity repository for a Multilib system.<br />
# Or you can create another chroot with 32bit system:<br />
<br />
Boot into Arch64, startx, open a term.<br />
$ xhost +local:<br />
$ su<br />
# mount /dev/sda1 /mnt/arch32<br />
# mount --bind /proc /mnt/arch32/proc<br />
# chroot /mnt/arch32<br />
# su your32bitusername<br />
$ /usr/bin/command-you want # or eg: /opt/mozilla/bin/firefox<br />
<br />
Some 32-bit apps (like OpenOffice) may require additional bindings. The following lines can be placed in rc.local to ensure you get all you need for the 32-bit apps (assuming /mnt/arch32 is mounted in fstab):<br />
mount --bind /dev /mnt/arch32/dev<br />
mount --bind /dev/pts /mnt/arch32/dev/pts<br />
mount --bind /dev/shm /mnt/arch32/dev/shm<br />
mount --bind /proc /mnt/arch32/proc<br />
mount --bind /proc/bus/usb /mnt/arch32/proc/bus/usb<br />
mount --bind /sys /mnt/arch32/sys<br />
mount --bind /tmp /mnt/arch32/tmp<br />
#comment the following line if you do not use the same home folder<br />
mount --bind /home /mnt/arch32/home<br />
You can then type in a term:<br />
$ xhost +localhost<br />
$ sudo chroot /mnt/arch32 su your32bitusername /opt/openoffice/program/soffice<br />
<br />
==Can I upgrade/switch my system from i686 to x86_64 without reinstalling?==<br />
- No. However, you can start the system with the Arch64 install CD, mount the disk, backup anything you may want to keep that isn't a 32-bit binary (e.g: /home & /etc), and install.</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=Reset_lost_root_password&diff=65912
Reset lost root password
2009-03-29T09:38:15Z
<p>SkonesMickLoud: </p>
<hr />
<div>I came back from vacation after doing an Arch64 install and like the genius I forgot my root password. To recover the password, do the following:<br />
* Boot your install CD and enter the bash shell.<br />
* <code># mount [your root partition -- e.g. /dev/sda3] /mnt</code><br />
* <code># chroot /mnt</code><br />
* <code># passwd root</code><br />
* (Set a new password.)<br />
* Reboot.<br />
<br />
==References==<br />
http://bugs.archlinux.org/task/8832</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=Pacman&diff=65825
Pacman
2009-03-27T16:33:52Z
<p>SkonesMickLoud: /* Additional Information */</p>
<hr />
<div>[[Category:Package management (English)]]<br />
[[Category:Utilities (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
{{Pacman i18n Links}}<br />
<br />
==Overview==<br />
<br />
The '''[http://archlinux.org/pacman/ Pacman]''' package manager is one of the great highlights of Arch Linux. It combines a simple binary package format with an easy-to-use build system (see [[makepkg]] and [[ABS]]). '''Pacman''' makes it possible to easily manage packages, whether they be from the official Arch repositories or the user's own builds.<br />
<br />
'''Pacman''' keeps the system up to date by synchronizing package lists with the master server. This server/client model also allows you to download/install packages with a simple command, complete with all required dependencies.<br />
<br />
'''Pacman''' is written in the C programming language, so it is fast, light, and very agile. It uses the .tar.gz package format, which further enhances its speed; Gzipped tarballs, though slightly larger, are decompressed much faster than their Bzipped counterparts, and are therefore generally installed more expediently. <br />
<br />
==Usage==<br />
<br />
{{Note|To really learn what pacman can do, read [http://archlinux.org/pacman/pacman.8.html man pacman]. The examples below is just a small sample of operations that can be performed.}}<br />
<br />
===Installing Packages===<br />
<br />
Before installing and upgrading packages, it is a good idea to synchronize the local package database with the remote repositories.<br />
<br />
pacman -Sy<br />
<br />
...or, equivalently:<br />
<br />
pacman --sync --refresh<br />
<br />
To install or upgrade a single package or list of packages (including dependencies), issue the following command:<br />
<br />
pacman -S package_name1 package_name2<br />
<br />
Sometimes there are multiple versions of a package in different repositories (e.g. extra and testing). You can specify which one to install:<br />
<br />
pacman -S extra/package_name<br />
pacman -S testing/package_name<br />
<br />
You can also refresh the package database before installing a package in one command:<br />
<br />
pacman -Sy package_name<br />
<br />
===Removing Packages===<br />
<br />
To remove a single package, leaving all of its dependencies installed:<br />
<br />
pacman -R package_name<br />
<br />
To remove a package's dependencies which aren't required by any other installed package:<br />
<br />
pacman -Rs package_name<br />
<br />
By default, pacman backs up configuration files of removed applications in place by adding the extension *.pacsave to them. If you want to delete configuration files as well when removing the corresponding package (this behavior is called purging on Debian-based systems) you can use:<br />
<br />
pacman -Rn package_name<br />
<br />
Of course, this can be extended with -s to also delete now-unnecessary dependencies. Thus, the command to truly remove a package, its configuration, and all dependencies which aren't needed anymore is:<br />
<br />
pacman -Rsn package_name<br />
<br />
'''Note!''' Pacman will not remove configuration files that are created after the package was installed. You can manually remove them from your home folder.<br />
<br />
===Upgrading the System===<br />
<br />
'''Pacman''' can update all packages on the system with just one command. This could take quite a while depending on how up-to-date your system is.<br />
<br />
pacman -Su<br />
<br />
However, the best option is to synchronize the repository databases AND update your system in one go with the following:<br />
<br />
pacman -Syu<br />
<br />
Please read [[Package Management FAQs]] for more information about updating and maintaining your system with pacman.<br />
<br />
===Querying the Package Database===<br />
<br />
'''Pacman''' can search for packages in the database, searching both in packages' names and descriptions:<br />
pacman -Ss package<br />
<br />
To search for already installed packages:<br />
pacman -Qs package<br />
<br />
Once you know the name of the package you are looking for, you can get more information about it:<br />
pacman -Si package <br />
pacman -Qi package<br />
<br />
To retrieve a list of the files installed by the package:<br />
pacman -Ql package<br />
<br />
You can also query the database to know which package a file on your file system belongs to.<br />
pacman -Qo /path/to/a/file<br />
<br />
To list all packages no longer required as dependencies (orphans):<br />
pacman -Qdt<br />
<br />
'''Pacman''' queries the local package database with the -Q flag. See:<br />
pacman -Q --help<br />
<br />
...and queries the sync databases with the -S flag. See:<br />
pacman -S --help<br />
<br />
See the [http://archlinux.org/pacman/pacman.8.html pacman(8)] manpage for more details.<br />
<br />
===Backing Up and Retrieving a List of Installed Packages for Quick Software Restore===<br />
<br />
It is good practice to keep periodic backups of all pacman-installed packages. In the event of a system crash which is unrecoverable by other means, pacman can then easily reinstall the very same packages onto a new installation. <br />
<br />
First, backup the current list of packages (which are available in a repository):<br />
<br />
pacman -Qqe | grep -v "$(pacman -Qmq)" > pkglist<br />
<br />
Store the pkglist on a USB key or other convenient medium.<br />
<br />
Copy the pkglist file to the new installation, and navigate to the directory containing it.<br />
<br />
Issue the following command:<br />
<br />
pacman -S $(cat pkglist)<br />
<br />
===Additional Information===<br />
<br />
'''Pacman''' is quite an extensive package management tool. Here is just a brief collection of other features.<br />
<br />
* Download a package without installing it:<br />
pacman -Sw package_name<br />
<br />
* Install a 'local' package (not from a repository):<br />
pacman -U /path/to/package/package_name-version.pkg.tar.gz<br />
<br />
* Install a 'remote' package (not from a repository):<br />
pacman -U http://www.examplepackage/repo/examplepkg.tar.gz<br />
<br />
* Clean the package cache of packages that are not currently installed (/var/cache/pacman/pkg):<br />
pacman -Sc<br />
<br />
* Completely cleans the package cache<br />
pacman -Scc <br />
{{Warning|About pacman -Scc, you should do this only if you are sure you will not need to [[Downgrade_packages| downgrade]] any package. pacman -Scc removes all packages from the cache.}}<br />
<br />
* For removing orphans (recursively; '''be careful!'''):<br />
pacman -Rs $(pacman -Qtdq)<br />
<br />
* For reinstalling all packages on your system (which are available in a repository):<br />
pacman -S $(pacman -Qq | grep -v "$(pacman -Qmq)")<br />
<br />
* To get a sorted list of local packages and their size:<br />
LANG=C pacman -Qi | sed -n '/^Name[^:]*: \(.*\)/{s//\1 /;x};/^Installed[^:]*: \(.*\)/{s//\1/;H;x;s/\n//;p}' | sort -nk2<br />
<br />
For a more detailed list of switches please refer to <code>pacman --help</code> or <code>man pacman</code>.<br />
<br />
==Configuration==<br />
<br />
Pacman configuration is located in <code>/etc/pacman.conf</code>. In depth information about the configuration file can be found in <code>man pacman.conf</code>.<br />
<br />
===General Options===<br />
<br />
General options are in [options] section. Read the man page or look in the default pacman.conf for information on what can be done here.<br />
<br />
===Repositories===<br />
<br />
In this section you define which repositories to use, as referred to in <code>/etc/pacman.conf</code>. They can be defined directly here, or you can include them from another file.<br />
<br />
All official repositories use the same /etc/pacman.d/mirrorlist file which contains a variable '$repo', so you only need to maintain one list.<br />
<br />
The following is an example for the official repositories which have a lot of [[mirrors]]. Avoid using ftp.archlinux.org as it is [http://www.archlinux.org/news/302/ throttled].<br />
<br />
<pre><br />
[core]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
[extra]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
[community]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
</pre><br />
<br />
{{Box Note|Care should be taken when using '''testing''' repository!}}<br />
<br />
===Errors===<br />
<br />
If you receive the following error:<br />
<br />
not found in sync db<br />
<br />
...this likely due to the package not being located because the repository has not been set correctly.<br />
<br />
==Further Reading==<br />
<br />
====Man Pages====<br />
<br />
*[http://www.archlinux.org/pacman/pacman.8.html man pacman]<br />
*[http://www.archlinux.org/pacman/PKGBUILD.5.html man PKGBUILD]<br />
*[http://www.archlinux.org/pacman/libalpm.3.html man libalpm]<br />
*[http://www.archlinux.org/pacman/pacman.conf.5.html man pacman.conf]<br />
*[http://www.archlinux.org/pacman/makepkg.8.html man makepkg]<br />
*[http://www.archlinux.org/pacman/makepkg.conf.5.html man makepkg.conf]<br />
*[http://www.archlinux.org/pacman/repo-add.8.html man repo-add]<br />
<br />
====Related Articles====<br />
<br />
* [[Improve Pacman Performance]]<br />
* [[Colored Pacman output]]<br />
* [[Downgrade packages]]<br />
* [[Redownloading all installed packages]]<br />
* [[Server_configuration|Server Configuration in pacman.conf]]<br />
* [[ArchLinux User-community Repository (AUR)]]<br />
* [[Local repository HOW-TO]]<br />
* [[Custom local repository with ABS and gensync]]<br />
* [[Howto Upgrade via Home Network]] (Network Shared Pacman Cache)<br />
* [[Rucksack]]<br />
* [[Pacman GUI Frontends]]<br />
* [[Pacman_Aliases|Pacman Aliases (for Bash and Zsh)]]<br />
* [[Mirrors]]<br />
* [[Pacman rosetta]] (Pacman for yum/apt-get/rug/zypper converts)<br />
<br />
==External Links==<br />
<br />
* [http://archux.com/page/using-pacman Using Pacman]<br />
* [http://bbs.archlinux.org/viewtopic.php?id=14849 GUI Frontends]<br />
* [http://bbs.archlinux.org/viewtopic.php?pid=431164 Powerpill] A wrapper and download accelerator for Pacman</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=Talk:Arch_IRC_channels&diff=65372
Talk:Arch IRC channels
2009-03-20T14:16:57Z
<p>SkonesMickLoud: /* Some grammatical errors: */ new section</p>
<hr />
<div>I created the initial page, and really don't care much about the layout. Feel free to go nuts and reorganize.<br />
The initial list of users was created from my pirc stats, and not from memory. So the most prolific posters ended up on the list. I'd suggest that if your adding yourself to the list, link to your userpage. Then link to any screenshots, blogs, etc from there.<br />
-- xterminus<br />
<br><br />
<br><br />
: Major update of the page. Comments and suggestions are more than welcome, and so are edits<br />
: [[User:Mr.Elendig|Mr.Elendig]] 13:22, 7 April 2008 (EDT)<br />
<br />
== List of operators from the future? ==<br />
<br />
its still 29 days until 31.08.2008!<br />
<br />
<br />
: Well, arch is the future after all >_> <br />
: But it's fixed now since the date have passed :D<br />
: [[User:Mr.Elendig|Mr.Elendig]]<br />
<br />
== Language ==<br />
<br />
In [[IRC_Channel#Abbreviations_and_jargon]], please remove ''"(Yes, fine and not f*ing)"''. The explanation destroys the meta-humor and the repitition of the phrase multiplies that negative effect. --[[User:Qubodup|Qubodup]] 08:11, 27 November 2008 (EST)<br />
<br />
== Some grammatical errors: ==<br />
<br />
The inner grammar nazi in me has found a few grammatical errors in the page, but as I'm not an op, I won't change them. I'd be willing to correct them if the powers that be say that I may.<br />
<br />
"The only exception are 'away' responses at nick highlight." Should either read "exception is" or "exceptions are"<br />
<br />
"Advertising are not allowed unless an op have given you permission to do so." Should read "Advertising is not allowed unless an op has..." Same under the #archlinux-offtopic section.<br />
<br />
"The channel topic often contain useful and/or important information." Needs an "s" at the end of "contain".<br />
<br />
"Also feel free to notify an channel operator." Should read "...a channel operator...".<br />
<br />
"Don't be shy, feel free to help others, 'everyone' got something contribute." Should either read "...'everyone's got..." or ...'everyone' has...</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=GRUB_Legacy&diff=65352
GRUB Legacy
2009-03-20T03:08:41Z
<p>SkonesMickLoud: /* How to find the correct code to use for the resolution you want to use */</p>
<hr />
<div>[[Category:Boot process (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{Article summary start}}<br />
{{Article summary text|Covers various aspects of Arch Linux's default bootloader, GRand Unified Bootloader (GRUB).}}<br />
<br />
{{Article summary heading|Available in languages}}<br />
{{i18n_entry|English|GRUB}}<br />
{{i18n_entry|עברית|GRUB (עברית)}}<br />
{{i18n_entry|简体中文|GRUB(简体中文)}}<br />
{{i18n_entry|Русский|GRUB (Русский)}}<br />
{{i18n_entry|Español|GRUB (Español)}}<br />
{{i18n_entry|Italiano|GRUB (Italiano)}}<br />
{{i18n_entry|Nederlands|GRUB (Nederlands)}}<br />
{{Article summary heading|Related articles}}<br />
{{Article summary wiki|Reinstalling GRUB}}<br />
{{Article summary wiki|Grub configure examples}}<br />
{{Article summary wiki|Grub-gfx}}<br />
{{Article summary end}}<br />
<br />
<br />
<br />
<br />
<br />
== Installing Grub package ==<br />
<br />
First install grub with pacman<br />
<br />
pacman -Sy grub<br />
<br />
Edit the menu.lst with your settings<br />
<br />
nano /boot/grub/menu.lst<br />
<br />
''Note: Use hd[a-z] for ide and sd[a-z] for scsi and sata''<br />
<br />
Here is mine for example:<br />
<br />
# Config file for GRUB - The GNU GRand Unified Bootloader<br />
# /boot/grub/menu.lst<br />
<br />
# DEVICE NAME CONVERSIONS <br />
#<br />
# Linux Grub<br />
# -------------------------<br />
# /dev/fd0 (fd0)<br />
# /dev/hda (hd0)<br />
# /dev/hdb2 (hd1,1)<br />
# /dev/hda3 (hd0,2)<br />
#<br />
<br />
# FRAMEBUFFER RESOLUTION SETTINGS<br />
# +-------------------------------------------------+<br />
# | 640x480 800x600 1024x768 1280x1024<br />
# ----+--------------------------------------------<br />
# 256 | 0x301=769 0x303=771 0x305=773 0x307=775<br />
# 32K | 0x310=784 0x313=787 0x316=790 0x319=793<br />
# 64K | 0x311=785 0x314=788 0x317=791 0x31A=794<br />
# 16M | 0x312=786 0x315=789 0x318=792 0x31B=795<br />
# +-------------------------------------------------+<br />
<br />
# general configuration:<br />
timeout 5<br />
default 1<br />
color light-blue/black light-cyan/blue<br />
<br />
# boot sections follow<br />
# each is implicitly numbered from 1 in the order of appearance below<br />
#<br />
# TIP: If you want a 1024x768 framebuffer, add "vga=773" to your kernel line.<br />
#<br />
#-*<br />
<br />
# (0) Arch Linux<br />
title Arch Linux [cpio]<br />
root (hd0,0)<br />
kernel /boot/vmlinuz26 root=/dev/sda6 ro vga=773<br />
initrd /boot/kernel26.img<br />
<br />
title Arch Linux [thinkpad]<br />
root (hd0,0)<br />
kernel /boot/vmlinuz26thinkpad root=/dev/sda6 ro video=vesafb:off acpi_sleep=s3_bios<br />
resume=swap:/dev/sda5<br />
initrd /boot/kernel26thinkpad.img<br />
<br />
Copy the mounts to mtab<br />
<br />
grep -v rootfs /proc/mounts > /etc/mtab<br />
<br />
== Installing or Restoring GRUB to the Master Boot Record ==<br />
GRUB may be installed from a live environment, or directly from a running Arch install.<br />
<br />
In either case, boot the system and run the '''grub''' command as root:<br />
# grub<br />
Grub must be told where its files are on the system, since multiple instances of it may exist. The grub files reside under /boot, which may be its own partition. If you know where /boot is, specify it with the '''root''' command like so:<br />
grub> root (hdx,x)<br />
(remember that /boot is GRUB's root)<br />
<br />
If you are unaware of the the location of /boot, use the '''find''' command to locate the GRUB files. <br />
<br />
The following example is for systems ''without'' a separate /boot partition, wherein /boot is merely a directory under / :<br />
grub> find /boot/grub/stage1<br />
The following example is for systems ''with'' a separate /boot partition:<br />
grub> find /grub/stage1<br />
<br />
Grub will find the file, and give an output showing the location of the stage1 file, (which resides under /boot). For example:<br />
(hd1,0)<br />
Use the root command, (with the output from the find command) to instruct GRUB which partition contains stage1, (and therefore, /boot):<br />
grub> root (hd1,0)<br />
Finally, (re)install GRUB to the MBR of the drive. The following example installs GRUB to the MBR of the drive containing /boot:<br />
grub> setup (hd1)<br />
Use the '''quit''' command to quit GRUB:<br />
grub> quit<br />
* Alternative, installing to a partition.<br />
You may, of course, install GRUB anywhere you need it to be.<br />
<br />
For example:<br />
<br />
grub> setup (hd1,0) <br />
will install GRUB to the second harddisk, first partition.<br />
<br />
== Boot loader configuration ==<br />
The grub configuration is done in this file:<br />
/boot/grub/menu.lst<br />
<br />
* <i>(hdn,m)</i> is the partition m on disc n, numbers starting with 0<br />
* <i>splashimage (hdn,m)/grub/Name.xpm.gz</i> is the splash-image-file<br />
* <i>default n</i> is the default boot entry, that is choosen after timout for user action<br />
* <i>timeout m</i> time m to wait in seconds for a user selection, before default is booted<br />
* <i>password -md5 str</i> encrypted boot password 'str'<br />
* <i>title str</i> title string 'str' for a boot entry<br />
* <i>root (hdn,m)</i> base partition, where the kernel is stored to<br />
* <i>kernel /path ro root=/dev/device initrd /initrd.img</i> use the root option, if the kernel not placed in /<br />
* <i>makeactive<br>chainloader +1</i> sets root active and gives booting procedure to its boot-loader (for Windows, f.e.)<br />
* <i>map (hd0) (hd1)<br>map (hd1) (hd0)</i> changes primary and secondary disc for a boot, necessary to boot Windows from a secondary disc<br />
* <i>root (hdn,m,z)<br>kernel /boot/loader</i> boots the FreeBSD-Partition x<br />
* <i>default saved</i> remembers each current boot selection and makes it the new default. Place "savedefault" at the end of each boot section, for that you want this feature shall be used.<br />
<br />
For those who like eye-candy, there is [[Graphical GRUB]].<br />
<br />
<br />
=== Dual booting===<br />
These are the two most common ways of configuring the menu.lst file. For more complex uses, click [[Grub configure examples|here]].<br />
====Dual booting with Windows====<br />
Add this at the end of your /boot/grub/menu.lst. This assumes that your Windows partition is [s/h]da2.<br />
<br />
# (2) Windows XP<br />
title Windows XP<br />
rootnoverify (hd0,1)<br />
makeactive<br />
chainloader +1<br />
<br />
Note, that although commonly believed to be the case, Windows 2000 and later versions do not need to be on the first partition to boot. If the Windows partition changes number (i.e. if you after install add a partition before the windows partition), you will need to edit the Windows boot.ini file to reflect the change (see [http://vlaurie.com/computers2/Articles/bootini.htm this article] for details on how to do that).<br />
<br />
====Dual booting with Windows on another hard disk====<br />
Add this at the end of your /boot/grub/menu.lst. This assumes that your Windows partition is [s/h]db1.<br />
<br />
# (2) Windows XP<br />
title Windows XP<br />
map (hd0) (hd1)<br />
map (hd1) (hd0)<br />
rootnoverify (hd1,0)<br />
makeactive<br />
chainloader +1<br />
<br />
The map function tricks your Windows install into thinking that a second hard drive is the primary.<br />
<br />
====Dual booting with other linux distros====<br />
This is done exactly the same way that Arch linux is loaded. Here we assume that the other distro is on partition [s/h]da3.<br />
title Other Linux<br />
root (hd0,2)<br />
kernel /boot/vmlinuz (add other options here as required)<br />
initrd /boot/initrd.img (if the other kernel uses/needs one)<br />
<br />
====Dual booting with other linux distro (Chainloading)====<br />
To avoid ''maintenance nightmare'', you might want to chainload the GRUB in the MBR to another bootloader you might have installed in the bootrecord of a partition [(hd0,2) in our example] instead of the MBR. This way the auto-magic stuff of some distro will manage the menu.lst on (hd0,2) (if it is grub) for its own distro and you will boot with all the option needed (like the correct last kernel) without the need to copy/paste some part of that menu.lst into yours.<br />
<br />
In our example [http://home.tele2.fr/solsTiCe/img/dualbooting.png], GRUB is in the MBR and some other bootloader (BL) (be it grub or lilo) is in the Boot Record of (hd0,2).<br />
-------------------------------------------------<br />
| | | | % (hd0,2) |<br />
| M | | | B % |<br />
| B | (hd0,0) | (hd0,1) | L % Other |<br />
| R | | | % Distro |<br />
| | | | % |<br />
-------------------------------------------------<br />
| ^<br />
| chainloading |<br />
-----------------------------<br />
<br />
Then, you simply use in your menu.lst:<br />
title Other Linux distro<br />
root (hd0,2)<br />
chainloader +1<br />
<br />
<br />
<br />
This, of course, also works the other way around, i.e. if your arch root is in (hd0,2)/sda2 and you chose to install Arch's GRUB there instead of the MBR, because you had installed another distro first, just put the above code in that distros menu.lst.<br />
<br />
===Tips and tricks===<br />
====Restart with named boot choice====<br />
If you realize that you need to switch to some other non-default OS, e.g. Windows, having to reboot and wait for the GRUB menu to appear is tedious. GRUB offers a simple way to record your OS choice when restarting instead of waiting for the menu, simply by designating a temporary new default which will be reset (to the 'default default') as soon as it has been used.<br />
<br />
Supposing a simple menu.lst setup like this:<br />
<br />
<pre><br />
# general configuration:<br />
timeout 10<br />
default 0<br />
color light-blue/black light-cyan/blue<br />
<br />
# (0) Arch<br />
title Arch Linux<br />
root (hd0,1)<br />
kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/a29113d7-2204-49e9-be69-d94699eba466 ro<br />
initrd /boot/kernel26.img<br />
<br />
# (1) Windows<br />
title Microsoft Windows XP Pro<br />
rootnoverify (hd0,0)<br />
makeactive<br />
chainloader +1<br />
</pre><br />
<br />
Arch is the default (0). We want to restart in to Windows. Change default to saved ("default saved") - this will record the current default in a 'default' file in the grub directory whenever the 'savedefault' grub command is used. Now add the line "savedefault 0" to the bottom of the Windows entry. Whenever Windows is booted, it will reset the default to Arch, thus making changing the default to Windows temporary. <br />
<br />
Now all that is needed is a way to easily change the default 'manually'. This can be accomplsihed using the command 'grub-set-default [number of entry (starting with 0)]. So to reboot into Windows, enter the following command:<br />
<br />
sudo grub-set-default 1 && sudo shutdown -r now<br />
<br />
For ease of use, you might to wish to implement the "[[Allow users to shutdown]] fix" (including /sbin/grub-set-default amongst the commands the user is allowed to issue without supplying a password).<br />
<br />
== LiLO and GRUB interaction ==<br />
<br />
If you once had used [[lilo]] Don't forget to remove it with <br />
pacman -R lilo<br />
as some tasks (f.e. kernel compilation using <code>make all</code>) will make a lilo call, and then lilo is installed over grub.<br />
Note that this will not remove lilo from the MBR, but it will be overwritten when you install another bootloader.<br />
<br />
== Framebuffer Resolution ==<br />
<br />
One can use the resolution given in the menu.lst of [[grub]]. But you might want to use your LCD wide-screen at its full native resolution. Here is what you can do to achieve this.<br />
<br />
On [http://en.wikipedia.org/wiki/VESA_BIOS_Extensions#Linux_video_mode_numbers wikipedia], there is a list of extended framebuffer resolution (i.e beyond the ones in the VBE standard). But, for example, the one i want to use is 1440x900 and the vga=867 does not work. May be because those resolution are outside of the standard and every graphic card manufacturer use the code they like.<br />
<br />
So instead of using that table, i suggest using this method:<br />
<br />
=== How to find the correct code to use for the resolution you want to use ===<br />
# install ''lrmi'' package from '''[community]''' repository (which contains vbetest)<br />
# run ''vbetest'' as root and in a '''console''' already running on framebuffer. While ''vbetest'' will return results in a terminal in X, you will not be able to test using <tt>vbetest -m yournumberhere</tt> unless you are running a framebuffered console.<br />
# then note the number in [ ] corresponding to your desired resolution <br />
# Press 'q' to quit ''vbetest'' interactive prompt. If you want to test the resolution you have just picked up, you can run <tt>vbetest -m yournumberhere</tt> to test the resolution. You will see a checked colored image on your console. It will return to black after some second. If the text of your console is not restored you will have to switch to another console and switch back to have your text restored. (minor glitch)<br />
# add 512 to the previous number and use the total as code to use in <tt>vga=</tt> kernel option in menu.lst. <br />
# reboot and voilà !<br />
<br />
For example, what i got with ''vbetest'' is :<br />
[356] 1440x900 (256 color palette)<br />
[357] 1440x900 (8:8:8)<br />
so here the number i want is 357. then, 357 + 512 = 869, so i will use '''vga=869'''.<br />
<br />
Now, you will have a console at the full native resolution of your screen. The next step is to use another font in console at a correct size. In my case i use ''terminus'' font named ter-120b<br />
<br />
'''Note''':<br />
* (8:8:8) is for 24-bit color (or 32-bit ?)<br />
* (5:6:5) is for 16-bit color<br />
* (5:5:5) is for 15-bit color<br />
<br />
== Troubleshooting ==<br />
===Editing GRUB entries just before boot===<br />
Once you have selected some entry before booting, you can edit it using key 'e' and following on-screen instructions. Then you can boot it using key 'b'. This settings '''will not be saved'''.<br />
<br />
===GRUB error 15===<br />
Make sure that the kernel line has <code>ro</code> in menu.lst.<br />
<br />
===Reboot pulldown menu in KDE does not have any effect===<br />
If you've opened a submenu with the list of all operating system configured in grub, selected one and upon restart you still got your default OS, then you might want to check if you have line <br />
<pre><br />
default saved<br />
</pre><br />
in file ''/boot/grub/menu.lst''.<br />
<br />
== External Resources ==<br />
* [http://www.gnu.org/software/grub/ GRUB Website]<br />
* [http://www.troubleshooters.com/linux/grub/index.htm GRUB Grotto- an excellent GRUB resource]</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=Dm-crypt&diff=65180
Dm-crypt
2009-03-17T05:39:33Z
<p>SkonesMickLoud: /* Why Encryption? */</p>
<hr />
<div>[[Category:Security (English)]]<br />
[[Category:File systems (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
== Why Encryption? ==<br />
Encryption is useful for two (related) reasons. Firstly, it prevents anyone with physical access to your computer, and your hard drive in particular, from getting the data from it (unless they have your passphrase/key). Secondly, it allows you to wipe the data on your hard drive with far more confidence in the event of you selling or discarding your drive.<br />
<br />
Basically, it supplements the access control mechanisms of the operating system (like file permissions) by making it harder to bypass the operating system by inserting a boot CD, for example. Encrypting the root partition prevents anyone from using this method to insert viruses or trojans onto your computer.<br />
<br />
Note that we're not encrypting the boot partition - the bootloader needs to read that one!<br />
<br />
'''ATTENTION: Having encrypted partitions does not protect you from all possible attacks. The encryption is only as good as your key management, and there are other ways to break into computers while they are running. Read the CAVEATS section below!'''<br />
<br />
== Why LUKS for dm-crypt? ==<br />
There are either 3 or 4 rival disk encryption standards in Linux, depending on how you count them.<br />
<br />
The old cryptoloop is deprecated: it's old, insecure and unreliable.<br />
<br />
A much better version, loop-AES (http://loop-aes.sourceforge.net/), was created but, due to politics, never became favorable with the kernel developers. It's far more secure than either cryptoloop or straight device-mapper encryptions (and probably faster than any of the other 3 options), but is not user-friendly. It also requires non-standard kernel support, which ARCH's kernel26 doesn't have.<br />
<br />
The standard device-mapper encryption ([http://www.saout.de/misc/dm-crypt/ dm-crypt]) is another choice.<br />
<br />
[http://luks.endorphin.org/ LUKS] essentially makes management of encrypted partitions easier. Without going into the hairy details (check out the [http://luks.endorphin.org/ LUKS home page] if you're interested), it stores all the needed setup information on the disk itself. All you need then is the password, which can be in a separate file if you like. The Linux implementation uses dm-crypt and it can have up to eight different passwords, which can be changed or revoked easily. It is also supported by mkinitcpio in ARCH linux, which is nice.<br />
<br />
== Caveats ==<br />
<br />
=== Security (encryption) ===<br />
<br />
Disk encryption is not the be-all and end-all of security. Why not? Well, for a start, it won't prevent people from hacking into a running computer (either over the network or at a console) if there is a security hole to exploited (and there invariably is). There are a dozen and one things you can (and should) do to secure your computer against this type of attack, but they are all outside the scope of this document.<br />
<br />
What's more, even in situations this type of encryption is useful for (physical access to storage media), it isn't worth a thing if someone has your key. In other words, if someone finds out or guesses your passphrase, or gets access to your external key file if you're using one, they can unlock the encryption on the hard drive in exactly the same way that you can.<br />
<br />
What does this mean for you? Well, if you use an external key file, keep the device it is on '''SAFE'''. Attach it to your keyring or whatever. If you use a passphrase, '''make it hard to guess'''. There are [http://www.google.co.uk/search?q=create+secure+password hundreds of documents] all over the internet telling you how to come up with a secure passphrase; we're not going to go over it here. Note, however, that we use the term "passphrase": '''it doesn't have to be a single word'''.<br />
<br />
== Getting started ==<br />
If you're not starting from an unused hard drive, '''BACK UP YOUR DATA!''' I cannot stress this enough. Ideally, you should be doing this regularly anyway, and it's particularly important with an encrypted hard drive. But beware: if you have unencrypted backups, is there any point in having an encrypted hard drive? Think about where you store your backups.<br />
<br />
'''Note:''' if you want to have encrypted swap, read the section below about Encrypted Swap and decide how you want to set it up ''before'' you start the rest of this HOWTO.<br />
<br />
== Preparation ==<br />
=== Overwriting ===<br />
Repartitioning and formatting your drive will only remove the filesystem metadata and will mostly leave the actual data intact, allowing determined attackers to recover data using tools like [http://foremost.sourceforge.net/ Foremost]. If your harddisk contained sensitive data from previous use, you might want to overwrite this data. Contrary to popular believe overwriting several times or using random data as source serves no purpose. Data won't be recoverable after being overwritten by zeros. [http://www.springerlink.com/content/408263ql11460147/]<br />
<br />
To overwrite your disk with zeros you can use<br />
# dd if=/dev/zero of=/dev/sda bs=1M<br />
<br />
If you want to check for bad blocks while writing you can use badblocks. <br />
The <tt>badblocks</tt> command will check your disk for bad blocks while writing random data. The pseudorandom algorithm used by this command is faster (although "less random") than <tt>/dev/urandom</tt>, so it can be useful for large disks.<br />
# badblocks -c 10240 -w -t random -s -v /dev/sda<br />
This will test blocks in groups of 10240 (i.e. 10MB) at a time, writing over them with random data and showing progress as it goes.<br />
<br />
However it should be noted that the pseudo random data generated by badblocks does not serve any other purpose than slowing down the wiping of your drive.<br />
<br />
=== Partitioning ===<br />
Next, set up your partitions as you want. Make sure you have a separate partition for /boot. If you think about it, this is absolutely necessary. If your /boot partition was encrypted, then your bootloader wouldn't be able to read the kernel image and you would not get far.<br />
# cfdisk /dev/sda<br />
<br />
The following - indicative - partition layout will be used:<br />
/dev/sda1 -> /boot<br />
/dev/sda2 -> swap<br />
/dev/sda3 -> /<br />
/dev/sda4 -> /home<br />
/dev/sda5 -> /tmp # especially useful if you don't want to encrypt the entire root (/) partition<br />
<br />
== Loading kernel modules ==<br />
'''Note:''' this article will use XTS-AES as encryption algorithm because it was standardized as IEEE P1619 Standard for Cryptographic Protection of Data on Block-Oriented Storage Devices and it is quite secure, however the XTS mode is still flagged as "experimental" in the Linux kernel, so if you want something less secure but more proven, you should go with the CBC-ESSIV mode. The XTS mode is supported by Linux 2.6.24 upwards (ISO of Arch 2008.06 upwards).<br />
<br />
'''Note:''' The XTS mode uses two keys of the same size, therefore available sizes (using XTS-AES) are 256 (128 * 2), 384 (192 * 2) and 512 (256 * 2).<br />
<br />
Load the dm-crypt and the optimized AES module:<br />
# modprobe dm-crypt<br />
# modprobe aes-i586<br />
<br />
'''Note:''' x86_64 users can also try the "aes-x86-64" optimized module instead of "aes-i586".<br />
<br />
== Mapping partitions ==<br />
==== Passphrase ====<br />
Create your new LUKS encrypted partitions:<br />
# cryptsetup -c aes-xts-plain -y -s 512 luksFormat /dev/sda3<br />
Enter passphrase: mypassword<br />
Verify passphrase: mypassword<br />
# cryptsetup -c aes-xts-plain -y -s 512 luksFormat /dev/sda4<br />
Enter passphrase: myotherpassword<br />
Verify passphrase: myotherpassword<br />
# cryptsetup -c aes-xts-plain -y -s 512 luksFormat /dev/sda5<br />
Enter passphrase: myotherpassword<br />
Verify passphrase: myotherpassword<br />
<br />
Then open the newly created LUKS partitions:<br />
# cryptsetup luksOpen /dev/sda3 root<br />
Enter any LUKS passphrase: mypassword<br />
key slot 0 unlocked.<br />
Command successful.<br />
# cryptsetup luksOpen /dev/sda4 home<br />
Enter any LUKS passphrase: myotherpassword<br />
key slot 0 unlocked.<br />
Command successful.<br />
# cryptsetup luksOpen /dev/sda5 tmp<br />
Enter any LUKS passphrase: myotherpassword<br />
key slot 0 unlocked.<br />
Command successful.<br />
<br />
==== Keyfile (visible on external USB stick) ====<br />
Mount your USB stick<br />
mkdir /mnt/usbstick<br />
mount -t vfat /dev/sdb1 /mnt/usbstick<br />
<br />
Create your new LUKS encrypted partitions:<br />
# cryptsetup -c aes-xts-plain -s 512 -v luksFormat /dev/sda3 /mnt/usbstick/mykeyfile<br />
# cryptsetup -c aes-xts-plain -s 512 -v luksFormat /dev/sda4 /mnt/usbstick/mykeyfile<br />
# cryptsetup -c aes-xts-plain -s 512 -v luksFormat /dev/sda5 /mnt/usbstick/mykeyfile<br />
<br />
Then open the newly created LUKS partitions:<br />
# cryptsetup -d /mnt/usbstick/mykeyfile luksOpen /dev/sda3 root<br />
key slot 0 unlocked.<br />
Command successful.<br />
# cryptsetup -d /mnt/usbstick/mykeyfile luksOpen /dev/sda4 home<br />
key slot 0 unlocked.<br />
Command successful.<br />
# cryptsetup -d /mnt/usbstick/mykeyfile luksOpen /dev/sda5 tmp<br />
key slot 0 unlocked.<br />
Command successful.<br />
<br />
=== Explanation ===<br />
Now you should have a device called <tt>/dev/mapper/root</tt>, another one called <tt>/dev/mapper/home</tt> and another one called <tt>/dev/mapper/tmp</tt>. These are block devices like any other, but with a neat twist: whenever you write to them, the data is actually written to <tt>/dev/sda3</tt>, <tt>/dev/sda4</tt> or <tt>/dev/sda5</tt> respectively, but it is encrypted first! The only way to access the data on this encrypted partition is to re-create that <tt>/dev/mapper/root</tt>, <tt>/dev/mapper/home</tt> etc. device with cryptsetup each time you boot. With LUKS, you can use <tt>cryptsetup luksAddKey /dev/sda3</tt> to add a new password or <tt>cryptsetup luksDelKey /dev/sda3</tt> to revoke a password. Type <tt>cryptsetup -?</tt> or <tt>man cryptsetup</tt> (once you've booted your new Arch installation) for more info.<br />
<br />
'''Note:''' With LUKS, if you enter the wrong password, it will reject it. You don't have to worry about it possibly destroying your data.<br />
<br />
'''Note:''' You might also want to replace /var/tmp/ with a symbolic link to /tmp.<br />
<br />
'''Note:''' If you've decided to go for option two for encrypted swap (see Encrypted Swap below), you should set up <tt>/dev/mapper/swap</tt> in a similar way as you've just set up <tt>/dev/mapper/home</tt>. See Encrypted Swap below for details.<br />
<br />
== Arch Linux Installer ==<br />
Now that <tt>/dev/mapper/root</tt> and <tt>/dev/mapper/home</tt> are in place, we can enter the regular Arch setup script and it will do the rest, as it normally would.<br />
# /arch/setup<br />
'''Note:''' Most of the installation can be carried out normally. However, there are a few areas where it is important to make certain selections these are marked below.<br />
<br />
=== Prepare hard drive ===<br />
Skip the Partitioning and Auto-Prepare business and go straight to "Set Filesystem Mountpoints".<br />
When asked for your / (root) partition, do NOT select <tt>/dev/sda3</tt> as you normally would. Select <tt>/dev/mapper/root</tt> instead. Similarly, use <tt>/dev/mapper/home</tt> instead of <tt>/dev/sda4</tt> as the partition to be mounted as /home. The same is valid for a swap partition which is set up like the home partition.<br />
<br />
=== Select packages ===<br />
The base package contains all required programs. If you want you can add others but it is not required.<br />
<br />
'''Note:''' If you are installing from a release predating Voodoo (which you really shouldn't) you need to install the <tt>system/cryptsetup</tt> package.<br />
<br />
=== Install packages ===<br />
Let the setup install the packages.<br />
<br />
=== Configure System ===<br />
'''Attention:''' You need to answer the question ''Do you need support for booting from encrypted volumes?'' with ''yes''.<br />
<br />
Let the <tt>hwdetect</tt> program detect your hardware and answer the questions asked suiting your needs, respecting the above mentioned option.<br />
<br />
Afterwards you can check the files presented to you by the installer, the most important one being <tt>/etc/mkinitcpio</tt>. For detailed info on mkinitcpio (and its configuration) refer to [[Mkinitcpio]].You have to make sure that your <tt>HOOKS</tt> looks somehow like this:<br />
HOOKS="... encrypt ... filesystems ..."<br />
It is important that the <tt>encrypt</tt> hook comes before the <tt>filesystems</tt> one. If you store your key on an external USB device (e.g. a USB stick), you need to add the USB hook too:<br />
HOOKS="... usb encrypt ... filesystems ..."<br />
For safety, add in usb before encrypt; not sure if they're run in the order they appear in mkinitcpio.conf or not.<br />
<br />
=== Install Kernel ===<br />
Select the kernel and follow the instructions presented to you by the installer.<br />
When asked to check over the <tt>/mnt/etc/mkinitcpio.d/kernel26-fallback.conf</tt> file make sure the <tt>HOOKS</tt> line looks the same as mentioned above.<br />
<br />
=== Install Bootloader ===<br />
'''GRUB:''' You have to make some small changes to the entries generated by the installer by replacing <tt>/dev/mapper/root</tt> with <tt>/dev/sda3</tt>. The corrected config looks like this:<br />
# (0) Arch Linux<br />
title Arch Linux<br />
root (hd0,0)<br />
kernel /vmlinuz26 root=/dev/sda3 ro<br />
initrd /kernel26.img<br />
<br />
'''LILO:''' On Lilo, edit the Arch Linux section on /etc/lilo.conf and include a line for append option, over the initrd, with the "root=/dev/sda3" param. The append section make the same kernel line on grub. Also, you can ommit the root option, over the image option. The section look like this:<br />
# Arch Linux lilo section<br />
image = /vmlinuz26<br />
# root = /dev/sda3<br />
label = Arch<br />
initrd = /kernel26.img<br />
append = "root=/dev/sda3"<br />
read-only<br />
<br />
=== Exit Install ===<br />
Now that the install is finished the only thing left to do is add entries to the <tt>/etc/crypttab</tt> file so you don't have to enter the passphrase for all encrypted partitions. This works only for non-root partitions e.g. /home, swap, etc.<br />
# vi /mnt/etc/crypttab<br />
Add the following line for the <tt>/home</tt> partition<br />
home /dev/sda4 "myotherpassword"<br />
<br />
If you want to use a key file, generate a key and add it to the LUKS partition by executing the following:<br />
# head -n 220 /dev/urandom | tail -n 200 > /mnt/etc/home.key<br />
# cryptsetup luksAddKey /dev/sda4 /mnt/etc/home.key<br />
Enter any LUKS passphrase: myotherpassword<br />
Verify passphrase: myotherpassword<br />
key slot 0 unlocked.<br />
Command successful.<br><br />
Then add the following information to the <tt>/etc/crypttab</tt> file for automounting:<br />
home /dev/sda4 /etc/home.key<br />
<br />
After rebooting you should now be presented with the text<br />
A password is required to access the root filesystem:<br />
followed by a prompt for any LUKS password. Type it in and everything should boot.<br />
Once you've logged in, have a look at your mounted partitions by typing <tt>mount</tt>. You should have <tt>/dev/mapper/root</tt> mounted at <tt>/</tt> and, if you set up a separate encrypted home partition, <tt>/dev/mapper/home</tt> mounted at <tt>/home</tt>. If you set up encrypted swap, <tt>swapon -s</tt> should have <tt>/dev/mapper/swap</tt> listed as your swap partition.<br />
<br />
== Encrypting swap partition ==<br />
Sensitive data stored in memory may be written to swap at any time. If you've gone to the trouble of encrypting your root and home partitions, you should encrypt your swap as well. There are two options here: random encryption on each boot (better security), or the same encryption each time. We won't cover the second option here, as it is pretty much identical to how you set up the /home partition above. Just replace all references to home with swap, and sda4 with sda2.<br />
<br />
Archlinux provides a convenient way for the first option, which uses dm-crypt directly without LUKS. If you're still in the archsetup process, just switch to a different virtual console (ALT+F2). If you've exited already, the new root will have been unmounted. Use <tt>mount /dev/mapper/root /mnt</tt> to mount it again.<br />
<br />
Now add an entry to the cryptsetup file:<br />
# echo swap /dev/sda2 SWAP "-c aes-xts-plain -h whirlpool -s 512" >> /mnt/etc/crypttab<br />
<br />
'''Note:''' Recommended hash algorithms are "whirlpool" (patent free), "sha256", "sha384" or "sha512". Default is "ripemd160" (not recommended).<br />
<br />
'''Note:''' Please take extra care to put the right partition here. The startup script won't ask before overwriting the provided device, destroying '''all''' data on it (unless it has a LUKS header, then it simply won't work).<br />
<br />
From now on, each time you boot, the partition will be encrypted automatically with a random key, and will then be formated with mkswap.<br />
<br />
Now all you have to do is adjust the corresponding entry in /etc/fstab:<br />
/dev/mapper/swap swap swap defaults 0 0<br />
<br />
And you're done! Carry on with installation or, if you've already finished, <tt>umount /mnt</tt>.<br />
<br />
== Storing the key externally (USB stick) ==<br />
''[Consistency with the other paragraphs should be improved]''<br />
<br />
A quick method (as opposed to setting up a udev rule) involves referencing your removable device by its label (or UUID). To find your label or UUID, plug in your USB drive and run dmesg to see where the device is located in /dev (/dev/sdd in my case).<br />
<br />
Next look in /dev/disk to find a symlink to your USB drive. In my case I labeled the vfat partition on my USB drive as "Keys" so my device is always symlinked in /dev/disk/by-label/Keys, or If I had wanted to use the UUID I would find /dev/disk/by-uuid/4803-8A7B. This allows me to have a consistent naming of my USB devices regardless of the order they are plugged into the system. These device names can be used in the "cryptkey" kernel option or any where else. Filesystem UUIDs are stored in the filesystem itself, meaning that the UUID will be the same if you plug it into any other computer, and that a dd backup of it will always have the same UUID since dd does a bitwise copy.<br />
<br />
Optionally you may choose to set up your stick with an udev rule. There's some documentation in the Arch wiki about that already, if you want more in-depth, structural info, read [http://reactivated.net/writing_udev_rules.html this guide]. Here's quickly how it goes.<br />
<br />
Get the serial number from your USB stick:<br />
lsusb -v | grep -A 5 Vendor<br />
Create a udev-rule for it:<br />
echo 'KERNEL=="sd*", ATTRS{serial}=="$SERIAL", SYMLINK+="$SYMLINK%n"' > /etc/udev/rules.d/8-usbstick.rules<br />
Replace $SYMLINK and $SERIAL with their respective values. %n will expand to the partition (just like sda is subdivided into sda1, sda2, ...). You do not need to go with the 'serial' attribute, if you have a custom rule of your own, you can put it in as well (e.g. using the vendor name). <br />
<br />
Rescan your sysfs:<br />
udevadm trigger<br />
Now check the contents of dev:<br />
ls /dev<br />
It should show your device with your desired name. <br />
<br />
Generate a temporary keyfile:<br />
dd if=/dev/urandom of=secretkey bs=512 count=4<br />
<br />
To store the key file, you have two options. The first is less risky than the other :-). We assume you are using a FAT-formatted USB stick here, if not, change the MODULES=() line in /etc/mkinitcpio.conf accordingly to provide support for your device.<br />
<br />
Now you have to add two extra modules in your /etc/mkinitcpio.conf, one for the stick's file system and one for the codepage:<br />
further you should tell mkinitcpio about your udev-rule:<br />
MODULES="ata_generic ata_piix nls_cp437 vfat"<br />
FILES="/etc/udev/rules.d/8-usbstick.rules"<br />
Replace those module names if you use another file system on your USB stick (e.g. ext2) or another codepage. Users running the stock Arch kernel should stick to the codepage mentioned here.<br />
<br />
Generate a new image (maybe you should take a copy of your old kernel26.img before):<br />
mkinitcpio -g /boot/kernel26.img<br />
<br />
=== Storing the key as plain (visible) file ===<br />
Be sure to choose a plain name for your key - a bit of 'security through obscurity' is always nice ;-). Avoid using dots (hidden files) and similar characters - the encrypt hook will fail to find the keyfile during the boot process.<br />
<br />
You have to add a kernel parameter in your menu.lst (grub), it should look something like this:<br />
kernel /vmlinuz26 root=/dev/hda3 ro vga=791 cryptkey=/dev/usbstick1:vfat:/secretkey<br />
This assumes /dev/usbstick1 is the FAT partition of your choice.<br />
<br />
That's all, reboot and have fun!<br />
<br />
=== Storing the key between MBR and 1st partition ===<br />
Add the temporary keyfile we created before with cryptsetup:<br />
cryptsetup luksAddKey /dev/hda3 secretkey<br />
<br />
That should return you output like this:<br />
Enter any LUKS passphrase:<br />
key slot 0 unlocked.<br />
Command successful.<br />
<br />
Next you'll have to write the key directly between MBR and first partition.<br />
<br />
WARNING: you should only follow this step if you know what you are doing - <b>it can cause data loss and damage your partitions or MBR on the stick!</b><br />
<br />
If you have a bootloader installed on your drive you have to adjust the values. E.g. Grub needs the first 16 sectors, you would have to replace seek=4 with seek=16; otherwise you would overwrite parts of your Grub installation. When in doubt, take a look at the first 64 sectors of your drive and decide on your own where to place your key. <br />
<br />
<i>Optional</i><br />
dd if=/dev/usbstick of=64sectors bs=512 count=64 # gives you copy of your first 64 sectors<br />
hexcurse 64sectors # determine free space<br />
<br />
Write your key to the disk:<br />
dd if=secretkey of=/dev/usbstick bs=512 seek=4<br />
<br />
If everything went fine you can now overwrite and delete your temporary secretkey:<br />
shred --remove --zero secretkey<br />
You should not simply use rm as the keyfile would only be unlinked from your filesystem and be left physically intact.<br />
<br />
Now you have to add a kernel parameter in your menu.lst (Grub), it should look something like this:<br />
kernel /vmlinuz26 root=/dev/hda3 ro vga=791 cryptkey=/dev/usbstick:2048:2048<br />
Format for the cryptkey option:<br />
cryptkey=BLOCKDEVICE:OFFSET:SIZE<br />
OFFSET and SIZE match in this example, but this is coincidence - they can differ (and often will). An other possible example could be<br />
kernel /vmlinuz26 root=/dev/hda3 ro vga=791 cryptkey=/dev/usbstick:8192:2048<br />
That's all, reboot and have fun! And look if your partitions still work after that ;-).<br />
<br />
== Encrypting a loopback filesystem ==<br />
<br />
''[This paragraph has been merged from another page; its consistency with the other paragraphs should be improved]<br />
<br />
=== Preparation and mapping ===<br />
So, let's start by creating an encrypted container!<br />
<br />
dd if=/dev/zero of=/bigsecret bs=1M count=10 # you can also use if=/dev/urandom, if you're really paranoid<br />
<br />
This will create the file 'bigsecret' with a size of 10 megabytes.<br />
<br />
losetup /dev/loop0 /bigsecret<br />
<br />
This will create the device node /dev/loop0, so that we can mount/use our container. (Note: if it gives you the error "/dev/loop0: No such file or directory", you need to first load the kernel module with <tt>modprobe loop</tt>)<br />
<br />
cryptsetup luksFormat /dev/loop0<br />
<br />
This will ask you for a password for your new container file. (Note: if you get an error like "Command failed: Failed to setup dm-crypt key mapping. Check kernel for support for the aes-cbc-essiv:sha256 cipher spec and verify that /dev/loop0 contains at least 133 sectors", then run <tt>modprobe dm-mod</tt>)<br />
<br />
cryptsetup luksOpen /dev/loop0 secret<br />
<br />
The encrypted container is now available through the devicefile /dev/mapper/secret.<br />
Now we are able to create a partition in the container:<br />
<br />
mkfs.ext2 /dev/mapper/secret<br />
<br />
and mount it...<br />
<br />
mkdir /mnt/secret<br />
mount -t ext2 /dev/mapper/secret /mnt/secret<br />
<br />
We can now use the container as if it was a normal partition!<br />
To unmount the container:<br />
<br />
umount /mnt/secret<br />
cryptsetup luksClose secret<br />
losetup -d /dev/loop0 # free the loopdevice.<br />
<br />
so, if you want to mount the container again, you just apply the following commands:<br />
<br />
losetup /dev/loop0 /bigsecret<br />
cryptsetup luksOpen /dev/loop0 secret<br />
mount -t ext2 /dev/mapper/secret /mnt/secret<br />
<br />
Pretty easy, huh?<br />
<br />
=== Encrypt using a key-file ===<br />
Let's first generate a 2048 Byte random keyfile :<br />
<br />
dd if=/dev/urandom of=keyfile bs=1k count=2<br />
<br />
We can now format our container using this key<br />
<br />
cryptsetup luksFormat /dev/loop0 keyfile<br />
<br />
or our partition : <br />
<br />
cryptsetup luksFormat /dev/hda2 keyfile<br />
<br />
Once formatted, we can now open the luks device using the key:<br />
<br />
cryptsetup -d keyfile luksOpen /dev/loop0 container<br />
<br />
You can now like before format the device /dev/mapper/container with your favorite filesystem and then mount it just as easily.<br />
<br />
The keyfile is now the only key to your file. I personally advise to encrypt your keyfile using your private GPG key and storing an offsite secured copy of the file.<br />
<br />
== Encrypting a LVM setup ==<br />
It's really easy to use encryption together with LVM. We are not going to cover the process of setting up LVM here as there is already a guide for that ([[Installing_with_Software_RAID_or_LVM]]).<br />
<br />
To use encryption on top of LVM, you have to first setup your lvm volumes and then use them as base for the encrypted partitions. That means in short that you have to setup lvm at first. Then follow this guide, but replace all occurrences of /dev/sdXy in the guide with its lvm counterpart. (eg: /dev/sda4 -> /dev/<volume group name>/home).<br />
<br />
Don't forget to add the "lvm2" hook in /etc/mkinitcpio.conf '''before''' the "encrypt" hook. And you will have to change USELVM in /etc/rc.conf to yes.<br />
<br />
== Applying this to a non-root partition ==<br />
You might get tempted to apply all this fancy stuff to a non-root partition. Arch does not support this out of the box, however, you can easily change the cryptdev and cryptname values in /lib/initcpio/hooks/encrypt (the first one to your /dev/sd* partition, the second to the name you want to attribute). That should be enough.<br><br />
The big advantage is you can have everything automated, while setting up /etc/crypttab with an external key file (i.e. not on any internal HD partition) can be a pain - you need to make sure the USB/FireWire/... device gets mounted before the encrypted partition, which means you have to change fstab order (at least).<br><br />
Of course, if the cryptsetup package gets upgraded, you will have to change this script again. However, this solution is to be preferred over hacking rc.sysinit or similar files. Unlike /etc/crypttab, only one partition is supported, but with some further hacking one should be able to have multiple partitions unlocked.<br />
<br />
<br />
If you want to do this on a software RAID partition, there's one more thing you need to do. Just setting the /dev/mdX device in /lib/initcpio/hooks/encrypt is not enough; the encrypt hook will fail to find the key for some reason, and not prompt for a passphrase either. It looks like the RAID devices aren't brought up until after the encrypt hook is run. You can solve this by putting the RAID array in /boot/grub/menu.lst, like <br />
kernel /boot/vmlinuz26 md=1,/dev/hda5,/dev/hdb5<br />
<br />
If you set up your root partition as a RAID array you will notice the similarities with that setup ;-). Grub can handle multiple array definitions just fine:<br />
kernel /boot/vmlinuz26 root=/dev/md0 ro md=0,/dev/sda1,/dev/sdb1 md=1,/dev/sda5,/dev/sdb5,/dev/sdc5<br />
== Short version ==<br />
=== Notes ===<br />
==== LVM ====<br />
If you're enough smart enough for this, you'll be smart enough to ignore/replace LVM-specific things if you don't want to use LVM.<br />
<br />
=== Partitioning scheme ===<br />
/dev/sda1 -> /boot<br />
/dev/sda2 -> LVM<br />
=== The commands ===<br />
cryptsetup -d /dev/random -c aes-xts-plain -s 512 create lvm /dev/sda2<br />
dd if=/dev/urandom of=/dev/mapper/lvm<br />
cryptsetup remove lvm<br />
lvm pvcreate /dev/sda2<br />
lvm vgcreate lvm /dev/sda2<br />
lvm lvcreate -L 10G -n root lvm<br />
lvm lvcreate -L 500M -n swap lvm<br />
lvm lvcreate -L 500M -n tmp lvm<br />
lvm lvcreate -l 100%FREE -n home lvm<br />
cryptsetup luksFormat -c aes-xts-plain -s 512 /dev/lvm/root<br />
cryptsetup luksOpen /dev/lvm/root root<br />
mkreiserfs /dev/mapper/root<br />
mount /dev/mapper/root /mnt<br />
dd if=/dev/zero of=/dev/sda1 bs=1M<br />
mkreiserfs /dev/sda1<br />
mkdir /mnt/boot<br />
mount /dev/sda1 /mnt/boot<br />
mkdir -p -m 700 /mnt/etc/luks-keys<br />
dd if=/dev/random of=/mnt/etc/luks-keys/home bs=1 count=256<br />
=== Install Arch Linux ===<br />
/arch/setup<br />
=== Configuration ===<br />
==== /etc/rc.conf ====<br />
Change ''USELVM="no"'' to ''USELVM="yes"''.<br />
==== /etc/mkinitcpio.conf ====<br />
Put ''lvm2 encrypt'' before ''filesystems.<br />
==== /boot/grub/menu.lst ====<br />
Change ''root=/dev/hda3'' to ''root=/dev/lvm/root''.<br />
==== /etc/fstab ====<br />
/dev/mapper/root /root reiserfs defaults 0 1<br />
/dev/sda1 /boot reiserfs defaults 0 2<br />
/dev/mapper/tmp /tmp tmpfs defaults 0 0<br />
/dev/mapper/swap none swap sw 0 0<br />
<br />
==== /etc/crypttab ====<br />
swap /dev/lvm/swap SWAP -c aes-xts-plain -h whirlpool -s 512<br />
tmp /dev/lvm/tmp /dev/urandom -c aes-xts-plain -s 512<br />
<br />
=== After reboot ===<br />
==== The commands ====<br />
cryptsetup luksFormat -c aes-xts-plain -s 512 /dev/lvm/home /etc/luks-keys/home<br />
cryptsetup luksOpen -d /etc/luks-keys/home /dev/lvm/home home<br />
mkreiserfs /dev/mapper/home<br />
mount /dev/mapper/home /home<br />
==== /etc/crypttab ====<br />
home /dev/lvm/home /etc/luks-keys/home<br />
==== /etc/fstab ====<br />
/dev/mapper/home /home reiserfs defaults 0 0<br />
<br />
== / on lvm on luks ==<br />
Make sure your kernel commandline looks like this:<br />
root=/dev/mapper/<volume-group>-<logical-volume> cryptdevice=/dev/<luks-part>:<volume-group><br />
for example:<br />
root=/dev/mapper/vg-arch cryptdevice=/dev/sda4:vg</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=Lightweight_Applications&diff=64871
Lightweight Applications
2009-03-12T08:44:09Z
<p>SkonesMickLoud: /* IRC */</p>
<hr />
<div>[[Category:Desktop user's guide (English)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Lightweight Software}}<br />
{{i18n_entry|Русский|Выбор программ}}<br />
{{i18n_links_end}}<br />
<br />
== Introduction ==<br />
<br />
This list is in response to the plethora of posts in the forums asking for help finding lightweight software. Please feel free to add to it. Discussion can be made in the following [http://bbs.archlinux.org/viewtopic.php?pid=448593 thread].<br />
<br />
== Internet ==<br />
<br />
=== Browsers ===<br />
<br />
[http://www.dillo.org/ Dillo] is a small, fast graphical web browser built on FLTK (older versions use GTK+).<br />
<br />
[http://kazehakase.sourceforge.jp/ Kazehakase] is a GTK+ web browser that uses the Gecko rendering engine.<br />
<br />
[http://links.sourceforge.net/ Links-g] is a text WWW browser, similar to Lynx, with framebuffer and X graphics enabled.<br />
<br />
[http://www.twotoasts.de/index.php?/pages/midori_summary.html Midori] is a lightweight web browser based on Gtk WebKit.<br />
<br />
=== Email Clients ===<br />
<br />
[[mutt]] is a small but very powerful text-based mail client.<br />
<br />
[http://www.claws-mail.org/ Sylpheed Claws] is a lightweight and user-friendly e-mail client.<br />
<br />
[http://www.mozilla.com/thunderbird/ Thunderbird] is an email and Usenet client based on Mozilla code.<br />
<br />
=== Instant Messengers ===<br />
<br />
[[Bitlbee]] is a way to use other IM to your [[#IRC]] client.<br />
<br />
[http://www.emesene.org/ emesene] is a Python/GTK+ instant messenger for the Windows Live Messenger network.<br />
<br />
[[Pidgin]] is a multiprotocol instant messenger.<br />
<br />
[http://pidgin.im Pidgin Light] is a light Pidgin version without gstreamer, tcl, tk, xscreensaver support.<br />
<br />
=== IRC ===<br />
<br />
[http://irssi.org/ Irssi] is a modular text mode IRC client with Perl scripting.<br />
<br />
[http://lostirc.sourceforge.net LostIRC] is a simple IRC client.<br />
<br />
[http://weechat.flashtux.org/ WeeChat] is a fast, light & extensible curses-based IRC client.<br />
<br />
[http://xchat.org XChat] is a GTK+ X client with Perl and Python scripting support.<br />
<br />
[http://www.smuxi.org/main/ SMUxI] Lightweight GTK frontend for Irssi.<br />
<br />
=== Torrents ===<br />
<br />
[http://deluge-torrent.org/ Deluge] is a bittorrent client written with Python and PyGTK.<br />
<br />
[http://libtorrent.rakshasa.no/ rTorrent] is a very simple, elegant and ultra-light BitTorrent client. It is written in C++ and uses ncurses, so it is completely text based and runs entirely in a console.<br />
<br />
[http://www.transmissionbt.com/ Transmission] is a fast, easy, and free BitTorrent client (GTK+ GUI and CLI).<br />
<br />
== Multimedia ==<br />
<br />
=== Audio Players ===<br />
<br />
[http://cmus.sourceforge.net/ C* Music Player] is a very feature-rich ncurses-based music player.<br />
<br />
[http://moc.daper.net/ MOC (Music On Console)] is an ncurses console audio player with support for the MP3, Ogg, and WAV formats.<br />
<br />
[http://hem.bredband.net/kaw/ncmpc/ ncmpc] is a curses client for [[mpd]].<br />
<br />
[http://unkart.ovh.org/ncmpcpp/ ncmpcpp] is an almost exact clone of ncmpc with some new features.<br />
<br />
[http://sonata.berlios.de/ Sonata] is an elegant GTK+ music client for [[mpd]].<br />
<br />
[http://mask.tf.hut.fi/~flu/cplay/ cplay] is a curses front-end for various audio players.<br />
<br />
=== Image Editors ===<br />
<br />
[http://mtpaint.sourceforge.net/ mtPaint] is a graphic editing program geared towards creating indexed palette images and pixel art.<br />
<br />
=== Image Viewers ===<br />
<br />
[http://linuxbrit.co.uk/feh/ Feh] is a fast, lightweight image viewer that uses imlib2.<br />
<br />
[http://lxde.sourceforge.net/gpicview/ GPicView] is a simple and fast image viewer for X. Made by the developers of [[LXDE]]<br />
<br />
[http://gqview.sourceforge.net/ GQview] is an image browser that features single click access to view images and move around the directory tree.<br />
<br />
[http://goodies.xfce.org/projects/applications/ristretto Ristretto] is a fast and lightweight picture-viewer for the Xfce desktop environment.<br />
<br />
[http://mirageiv.berlios.de Mirage] is a fast and simple GTK+ image viewer.<br />
<br />
=== Video Players ===<br />
<br />
[http://smplayer.sourceforge.net/ SMPlayer] is a complete frontend for [[MPlayer]].<br />
<br />
[http://www.videolan.org/vlc/ VLC] is a multi-platform video player that supports many audio and video formats out-of-the-box.<br />
<br />
== Office ==<br />
<br />
=== PDF Tools ===<br />
<br />
[http://www.emma-soft.com/projects/epdfview/ ePDFView] is a free lightweight PDF document viewer using Poppler and GTK+ libraries.<br />
<br />
[http://www.foolabs.com/xpdf/ Xpdf] is a viewer for Portable Document Format (PDF) files.<br />
<br />
[http://code.google.com/p/apvlv/ apvlv] is a lightweight PDF viewer with VIM key bindings.<br />
<br />
=== Text Editors ===<br />
<br />
[http://www.nongnu.org/beaver/ Beaver] is an Early AdVanced EditoR.<br />
<br />
[http://www.geany.org Geany] is a text editor using the GTK+ 2 toolkit with basic features of an integrated development environment.<br />
<br />
[http://tarot.freeshell.org/leafpad/ Leafpad] is a notepad clone for GTK+ 2.x that emphasizes simplicity.<br />
<br />
[http://mooedit.sourceforge.net/ medit] is intended to be a useful programming and around-programming text editor.<br />
<br />
[http://www.xfce.org/projects/mousepad/ Mousepad] is a simple text editor for Xfce based on Leafpad.<br />
<br />
Vi, [[Vim]], gVim the classic vi text editor.<br />
<br />
=== Word Processors ===<br />
<br />
[http://www.abisource.com/ Abiword] is a full-featured word processor ([[Abiword|HOWTO]]).<br />
<br />
== System ==<br />
<br />
=== GUI Compression Tools ===<br />
<br />
[http://squeeze.xfce.org/ Squeeze] is a modern and advanced archive manager.<br />
<br />
[http://xarchive.sourceforge.net Xarchive] is a GTK+ 2 front-end for various command line archiving tools.<br />
<br />
[http://xarchiver.xfce.org/ Xarchiver] is a lightweight desktop independent archive manager built with GTK+ 2.<br />
<br />
=== File Managers ===<br />
<br />
[http://emelfm2.net/ emelFM2] is file manager that implements the popular two-pane design.<br />
<br />
[http://www.midnight-commander.org Midnight Commander] is a console-based, dual-paned, file manager.<br />
<br />
[http://pcmanfm.sourceforge.net/ PCManFM] is a lightweight file manager which features tabbed browsing.<br />
<br />
[http://rox.sourceforge.net ROX] is a small and fast file manager which can optionally manage the desktop background and panels.<br />
<br />
[http://thunar.xfce.org/ Thunar] is fast and responsive with a good start up time and directory load time.<br />
<br />
=== Monitors ===<br />
<br />
[http://conky.sourceforge.net/ Conky] is a lightweight, scriptable system monitor ([[Conky|HOWTO]]).<br />
<br />
[http://htop.sourceforge.net/ htop] is a simple, ncurses interactive process viewer.<br />
<br />
=== Panels ===<br />
<br />
[http://fbpanel.sourceforge.net fbpanel] is a lightweight, NETWM compliant desktop panel.<br />
<br />
[http://lxde.org LXPanel] is a lightweight X11 desktop panel (part of LXDE).<br />
<br />
[http://pypanel.sourceforge.net/ PyPanel] is a lightweight panel/taskbar written in Python and C ([[PyPanel|HOWTO]]).<br />
<br />
[http://code.google.com/p/tint2/ Tint] is a simple panel/taskbar intentionally made for openbox3, but should also work with other window managers ([[Tint|HOWTO]]).<br />
<br />
=== Window managers ===<br />
<br />
[[Dwm]] is a extra light dynamic window manager which is configured by directly editing the source(which itself is less than 2000 SLOC). <br />
<br />
[[Xfce]] is a desktop environment much lighter but similar to GNOME. It includes the xfwm4 window manager.<br />
<br />
[[Fluxbox]] is a lightweight and highly configurable window manager.<br />
<br />
[[Openbox]] is another lightweight and highly configurable window manager.<br />
<br />
[[Awesome]] is a floating and tiling window manager initially based on a [[dwm]] code rewriting.<br />
<br />
<!-- [[Xmonad]] is a tiling window manager for X. This one is actually huge (install size ~350 MiB). --><br />
<br />
=== Terminals ===<br />
<br />
[http://lilyterm.luna.com.tw/index_en.html Lilyterm] is a light and easy to use libvte based X Terminal Emulator.<br />
<br />
[http://rox.sourceforge.net ROXTerm] is a tabbed, VTE-based terminal emulator with a small footprint.<br />
<br />
[http://www.pleyades.net/david/sakura.php Sakura] is a terminal emulator based on GTK+ and VTE.<br />
<br />
[http://software.schmorp.de/pkg/rxvt-unicode urxvt] is a highly extendable unicode enabled rxvt-clone terminal emulator.<br />
<br />
=== Trays ===<br />
<br />
[http://icculus.org/openbox/2/docker/ Docker] is a docking application which acts as a system tray.<br />
<br />
[http://stalonetray.sourceforge.net Stalonetray] is a stand-alone system tray.<br />
<br />
[http://gna.org/projects/fvwm-crystal/ Trayer] swallows GTK+ 1.2/2.x application docklets, and KDE docklets.</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=HOSTNAME&diff=64453
HOSTNAME
2009-03-08T04:47:46Z
<p>SkonesMickLoud: </p>
<hr />
<div>[[Category:Networking]]<br />
{{stub}}<br />
A hostname is a unique name created to identify a machine on a network. With Arch Linux, a machine's hostname is set in [[rc.conf]] or until a restart using the ''hostname'' command. Hostnames are restricted to alphanumeric characters. The dash (''-'') can be used but a hostname cannot start or end with it. Length is restricted to 63 characters.<br />
<br />
After setting a hostname, it is also a good idea to include the same name in /etc/hosts.<br />
127.0.0.1 ''hostname''<br />
This will help processes that refer to the computer by its hostname to find its IP.<br />
<br />
To set a hostname temporarily (until the next reboot) use the ''hostname'' command as root:<br />
<br />
$:hostname ''<hostname>''<br />
<br />
=External Links=<br />
*[http://www.randomhostname.com/ Random Hostname Generator]</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=HOSTNAME&diff=64452
HOSTNAME
2009-03-08T04:47:26Z
<p>SkonesMickLoud: </p>
<hr />
<div>[[Category:Networking]]<br />
{{stub}}<br />
A hostname is a unique name created to identify a machine on a network. With Arch Linux, a machine's hostname is set in [[rc.conf]] or until a restart using the ''hostname'' command. Hostnames are restricted to alphanumeric characters. The dash (''-'') can be used but a hostname cannot start or end with it. Length is restricted to 63 characters.<br />
<br />
After setting a hostname, it is also a good idea to include the same name in /etc/hosts.<br />
127.0.0.1 ''hostname''<br />
This will help processes that refer to the computer by its hostname to find its IP.<br />
<br />
To set a hostname temporarily (until the next reboot) use the ''hostname'' command as root:<br />
<br />
$:hostname <hostname><br />
<br />
=External Links=<br />
*[http://www.randomhostname.com/ Random Hostname Generator]</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=Pacman_Aliases&diff=63784
Pacman Aliases
2009-03-03T20:39:04Z
<p>SkonesMickLoud: /* Configure Bash or Zsh */</p>
<hr />
<div>[[Category:Package management (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Pacman Aliases}}<br />
{{i18n_entry|Español|Alias para pacman}}<br />
{{i18n_entry|简体中文|Pacman别名}}<br />
{{i18n_links_end}}<br />
<br />
=Summary=<br />
The following instructions allow users to run some of the more common pacman commands without the need to type them fully.<br />
<br />
==Configure Bash or Zsh==<br />
Open the bash or zsh config file in the editor of your choice, for example:<br />
$ nano ~/.bashrc<br />
or<br />
$ mousepad ~/.bashrc<br />
or<br />
% vim ~/.zshrc<br />
<br />
<br />
{{Box Note|Some Bash users may prefer to retain their aliases in ~/.bash_aliases. Enter either of the following two entries to ~/.bashrc in order to <tt>source</tt> the file appropriately.|}}<br />
<br />
if [ -f ~/.bash_aliases ]; then<br />
. ~/.bash_aliases<br />
fi<br />
<br />
(The same as above, only <tt>source</tt> is declared)<br />
<br />
if [ -f ~/.bash_aliases ]; then<br />
source ~/.bash_aliases<br />
fi<br />
<br />
Moving along, add the following lines (works in both bash and zsh):<br />
<br />
# pacman alias examples<br />
alias pacupg='sudo pacman -Syu' # synchronize with repositories before upgrading packages that are out of date on the local system.<br />
alias pacin='sudo pacman -S' # install specific package(s) from the repositories<br />
alias pacins='sudo pacman -Up' # install specific package not from the repositories as a file <br />
alias pacre='sudo pacman -R' # remove the specified package(s), retaining its configuration(s) and required dependencies<br />
alias pacrem='sudo pacman -Rns' # remove the specified package(s), its configuration(s) and unneeded dependencies<br />
alias pacrep='pacman -Si' # display information about a given package in the repositories<br />
alias pacreps='pacman -Ss' # search for package(s) in the repositories<br />
alias pacloc='pacman -Qi' # display information about a given package in the local database<br />
alias paclocs='pacman -Qs' # search for package(s) in the local database<br />
<br />
# additional pacman alias examples<br />
alias pacupd='sudo pacman -Sy && sudo abs' # update and refresh the local package and ABS databases against repositories<br />
alias pacinsd='sudo pacman -S --asdeps' # install given package(s) as dependencies of another package<br />
alias pacmir='sudo pacman -Syy' # force refresh of all package lists after updating /etc/pacman.d/mirrorlist<br />
<br />
Save and exit.<br />
<br />
==Usage==<br />
You can now perform the respective commands by simply typing the alias name.<br><br />
For example, to synchronize with repositories before upgrading packages that are out of date on the local system, type:<br />
<br />
$ pacupg<br />
To install a specific package from repositories, type:<br />
$ pacin <packagename><br />
To install specific packages from repositories, type:<br />
$ pacin <packagename> <packagename> <packagename><br />
To install a custom built package on your local machine, type:<br />
$ pacins /path/to/<packagename><br />
To completely remove a locally installed package, type:<br />
$ pacrem <packagename><br />
To search for available packages in the repositories, type:<br />
$ pacreps <keywords><br />
To display information about a package (e.g. size, dependencies) in the repositories, type:<br />
$ pacrep <keywords><br />
<br />
==Notes==<br />
The aliases used above are merely examples. By following the syntax samples above, you may opt to rename the aliases to your own liking. For example:<br />
<br />
<code>alias pacrem</b>='sudo pacman -Rns'</code><br><br />
<code>alias pacout</b>='sudo pacman -Rns'</code><br />
<br />
In the case above, the commands <code>pacrem</code> and <code>pacrem</code> both call Bash to execute the same command: <code>sudo pacman -Rns</code><br />
<br />
For other useful aliases have a look at [[Post_Installation_Tips#Timesaving_Command-aliases|Timesaving Command aliases]].</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=Bootchart&diff=62368
Bootchart
2009-02-18T04:06:12Z
<p>SkonesMickLoud: /* Grub */</p>
<hr />
<div>= Introduction =<br />
<br />
Bootchart is a handy tool used for profiling the Linux boot sequence, generally used for making your computer boot faster. It consists of the bootchartd daemon and bootchart-render, which is used to generate the resulting chart.<br />
<br />
= Installing Bootchart =<br />
<br />
Bootchart can be easily installed by:<br />
# pacman -Sy bootchart<br />
<br />
= Running Bootchart =<br />
To make use of bootchart, you have to either set it as the init process in your boot loader or starting it manually from one of the init scripts (rc.sysinit preferrably). Note that if you start bootchartd manually, you have to stop it manually too. In general, be extra careful with this step.<br />
== Boot loader setup ==<br />
This generally involves making a copy of the boot option you want to profile and adding 'init=/sbin/bootchartd' to it. When started from the boot loader, bootchart will stop when you get to the login prompt.<br />
=== Grub ===<br />
Open up /boot/grub/menu.lst, and copy/paste the entry you want to log. Append "init=/sbin/bootchartd" to the kernel line. Generally, you'll want your entry to look something like this:<br />
<br />
# (1) Arch Linux Bootchart<br />
title Arch Linux<br />
root (hd0,0)<br />
kernel /vmlinuz26 root=/dev/disk/by-uuid/d531ff5b-de65-499a-9942-d18682375163 ro vga=37C init=/sbin/bootchartd<br />
initrd /kernel26.img<br />
<br />
=== Lilo ===<br />
TODO<br />
=== Grub 2 ===<br />
Open up /boot/grub/grub.cfg, copy the boot option you want to profile and edit it to look like this:<br />
<br />
# (0) Arch Linux<br />
menuentry "Arch Linux" {<br />
set root=(hd0,1)<br />
linux /boot/vmlinuz26 root=/dev/sda1 ro<br />
initrd /boot/kernel26.img<br />
}<br />
# (1) Arch Linux with Bootchart<br />
menuentry "Arch Linux with Bootchart" {<br />
set root=(hd0,1)<br />
linux /boot/vmlinuz26 root=/dev/sda1 ro init=/sbin/bootchartd<br />
initrd /boot/kernel26.img<br />
}<br />
<br />
Now you can reboot and choose the new bootcharting option.<br />
<br />
== rc.sysinit setup ==<br />
This one is dangerous (you can make your Arch Linux unbootable) - use it only when the first approach fails. When run in this way, not only you'll have to stop bootchartd manually after you boot up (or it will completely fill your harddrive) but it will start with every boot too. Also, any changes to /etc/rc.sysinit will be reverted next time you update the initscripts package.<br />
On the positive side, you'll end up with a bootchart that shows what happens after you log in.<br />
=== Edit /etc/rc.sysinit ===<br />
Now, we're going to add this line:<br />
/sbin/bootchartd start<br />
to /etc/rc.sysinit<br />
<br />
It can't be too high up, because that would render the system unbootable, but placing it too far into the script will hide anything that happened before from the bootchart.<br />
It should be safe to put this right before the section that brings up the system clock.<br />
Look for this line:<br />
stat_busy "Configuring System Clock"<br />
Put this:<br />
/sbin/bootchartd start<br />
before it.<br />
=== Stop bootchartd after login ===<br />
As stated previouslt, you have to stop bootchartd manually.<br />
Either run this as root:<br />
/sbin/bootchartd stop<br />
Or with sudo if you have that set up:<br />
sudo /sbin/bootchartd stop<br />
= Generating a chart =<br />
Generating a bootchart involves running:<br />
bootchart-render<br />
<br />
in a folder to which you have write access. This will generate a 'bootchart.png' image with your chart.<br />
You'll have to have a Java runtime installed and properly set up before you can do this.<br />
== Example bootcharts ==<br />
=== Boot in 5 seconds ===<br />
[http://lwn.net/Articles/299483/ LWN Article on fast booting netbooks]<br />
<br />
This article is really awesome and along with a bunch of bootcharts provides some tips on how to boot faster. Some of those improvements are beyond reach of the ordinary user though (patching X.org, kernel, etc.).<br />
=== A fast system getting even faster ===<br />
These bootcharts are from a system with proprietary NVidia drivers and KDE 4.2. It acts as a print server for everyone in the house and is set up to play music on boot using mpd.<br />
<br />
* [http://www.progarden.cz/bootchart.png Bootchart - 'almost' stock Arch]<br />
<br />
Sevices start mostly in sequence, the kernel isn't tweaked in any way and there are no changes to the initscripts.<br />
<br />
* [http://www.progarden.cz/bootchart2.png Bootchart - further optimizations]<br />
<br />
Services now start in parallel - netfs, network have been combined into a single script that also starts the music player daemon. KDM starts sooner, so less of the bootchart is visible.<br />
<br />
* [http://www.progarden.cz/bootchart-ssd.png Bootchart - system migrated to SSD drive]<br />
Bootchartd is started from rc.sysinit, because the bootloader approach failed (bootchartd doesn't have enough time to initialize).<br />
<br />
As you can see, there are hardly any latencies from HDD seek operations. The whole boot process is CPU-bound and is slowed down by poor nvidia drivers which can't properly accelerate 2D operations - KDE apps fight for the CPU. At the 4 second mark, the base system is ready for use in CLI. At ~10 seconds, mpd starts playing music from a samba share.<br />
System daemons - syslog-ng, dethnet, kdm, cups, hal and preload start in parallel. This is not exactly ideal, because preload and kdm/X use the SSD at the same time. A waiting state between preload and KDM could save an another second or two (maybe).<br />
KDM is set up to autologin and lock the session automatically. This starts the 'vermiculate' screensaver, which acts as a login window and hides the apps starting in background. The big red bar is when the login dialog appears.<br />
<br />
Obviously, KDE isn't optimized at all. There's over-use of CPU resources and applications don't start in parallel.<br />
----<br />
Add yours here :)<br />
= Useful links =<br />
* [http://www.bootchart.org/ Bootchart home page]</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=Bootchart&diff=62366
Bootchart
2009-02-18T03:59:33Z
<p>SkonesMickLoud: /* Grub */</p>
<hr />
<div>= Introduction =<br />
<br />
Bootchart is a handy tool used for profiling the Linux boot sequence, generally used for making your computer boot faster. It consists of the bootchartd daemon and bootchart-render, which is used to generate the resulting chart.<br />
<br />
= Installing Bootchart =<br />
<br />
Bootchart can be easily installed by:<br />
# pacman -Sy bootchart<br />
<br />
= Running Bootchart =<br />
To make use of bootchart, you have to either set it as the init process in your boot loader or starting it manually from one of the init scripts (rc.sysinit preferrably). Note that if you start bootchartd manually, you have to stop it manually too. In general, be extra careful with this step.<br />
== Boot loader setup ==<br />
This generally involves making a copy of the boot option you want to profile and adding 'init=/sbin/bootchartd' to it. When started from the boot loader, bootchart will stop when you get to the login prompt.<br />
=== Grub ===<br />
Open up /boot/grub/menu.lst, and copy/paste the entry you want to log. Append "init=/sbin/bootchartd" to the kernel line. Generally, you'll want your entry to look something like this:<br />
<br />
# (1) Arch Linux Bootchart<br />
title Arch Linux<br />
root (hd0,0)<br />
kernel /vmlinuz26 root=/dev/disk/by-uuid/d531ff5b-de65-499a-9942-d18682375163 ro init=/sbin/bootchartd<br />
initrd /kernel26.img<br />
<br />
=== Lilo ===<br />
TODO<br />
=== Grub 2 ===<br />
Open up /boot/grub/grub.cfg, copy the boot option you want to profile and edit it to look like this:<br />
<br />
# (0) Arch Linux<br />
menuentry "Arch Linux" {<br />
set root=(hd0,1)<br />
linux /boot/vmlinuz26 root=/dev/sda1 ro<br />
initrd /boot/kernel26.img<br />
}<br />
# (1) Arch Linux with Bootchart<br />
menuentry "Arch Linux with Bootchart" {<br />
set root=(hd0,1)<br />
linux /boot/vmlinuz26 root=/dev/sda1 ro init=/sbin/bootchartd<br />
initrd /boot/kernel26.img<br />
}<br />
<br />
Now you can reboot and choose the new bootcharting option.<br />
<br />
== rc.sysinit setup ==<br />
This one is dangerous (you can make your Arch Linux unbootable) - use it only when the first approach fails. When run in this way, not only you'll have to stop bootchartd manually after you boot up (or it will completely fill your harddrive) but it will start with every boot too. Also, any changes to /etc/rc.sysinit will be reverted next time you update the initscripts package.<br />
On the positive side, you'll end up with a bootchart that shows what happens after you log in.<br />
=== Edit /etc/rc.sysinit ===<br />
Now, we're going to add this line:<br />
/sbin/bootchartd start<br />
to /etc/rc.sysinit<br />
<br />
It can't be too high up, because that would render the system unbootable, but placing it too far into the script will hide anything that happened before from the bootchart.<br />
It should be safe to put this right before the section that brings up the system clock.<br />
Look for this line:<br />
stat_busy "Configuring System Clock"<br />
Put this:<br />
/sbin/bootchartd start<br />
before it.<br />
=== Stop bootchartd after login ===<br />
As stated previouslt, you have to stop bootchartd manually.<br />
Either run this as root:<br />
/sbin/bootchartd stop<br />
Or with sudo if you have that set up:<br />
sudo /sbin/bootchartd stop<br />
= Generating a chart =<br />
Generating a bootchart involves running:<br />
bootchart-render<br />
<br />
in a folder to which you have write access. This will generate a 'bootchart.png' image with your chart.<br />
You'll have to have a Java runtime installed and properly set up before you can do this.<br />
== Example bootcharts ==<br />
=== Boot in 5 seconds ===<br />
[http://lwn.net/Articles/299483/ LWN Article on fast booting netbooks]<br />
<br />
This article is really awesome and along with a bunch of bootcharts provides some tips on how to boot faster. Some of those improvements are beyond reach of the ordinary user though (patching X.org, kernel, etc.).<br />
=== A fast system getting even faster ===<br />
These bootcharts are from a system with proprietary NVidia drivers and KDE 4.2. It acts as a print server for everyone in the house and is set up to play music on boot using mpd.<br />
<br />
* [http://www.progarden.cz/bootchart.png Bootchart - 'almost' stock Arch]<br />
<br />
Sevices start mostly in sequence, the kernel isn't tweaked in any way and there are no changes to the initscripts.<br />
<br />
* [http://www.progarden.cz/bootchart2.png Bootchart - further optimizations]<br />
<br />
Services now start in parallel - netfs, network have been combined into a single script that also starts the music player daemon. KDM starts sooner, so less of the bootchart is visible.<br />
<br />
* [http://www.progarden.cz/bootchart-ssd.png Bootchart - system migrated to SSD drive]<br />
Bootchartd is started from rc.sysinit, because the bootloader approach failed (bootchartd doesn't have enough time to initialize).<br />
<br />
As you can see, there are hardly any latencies from HDD seek operations. The whole boot process is CPU-bound and is slowed down by poor nvidia drivers which can't properly accelerate 2D operations - KDE apps fight for the CPU. At the 4 second mark, the base system is ready for use in CLI. At ~10 seconds, mpd starts playing music from a samba share.<br />
System daemons - syslog-ng, dethnet, kdm, cups, hal and preload start in parallel. This is not exactly ideal, because preload and kdm/X use the SSD at the same time. A waiting state between preload and KDM could save an another second or two (maybe).<br />
KDM is set up to autologin and lock the session automatically. This starts the 'vermiculate' screensaver, which acts as a login window and hides the apps starting in background. The big red bar is when the login dialog appears.<br />
<br />
Obviously, KDE isn't optimized at all. There's over-use of CPU resources and applications don't start in parallel.<br />
----<br />
Add yours here :)<br />
= Useful links =<br />
* [http://www.bootchart.org/ Bootchart home page]</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=Bootchart&diff=62365
Bootchart
2009-02-18T03:53:49Z
<p>SkonesMickLoud: /* Grub 2 */</p>
<hr />
<div>= Introduction =<br />
<br />
Bootchart is a handy tool used for profiling the Linux boot sequence, generally used for making your computer boot faster. It consists of the bootchartd daemon and bootchart-render, which is used to generate the resulting chart.<br />
<br />
= Installing Bootchart =<br />
<br />
Bootchart can be easily installed by:<br />
# pacman -Sy bootchart<br />
<br />
= Running Bootchart =<br />
To make use of bootchart, you have to either set it as the init process in your boot loader or starting it manually from one of the init scripts (rc.sysinit preferrably). Note that if you start bootchartd manually, you have to stop it manually too. In general, be extra careful with this step.<br />
== Boot loader setup ==<br />
This generally involves making a copy of the boot option you want to profile and adding 'init=/sbin/bootchartd' to it. When started from the boot loader, bootchart will stop when you get to the login prompt.<br />
=== Grub ===<br />
TODO<br />
=== Lilo ===<br />
TODO<br />
=== Grub 2 ===<br />
Open up /boot/grub/grub.cfg, copy the boot option you want to profile and edit it to look like this:<br />
<br />
# (0) Arch Linux<br />
menuentry "Arch Linux" {<br />
set root=(hd0,1)<br />
linux /boot/vmlinuz26 root=/dev/sda1 ro<br />
initrd /boot/kernel26.img<br />
}<br />
# (1) Arch Linux with Bootchart<br />
menuentry "Arch Linux with Bootchart" {<br />
set root=(hd0,1)<br />
linux /boot/vmlinuz26 root=/dev/sda1 ro init=/sbin/bootchartd<br />
initrd /boot/kernel26.img<br />
}<br />
<br />
Now you can reboot and choose the new bootcharting option.<br />
<br />
== rc.sysinit setup ==<br />
This one is dangerous (you can make your Arch Linux unbootable) - use it only when the first approach fails. When run in this way, not only you'll have to stop bootchartd manually after you boot up (or it will completely fill your harddrive) but it will start with every boot too. Also, any changes to /etc/rc.sysinit will be reverted next time you update the initscripts package.<br />
On the positive side, you'll end up with a bootchart that shows what happens after you log in.<br />
=== Edit /etc/rc.sysinit ===<br />
Now, we're going to add this line:<br />
/sbin/bootchartd start<br />
to /etc/rc.sysinit<br />
<br />
It can't be too high up, because that would render the system unbootable, but placing it too far into the script will hide anything that happened before from the bootchart.<br />
It should be safe to put this right before the section that brings up the system clock.<br />
Look for this line:<br />
stat_busy "Configuring System Clock"<br />
Put this:<br />
/sbin/bootchartd start<br />
before it.<br />
=== Stop bootchartd after login ===<br />
As stated previouslt, you have to stop bootchartd manually.<br />
Either run this as root:<br />
/sbin/bootchartd stop<br />
Or with sudo if you have that set up:<br />
sudo /sbin/bootchartd stop<br />
= Generating a chart =<br />
Generating a bootchart involves running:<br />
bootchart-render<br />
<br />
in a folder to which you have write access. This will generate a 'bootchart.png' image with your chart.<br />
You'll have to have a Java runtime installed and properly set up before you can do this.<br />
== Example bootcharts ==<br />
=== Boot in 5 seconds ===<br />
[http://lwn.net/Articles/299483/ LWN Article on fast booting netbooks]<br />
<br />
This article is really awesome and along with a bunch of bootcharts provides some tips on how to boot faster. Some of those improvements are beyond reach of the ordinary user though (patching X.org, kernel, etc.).<br />
=== A fast system getting even faster ===<br />
These bootcharts are from a system with proprietary NVidia drivers and KDE 4.2. It acts as a print server for everyone in the house and is set up to play music on boot using mpd.<br />
<br />
* [http://www.progarden.cz/bootchart.png Bootchart - 'almost' stock Arch]<br />
<br />
Sevices start mostly in sequence, the kernel isn't tweaked in any way and there are no changes to the initscripts.<br />
<br />
* [http://www.progarden.cz/bootchart2.png Bootchart - further optimizations]<br />
<br />
Services now start in parallel - netfs, network have been combined into a single script that also starts the music player daemon. KDM starts sooner, so less of the bootchart is visible.<br />
<br />
* [http://www.progarden.cz/bootchart-ssd.png Bootchart - system migrated to SSD drive]<br />
Bootchartd is started from rc.sysinit, because the bootloader approach failed (bootchartd doesn't have enough time to initialize).<br />
<br />
As you can see, there are hardly any latencies from HDD seek operations. The whole boot process is CPU-bound and is slowed down by poor nvidia drivers which can't properly accelerate 2D operations - KDE apps fight for the CPU. At the 4 second mark, the base system is ready for use in CLI. At ~10 seconds, mpd starts playing music from a samba share.<br />
System daemons - syslog-ng, dethnet, kdm, cups, hal and preload start in parallel. This is not exactly ideal, because preload and kdm/X use the SSD at the same time. A waiting state between preload and KDM could save an another second or two (maybe).<br />
KDM is set up to autologin and lock the session automatically. This starts the 'vermiculate' screensaver, which acts as a login window and hides the apps starting in background. The big red bar is when the login dialog appears.<br />
<br />
Obviously, KDE isn't optimized at all. There's over-use of CPU resources and applications don't start in parallel.<br />
----<br />
Add yours here :)<br />
= Useful links =<br />
* [http://www.bootchart.org/ Bootchart home page]</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=KDE4&diff=62150
KDE4
2009-02-16T04:49:50Z
<p>SkonesMickLoud: Redirecting to KDE</p>
<hr />
<div>#REDIRECT [[KDE]]</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=KDE4&diff=62148
KDE4
2009-02-16T04:49:26Z
<p>SkonesMickLoud: </p>
<hr />
<div>#REDIRECT {{KDE}}</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=Network_Time_Protocol&diff=62145
Network Time Protocol
2009-02-16T04:36:44Z
<p>SkonesMickLoud: /* Using OpenNTPD instead of ntpd */</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|:Network Time Protocol}}<br />
{{i18n_entry|简体中文|:Network Time Protocol (简体中文)}}<br />
{{i18n_links_end}}<br />
This article discribes the different possibilities of getting accurate system time and date for your Arch Linux. First openntpd is explained, an easy to use solution. Second, the original ntpd is explained.<br />
<br />
== OpenNTPD ==<br />
<br />
===Using OpenNTPD instead of ntpd===<br />
<br />
OpenNTPD is a FREE, easy to use implementation of the Network Time Protocol. It provides the ability to sync the local clock to remote NTP servers and can act as NTP server itself, redistributing the local clock.<br />
<br />
OpenNTPD is primarily developed by Henning Brauer as part of the OpenBSD Project.<br />
<br />
OpenNTPD is a brand new implementation of the ntp protocol. It is much easier to configure and use than ntpd.<br />
<br />
First, the OpenNTPD package must be installed.<br />
It is available in the Arch Linux community repository.<br />
<br />
# pacman -S openntpd<br />
<br />
Once installed, the /etc/ntpd.conf file must be edited.<br />
This is much easier than with ntpd.<br />
<br />
The default configuration is actually usable if all you want is to sync the local computer.<br />
<pre><br />
# $OpenBSD: ntpd.conf,v 1.7 2004/07/20 17:38:35 henning Exp $<br />
# sample ntpd configuration file, see ntpd.conf(5)<br />
<br />
# Addresses to listen on (ntpd does not listen by default)<br />
#listen on *<br />
#listen on 127.0.0.1<br />
#listen on ::1<br />
<br />
# sync to a single server<br />
#server ntp.example.org<br />
<br />
# use a random selection of 8 public stratum 2 servers<br />
# see http://twiki.ntp.org/bin/view/Servers/NTPPoolServers<br />
servers pool.ntp.org<br />
</pre><br />
<br />
To sync to a particular server, uncomment and edit the "server" directive. You can find server's URL in your area at [http://www.pool.ntp.org/zone/@ www.pool.ntp.org/zone/@].<br />
server ntp.example.org<br />
<br />
The "servers" directive works the same as the "server" directive, however, if the dns name resolves to multiple IP address, ALL of them will be synced to. The default, "pool.ntp.org" is working and should be acceptable in most cases.<br />
pool.ntp.org<br />
<br />
Any number of "server" or "servers" directives may be used.<br />
<br />
If you want the computer you run OpenNTPD on to also be a time server, simply uncomment and edit the "listen" directive.<br />
<br />
For example:<br />
listen on *<br />
will listen on all interfaces, and<br />
listen on 127.0.0.1<br />
will only listen on the loopback interface.<br />
<br />
If you would like to run OpenNTPD at boot, add openntpd the DAEMONS variable in your /etc/rc.conf. If you are using openntpd just to set your local system time, you could add @openntpd instead of openntpd to decrease the boot time; adding the @ makes Arch run the other daemons following @openntpd without waiting for openntpd to finish.<br />
<br />
If you want to see the status of of your syncing, look at /var/log/daemon.log<br />
<br />
=== Trouble Shooting ===<br />
If you find your time set incorrectly and in log you see<br />
openntpd adjtime failed: Invalid argument<br />
try "<code>ntpd -s -d</code>" in console .<br />
<br />
== ntp ==<br />
===Installation===<br />
# pacman -S ntp<br />
<br />
===/etc/ntp.conf Configuration===<br />
The very first line of your ntp.conf file should contain a line such as the following:<br />
restrict default noquery notrust nomodify<br />
<br />
This essentially restricts everyone from modifying anything. Following this, you need to let ntpd know what you want to let through into your NTP server. Here is where you would specify any other ip addresses you would like to synchronize on your NTP server. For example:<br />
restrict 1.2.3.4<br />
restrict 192.168.0.0 mask 255.255.255.0 nomodify<br />
<br />
This tells ntpd that 1.2.3.4 and all ip addresses from the 192.168.0.0 range will be allowed to synchronize on this server, but they will not be allowed to modify anything. All other IP addresses in the world will still obey the default restrictions (the first line in the ntp.conf).<br />
<br />
Now, is where the stratum 2 servers that our server will synchronize with come into play. The lines in ntp.conf will be used to tell ntpd what servers we would like to use for synchronizing (these are just examples; use ntp servers that are closest to your location). Please see http://ntp.isc.org/bin/view/Servers/NTPPoolServers for a list a closer servers.<br />
server ntp1.cs.wisc.edu<br />
server ntp3.cs.wisc.edu<br />
server ntp3.sf-bay.org<br />
<br />
Unless you have a good reason not to, it is advisable to use the pool.ntp.org servers: http://www.pool.ntp.org/.<br />
Alternatively, a list of ntp servers is available at http://www.eecis.udel.edu/~mills/ntp/clock2a.html. Please pay attention to the Access Policies. <br />
<br />
If we left it alone right now, we would never connect to a server because the response from any of the three servers listed above would never be allowed back into our server due to the fact that our default restrict statement would be in use (since we did not add the servers to our lesser restrictions (like we did with 127.0.0.1 and the subnet of 192.168.0.0).<br />
<br />
To correct this, enter the following lines in ntp.conf:<br />
restrict ntp1.cs.wisc.edu noquery nomodify<br />
restrict ntp3.cs.wisc.edu noquery nomodify<br />
restrict ntp3.sf-bay.org noquery nomodify<br />
<br />
This will allow the response from the above servers into our system so our local clock can be synchronized. The noquery restriction will not allow any of the above three servers to query for information from our server. The nomodify restriction will not allow the three servers to modify anything (synchronization will still take place).<br />
<br />
The only thing left to do is add the drift file (which keeps track of yours clocks time deviation). and the log file location:<br />
driftfile /etc/ntp.drift<br />
logfile /var/log/ntp.log<br />
<br />
The complete file will look like this:<br />
<br />
<pre><br />
# default restrictions<br />
restrict default noquery notrust nomodify<br />
<br />
# override the default restrictions here<br />
restrict 10.1.1.0 mask 255.255.255.0 nomodify<br />
<br />
# public NTP servers to sync with (all stratum 2)<br />
server ntp1.cs.wisc.edu<br />
server ntp3.cs.wisc.edu<br />
server ntp3.sf-bay.org<br />
<br />
restrict ntp1.cs.wisc.edu noquery nomodify<br />
restrict ntp3.cs.wisc.edu noquery nomodify<br />
restrict ntp3.sf-bay.org noquery nomodify<br />
<br />
# NTP drift file - used to keep track of your system clocks<br />
# time deviation<br />
driftfile /etc/ntp.drift<br />
<br />
# NTP log file<br />
logfile /var/log/ntp.log<br />
</pre><br />
<br />
Take note that this is for a client and a server ntp.conf configuration. If you just want to synchronize with a stratum server and are not concerned with other PCs synchronizing with your ntp server, then you can do something like the following (note that only 127.0.0.1 is allowed to be synchronized):<br />
<br />
<pre><br />
# default restrictions<br />
restrict default noquery notrust nomodify<br />
<br />
# Permit all access over the loopback interface<br />
restrict 127.0.0.1<br />
<br />
# public NTP servers to sync with (all stratum 2)<br />
server ntp1.cs.wisc.edu<br />
server ntp3.cs.wisc.edu<br />
server ntp3.sf-bay.org<br />
<br />
restrict ntp1.cs.wisc.edu noquery nomodify<br />
restrict ntp3.cs.wisc.edu noquery nomodify<br />
restrict ntp3.sf-bay.org noquery nomodify<br />
<br />
# NTP drift file - used to keep track of your system clocks<br />
# time deviation<br />
driftfile /etc/ntp.drift<br />
<br />
# NTP log file<br />
logfile /var/log/ntp.log<br />
</pre><br />
<br />
... or if you don't care about restrictions at all, something like this (note there are no restrictions, thus no need to reduce restrictions for 127.0.0.1 to allow your local clock to synchronize):<br />
<br />
<pre><br />
# public NTP servers to sync with (all stratum 2)<br />
server ntp1.cs.wisc.edu<br />
server ntp3.cs.wisc.edu<br />
server ntp3.sf-bay.org<br />
<br />
# NTP drift file - used to keep track of your system clocks<br />
# time deviation<br />
driftfile /etc/ntp.drift<br />
<br />
# NTP log file<br />
logfile /var/log/ntp.log<br />
</pre><br />
<br />
===A Note about Security===<br />
You may wonder about all of the restrict lines. The reason for them is security. If you don't want a secure NTP server, don't add any restrict lines to your ntp.conf file. If you want a secure NTP server, start out by adding a default restrict that doesn't allow anything to contact your server, then add more (less restrictive) restrict lines - allowing certain addresses various access privileges.<br />
<br />
===/etc/rc.d/network file modification===<br />
One more thing that you may want to do. In some cases, your /etc/ntp.conf file may be overwritten by dhcp. To avoid this, edit the /etc/conf.d/dhcpcd file and add <code>-N</code> to the line that starts with '<code>dhcpcd -t 10</code>'.<br />
<br />
'''Note:''' This was my experience/solution with setting the time:<br />
<br />
On my system my /etc/conf.d/dhcpcd contains a single line:<br />
DHCPCD_ARGS="-t 30 -h $HOSTNAME"<br />
<br />
I assume it needs to be changed to:<br />
DHCPCD_ARGS="-N -t 30 -h $HOSTNAME"<br />
<br />
Some have suggested adding <code>-R</code> to preserve /etc/resolv.conf as well.<br />
<br />
===To fix Time use /etc/rc.local===<br />
To set the correct time; Set time and start ntpd at boot via /etc/rc.local<br />
<br />
Relevant sections of /etc/rc.conf<br />
HARDWARECLOCK="UTC"<br />
TIMEZONE="US/Mountain"<br />
<br />
''Network/DHCP section:''<br />
lo="lo 127.0.0.1"<br />
eth0="dhcp"<br />
INTERFACES=(lo eth0)<br />
''Daemons subsection:''<br />
DAEMONS=(syslog-ng hotplug !pcmcia network netfs !ntpd crond dbus hal alsa gdm)<br />
<br />
This is my /etc/rc.local<br />
#!/bin/bash<br />
#<br />
# /etc/rc.local: Local multi-user startup script.<br />
#<br />
<br />
# Re-copy ntp.conf (was over written by dhcp)<br />
cp /root/CONFIG.BAK/ntp.conf.bac /etc/ntp.conf<br />
# I advise you keep your desired /etc/ntp.conf<br />
# OUTSIDE of /etc<br />
<br />
# Set time<br />
/usr/bin/ntpdate ntp.nasa.gov #Use any time server you like here<br />
<br />
# Start ntpd<br />
/etc/rc.d/ntpd start<br />
<br />
And here is my /root/CONFIG.BAK/ntp.conf.bac (this is just a copy of the desired /etc/ntp.conf)<br />
# default restrictions<br />
restrict default noquery notrust nomodify<br />
<br />
# override the default restrictions here<br />
restrict 127.0.0.1 nomodify<br />
restrict 192.168.2.0 mask 255.255.255.0 nomodify<br />
<br />
# public NTP servers to sync with (all stratum 2)<br />
server ntp.nasa.gov #Use any time server you like here<br />
<br />
restrict ntp.nasa.gov noquery nomodify<br />
<br />
# NTP drift file - used to keep track of your system clocks<br />
driftfile /etc/ntp.drift<br />
<br />
# NTP log file<br />
logfile /var/log/ntp.log<br />
<br />
Leave /etc/conf.d/dhcpcd at default. Mine is a single line and reads<br />
DHCPCD_ARGS="-t 30 -h $HOSTNAME"<br />
<br />
With this configuration I get the correct time and ntpd running at boot.<br />
There may be a better way, but this worked for me.<br />
I hope it helps.<br />
<br />
===Updating your system immediately using ntpdate===<br />
It is recommended to add a line like the following to your /etc/rc.local file so when you boot your system, your time will be correct (use an NTP server close to your location).<br />
/usr/bin/ntpdate ntp1.cs.wisc.edu<br />
<br />
Running ''ntpdate'' when you boot up is a good idea because ntpd may take a long time to synchronize your local clock depending on how far off the time is. If your clock is synchronized when ntpd starts, then it's sole purpose is to keep it synchronized. To run ntpd at startup, add ''ntpd'' to the daemons section of the /etc/rc.conf file.<br />
<br />
ntpd will work well if you have a connection to the internet all the time. If you are using dialup, you may just want to stick with using ntpdate via the command line.<br />
<br />
===Querying your NTP server using ntpq===<br />
There is a default restrict statement for the localhost that includes an ignore flag. Without overriding it (adding the line ''restrict'' ''127.0.0.1'') you will not be able to query your NTP server. If that's not a concern to you, then leave out the restrict line for your localhost. You will still be able to synchronize with your stratum 2 servers.<br />
<br />
== External Resources ==<br />
* http://www.ntp.org/<br />
* http://twiki.ntp.org/bin/view/Main/WebHome<br />
* http://www.eecis.udel.edu/~mills/ntp/html/index.html<br />
* http://www.openntpd.org</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=HAL&diff=61353
HAL
2009-02-11T14:14:39Z
<p>SkonesMickLoud: /* Removing USB flash causes improper unmount */</p>
<hr />
<div>[[Category: Hardware detection and troubleshooting (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|HAL}}<br />
{{i18n_entry|Polish|HAL_(Polski)}}<br />
{{i18n_entry|Русский|HAL_(Русский)}}<br />
{{i18n_entry|简体中文|HAL (简体中文)}}<br />
{{i18n_entry|Español|HAL (Español)}}<br />
{{i18n_entry|Italiano|HAL (Italiano)}}<br />
{{i18n_entry|Türkçe|HAL (Türkçe)}}<br />
{{i18n_links_end}}<br />
<br />
HAL (Hardware Abstraction Layer) is a daemon that allows desktop applications to readily access hardware information so that they can locate and use such hardware regardless of bus or device type. In this way a desktop GUI can present all resources to its user in a seamless and uniform manner.<br />
<br />
=HAL and hotplugging=<br />
There are a number of things involved in 'hotplugging' and HAL is only one of them. When a new device is added, e.g. a USB drive is plugged in, the following takes place (roughly):<br />
* The kernel becomes aware of a new device and writes it up in /sys.<br />
* [[Udev]] creates a device node (e.g. /dev/sdb1), and runs the drivers/modules needed.<br />
* The HAL daemon is notified by [[D-Bus]] and adds the device and what it can find out about it to its database.<br />
* The addition of the new device is broadcast by HAL over D-Bus to whatever programs are subscribing, e.g. Thunar which shows it as an icon in the shortcuts side panel, or Metacity/Nautilus which will add an icon to the desktop.<br />
* Another program listening may be a volume manager, such as thunar-volman or [[AutoFS]], configured to automatically create mount points and mount certain types of drives, start Rhythmbox whenever an iPod is connected, etc.<br />
<br />
HAL does not detect the hardware (kernel), manage the devices or the drivers (udev) or automount drives (volume managers). Its role is more akin to a communications central, providing your applications with a nice, clean interface to the devices. Problems with hotplugged devices not being properly detected, usable, or mounted should be investigated, knowing that it is a long chain and there are more components involved (see 'Troubleshooting').<br />
<br />
=Initial configuration=<br />
The HAL daemon requires the presence of the D-Bus daemon, so we need to make sure both are installed. <br />
<br />
'''If desired, you may want to install pmount:'''<br />
<br />
Open a terminal and type the following as root:<br />
# pacman -S pmount<br />
Besides installing pmount, which lets normal users mount removable devices without the aid of sudo or editing /etc/fstab beforehand, this will also pull in the D-Bus and HAL packages as dependencies.<br />
<br />
'''However, you also can just install HAL and D-Bus:'''<br />
# pacman -S hal dbus<br />
No matter if you choose to install pmount or not, continue with the following:<br />
Then edit the file ''/etc/rc.conf'' as root with your favorite editor and add '''hal''' to the DAEMONS array, for example:<br />
DAEMONS=(syslog-ng '''hal''' network netfs ...)<br />
The HAL daemon will now load at boot time. When HAL initializes it will check for the presence of D-Bus and load it automatically. If you have '''dbus''' in your list of daemons, remove it, since it can cause problems.<br />
<br />
You can also start HAL manually by issuing the following command as root:<br />
# /etc/rc.d/hal start<br />
<br />
For D-Bus and HAL to be of any practical use, local user accounts should be members of the following [[groups]]: '''optical''' and '''storage'''. To achieve this, open a terminal and type the following commands as root:<br />
# gpasswd -a ''username'' optical<br />
# gpasswd -a ''username'' storage<br />
Replace ''username'' with your actual username (e.g. johndoe).<br />
<br />
For those group changes to take effect, you have to completely logout and login again.<br />
<br />
=Policies=<br />
<br />
==Permissions policies==<br />
<br />
Your programs communicate with HAL controlled devices through a D-Bus interface. A number of [http://people.freedesktop.org/~david/hal-spec/hal-spec.html#interfaces interfaces] are defined, each associated with a number of methods: The storage device interface, for example, has the methods 'eject' and 'close tray' (for optical drives). In order to 'mount' a partition on a USB key, you need access to the relevant D-Bus interface ('volume' in this case). <br />
<br />
The configuration file /etc/dbus-1/system.d/hal.conf specifies HAL-specific privileges, i.e. what users have access to what interfaces. These are defined as exceptions to the overall restrictions imposed on using D-Bus interfaces, specified in /etc/dbus-1/system.conf. In short, you'll need to see that hal.conf grants your user the right to access specific DBUS/HAL interfaces, because the D-Bus default is not to let you access them.<br />
<br />
The default hal.conf will contain a number of policies denying and allowing access, amongst them this default (the later of two defaults and therefore seemingly the deciding one):<br />
<br />
<!-- Default policy for the exported interfaces --><br />
<policy context="default"><br />
<deny send_interface="org.freedesktop.Hal.Device.SystemPowerManagement"/><br />
<deny send_interface="org.freedesktop.Hal.Device.VideoAdapterPM"/><br />
<deny send_interface="org.freedesktop.Hal.Device.LaptopPanel"/><br />
<deny send_interface="org.freedesktop.Hal.Device.Volume"/><br />
<deny send_interface="org.freedesktop.Hal.Device.Volume.Crypto"/><br />
</policy><br />
<br />
In short, users are by default denied access to interfaces like Volume which has methods such as mount and unmount. This is overruled by policies allowing users of the groups 'power' and 'storage' to access their respective devices:<br />
<br />
<policy group="power"><br />
<allow send_interface="org.freedesktop.Hal.Device.SystemPowerManagement"/><br />
<allow send_interface="org.freedesktop.Hal.Device.LaptopPanel"/><br />
</policy><br />
<br />
<policy group="storage"><br />
<allow send_interface="org.freedesktop.Hal.Device.Volume"/><br />
<allow send_interface="org.freedesktop.Hal.Device.Volume.Crypto"/><br />
</policy><br />
<br />
Which is why you will want to add your user to those groups (see 'Initial configuration'), thus reducing the number of customized configuration files. A less elegant solution is inserting your user name into the user policy section granting access to all the HAL devices listed (replace the zero with your user name):<br />
<br />
<!-- You can change this to a more suitable user, or make per-group --><br />
<policy user="0"><br />
<allow send_interface="org.freedesktop.Hal.Device.SystemPowerManagement"/><br />
<allow send_interface="org.freedesktop.Hal.Device.VideoAdapterPM"/><br />
<allow send_interface="org.freedesktop.Hal.Device.LaptopPanel"/><br />
<allow send_interface="org.freedesktop.Hal.Device.Volume"/><br />
<allow send_interface="org.freedesktop.Hal.Device.Volume.Crypto"/><br />
</policy><br />
<br />
==Device specific policies==<br />
<br />
===NTFS===<br />
Add the following to /etc/hal/fdi/policy/20-ntfs-config-write-policy.fdi (create the file if it doesn't exist)<br />
<br />
Note: This config file has been tested with hal = 0.5.11 and correctly identifies/mounts (external) ntfs devices with ntfs-3g. 'mount' should display the filesystem type as 'fuseblk' if this configuration file is correctly detected.<br />
<br />
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- SGML -*- --><br />
<deviceinfo version="0.2"><br />
<device><br />
<match key="volume.fstype" string="ntfs"><br />
<match key="@block.storage_device:storage.hotpluggable" bool="true"><br />
<merge key="volume.fstype" type="string">ntfs-3g</merge><br />
<merge key="volume.policy.mount_filesystem" type="string">ntfs-3g</merge><br />
<append key="volume.mount.valid_options" type="strlist">locale=</append><br />
</match><br />
</match><br />
</device><br />
</deviceinfo><br />
<br />
If you use pcmanfm as FM, you have to tell it explicitely how to manage the ntfs-3g driver. It is not difficult, you just have to edit the config file at /usr/share/pcmanfm/mount.rules like the following:<br />
<br />
[ntfs-3g]<br />
# mount_options=locale=;exec<br />
mount_options=uid=1000;gid=100;fmask=0113;dmask=0002;locale=;exec<br />
<br />
Obviously, you can select the permission that you want.<br />
<br />
=== mount.ntfs linking ===<br />
As of hal >= 0.5.10 the above policy may not work. This is a workaround forcing HAL to use the ntfs-3g driver instead of the standard ntfs driver. Please note that this method will use the ntfs-3g driver for all NTFS drives on your system! As root create a symbolic link from mount.ntfs to mount.ntfs-3g.<br />
<br />
Note: This should only be used as a last resort 'hack' if HAL is unable to properly recognize and mount (rw) ntfs drives.<br />
<br />
# ln -s /sbin/mount.ntfs-3g /sbin/mount.ntfs<br />
<br />
Possible issues using this method:<br />
* if mount is called with the "-i" option it doesn't work<br />
* possible issues with the kernel ntfs module<br />
<br />
===Mount a device to a specific mount point===<br />
To tell HAL where to mount a device you need two things:<br />
* $device_uuid, the uuid of the device (<code>ls -l /dev/disk/by-uuid/</code> can help)<br />
* $device_name, the name you want to give to the device, the device will be mounted in '''/media/$device_name'''<br />
{{Box Note | The directory /media/$device_name must '''NOT''' exists, it will be created and deleted by HAL.}}<br />
{{Box Note | The device must '''NOT''' be listed in fstab otherwise HAL will refuse to mount it.}}<br />
<br />
Place this into "<code>/etc/hal/fdi/policy/20-$device_name.fdi</code>" without forgetting to replace $device_uuid and $device_name by their values.<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<deviceinfo version="0.2"><br />
<device><br />
<match key="volume.uuid" string="$device_uuid"><br />
<merge key="volume.label" type="string">$device_name</merge><br />
<merge key="storage.automount_enabled_hint" type="bool">true</merge> <nowiki><!-- if you want automount this should be true even if it may not be taken into account by the Desktop Environment --></nowiki><br />
</match><br />
</device><br />
</deviceinfo><br />
<br />
{{Box Note | If permission is denied by HAL with "PermissionDeniedByPolicy hal-storage-mount-removable-extra-options no" see ''Permission Denied with automounter'' below.}}<br />
<br />
=== Locale issues ===<br />
{{Box Note | This shouldn't happen anymore with ntfs-3g 2009.1.1 and newer.}}<br />
<br />
You may have problem with filenames containing non-latin characters. This happens because your mounthelper is not parsing the policies and locale option correctly. There is a workaround for this:<br />
<br />
* Remove this symlink: <code>rm /sbin/mount.ntfs-3g</code><br />
* Replace it with a new bash script containing:<br />
#!/bin/bash<br />
/bin/ntfs-3g $1 "$2" -o locale=en_US.UTF-8,$4 # put your own locale here<br />
* Make it executable: <code>chmod +x /sbin/mount.ntfs-3g</code><br />
* Add "<code>NoUpgrade = sbin/mount.ntfs-3g</code>" to /etc/pacman.conf.<br />
<br />
===Allow dmask and fmask for ntfs-3g===<br />
dmask and fmask are very useful for setting different access rights for directories and files, e.g. dmask=000,fmask=111 will make directories accessible to all, while files will stay non-executable.<br />
<br />
<!-- mount ntfs volume with the ntfs-3g driver to enable write support --><br />
<device><br />
<match key="volume.fstype" string="ntfs"><br />
<append key="volume.mount.valid_options" type="strlist">dmask=</append><br />
<append key="volume.mount.valid_options" type="strlist">fmask=</append><br />
</match><br />
</device><br />
<br />
===Auto-mount only removable media===<br />
By default HAL automounts all available partitions not mounted in /etc/fstab and create desktop icons for them. To override this behavior and automount only removable drives, just add this rule:<br />
<br />
<device><br />
<match key="storage.hotpluggable" bool="false"><br />
<match key="storage.removable" bool="false"><br />
<merge key="storage.automount_enabled_hint" type="bool">false</merge><br />
</match><br />
</match><br />
</device><br />
<br />
If you are running KDE and the device is being automounted (i.e. it comes up in Konqueror), but it is not on the desktop go to <tt>Control Center -> Desktop -> Behavior -> Device Symbols (3rd Tab)</tt> and make sure the box is checked.<br />
<br />
Edit from LeoSolaris: I tried to add this to /etc/dbus-1/system.d/hal.conf and it kept dbus from loading properly. If this still works, it is meant to be placed somewhere else. (FYI for those less experienced, if dbus fails to load properly, usb keyboards, including the ones on laptops, will cease to function entirely. Use single user mode to gain console access, then remove this piece of code if dbus fails.)<br />
<br />
===Enable the noatime mount option for removable devices===<br />
This will speed up file operations and also reduce wear on flash memory devices like USB sticks or SD cards.<br />
<br />
<device> <br />
<match key="block.is_volume" bool="true"><br />
<match key="@block.storage_device:storage.hotpluggable" bool="true"><br />
<merge key="volume.policy.mount_option.noatime" type="bool">true</merge><br />
</match><br />
<match key="@block.storage_device:storage.removable" bool="true"><br />
<merge key="volume.policy.mount_option.noatime" type="bool">true</merge><br />
</match><br />
</match><br />
</device><br />
<br />
===... finally===<br />
<br />
Remember to restart the HAL-daemon for your changes to take effect immediately:<br />
# /etc/rc.d/hal restart<br />
<br />
=Troubleshooting=<br />
<br />
An alternative approach for solving the two first issues is presented at [http://bbs.archlinux.org/viewtopic.php?id=65070]. It also helps to correct issues with powerdown and shutdown of the system.<br />
==Automounting fails with "IsCallerPrivileged failed" message==<br />
If you get a message "IsCallerPriviliged failed" and are not using KDM or GDM :<br />
use ck-launch-session to start your DE/WM .<br />
<br />
example for startx/KDE :<br />
<br />
originally in ~/.xinitrc<br />
<br />
exec startkde<br />
<br />
<br />
NEW version<br />
<br />
exec ck-launch-session startkde<br />
<br />
==Permission Denied with automounter==<br />
If you just upgraded and suddenly your automount stopped working with the error "PermissionDeniedByPolicy mount-removable no" or "PermissionDeniedByPolicy mount-removable-extra-options no", you can hotfix the situation by editing /etc/PolicyKit/PolicyKit.conf and paste <br />
<match user="$USER"> <nowiki><!-- replace with your login or delete the line if you want to allow all users to manipulate devices (keep security issues in mind though) --></nowiki><br />
<match action="org.freedesktop.hal.storage.*"><br />
<return result="yes"/><br />
</match><br />
<match action="hal-storage-mount-fixed-extra-options"> <nowiki><!-- for internal devices mounted with extra options like a wished mount point --></nowiki><br />
<return result="yes" /><br />
</match><br />
<match action="hal-storage-mount-removable-extra-options"> <nowiki><!-- for external devices mounted with extra options like a wished mount point --></nowiki><br />
<return result="yes" /><br />
</match><br />
</match> <nowiki> <!-- don't forget to delete this line if you deleted the first one --></nowiki><br />
into the <config> section (replace $USER with your login name). Restart dbus and hal. If you used kde you will have to restart kde as well (the device notifier won't get it otherwise and will stop responding altogether). This was taken from Gullible Jones' "So long, Arch" thread as a hotfix for exactly this type of breakage and is probably not the best fix (especially for machines with a large number of users), but it works. Maybe someone can make it match group "storage" and update this hastily typed thing.<br />
<br />
==Security error==<br />
If inserted CD/DVDs are recognized and an icon is placed on the desktop, but you are not able to open and explore the device, then the device is recognised by the [[udev]] system but something is preventing HAL from mounting it. If double-clicking the icon gives the error window "A security policy prevents this sender from sending this message to this recipient...", you will need to check your permissions settings (see the 'Initial configuration' and 'Permissions policies' sections).<br />
<br />
==Inserted CD/DVD doesn't get recognized by HAL==<br />
If inserted CDs/DVDs are not recognized by HAL (no icon on the desktop), check /etc/fstab and remove the lines for the optical drives.<br />
<br />
==USB sticks and drives do not automount correctly==<br />
This sub-section is sourced from [http://bbs.archlinux.org/viewtopic.php?pid=248224 this forum page].<br />
<br />
If you are experiencing problems with automounting USB sticks and/or drives, but do not have problems with automounting CDs or DVDs, and if you are able to manually mount the USB device in question, then you should create the file "preferences.fdi" in the folder /etc/hal/fdi/policy and paste the following line into the file<br />
<merge key="volume.ignore" type="bool">false</merge><br />
<br />
Also, if you have GParted installed, you might need to delete this file:<br />
/usr/share/hal/fdi/policy/gparted-disable-automount.fdi<br />
<br />
... as being mentioned at the end of this thread: [http://bbs.archlinux.org/viewtopic.php?pid=310284]<br />
<br />
Also you should remove from '''/etc/fstab''' lines, corresponding to usb devices which should be mounted by hal automatically.<br />
<br />
==Could not get UID and GID==<br />
If you get the following error while starting DBUS:<br />
Failed to start message bus: Could not get UID and GID for username "dbus"<br />
then add the user like so:<br />
# /usr/sbin/groupadd -g 81 dbus<br />
# /usr/sbin/useradd -c 'System message bus' -u 81 -g dbus -d '/' -s /bin/false dbus<br />
<br />
==Removing USB flash causes improper unmount==<br />
If you remove your USB flash without previously unmounting it, automatic unmount by HAL may work improperly.<br />
<br />
You may find that corresponding records from /media/.hal-mtab is not deleted, and in nautilus device list (and also on GNOME desktop) remains link to an empty folder, where the device was previously mounted. <br />
<br />
This may be corrected by unmounting flash drive with "lazy" parameter. To do so, you should do some tweaking:<br />
<br />
1) Create an executable script /usr/lib/hal/hal-unmount.sh with access rights 755 and the following content<br />
#!/bin/sh <br />
# sanity check. DEVNAME should start with a / <br />
[ "$DEVNAME" != "${DEVNAME#/}" ] || exit 0<br />
# Lazily unmount drives which are removed, but still mounted <br />
if [ "$ACTION" = remove ] ; then<br />
if [ -x /usr/bin/pumount ] ; then<br />
/usr/bin/pumount -l "$DEVNAME";<br />
else<br />
/bin/umount -l "$DEVNAME";<br />
fi<br />
fi<br />
exit 0<br />
2) Then you should tell HAL to run this script when you remove your usb stick. To do so, you should add to '''/etc/udev/rules.d/90-hal.rules''' the following line<br />
SUBSYSTEM=="block", ACTION=="remove", RUN+="/usr/lib/hal/hal-unmount.sh"<br />
<br />
3) Execute<br />
# /etc/rc.d/hal restart<br />
<br />
=External links=<br />
*[http://people.freedesktop.org/~david/hal-spec/hal-spec.html HAL 0.5.10 specifications] - A comprehensive HAL specification and introduction.<br />
*[http://dventurin.blogspot.com/2007/04/udev-hal-dbus.html Dam's blog] - An attempt to clarify the division of labor among the kernel, udev, D-Bus and HAL with links to HOWTOs and FAQs on each.<br />
*[http://people.freedesktop.org/~david/talks/dynamic-device-handling-OLS-2006.pdf Dynamic Device Handling (pdf)] - A presentation of device handling.</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=Ext4&diff=60003
Ext4
2009-02-04T09:11:28Z
<p>SkonesMickLoud: /* GRUB Error 13 */</p>
<hr />
<div>[[Category:HOWTOs (English)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Ext4}}<br />
{{i18n_entry|Türkçe|Ext4 (Türkçe)}}<br />
{{i18n_links_end}}<br />
<br />
=Introduction=<br />
<br />
Ext4 is the evolution of the most used Linux filesystem, Ext3. In many ways, Ext4 is a deeper improvement over Ext3 than Ext3 was over Ext2. Ext3 was mostly about adding journaling to Ext2, but Ext4 modifies important data structures of the filesystem such as the ones destined to store the file data. The result is a filesystem with an improved design, better performance, reliability, and features.<br />
<br />
Source: [http://kernelnewbies.org/Ext4 Ext4 - Linux Kernel Newbies]<br />
<br />
=Creating ext4 Partitions From Scratch=<br />
<br />
# Upgrade your system: <code>pacman -Syu</code><br />
# Format the drive: <code>mkfs.ext4 /dev/sdxY</code> (see the mkfs.ext4 man page for options)<br />
# Mount the drive<br />
# Add an entry to <code>/etc/fstab</code>, using the filesystem 'type' ext4<br />
<br />
=Migrating From ext3 to ext4=<br />
<br />
There are two ways of migrating partitions from ext3 to ext4:<br />
* mounting ext3 partitions as ext4 without converting (compatibility)<br />
* converting ext3 partitions to ext4 (performance)<br />
<br />
These two approaches are described below.<br />
<br />
==Mounting ext3 Partitions as ext4 Without Converting==<br />
<br />
===Rationale===<br />
<br />
A compromise between fully converting to ext4 and simply remaining with ext3 is to mount existing ext3 partitions as ext4.<br />
<br />
'''Pros:'''<br />
* Compatibility (the filesystem can continue to be mounted as ext3) &ndash; This allows users to still read the filesystem from other distributions/operating systems without ext4 support (e.g. Windows with ext3 drivers)<br />
* Improved performance (though not as much as a fully-converted ext4 partition) &ndash; See [http://kernelnewbies.org/Ext4 Ext4 - Linux Kernel Newbies] for details<br />
<br />
'''Cons:'''<br />
* Fewer features of ext4 are used (only those that do not change the disk format such as multiblock allocation and delayed allocation)<br />
<br />
'''Conclusion:''' Except for the relative novelty of ext4 (which can be seen as a risk), '''there is no major drawback to this technique'''.<br />
<br />
===Procedure===<br />
<br />
# Edit <code>/etc/fstab</code> and change the 'type' from ext3 to ext4 for any partitions you would like to mount as ext4.<br />
# Re-mount the affected partitions.<br />
# That's all, folks!<br />
<br />
==Converting ext3 Partitions to ext4==<br />
<br />
===Rationale===<br />
<br />
To fully experience the joys of ext4, an irreversible conversion process must be completed.<br />
<br />
'''Pros:'''<br />
* Improved performance and awesome new features &ndash; See [http://kernelnewbies.org/Ext4 Ext4 - Linux Kernel Newbies] for details<br />
<br />
'''Cons:'''<br />
* Cannot be read/written with ext3 drivers (note that there is no known ext4 driver for Windows)<br />
* Irreversible (ext4 partitions cannot be 'downgraded' to ext3)<br />
<br />
===Prerequisites===<br />
<br />
The following software is required on the Arch Linux system:<br />
* kernel26 >= 2.6.28<br />
* e2fsprogs >= 1.41<br />
<br />
If converting one's /boot partition to ext4:<br />
* grub >= 0.97 (with ext4 patch)<br />
<br />
'''NOTE:''' The ext4 patch is included by default with Arch's GRUB package (at the time of writing, but this will likely not change). Otherwise, [[GRUB2]] is required for booting from an ext4 partition.<br />
<br />
'''WARNING:''' Booting from an ext4 partition is not 'officially' supported by GRUB, and [[GRUB2]] is still under development. While GRUB does currently work, the 'safe' option is to boot from an ext2 or ext3 /boot partition. '''CONSIDER YOURSELF WARNED!<br />
<br />
If converting one's root (/) partition to ext4:<br />
* mkinitcpio >= 0.5.20<br />
<br />
If converting one's root (/) partition to ext4, the following software is also needed on a bootable CD/USB drive:<br />
* e2fsprogs >= 1.41<br />
<br />
'''NOTE:''' The latest Arch Linux images (2008.06) ship with an older version of <code>e2fsprogs</code>, but it is a simple matter to <code>pacman -Sy e2fsprogs</code> from the live environment after setting up networking. Alternatively, [http://www.sysresccd.org/Download SystemRescueCd 1.1.4] contains an appropriate version, and is in itself a handy CD to have.<br />
<br />
'''NOTE:''' A new Arch Linux image is expected to be released shortly, and will contain a current version of <code>e2fsprogs</code>.<br />
<br />
===Procedure===<br />
<br />
These instructions were adapted from http://ext4.wiki.kernel.org/index.php/Ext4_Howto and http://bbs.archlinux.org/viewtopic.php?id=61602. They have been tested and confirmed by this author as of January 16, 2009.<br />
<br />
* '''UPGRADE!''' Perform a sysupgrade to ensure all required packages are up-to-date: <code>pacman -Syu</code><br />
* '''BACK-UP!''' Back-up all data on any ext3 partitions that are to be converted to ext4. Although ext4 is considered 'stable' for general use, it is still a relatively young and untested file system. Furthermore, this conversion process was only tested on a relatively simple setup; it is impossible to test each of the many possible configurations the user may be running.<br />
* Edit <code>/etc/fstab</code> and change the 'type' from ext3 to ext4 for any partitions that are to be converted to ext4.<br />
<br />
'''WARNING:''' ext4 is backwards-compatible with ext3 until extents and other new fancy options are enabled. If the user has a partition that is shared with another OS that cannot yet read ext4 partitions, it is possible to mount said partition as ext4 in Arch and still be able to use it as ext3 elsewhere at this point... Not so after the next step! Note, however, that there are fewer benefits to using ext4 if the partition is not fully converted.<br />
<br />
* The conversion process with <code>e2fsprogs</code> must be done when the drive is not mounted. If converting one's root (/) partition, the simplest way to achieve this is to boot from some other live medium, as described in the 'Prerequisites' section above.<br />
** Boot the live medium (if necessary).<br />
** For each partition to be converted to ext4:<br />
*** Ensure the partition is '''NOT''' mounted<br />
*** Run <code>tune2fs -O extents,uninit_bg,dir_index /dev/the_partition</code> (where <code>/dev/the_partition</code> is replaced by the path to the desired partition, such as <code>/dev/sda1</code>)<br />
*** Run <code>fsck -fp /dev/the_partition</code><br />
<br />
'''NOTE:''' The user '''MUST''' fsck the filesystem, or it will be unreadable! This fsck run is needed to return the filesystem to a consistent state. '''It WILL find checksum errors in the group descriptors''' -- this is expected. The '-f' parameter asks fsck to force checking even if the file system seems clean. The '-p' parameter asks fsck to 'automatically repair' (otherwise, the user will be asked for input for each error).<br />
<br />
* Reboot Arch Linux!<br />
<br />
'''WARNING:''' If the user converted their root (/) partition, a kernel panic may be encountered when attempting to boot. If this happens, simply reboot using the 'fallback' initial ramdisk and re-create the 'default' initial ramdisk: <code>mkinitcpio -k 2.6.28-ARCH -c /etc/mkinitcpio.conf -g /boot/kernel26.img</code><br />
<br />
===Troubleshooting===<br />
<br />
====Kernel Panic====<br />
One problem this author encountered was a kernel panic after converting the root (/) partition to ext4. This is because the initial ramdisk was detecting the partition as 'ext4dev', rather than 'ext4'. It was a simple matter to boot with the 'fallback' initial ramdisk and re-create the 'default' image. During the creation process, <code>mkinitcpio</code> correctly detected and included ext4 modules in the initial ramdisk.<br />
<br />
====GRUB Error 13====<br />
After a recent kernel update, this author encountered a GRUB error while attempting to boot from an ext4 /boot partition:<br />
Error 13: Invalid or unsupported executable format<br />
<br />
The solution is to boot from the live medium (SystemRescueCd 1.1.4), and chroot into the Arch Linux installation:<br />
# mkdir /mnt/arch<br />
# mount -t ext4 /dev/sda1 /mnt/arch<br />
# mount -t proc proc /mnt/arch/proc<br />
# mount -t sysfs sys /mnt/arch/sys<br />
# mount -o bind /dev /mnt/arch/dev<br />
<br />
# chroot /mnt/arch /bin/bash<br />
<br />
If /boot is on a separate partition, this partition must also be mounted:<br />
# mount -t ext4 /dev/sda2 /boot<br />
<br />
Then, the following command should resolve the issue. (Does anyone know why?):<br />
# grub-install --recheck /dev/sda</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=Folding@home&diff=59436
Folding@home
2009-01-28T03:18:47Z
<p>SkonesMickLoud: /* Automatic Install */</p>
<hr />
<div>[[Category:Daemons and system services (English)]]<br />
<br />
= What is Folding@Home =<br />
From the [http://aur.archlinux.org/packages.php?do_Details=1&ID=11852&O=0&L=&C=&K=folding&SB=&SO=&PP=&do_MyPackages=&do_Orphans=&SeB= AUR package page] "Folding@Home is a distributed computing project which studies protein folding, misfolding, aggregation, and related diseases."<br />
<br />
Please see the [http://folding.stanford.edu/ Folding@Home site] for a fuller description.<br />
<br />
= Installing Folding@Home =<br />
<br />
Folding@Home is no longer in the community repository due to licensing issues. However, it is still possible to build it from [[AUR]]. If you are familiar with PKGBUILDS and AUR then build it and skip to configuration.<br />
<br />
<br />
== Automatic Install ==<br />
<br />
<br />
If you are using [[Aurbuild]], it's as simple as:<br />
<br />
sudo aurbuild -s foldingathome<br />
<br />
If you are using [http://archlinux.fr/yaourt-en yaourt] , it's as simple as:<br />
<br />
yaourt -S --aur foldingathome<br />
<br />
== Manual Install ==<br />
<br />
To install manually, first download everything under the [http://aur.archlinux.org/packages/foldingathome/foldingathome/ files section] of the [http://aur.archlinux.org/packages.php?do_Details=1&ID=11852&O=0&L=&C=&K=folding&SB=&SO=&PP=&do_MyPackages=&do_Orphans=&SeB= Folding@Home AUR page] to a folder. Open a console and cd to the directory you downloaded to. Now it's just a matter of running<br />
<br />
makepkg<br />
<br />
and if there are no errors you will be left with a package called foldingathome-version-number.pkg.tar.gz.<br />
<br />
Run <br />
sudo pacman -U foldingathome-version-number.pkg.tar.gz<br />
being sure to replace version-number first ;)<br />
<br />
If all went well, Folding@Home should now be installed.<br />
<br />
<br />
<br />
<br />
= Configuration =<br />
<br />
Firstly, you will want to open your /etc/conf.d/foldingathome config file, with your editor of choice.<br />
<br />
sudo nano /etc/conf.d/foldingathome<br />
<br />
The config is self explanatory, if you wish to have Folding@Home run as a user other than root (handy on single user systems, probably more secure on multi-user systems), or in a different group, then change these values.<br />
<br />
Now run the Folding@Home process for the first time with<br />
<br />
sudo /etc/rc.d/foldingathome start<br />
<br />
give it a few seconds and then run <br />
<br />
sudo /etc/rc.d/foldingathome stop<br />
<br />
You will find under your /opt/fah/ directory, either new files or a new folder, if you set the user variable in /etc/conf.d/foldingathome. You will find a file called client.cfg, either in the /opt/fah dir or the /opt/fah/FAH_USER folder.<br />
<br />
sudo nano /opt/fah/client.cfg<br />
or<br />
nano /opt/fah/FAH_USER/client.cfg # Replace FAH_USER first<br />
<br />
<br />
The most important settings here are:<br />
<br />
<br />
*username, username associated to the work-units you return (not related to the FAH_USER variable in /etc/conf.d/foldingathome).<br />
<br />
*team, the team number you wish to contribute points to (earned for work units returned), you will of course want to fill in 45032, the arch-linux team number ;)<br />
<br />
*bigpackets, defines whether you will accept memory intensive work loads. If you have no problem with Folding@Home using up more of your RAM, then set this to yes (at least 512MB of RAM recommended).<br />
<br />
*machineid, covered in the Multi-Core section.<br />
<br />
<br />
After editing that, run <br />
<br />
sudo /etc/rc.d/foldingathome start<br />
<br />
again, to start Folding@Home up.<br />
<br />
<br />
Assuming it all ran correctly, you'll want to put it in /etc/rc.conf to run on startup, so<br />
<br />
sudo nano /etc/rc.conf<br />
<br />
and add @foldingathome to your DAEMONS variable (the @ causes it to start in the background, so as not to slow startup, see [[Daemons]]).<br />
<br>Remember, this is @foldingathome-smp for the SMP client!<br />
<br />
<br />
Folding@Home is now installed and running!<br />
<br />
<br />
= Multi-Core Cpu's and Folding@Home =<br />
<br />
== A Quick Note On Hyperthreading ==<br />
If you have a single-core hyperthreading CPU, you may be tempted to follow the multi-core instructions. It's highly recommenced that you '''''don't''''' do this as the Folding@Home team prefers fewer results quickly, than more results slowly. There's also a time-limit on work-units, so if it runs slower, your work-units may not be returned in time, and so distributed to another user. If you have one core, run one folding process.<br />
<br />
== Multiple Folding@Home Installs ==<br />
=== Setting up Multiple Folding@Home installs ===<br />
It's very simple to set up an extra install, although after each (rare) upgrade of the Folding@Home package, you will have to perform some maintenance, unless you wish to build separate packages with custom PKGBUILDS / scripts (beyond the scope of this tutorial). This method ''should'' also scale to however many cores/processors you have.<br />
<br />
First, stop Folding@Home if it's running<br />
<br />
sudo /etc/rc.d/foldingathome stop<br />
<br />
next<br />
<br />
sudo cp -r /opt/fah /opt/fah2<br />
<br />
If you wish to call it something different, then by all means do. This tutorial will assume you're using /opt/fah2 for your second install and that you have the FAH_USER directory.<br />
<br />
Now<br />
<br />
rm -rf /opt/fah2/FAH_USER/work /opt/fah2/FAH_USER/queue.dat<br />
<br />
<br />
if they exist, this way the new process won't start working on the same work-unit as the original thread.<br />
<br />
You now have to open up the config for the new process<br />
<br />
nano /opt/fah2/FAH_USER/client.cfg<br />
<br />
and change the '''machineid''' to a number different to the one in /opt/fah/client.cfg.<br />
<br />
If you're using the bigpackets option in client.cfg, you should only have it set to yes for '''one''' of your Folding@Home processes as it can overwhelm your system unless you have plenty of free RAM (1GB at least).<br />
<br />
=== Editing Init Scripts ===<br />
Now comes the fun part. A second init script needs to be created and a little editing needs to be done, but this way you can turn each process on and off as wanted and it's simpler than one script managing both.<br />
<br />
<br />
First, some initial editing has to be done to the current script and saved under another name<br />
<br />
sudo nano /etc/rc.d/foldingathome<br />
<br />
<br />
After <br />
<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
. /etc/conf.d/foldingathome<br />
<br />
Add<br />
<br />
FAH_VER=504<br />
<br />
<br />
This is to cut down on later maintenance.<br />
<br />
<br />
Next, change <br />
<br />
PID=`pidof -o %PPID /opt/fah/FAH504-Linux.exe`<br />
<br />
to<br />
<br />
PID=`pgrep -f /opt/fah/FAH${FAH_VER}-Linux.exe -u $FAH_USER`<br />
<br />
The reason for this is that pidof detects the first and second Folding@Home process as the same and so stopping one init script will kill both processes. On the other hand, pgrep will find the process' associated filename/location. The "-u $FAH_USER" part is tacked on as a precaution, in case you are doing something strange with Folding@Home threads and users. You'll also notice the FAH_VER has slipped in there.<br />
<br />
There should be two more instances of /opt/fah/FAH504-Linux.exe, change them to <br />
<br />
/opt/fah/FAH${FAH_VER}-Linux.exe<br />
<br />
<br />
Next, find the lines <br />
add_daemon foldingathome<br />
rm_daemon foldingathome <br />
<br />
and change them to something like<br />
add_daemon foldingathome1<br />
rm_daemon foldingathome1 <br />
<br />
<br />
You can also change the<br />
<br />
stat_busy "Starting Folding@Home"<br />
<br />
stat_busy "Stopping Folding@Home"<br />
<br />
lines to have some extra description such as "on Core 1" if you need to.<br />
<br />
<br />
Now save the file as /etc/rc.d/foldingathome1 , this is to prevent it being over-written by a package upgrade.<br />
<br />
<br />
Make a copy of the script<br />
<br />
sudo cp /etc/rc.d/foldingathome1 /etc/rc.d/foldingathome2<br />
<br />
Now you have to find and replace instances of /opt/fah with /opt/fah2 in this script, double checking you aren't getting any false positives (there shouldn't be any, but scripts change). Make sure you get the one in the PID variable, otherwise the whole pgrep bit was a bit pointless ;)<br />
<br />
Also, find the lines <br />
add_daemon foldingathome1<br />
rm_daemon foldingathome1<br />
<br />
again, and change them to something like <br />
add_daemon foldingathome2<br />
rm_daemon foldingathome2 <br />
<br />
Now, save this script and open up /etc/rc.conf and add @foldingathome1 and @foldingathome2 to the DAEMONS variable. Start up the two processes<br />
<br />
sudo /etc/rc.d/foldingathome1 start<br />
sudo /etc/rc.d/foldingathome2 start<br />
<br />
and if all goes well, you've got 2 Folding@Home processes running!<br />
<br />
=== Maintenance ===<br />
<br />
When upgrading the Folding@Home package, it's recommended you stop both Folding@Home init-scripts first<br />
<br />
sudo /etc/rc.d/foldingathome1 stop<br />
sudo /etc/rc.d/foldingathome2 stop<br />
<br />
On upgrading, /opt/fah/FAH504-Linux.exe will be replaced with a new version, this needs to be copied into your /opt/fah2 directory and the old executable deleted. <br />
<br />
You then just have to change the FAH_VER variable in ''both scripts'' to reflect the new version number. You can then restart both scripts with<br />
<br />
sudo /etc/rc.d/foldingathome1 start<br />
sudo /etc/rc.d/foldingathome2 start<br />
<br />
It may also be worth checking that there have been no other significant changes to the updated original script.<br />
<br />
=== Alternative: Single Init Script ===<br />
<br />
I couldn't get the above method to work with the current (6.02) version of the client. I found an old script on the forums and modified it slightly which works just fine on my system.<br />
<br />
#!/bin/bash<br />
#/etc/rc.d/foldingathome<br />
#<br />
# Starts the Folding@Home client in the background<br />
<br />
. /etc/rc.d/functions<br />
<br />
case "$1" in<br />
start)<br />
stat_busy "Starting Folding@Home"<br />
cd /opt/fah/<br />
/opt/fah/fah6 > /opt/fah/myfah.log &<br />
cd /opt/fah2/<br />
/opt/fah2/fah6 > /opt/fah2/myfah.log &<br />
stat_done<br />
;;<br />
stop)<br />
stat_busy "Stopping Folding@Home"<br />
killall fah6<br />
stat_done<br />
;;<br />
restart)<br />
stop<br />
start<br />
;;<br />
*)<br />
echo $"Usage: $0 {start|stop|restart}"<br />
RETVAL=1<br />
<br />
esac<br />
exit 0<br />
<br />
Just make sure you don't forget to follow the first section under "Setting up Multiple Folding@Home installs".<br />
<br />
== Folding@Home SMP Support ==<br />
<br />
=== About ===<br />
There is now a Folding@Home client available for 64-bit multi-processor or multi-core computers (aka SMP). The creators of Folding@Home suggest the SMP client runs best on quad core machines but many people run it on dual cores with no trouble. This client is definitely NOT recommended for single-core CPUs with Hyperthreading. So, if your machine meets the requirements (Arch 64-bit, true multi-core/processor) you may want to give the SMP client a try instead of running two of the standard client!<br />
<br />
<br />
Setup is identical to that of the standard client EXCEPT for the following:<br />
<br />
* the name of the package in the [http://aur.archlinux.org/packages.php?do_Details=1&ID=11964&O=0&L=&C=&K=folding&SB=&SO=&PP=&do_MyPackages=&do_Orphans=&SeB= AUR is foldingathome-smp]<br />
* lib32-glibc is required to install and run the client (this is reflected as a dependency in the PKGBUILD)<br />
* the package installs to /opt/fah-smp<br />
* the configuration script in /etc/conf.d is foldingathome-smp<br />
* the daemon that should be added to /etc/rc.conf is foldingathome-smp<br />
<br />
<br />
=== Migrating ===<br />
<br />
When migrating from the standard FAH client/s to SMP, you may wish to finish off the work units currently running but without the FAH client downloading new ones. This is possible through the init-scripts as long as you make sure to check the status of the current work-unit before shutting down / rebooting. <br />
<br />
This may seem a bit over the top and whether you do it depends on how committed you are to returning all work-units sent to your box. At the worst, your work-unit will be distributed to someone else after the cut-off date.<br />
<br />
<br />
To do this, stop the folding client/s <br />
sudo /etc/rc.d/foldingathome1 stop<br />
sudo /etc/rc.d/foldingathome2 stop<br />
<br />
open up your /etc/rc.d/foldingathome file/s and change<br />
<br />
su $FAH_USER -c "/opt/fah/FAH504-Linux.exe -verbosity 9 > /opt/fah/$FAH_USER/myfah.log" &<br />
<br />
to<br />
<br />
su $FAH_USER -c "/opt/fah/FAH504-Linux.exe -oneunit -verbosity 9 > /opt/fah/$FAH_USER/myfah.log" &<br />
<br />
<br />
<br />
This will force the FAH client to only finish its current work-unit and upload it without downloading a new one. The problem arises in that if you reboot (or restart the init-scripts) after it's finished and sent back the work-unit, it will download a new one to finish and send back. You will just have to monitor the status of the work-unit before you restart, and if it's at 100% and the end of /opt/fah/FAH_USER/FAHlog.txt says the work-unit has been returned, you can remove that script from the DAEMONS= line in /etc/rc.conf. <br />
<br />
<br />
If you know how, you can probably find a way of stopping it from doing this, maybe with a check in the init-script which stops it running when the work-unit file is no longer in the /opt/fah/FAH_USER/work directory. <br />
<br />
<br />
If you're currently on i686 arch, you will also need to migrate to X86_64 arc, and it would be a good idea to read the [[Arch64_FAQ]]<br />
<br />
=== Troubleshooting ===<br />
<br />
==== Can't find ./mpiexec ====<br />
<br />
If you are using the $FAH_USER variable, you will find on starting the smp client that it can't find ./mpiexec , this is because it's in the /opt/fah-smp/ directory and not your local one. Copy it to /opt/fah-smp/$FAH_USER and it should run fine.<br />
<br />
<br />
==== SMP client not doing any work / stalling ( NNODES=4 ) ====<br />
<br />
( This is adapted from the [http://folding.stanford.edu/English/FAQ-SMP folding@home SMP FAQ] )<br />
<br />
If you run <br />
sudo /etc/rc.d/foldingathome-smp start<br />
<br />
from the console, you will get some output. If this output stalls with a<br />
NNODES=4 <br />
line and top/htop shows the smp-client running but with no CPU usage, you will need to check your local network settings. Check that your /etc/hosts file is set up with 127.0.0.1 linked to the hostname you set up in /etc/rc.conf.<br />
<br />
= Monitoring Work-Unit Progress =<br />
There are several ways of monitoring the progress of your FAH client/s, both on the command line and by GUI. <br />
<br />
In AUR there is silent blades [http://aur.archlinux.org/packages.php?do_Details=1&ID=7788&O=0&L=&C=&K=folding&SB=&SO=&PP=&do_MyPackages=&do_Orphans=&SeB= fahmon], which provides a GUI with the ability to watch multiple clients and get info on the work-unit itself. Fahmon has a dedicated site at [http://www.fahmon.net/ http://www.fahmon.net/]<br />
<br />
On the CLI, you can add a command to your .bashrc , .zshrc or .whateverrc :<br />
<br />
fahstat() {<br />
echo<br />
echo `date`<br />
echo<br />
cat /opt/fah/FAH_USER/unitinfo.txt #(replacing FAH_USER first)<br />
}<br />
<br />
Or for multiple clients :<br />
<br />
fahstat() {<br />
echo<br />
echo `date`<br />
echo<br />
echo "Core 1:";cat /opt/fah/FAH_USER/unitinfo.txt #(replace FAH_USER first)<br />
echo<br />
echo "Core 2:";cat /opt/fah2/FAH_USER/unitinfo.txt #(replace FAH_USER first)<br />
}<br />
<br />
Also, replacing cat with tail -n1 will give just the percentage of work unit complete.<br />
<br />
<br />
= More Resources =<br />
[http://folding.stanford.edu/ Folding@Home Site] <br />
<br />
[http://folding.stanford.edu/English/FAQ Folding@Home FAQ] <br />
<br />
[http://folding.stanford.edu/English/FAQ-Configure Folding@Home Configuration FAQ]<br />
<br />
<br />
<br />
[http://aur.archlinux.org/packages.php?do_Details=1&ID=11964&O=0&L=&C=&K=foldingathome&SB=&SO=&PP=&do_MyPackages=&do_Orphans=&SeB= Folding@Home SMP Client on AUR] <br />
<br />
[http://folding.stanford.edu/English/FAQ-SMP Folding@Home SMP Client FAQ]<br />
<br />
<br />
<br />
[http://vspx27.stanford.edu/cgi-bin/main.py?qtype=teampage&teamnum=45032 Arch Folding@Home team page]<br />
<br />
[http://folding.extremeoverclocking.com/team_summary.php?s=&t=45032 Extended Arch team statistics on extremeoverclocking.com]</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=Network_configuration/Wireless&diff=59425
Network configuration/Wireless
2009-01-27T22:08:06Z
<p>SkonesMickLoud: /* iwl3945, iwl4965 and iwl5000-series */</p>
<hr />
<div>[[Category:Communication and network (English)]]<br />
[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Wireless_Setup}}<br />
{{i18n_entry|Español|Wireless_Setup_(Español)}}<br />
{{i18n_entry|Italiano|Configurazione_Wireless}}<br />
{{i18n_entry|Nederlands|Draadloze_Configuratie}}<br />
{{i18n_entry|German|Drahtlos_Installation}}<br />
{{i18n_entry|简体中文|无线设置}}<br />
{{i18n_entry|Russian|Wireless_Setup_(Русский)}}<br />
{{i18n_entry|Türkçe|Kablosuz Bağlantı}}<br />
{{i18n_links_end}}<br />
<br />
= Introduction =<br />
<br />
Configuring wireless under Arch Linux (or any distro for that matter) is a two-part process. The first part is to identify and ensure the correct driver for your wireless device is installed, (they are available on the installation media, so make sure you install them) and configure the interface. The second is choosing a method of managing wireless connections. This article covers both parts, and provides additional links to wireless management tools.<br />
<br />
{{Box Note | The wireless drivers and tools are available on the installation media. (Be sure to install the proper driver for your card). Udev will usually load the appropriate module, thereby creating the wireless interface, from the initial live system of the installer, as well as the newly installed system on your hard drive. If you are configuring your wireless functionality after, and not during, Arch installation, simply ensure the required packages are installed with pacman, (driver, firmware if needed, wireless_tools) and follow the guidelines below.}}<br />
<br />
= Part I: Identify your card and appropriate Driver =<br />
<br />
==First steps==<br />
#Check to see whether Linux supports your hardware. You can find your card with 'lspci | grep -i net'. The [https://help.ubuntu.com/community/WifiDocs/WirelessCardsSupported Ubuntu Wiki] has an extensive list of wireless cards and whether or not they are supported by available linux kernel drivers.<br />
#*zd1201-based card like ZyXEL B-220<br />
#*[http://www.linux-wlan.org/docs/wlan_adapters.html.gz wlan-ng] supports quite a lot of chipsets; check here first.<br />
#*[http://madwifi.org madwifi] for Atheros chipsets (AR5210, AR5211, AR5212 and AR5213)<br />
#*[http://wireless.kernel.org/en/users/Drivers/ath5k ath5k] is a completely FOSS driver (without a binary blob, unlike Madwifi) for Atheros chipsets.<br />
#*[http://wireless.kernel.org/en/users/Drivers/ath9k ath9k] is Atheros' official driver for the newer 11n chipsets (AR5416, AR5418, AR9160, AR9280, AR9281, AR9285).<br />
#*[http://rt2x00.serialmonkey.com/wiki/index.php/Main_Page rt2x00 project] for a unified driver for Ralink's rt2400, rt2500, and rt2570 chipsets (beta).<br />
#*[http://www.ralinktech.com/ralink/Home/Support/Linux.html Ralink Linux Support] for drivers for Ralink chipsets direct from the manufacturer.<br />
#*[http://rt2x00.serialmonkey.com/wiki/index.php/Downloads rt2x00 project] for better-maintained versions of Ralink's own drivers ("legacy drivers" on the site).<br />
#*[http://ipw2100.sourceforge.net/ ipw2100] for Intel Pro/Wireless 2100 Mini PCI<br />
#*[http://ipw2200.sourceforge.net/ ipw2200] for Intel Pro/Wireless 2200 Mini PCI<br />
#*[http://intellinuxwireless.org/?p=iwlwifi/ iwlwifi-3945-ucode] for Intel Pro/Wireless 3945 AB/G Mini PCI-E<br />
#*[http://intellinuxwireless.org/?p=iwlwifi/ iwlwifi-4965-ucode] for Intel Pro/Wireless 4965 AB/G Mini PCI-E<br />
#*[http://www.nongnu.org/orinoco/devices/ orinoco] for some Prism 2-based cards<br />
#*[http://prism54.org/ prism54] for Prism 54-based cards<br />
#*[http://bcm43xx.berlios.de/ bcm43xx] for Broadcom 43xx-based cards (old)<br />
#*[http://linuxwireless.org/en/users/Drivers/b43/ b43] for Broadcom 43xx-based cards<br />
#*[http://www.broadcom.com/support/802.11/linux_sta.php broadcom-wl] for recent 43xx Broadcom cards not supported by bcm43xx or b43.<br />
#*Check the [http://linux-wless.passys.nl/ Linux Wireless Support] page for your hardware or in The Linux Questions [http://www.linuxquestions.org/hcl/index.php?cat=10 hardware compatibility list] (HCL), which also has a good list of Linux-friendly hardware <br />
#*Also, [http://wireless.kernel.org/en/users/Devices this page] has a matrix of supported hardware.<br />
#If the hardware is supported only under Windows<br />
#*[http://ndiswrapper.sourceforge.net/wiki/index.php/List ndiswrapper] for hardware supported only under Windows (some Broadcom, 3com, etc)<br />
#*You will need the .inf and .sys files from your Windows driver - [http://ndiswrapper.sourceforge.net/mediawiki/index.php/List check here]<br />
#If your hardware is not listed anywhere<br />
#*Try a web search for the exact model name of your hardware with the word "linux" - and feel free to ask for help on [http://bbs.archlinux.org the forums]<br />
#*There is a chance that your hardware will not function under Linux (however, this is rarely the case)<br />
<br />
==How it Works==<br />
The Arch kernel is ''modular'', meaning many of the drivers for machine hardware reside on the hard drive and are available as ''modules''. At boot, udev takes an inventory of your hardware. Udev will load appropriate modules (drivers) for your corresponding hardware, and the driver, in turn, will allow creation of a kernel ''interface''. <br />
<br />
The interface name for different drivers and chipsets will vary. Some examples are wlan0, eth1, and ath0.<br />
<br />
*Note: Udev is not perfect. If the proper module is not loaded by udev on boot, simply modprobe it and add the module name to etc/rc.conf on the '''MODULES=''' line.<br />
<br />
==Installation==<br />
<br />
===If you have wired internet available===<br />
If you have wired ethernet available, and are simply adding wireless functionality to an existing system, and did not include wireless_tools during initial installation, use pacman to install:<br />
# pacman -S wireless_tools<br />
The drivers' corresponding package names are all highlighted in '''bold''' on this page. The packages can be installed during initial package selection on the Arch installation media and can also be installed later with pacman, e.g.:<br />
# pacman -S madwifi<br />
<br />
===If you have only wireless internet available===<br />
The '''wireless_tools''' package is now available as part of the base system and is also on the live installation media (CD/USB stick image). <br />
<br />
You cannot initialize wireless hardware without these userspace tools, so ensure they are installed from the installer media, (during package selection), especially if you have no other means of networking other than wirelessly. Otherwise, you will be stuck in a recursion when you reboot your newly installed Arch system; you will need wireless_tools and drivers, but in order to get them, you will need wireless_tools and drivers.<br />
*This line intentionally left blank.<br />
<br />
===Wireless Quickstart===<br />
The general procedure will be:<br />
<br />
* Identify your interface and appropriate module:<br />
# hwdetect --show-net<br />
or<br />
# lshwd<br />
or<br />
# lspci | grep -i net <br />
* Ensure the module is loaded with <code>lsmod | grep <name_or_part_of_name_of_module></code> e.g.:<br />
# lsmod | grep ath<br />
* Ensure the driver has created a usable interface:<br />
# iwconfig<br />
* Bring the interface up with <code>ifconfig <interface> up</code>. e.g.:<br />
# ifconfig ath0 up<br />
* (Optional) Scan for available access points:<br />
# iwlist ath0 scan | less<br />
* Specify the id of the wireless network with <code>iwconfig <interface> essid "<youressid>"</code>. Or, if using WEP; <code>iwconfig <interface> essid "<youressid>" key <yourwepkey></code>(give the essid (the 'network name') of the network in quotes), e.g.:<br />
# iwconfig ath0 essid "linksys" key 0241baf34c<br />
If your WEP key is ASCII, prefix with <code>s:</code>, e.g.:<br />
# iwconfig ath0 essid linksys key s:mywepkey<br />
* Request an IP address with <code>dhcpcd <interface></code>. e.g.:<br />
# dhcpcd ath0<br />
* Ensure you can route:<br />
$ ping -c 3 www.google.com<br />
Done.<br />
<br />
Refer to [[#Part II: Wireless Management|Part II]] to ensure a permanent configuration solution for your system.<br />
<br />
===Drivers and Firmware===<br />
Methods and procedures for installing drivers for various chipsets are covered below. In addition, certain chipsets require the installation of corresponding ''firmware''. (Also covered below).<br />
<br />
====wlan-ng====<br />
Packages: '''wlan-ng26, wlan-ng26-utils'''<br />
<br />
This driver support PRISM based cards, which are hard to find now. The PRISM card is an IEEE 802.11 compliant 2.4 GHz DSSS WLAN network interface card that uses the Intersil PRISM chipset for its radio functions and the AMD PCNet-Mobile chip (AM79C930) for its Media Access Controller (MAC) function. The supported adapters can be found from here: http://www.linux-wlan.org/docs/wlan_adapters.html.gz<br />
<br />
For wlan-ng you do not need the wireless_tools package as mentioned above. Instead you will need to learn the tools in the wlan-ng26-utils package: '''wlancfg and wlanctl-ng'''.<br />
<br />
See http://www.linux-wlan.org/<br />
<br />
====rt2870====<br />
See [[Rt2870]]<br />
<br />
====rtl8180====<br />
Realtek rtl8180 PCI/Cardbus 802.11b now fully supported in the kernel<br />
<pre>modprobe rtl8180</pre><br />
<br />
====rt2x00====<br />
Unified driver for Ralink chipsets (replaces rt2500,rt61,rt73 etc). Compatible with stable wpa_supplicant using the wext driver interface. This driver is now (as of 2.6.24) part of the mainline kernel, and can be manually loaded as follows...<br />
<pre>modprobe rt2500pci</pre> (replace rt2500pci with your hardware e.g. rt2400pci, rt2500usb, rt61pci, rt73usb)<br />
Some chips require a firmware file, which can be installed like this: <br />
<pre>pacman -S rt2x00-rt71w-fw</pre><br />
<pre>pacman -S rt2x00-rt61-fw</pre><br />
..depending on the chipset.<br />
See the [[Using_the_new_rt2x00_beta_driver|rt2x00 wiki page]].<br />
<br />
====RT2500====<br />
For Ralink's PCI/PCMCIA based rt2500 series chipsets (the first generation of Ralink chips to support 802.11g).<br />
<br />
Package: '''rt2500'''<br />
<br />
Supports standard iwconfig tools for unencrypted and WEP connections, although it can be quite sensitive to the order of commands.<br />
wpa_supplicant is not supported using the standard wext interface. The driver does support WPA (using hardware encryption), but in a non-standard way. The trunk version of wpa_supplicant (0.6.x) appears to include special support for this driver, and it is also possible to negotiate a WPA connection manually using iwpriv commands.<br />
See [http://rt2400.cvs.sourceforge.net/*checkout*/rt2400/source/rt2500/Module/iwpriv_usage.txt these instructions] for details.<br />
The same applies for RT61 and RT73 below.<br />
<br />
As of August 24, 2008, the rt2x00 driver (rt2500pci module) is preferred and will work with wpa_supplicant using the wext driver, if you are using the old rt2500 module, you may need to disable it in your rc.conf fileand make sure you are loading the rt2500pci and rt2x00lib and rt2x00pci modules.<br />
<br />
====RT61====<br />
For PCI/PCMCIA cards based on Ralink's later generation of 802.11g chipsets (including those supporting proprietary MIMO modes). "RT61" has now been made largely obsolete by the in-kernel rt2x00 driver (see above), although there may be cases where the legacy driver performs better.<br />
<br />
See the [[RT61_Wireless|RT61 wiki page]].<br />
<br />
====RT73 (ie Ralink RT2571)====<br />
For USB devices based on Ralink's later generation of 802.11g chipsets (including those supporting proprietary MIMO modes).<br />
<br />
Several USB WiFi dongles use this chipset, including the Linksys WUSB54GC and the Belkin Wireless G USB key (F5D7050 v3000) .<br />
<br />
"RT73" has now been made largely obsolete by the in-kernel rt2x00 driver (see above), although there may be cases where the legacy driver performs better. <br />
See the [[RT73_Wireless|RT73 wiki page]].<br />
<br />
====madwifi====<br />
<br />
Package: '''madwifi'''<br />
<br />
The module is called <tt>ath_pci</tt>. The newer module, ath5k, will eventually phase out ath_pci.<br />
modprobe ath_pci<br />
for the older driver, or:<br />
modprobe ath5k<br />
for the development version. Note that not all cards work with ath5k yet.<br />
<br />
If using ath_pci, you may need to blacklist ath5k by adding it to the MODULES= array in /etc/rc.conf, and subsequently prefixing it with a bang (!):<br />
MODULES=(!ath5k forcedeth snd_intel8x0 ... ...)<br />
<br />
'''Some users may need to use the countrycode option when loading the MadWifi driver in order to use channels and transmit power settings that are legal in their country/region.''' In the Netherlands, for example, you would load the module like this:<br />
<br />
modprobe ath_pci countrycode=528<br />
<br />
You can verify the settings with the <tt>iwlist</tt> command. See <tt>man iwlist</tt> and the [http://madwifi.org/wiki/UserDocs/CountryCode CountryCode page on the MadWifi wiki]. To have this setting automatically applied during boot, add the following to <tt>/etc/modprobe.conf</tt>:<br />
<br />
options ath_pci countrycode=528<br />
<br />
ATTENTION: I had to remove the countrycode option completely or the ath0 device wasn't created (andyrtr, kernel 2.6.21)!<br />
<br />
====ath9k====<br />
<br />
ath9k is Atheros' officially supported driver for the newer 11n chipsets. All of the chips with 11n capabilities are supported, with a maximum throughput around 180 Mbps. To see a complete list of supported hardware, check this [http://wireless.kernel.org/en/users/Drivers/ath9k page].<br />
<br />
Working modes: Station, AP and Adhoc.<br />
<br />
ath9k has been part of the kernel as of 2.6.27. But it has undergone some heavy development, and the changes haven't propagated to the mainline kernel tree yet.<br />
The best solution would be to use the [http://wireless.kernel.org/en/users/Download compat-wireless] package for now.<br />
A [https://lists.ath9k.org/mailman/listinfo/ath9k-devel mailing list] exists for support and development related discussions.<br />
<br />
====ipw2100 and ipw2200====<br />
Depending on which of the chips you have, use either:<br />
<br />
'''ipw2100-fw'''<br />
<br />
or:<br />
<br />
'''ipw2200-fw'''<br />
<br />
If installing after initial Arch installation, you may need to reboot for the firmware to be loaded.<br />
<br />
If at boot up you see that your firmware is not being loaded, then you probably need to add the 'firmware' hook to your /etc/mkinitcpio.conf file and regenerate your kernel image with: <br />
<pre>mkinitcpio -g /boot/kernel26.img</pre><br />
<br />
====iwl3945, iwl4965 and iwl5000-series====<br />
<br />
'''I'''ntel's open source '''W'''iFi drivers for '''L'''inux (See [http://intellinuxwireless.org iwlwifi]) will work for both the 3945 and 4965 chipsets since kernel v2.6.24. And iwl5000-series chipsets (including 5100BG, 5100ABG, 5100AGN, 5300AGN and 5350AGN) module has been supported since '''kernel 2.6.27''', by the intree driver '''iwlagn'''.<br />
<br />
{{Box Note | You must install the '''firmware''' that corresponds to your chipset. }}<br />
<br />
# pacman -S iwlwifi-3945-ucode<br />
or:<br />
# pacman -S iwlwifi-4965-ucode<br />
or:<br />
# pacman -S iwlwifi-5000-ucode<br />
<br />
If MOD_AUTOLOAD is set to yes in /etc/rc.conf (it is by default) that should be all that's required. Simply check for the presence of the drivers by running '''ifconfig -a''' from a terminal. There should be a listing for wlan0.<br />
<br />
To manually load the driver at startup, edit <tt>/etc/rc.conf</tt> as root and add '''iwl3945''' or '''iwl4965''' respectively to the MODULES array. For example:<br />
<br />
MODULES=( ... b44 mii '''iwl3945''' snd-mixer-oss ...)<br />
<br />
The drivers should now load after a reboot, and running '''ifconfig -a''' from a terminal should report '''wlan0''' as a new network interface.<br />
<br />
'''Other Notes'''<br />
* The windows NETw4x32 driver can be used with ndiswrapper as an alternative to the iwl3945 and ipw3945 drivers<br />
* In some cases (specifically a [[Dell Latitude D620]] with Arch 2008.06, though it could happen elsewhere) after installation you may have both iwl3945 and ipw3945 in your <tt>MODULES=()</tt> section of rc.conf. The card will not work with both modules loaded, so you will have to ! out the ipw3945 module and then reboot or remove the module manually before you can use your wireless card.<br />
* By default iwl3945 is configured to only work with networks on channels 1-11. Higher ranges are not allowed in some parts of the world (US). In the EU however channels 12 and 13 are used quite common. To make iwl3945 scan for all channels, add "options cfg80211 ieee80211_regdom=EU" to /etc/modprobe.d/options. With "iwlist f" you can check which channels are allowed.<br />
<br />
====ipw3945 (Deprecated Method)====<br />
{{Box Note | ''The ipw3945 driver is no longer actively developed, and the iwlwifi driver (described above) should work perfectly, but may conflict with the former one. So, only one of them should be installed. If you choose to use the iwlwifi driver you still do need the '''ipw3945-ucode''' package though.''}}<br />
# pacman -S ipw3945 ipw3945-ucode ipw3945d<br />
To initialize the driver on startup, edit <tt>/etc/rc.conf</tt> as root and add '''ipw3945''' to the MODULES array and '''ipw3945d''' to the DAEMONS array. For example:<br />
<br />
MODULES=(... mii '''ipw3945''' snd-mixer-oss ...)<br />
<br />
DAEMONS=(syslog-ng '''ipw3945d''' network ...)<br />
<br />
'''Note:''' The '''ipw3945d''' daemon ''must'' be inserted BEFORE network and dhcdbd/networkmanager in the array.<br />
<br />
====orinoco====<br />
This should be part of the kernel package and be installed already.<br />
====ndiswrapper====<br />
Ndiswrapper is not a real driver, but you can use it when there are no native Linux drivers for your wireless chips. So it is very useful in some situations. To use it you need the *.inf file from your Windows driver (the *.sys file must also be present in the same directory). If you need to extract these files from an *.exe file, you can use either cabextract or wine. ndiswrapper is included on the installation CD.<br />
<br />
Follow these steps to configure ndiswrapper.<br />
<pre>ndiswrapper -i filename.inf<br />
ndiswrapper -l<br />
ndiswrapper -m<br />
depmod -a</pre><br />
<br />
Now the ndiswrapper install is almost finished; you just have to update /etc/rc.conf to load the module at boot (below is a sample of my config; yours might look slightly different):<br />
<br />
<pre>MODULES=(ndiswrapper snd-intel8x0 !usbserial)</pre><br />
<br />
The important part is making sure that ndiswrapper exists on this line, so just add it alongside the other modules. It would be best to test that ndiswrapper will load now, so:<br />
<br />
<pre>modprobe ndiswrapper<br />
iwconfig</pre><br />
<br />
and wlan0 should exist. Check this page if you're having problems:<br />
[http://ndiswrapper.sourceforge.net/joomla/index.php?/component/option,com_openwiki/Itemid,33/id,installation/ Ndiswrapper installation wiki].<br />
<br />
====prism54====<br />
Download the firmware driver for your appropriate card from [http://www.prism54.org/ this site]. Rename the firmware file to 'isl3890'.<br />
If nonexistent, create the directory /lib/firmware and place the file 'isl3890' in it. This should do the trick. ([http://bbs.archlinux.org/viewtopic.php?t=16569&start=0&postdays=0&postorder=asc&highlight=siocsifflags+such+file++directory forum source])<br />
<br />
If that didn't work, try this:<br />
<br />
*Reload the prism module (modprobe p54usb or modprobe p54pci, depending on your hardware)<br />
alternatively remove your wifi card and then reconnect it<br />
*Use the "dmesg" command, and look at the end of the output it prints out.<br />
Look for a section looking like this: <br />
<br />
firmware: requesting '''isl3887usb_bare'''<br />
p54: LM86 firmware<br />
p54: FW rev 2.5.8.0 - Softmac protocol 3.0<br />
<br />
and try renaming the firmware file to the name corresponding to the part bolded here.<br />
<br />
====ACX100/111====<br />
packages: tiacx tiacx-firmware<br />
<br />
The driver should tell you which firmware it needs; check /var/log/messages.log or use the dmesg command. Move the appropriate firmware to '/lib/firmware'. I did this:<br />
ln -s /usr/share/tiacx/acx111_2.3.1.31/tiacx111c16 /lib/firmware<br />
<br />
Hint: If you find that the driver is spamming your kernel log, for example because you're running Kismet with channel-hopping, you could put this in /etc/modprobe.conf:<br />
options acx debug=0<br />
<br />
====BCM43XX====<br />
Broadcom users that have 43xx series chipsets have a new alternative to ndiswrapper. In kernel version 2.6.17, the bcm43xx driver was introduced.<br />
<br />
#Run <pre>iwconfig</pre> or <pre>hwd -s</pre> to determine that you have an appropriate card. My output of hwd -s looked like this: <pre>Network : Broadcom Corp.|BCM94306 802.11g NIC module: unknown</pre><br />
For a list of supported devices, see [http://bcm43xx.berlios.de/?go=devices here].<br />
#Run <pre>pacman -Sy bcm43xx-fwcutter</pre> to install the firmware cutter application.<br />
#Download the Windows driver file for your card from which to extract the firmware.<br />
#If you download the driver from Dell's website, you must run in on a Windows machine or under WINE (it is a .exe file that extracts itself to C:\Dell\[driver numbers]). Or you may try [http://downloads.openwrt.org/sources/wl_apsta-3.130.20.0.o], [http://freewebs.com/ronserver/bcm43xx.tar.gz] or [http://xeve.de/down/wl_apsta.o]. I just saved this file to my desktop; you won't need it after the next step.<br />
#Run <pre>bcm43xx-fwcutter -w /lib/firmware /home/&lt;user&gt;/Desktop/wl_apsta.o</pre> You may have to create /lib/firmware first.<br />
#Restart, and configure your device as normal. You may want to add bcm43xx into the modules section of your rc.conf file. Good luck!<br />
<br />
====b43====<br />
This driver is the successor to the bcm43xx driver, and is included in kernel 2.6.24.<br />
<br />
#Run <pre>lspci</pre> to determine that you have an appropriate card. My output of looked like this: <pre>0c:00.0 Network controller: Broadcom Corporation BCM4311 802.11b/g WLAN (rev 01)</pre><br />
For a list of supported devices, see [http://linuxwireless.org/en/users/Drivers/b43/devices here].<br />
<br />
Either install the "b43-firmware" package from [http://aur.archlinux.org/packages.php?ID=21690 AUR], or perform the following steps manually.<br />
#Install the firmware cutter application from core. It is named "b43-fwcutter".<br />
#Because now in core we have kernel >=2.6.25 we download version 4.150.10.5 of Broadcom's proprietary driver. The older version(4.80.53.0) will be drop in july. <pre>wget http://mirror2.openwrt.org/sources/broadcom-wl-4.150.10.5.tar.bz2</pre><br />
#Unpack the compressed file.<pre>tar xjf broadcom-wl-4.150.10.5.tar.bz2</pre><br />
#Change the current directory to the newly created directory, and then further to the driver folder: <pre>cd broadcom-wl-4.150.10.5/driver</pre><br />
#Create /lib/firmware if you don't have and then Run <pre>b43-fwcutter -w "/lib/firmware/" wl_apsta_mimo.o</pre> <br />
#Restart, and configure your device as normal.<br />
You may want to add b43 into the modules section of your rc.conf file.<pre>MODULES=(...b43 !bcm43xx...)</pre><br />
Good luck!<br />
<br />
====broadcom-wl====<br />
For recent Broadcom 43xx cards not supported by bcm43xx or b43. Not just for 4312 cards. See the [[Broadcom_BCM4312|Broadcom 4312 wiki page]]. It is available in [http://aur.archlinux.org/packages.php?ID=19514 AUR]. These chipsets are used in most Dell laptops, among others.<br />
<br />
====rtl8187====<br />
See the [[Rtl8187_wireless|rtl8187 wiki page]].<br />
<br />
====zd1211rw====<br />
[http://zd1211.wiki.sourceforge.net/ zd1211rw] is a driver for the ZyDAS ZD1211 802.11b/g USB WLAN chipset and it is included in recent versions of the Linux kernel. See [http://www.linuxwireless.org/en/users/Drivers/zd1211rw/devices] for a list of supported devices. You only need to install the firmware for the device: <pre>pacman -Sy zd1211-firmware</pre><br />
--[[User:Willey|Willey]] 22:32, 20 September 2008 (EDT)<br />
<br />
==Test Installation==<br />
After loading your driver run<br />
iwconfig<br />
and see if a wireless interface (wlan''x'', eth''x'', ath''x'') is recognized<br />
<br />
If <code>iwlist scan</code> displays <code>Interface doesn't support scanning</code> then you probably forgot to install the firmware.<br />
<br />
= Part II: Wireless Management =<br />
<br />
Assuming that your drivers are installed and working properly, you will need to choose a method for managing your wireless connections. The following subsections will help you decide the best way to do just that.<br />
<br />
Procedure and tools you’ll need will depend on several factors:<br />
* The '''easiness of configuration management''', from a completely manual setup procedure that you’ll need to repeat at each boot to a software-managed, automatic, autostarting solution<br />
* The '''encryption type''' (or not) that protects the wireless network<br />
* If you need '''network profiles''', i.e. if your computer will frequently change networks (such as a laptop)<br />
<br />
== Encryption types ==<br />
=== WEP ===<br />
The '''Wired Equivalent Privacy''' encryption scheme was introduced in 1997. But the discovery of weaknesses in the WEP algorithm in 2001 have made it a poor choice of wireless security protocol. Some tools, such as ''aircrack'', can break the WEP protection in a couple of seconds. Despite this issue, WEP is still popular and the default encryption scheme in many commercial wireless routers.<br />
<br />
=== WPA/WPA2 ===<br />
<br />
The '''Wi-Fi Protected Access''' security protocol was created in response to the WEP weaknesses. WPA and especially WPA2, which uses the AES encryption algorithm, are considered secure. Wi-Fi certified devices must now provide WPA2. Several modes of authentication are supported by WPA/WPA2: a PSK mode (Pre-Shared Key) designed for home and small office use, and an Enterprise (EAP) mode, which requires an authentication server. The following instructions will only cover the PSK method.<br />
<br />
== Management methods ==<br />
<br />
This table shows the different methods that can be used to activate and manage a wireless network connection, depending on the encryption and management types, and the various tools that are required. Although there may be other possibilities, these are the most frequently used:<br />
{| border="1"<br />
! Management || No encryption/WEP || WPA/WPA2 PSK<br />
|-<br />
| Manual, need to repeat at each computer reboot || <code>ifconfig + iwconfig + dhcpcd/ifconfig</code> || <code>ifconfig + iwconfig + wpa_supplicant + dhcpcd/ifconfig</code><br />
|-<br />
| Automatically managed, centralized without network profile support || define interface in <code>/etc/rc.conf</code> || not covered<br />
|-<br />
| Automatically managed, with network profiles support || colspan="2" align="center" | <code>Netcfg, wicd, NetworkManager, etc…</code><br />
|}<br />
<br />
<br />
Whatever your choice, you should try to connect using the manual method first. This will help you understand the different steps that are required and debug them in case a problem arose. Another tip: if possible (e.g. if you admin your wifi access point), try connecting with no encryption, to check everything works. Then try using encryption, either WEP (simpler to configure) or WPA.<br />
<br />
=== Manual setup ===<br />
<br />
The programs provided by the package '''wireless_tools''' are the basic set of tools to set up a wireless network. Moreover, if you use WPA/WPA2 encryption, you will need the package '''wpa_supplicant'''. These powerful userspace console tools work extremely well and allow complete, manual control from the shell.<br />
<br />
These examples assume your wireless device is <code>wlan0</code>. Replace <code>wlan0</code> with the appropriate device name.<br />
{{Box Note | Depending on your hardware and encryption type, some of these steps may not be necessary. Some cards are known to require interface activation and/or access point scanning before being associated to an access point and being given an IP address. Some experimentation may be required. For instance, WPA/WPA2 users may directly try to activate their wireless network from step 3.}}<br />
<br />
1. ''(Optional, may be required)'' Some cards require that the kernel interface be activated before you can use the wireless_tools:<br />
# ifconfig wlan0 up<br />
<br />
2. ''(Optional, may be required)'' See what access points are available:<br />
# iwlist wlan0 scan<br />
We assume you want to use the essid named <code>MyEssid</code>.<br />
<br />
3. Depending on the encryption, you need to associate your wireless device with the access point to use and pass the encryption key.<br />
* ''No encryption''<br />
# iwconfig wlan0 essid "MyEssid"<br />
* ''WEP''<br />
using an hexadecimal key:<br />
# iwconfig wlan0 essid "MyEssid" key 1234567890<br />
using an ascii key:<br />
# iwconfig wlan0 essid "MyEssid" key s:asciikey<br />
* ''WPA/WPA2''<br />
You need to edit the <code>/etc/wpa_supplicant.conf</code> file as described in [[WPA_Supplicant]]. Then, issue this command:<br />
# wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf<br />
This is assuming your device uses the <code>wext</code> driver. If this does not work, you may need to adjust these options. Check [[WPA_Supplicant]] for more information and troubleshooting.<br />
<br />
4. Finally, provide an IP address to the network interface. Simple examples are:<br />
# dhcpcd wlan0<br />
for DHCP, or<br />
# ifconfig wlan0 192.168.0.2<br />
# route add default gw 192.168.0.1<br />
for static IP.<br />
<br />
{{Box Note | Although the manual configuration method will help troubleshoot wireless problems, you will have to retype every command each time you reboot.}}<br />
<br />
=== Automatically managed, centralized without network profile support ===<br />
<br />
{{Box Note | This method and configuration examples are only valid for unencrypted or WEP-encrypted networks, which are particularly unsecure. To use WPA/WPA2, you'll need to use other solutions like using '''[[wpa_supplicant]]''' manually or network managers, such as '''[[netcfg]]''' or '''[[wicd]]'''. Also, avoid mixing these methods as they may create a conflict and prevent the wireless card from functioning.}}<br />
<br />
* The '''/etc/rc.conf''' file is sourced by the network script. Therefore, you may define and configure a simple wireless setup within /etc/rc.conf for a centralized approach with '''wlan_<interface>="<interface> essid <essid>"''' and '''INTERFACES=(<interface1> <interface2>)'''. The name of the network goes in place of '''MyEssid'''.<br />
<br />
For example:<br />
# /etc/rc.conf<br />
eth0="dhcp"<br />
wlan0="dhcp"<br />
wlan_wlan0="wlan0 essid MyEssid" # Unencrypted<br />
#wlan_wlan0="wlan0 essid MyEssid key 1234567890" # hex WEP key<br />
#wlan_wlan0="wlan0 essid MyEssid key s:asciikey" # ascii WEP key<br />
INTERFACES=(eth0 wlan0)<br />
<br />
Not all wireless cards are <code>wlan0</code>. Determine your wireless interface with ifconfig -a. <br />
Atheros-based cards, for example, are typically <code>ath0</code>, so change <code>wlan_wlan0</code> to:<br />
wlan_ath0="ath0 essid MyEssid key 12345678" <br />
Also define ath0 in the INTERFACES= line.)<br />
<br />
* Alternatively, you may define wlan_<interface> within /etc/conf.d/wireless, (which is also sourced by the network script), for a de-centralized approach: <br />
# /etc/conf.d/wireless<br />
wlan_wlan0="wlan0 essid MyEssid"<br />
<br />
{{Box Note | These solutions are limited: for a laptop which is always on the move it would be good to have multiple [[network profiles]] and be able to easily switch from one to another. That's the aim of network managers, such as '''[[netcfg]]'''.}}<br />
<br />
=== Automatically managed, using a network manager ===<br />
<br />
==== [[Network Profiles|netcfg]] ====<br />
<br />
[[Network Profiles|netcfg]] provides a '''versatile, robust and fast''' solution to networking on Arch.<br />
<br />
It uses a profile based setup and is capable of detection and connection to a wide range of network types. This is no harder than using graphical tools. Following the directions above, you can get a list of wireless networks. Then, as with graphical tools, you will need a password.<br />
<br />
Occasionally, you have to [[wpa_supplicant|configure wpa_supplicant]] properly at first, if you want to use an encrypted wireless connection (eg: wep, wpa, wpa2, etc.) in netcfg, because netcfg package depends on wpa_supplicant.<br />
<br />
''Detailed article: [[Network Profiles]]''<br />
<br />
''Detailed article for development version: [[Network Profiles development]]''<br />
<br />
There are a number of wireless management solutions available to Arch Linux users as an alternative to the above.<br />
<br />
====Autowifi====<br />
Autowifi is a daemon that configures your wireless network automatically depending on the ESSID. Once configured, no user interaction is necessary and no GUI tools are required.<br />
<br />
For more information, see the [[Autowifi]] wiki.<br />
====Wicd====<br />
Wicd is a network manager that can handle both wireless and wired connections. It is written in Python and Gtk with fewer dependencies than NetworkManager, making it an ideal solution for lightweight desktop users. Wicd is now available in the extra repository for both i686 and x86_64.<br />
<br />
For more information, see the [[Wicd]] wiki.<br />
====NetworkManager====<br />
NetworkManager is an advanced network management tool that is enabled by default in most popular Linux distributions. In addition to managing wired connections, NetworkManager provides worry-free wireless roaming with an easy-to-use GUI program for selecting your desired network. <br />
<br />
For more information, see the [[NetworkManager]] wiki.<br />
<br />
====Wifi Radar====<br />
WiFi Radar is Python/PyGTK2 utility for managing wireless profiles (and ''only'' wireless). It enables you to scan for available networks and create profiles for your preferred networks.<br />
<br />
For more information, see the [[Wifi Radar]] wiki.<br />
<br />
====Wlassistant====<br />
Wlassistant is a very intuitive and straightforward GUI app for managing your wireless connections. <br />
<br />
Install with:<br />
# pacman -S wlassistant<br />
Wlassistant must be run with root privileges:<br />
# sudo wlassistant<br />
One method of using wlassistant is to configure your wireless card within /etc/rc.conf, specifying the access point you use most often. On startup, your card will automatically be configured for this essid, but if other wireless networks are needed/available, wlassistant can then be invoked to access them. Background the network daemon in /etc/rc.conf, by prefixing it with a @, to avoid boot delays.<br />
<br />
= See Also =<br />
*[[Sharing ppp connection with wlan interface]]<br />
<br />
= Additional Resources =<br />
*[http://www.gnome.org/projects/NetworkManager/ NetworkManager] - The official website for NetworkManager<br />
*[http://wicd.sourceforge.net/ WICD] - The official website for WICD<br />
*[http://wifi-radar.systemimager.org/ Wifi Radar] - The official website for Wifi Radar<br />
*[http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Wireless.html An overly wordy howto that rarely helps]<br />
*[http://madwifi.org/wiki/UserDocs/FirstTimeHowTo The madwifi project's method of installing, good if you're having trouble doing it the Arch way]</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=AUR_helpers&diff=59127
AUR helpers
2009-01-24T21:37:08Z
<p>SkonesMickLoud: /* AUR Helpers */</p>
<hr />
<div>[[Category:Utilities (English)]]<br />
[[Category:AUR]]<br />
== Overview ==<br />
This is an index of AUR helper scripts that help search and/or build packages from the AUR. None of these scripts are officially supported.<br />
<br />
== AUR Helpers ==<br />
* [[Yaourt]] - Yet AnOther User Repository Tool. It is arguably the most widely used helper.<br />
* [http://aurbuild.berlios.de aurbuild] is a tool written in Python to download and build packages from the AUR.<br />
* [http://aur.archlinux.org/packages.php?ID=16021 Arson] -- arson is the "HOT AUR search helper", providing simple access to AUR packages. You have to run makepkg, unlike (for example) yaourt or aurbuild<br />
* [http://husio.homelinux.com/static/aurshell/ aurshell] is a shell written in Python. With plugins included, it's possible to use AUR, ABS and even wrap pacman.<br />
* [http://wiki.archlinux.org/index.php/AUTOAUR autoaur] A small script for downloading and building more than one package.</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=GNOME_tips&diff=57583
GNOME tips
2009-01-10T22:45:54Z
<p>SkonesMickLoud: /* Gnome System Monitor */</p>
<hr />
<div>[[Category:Desktop environments (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Gnome Tips}}<br />
{{i18n_entry|简体中文|Gnome Tips (简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
==Configuration Tips==<br />
===Better Video Performance===<br />
<br />
Some users report that, if they move the player window while playing a video file, a blue border appears around the video while it is moving. If you experience this, go to Desktop->Preferences->Multimedia Systems Selector, and under video change the "Default Sink" to "XWindows (No Xv)". When you click test, the blue border should be gone and on the whole, video should perform better.<br />
<br />
Edit: This no longer applies to Gnome 2.20 and later ([[User:Evanlec|Evanlec]])<br />
<br />
===Add/Edit GDM Sessions===<br />
To add or edit sessions to GDM:<br />
The GDM configuration file is located at /opt/gnome/etc/gdm/gdm.conf. The gdm.conf file links to the desktop/window manager sessions in the folder /etc/X11/sessions. The sessions are in the format *.desktop.<br />
<b>To add a new session</b><br />
#Copy an existing *.desktop file to use as a template for a new session:<br />
<pre><br />
cd /etc/X11/sessions<br />
cp enlightenment.desktop waimea.desktop<br />
</pre><br />
#Modify the template *.desktop file to open the required window manager:<br />
<pre><br />
nano waimea.desktop<br />
</pre><br />
Alternatively, you can open the new session in KDM. This creates the *.desktop file. Then return to using GDM and the new session will be available.<br />
<br />
===Tweaking===<br />
If your gnome applications seem sluggish and gnome hangs at start-up after killing the previous session, it's likely you haven't set your /etc/hosts file correctly <br />
and your /etc/hosts file includes:<br />
<pre><br />
127.0.0.1 localhost.localdomain localhost YOURHOSTNAME<br />
</pre><br />
Then run "/bin/hostname YOURHOSTNAME" and "/sbin/ifconfig lo up" as root.<br />
<br />
also see [http://wiki.archlinux.org/index.php/Configuring_network]<br />
<br />
==Misc Tips==<br />
===Screen Lock===<br />
#Make sure that dbus is running (probably a good idea to add it to the daemons array in rc.conf).<br />
#Install xscreensaver<br />
<pre><br />
pacman -S xscreensaver<br />
</pre><br />
#Go to Desktop -> Preferences -> Screensaver<br />
#Enable one or more screensavers<br />
#Lock Screen will now start your screensaver and require your password to stop it.<br />
<br />
<b>or</b> you can install gnome-screensaver<br />
<br />
<pre><br />
pacman -S gnome-screensaver<br />
</pre><br />
<br />
===Unlock Gnome-keyring on Login===<br />
In /etc/pam.d/gdm, add lines like this at the end:<br />
auth optional pam_gnome_keyring.so<br />
session optional pam_gnome_keyring.so auto_start<br />
<br />
In /etc/pam.d/gnome-screensaver, add a line like this:<br />
auth optional pam_gnome_keyring.so<br />
<br />
In /etc/pam.d/passwd, add a line like this:<br />
password optional pam_gnome_keyring.so<br />
<br />
http://live.gnome.org/GnomeKeyring/Pam<br />
<br />
<br />
'''Easier way:''' Install SEAHORSE with "pacman -S seahorse". Now you find under "Applications-> Accessories-> Password and Encryption Settings" a nice GUI where you can set for the keyring "Automatically unlocked when user logs in".<br />
<br />
===Nautilus Tips===<br />
Get a certain path in spatial view? Just type:<br />
<pre>control + L</pre><br />
<br />
====Change Browser Mode (Spatial View)====<br />
#Start gconf-editor<br />
#Browse to apps/nautilus/preferences<br />
#Change the value of "always_use_browser" (it's a yes/no value and should be visible as a checkbox or say "false", for the later change the value to "true")<br />
Or you can do this through the preferences:<br />
#In a Nautilus window go to Edit>>Preferences<br />
#Change to the Behaviour tab<br />
#Check (or uncheck) Always Open in Browser Windows<br />
<br />
===Speed Up Panel Autohide===<br />
If you find that your panels are taking too long to appear/disappear when using the Panel Autohide feature, try this;<br />
# Start gconf-editor<br />
# Browse to /apps/panel/global<br />
# Set panel_hide_delay and panel_show_delay to more sensible (integer) values. Note that these values represent milliseconds!<br />
<br />
===GNOME Menu Tips===<br />
====Speed Tweak====<br />
You can remove the delay in GNOME menus by running this command:<br />
<br />
echo "gtk-menu-popup-delay = 0" >> ~/.gtkrc-2.0<br />
<br />
Or just add "gtk-menu-popup-delay = 0" (without quotes) to .gtkrc-2.0<br />
<br />
====Menu Editing====<br />
Most Gnome users complain about the menu. Changing menu entries system-wide or for one or several users alone is poorly documented.<br />
<br />
=====User menus=====<br />
Recent versions of Gnome (ie, v2.22) have a menu editor in which you can de-select menu entires, but not add new menu entries. Right-click on the menu panel and select Edit Menus. Unchecking the box next to a entry will prevent it from displaying.<br />
<br />
To add new menu entries, create a .desktop file in the $XDG_DATA_HOME/applications directory (most likely $HOME/.local/share). A sample .desktop file can be seen below, or take a look at [http://library.gnome.org/admin/system-admin-guide/2.22/menustructure-desktopentry.html.en|the Gnome documentation].<br />
<br />
Or install Alacarte, which makes it easy to create, change and remove menu entries with a GUI. Do this with:<br />
<br />
pacman -S alacarte<br />
<br />
=====Group menus, System menus=====<br />
You will find common gnome menu entries as 'appname.desktop' objects inside one of the $XDG_DATA_DIRS/applications directories (most likely /usr/share/applications). To add new menu items for all users, create an 'appname.desktop' file in one of those directories.<br />
* Edit one of them to fit your needs for a new application, then save it.<br />
* Save it as a menu entry for all users <br> Most often, you will set this files permissions to 644 (root: rw group: r others: r), so all users can see it.<br />
* Save it as a menu entry for a group or user alone <br> You may also have different user permissions; for example, some menu entries should only be available for a group or for one user.<br />
<br />
Here is an example how a Scite menu entry definition file could look:<br />
<br />
<pre><br />
[Desktop Entry]<br />
Encoding=UTF-8<br />
Name=SciTE<br />
Comment=SciTE editor<br />
Type=Application<br />
Exec=/usr/bin/scite<br />
Icon=/usr/share/pixmaps/scite_48x48.png<br />
Terminal=false<br />
Categories=GNOME;Application;Development;<br />
StartupNotify=true<br />
</pre><br />
<br />
====Custom Icon====<br />
<br />
This is a quick guide on changing the gnome "foot" icon of your main menu to the icon of your choice.<br />
<br />
* Open the configuration editor in gnome (it should be in System Tools of your main menu) or run <code>gconf-editor</code><br />
* In the configuration editor go to apps > panel > objects > find the object for your menu (an easy way to spot the correct object is that it will have "Main Menu" in the tool tip section).<br />
* Set the path to your icon in the "Custom_Icon" field.<br />
* Check "Use_Custom_Icon" a little ways down.<br />
* To see the change without having to restart X, open a terminal window and type:<br />
killall gnome-panel<br />
<br />
==Useful Add-ons==<br />
===FAM===<br />
FAM allows gnome to do such useful things as automatically update the menu when new applications are installed, and refresh nautilus when a directory it is viewing is changed.<br />
<br />
See the [[FAM|FAM Wiki]] for instructions on how to install it.<br />
<br />
===Gnome System Monitor===<br />
This application appears when the "System Monitor" applet is clicked, and displays the processor/memory usage of all running applications. It is not installed by default in the GNOME group, so you need to install it separately using:<br />
pacman -Sy gnome-system-monitor<br />
<br />
===Burning CDs from Nautilus===<br />
pacman -Sy nautilus-cd-burner<br />
<br />
===Gnome System Tools===<br />
This adds several Gnome menu items under System->Administration, specifically <br />
user management, date and time, network configuration, runlevels, and shared folders through <br />
samba or NFS. See [http://www.gnome.org/projects/gst/ Gnome documentation].<br />
pacman -Sy gnome-system-tools<br />
'''Pay attention to the post-install message from pacman.'''<br />
<br />
===Gdesklets: Desktop Candy===<br />
Put a clock, calendar, weather report, and more onto your desktop<br />
pacman -S gdesklets<br />
You can find more desklets at [http://www.gdesklets.de/?q=desklet/browse gdesklets.org]. To install them, download the files. Next, in the Gnome menu, open Applications->Accessories->gDesklets. When the gDesklets Shell appears, drag the new gdesklet file onto the shell. If you want gdesklets to load when you log in, click on the Gnome menu under System->Preferences->Sessions. Choose "Startup Programs", click "add", and type in the data. The command should be /usr/bin/gdesklets. You can always find such a path by typing "whereis gdesklets".<br />
<br />
==Other Applications==<br />
These are some other nice applications and utilities for gnome, most of which can be downloaded all at once with:<br />
pacman -Sy gnome-extra<br />
This is a group, so it is quite easy to choose not to download some of the packages, such as the documentation.<br />
<br />
===gnome-terminal===<br />
Install this application before logging into gnome for the first time unless you prefer to use xterm.<br />
<br />
====Drop Down Consoles====<br />
Gnome has a few dropdown consoles inspired by the ones found in FPS's such as Quake and Half-life (ie pressing the ~ key)<br />
These follow Yakuake from KDE, below are a few ones native to Gnome.<br />
<br />
=====Guake=====<br />
Guake requires Python, it can be installed via the following command. F12 is the default to toggle the terminal. Guake features mutiple tabs and by default Cntrl+PgUp and Cntrl+PgDown can be used to switch between these terminals. <br />
<br />
pacman -S guake<br />
<br />
You can set transparency and other settings by first toggling to the terminal via F12, right clicking and selecting Preferences.<br><br />
<br />
Guake can be started automatically by adding the following to Gnome Sessions via <br><br />
System -> Preferences -> Sessions<br><br />
Select Add, and these settings can be used:<br><br />
Name: Guake<br><br />
Command: guake &<br><br />
Comment: Guake Dropdown Terminal.<br><br />
<br />
=====Tilda=====<br />
<br />
Tilda is another dropdown terminal for Gnome, I discontinued using it after discovering Guake but here it is. Kindly add to this section if possible.<br />
<br />
pacman -S tilda<br />
<br />
===gedit===<br />
A text editor with syntax highlighting.<br />
<br />
===eog===<br />
Eye-of-Gnome, a handy, fast little image viewer which can re-size and rotate photos.<br />
<br />
===file-roller===<br />
An archive manager which supports many different formats. (Install unrar, unzip, ... to get the respective formats)<br />
<br />
===gcalctool===<br />
A calculator, what else?<br />
<br />
===rhythmbox===<br />
An iTunes like audio library and player.<br />
<br />
===sound-juicer===<br />
CD Ripper, integrates with rhythmbox.<br />
<br />
''To enable default mp3 profiles in preferences menu:''<br />
pacman -S gstreamer0.10-lame gstreamer0.10-taglib<br />
<br />
Note: This should not be necessary anymore, since these packages now are included in gstreamer0.10-ugly-plugins and gstreamer0.10-good-plugins.<br />
<br />
''If you're having other problems with SoundJuicer , click [[User:Munk3h|here]]''<br />
<br />
===totem===<br />
A video player which uses gstreamer for decoding its input.<br />
<br />
===gimp===<br />
Photoshop alternative for linux, only better and open-source. A must-have if you ever do anything with graphics.<br />
<br />
===gftp===<br />
An nice little FTP client for gnome.<br />
<br />
===abiword===<br />
A small, fast, .doc compatible word processor.<br />
<br />
===gnumeric===<br />
A very nice, excel like spreadsheet editor.<br />
<br />
===Leave message feature in gnome screensaver===<br />
This is a cool feature provided by gnome-screensaver 2.20, somebody can leave a message for you when you are not at your desk.<br />
Please install notification-daemon to make this work.<br />
<br />
===DevilsPie===<br />
A very useful application that can be run as a daemon within gnome. It manipulates windows allowing you to start programs on a desired desktop or in a size of your choice among many other things. Brings a whole new level of control into the metacity engine. There's a pretty good HOWTO on their [http://live.gnome.org/DevilsPie homepage],<br />
<br />
<br />
<br />
==See also==<br />
* [[Gnome]]</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=Vim&diff=53634
Vim
2008-11-16T04:09:01Z
<p>SkonesMickLoud: </p>
<hr />
<div>[[Category:Development (English)]]<br />
[[Category:Utilities (English)]]<br />
[[Category:General (English)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Vim}}<br />
{{i18n_entry|Italiano|Vim_(Italiano)}}<br />
{{i18n_entry|Русский|Vim_(Русский)}}<br />
{{i18n_entry|Español|Vim_(Español)}}<br />
{{i18n_links_end}}<br />
<br />
Vim ('''V'''i '''IM'''proved), is a text editor derived from Vi. It is notorious for its steep learning curve and unfriendly user interface. However, because of its efficiency, variety of plugins, and customization options, vim is one of the most popular text editors for programmers and *nix users (along with [[Emacs]]*). A graphical version, gVim, which provides a user with menus is also available.<br />
<br />
<nowiki>*</nowiki>''Note that The Cult of Vi has determined that using emacs may cause dry mouth, blurred vision, drowsiness, dizziness, profuse sweating, tremors, sexual problems, headache, nausea and abdominal pain.''<br />
<br />
==Installation==<br />
* <tt>vim</tt> depends on <tt>vi</tt>, so that must be installed first. However, since vi is part of the base installation most users should already have it.<br />
<br />
<pre><br />
pacman -S vim<br />
</pre><br />
<br />
==Configuration==<br />
vim's configuation file is in a user's home directy (~/) and is named .vimrc. A sample .vimrc can be found in /etc/vimrc.<br />
<br />
<pre><br />
"Sample .vimrc<br />
set nocompatible<br />
set showmatch<br />
set incsearch<br />
set ignorecase <br />
set smartcase<br />
set history=100<br />
set backspace=eol,start,indent<br />
set ruler<br />
set tabstop=4<br />
set shiftwidth=4<br />
set expandtab<br />
set virtualedit=all<br />
set background=dark<br />
set vb t_vg=<br />
set mouse=v<br />
set textwidth=79<br />
set formatoptions=tcrq<br />
</pre><br />
<br />
* To install gvim (Just like vim but with gtk2 interface and listens to /etc/gvimrc and ~/.gvimrc)<br />
<pre><br />
pacman -S gvim<br />
</pre><br />
<br />
* There is also a group of selected popular vim scripts available via pacman<br />
<pre><br />
pacman -S vim-plugins<br />
</pre><br />
<br />
==VIM quick start guide==<br />
<br />
<br />
===How to start vim===<br />
<br />
* to start vim and edit a file (new or existing)<br />
<br />
vim ''filename''<br />
* to start vim and open a new file<br />
vim<br />
<br />
(You may name your file later when you save it.)<br />
<br />
===Modes===<br />
<br />
Vim is a ''modal'' editor. There are many modes, but the basic modes of vim are:<br />
<br />
* Insert mode, in which anything you type (except some special keys) will appear on the screen and become part of your file buffer. There are many insert modes. The most basic form of insert mode is entered by pressing '''i'''. <br />
* Command mode (also called normal mode), in which your key strokes are interpreted as commands. Command mode is entered by pressing <ESC><br />
* '''ex''' mode, where you may save a file, split the screen, open additional files, etc. '''ex''' mode commands are preceded by a colon, ''':'''<br />
* Visual mode, which allows you to expediently cut, copy and paste large areas of text with the keyboard or mouse. Visual mode is entered by pressing '''v'''<br />
Open a new text file with vim:<br />
vim mytext<br />
After you start vim, you're in command mode.<br />
<br />
*Switch between modes<br />
<br />
1. From command mode to insert mode, press '''i'''<br />
<br />
Enter some text.<br />
<br />
2. from insert mode to command mode, press '''<ESC>'''<br />
<br />
You are now in command mode. Vim is waiting for your commands. Notice if you try typing, you get weird and unexpected results, because, well, you need to learn some commands, and Vim is not in insert mode.<br />
<br />
3. Press '''<ESC>''' again to make sure you are truly in command mode and press ''':''' (colon)<br />
<br />
Now you are in '''ex''' mode, which will allow us to save your first file. Type:<br />
wq<br />
for '''w'''rite and '''q'''uit.<br />
<br />
Your file is written and vim will exit. You have just utilized 3 of the main modes of vim.<br />
<br />
We'll focus on visual mode later.<br />
<br />
===Navigation===<br />
<br />
In both the command mode and the insert mode, the arrow keys function to move the cursor, and with gvim you can mouse click to get to a new position. However, this is not '''''the vim way'''''. The most effective way of moving the cursor is to first enter the command mode by pressing ESC and then use vim's cursor-moving commands to move around. The 4 basic commands are<br />
<br />
* '''j''' move down one line<br />
<br />
* '''k''' move up one line<br />
<br />
* '''h''' move left one character<br />
<br />
* '''l''' move right one character<br />
<br />
Remember: these commands work only in command mode. At first you may feel a bit uncomfortable. After you get familiar using these commands you will stick to them and forget the arrow keys.<br />
<br />
Advanced movement:<br />
<br />
* '''0''' (zero) move to the first character of a line<br />
<br />
* '''$''' move to the last character of a line<br />
<br />
* '''w''' move to the first character of the next word<br />
<br />
* '''e''' move to the last character of the next word<br />
<br />
* '''(''' move to the beginning of the previous sentence<br />
<br />
* ''')''' move to the beginning of the next sentence<br />
<br />
* '''{''' move to the beginning of the current paragraph<br />
<br />
* '''}''' move to the beginning of the next paragraph<br />
<br />
* '''PGUP''' or '''<CTRL>F''' move up one page<br />
<br />
* '''PGDOWN''' or '''<CTRL>B''' move down one page<br />
<br />
* '''H''' move cursor to the top left<br />
<br />
* '''L''' move to the bottom of the screen.<br />
<br />
* ''':25''' go to line 25<br />
<br />
* '''G''' move to end of file<br />
<br />
===How to delete text===<br />
<br />
The DELETE key always works, and the BACKSPACE key works with newly typed text in insert mode. However, it is suggested you not use them. Instead, learn to use vim's deletion commands.<br />
<br />
1. Make sure you are in command mode by pressing '''<ESC>'''<br />
<br />
2. move the cursor to the character you want to delete<br />
<br />
3. press '''x''' , this character disappears<br />
<br />
'''x''' is just one of the many powerful deletion commands. Remember, try to use the cursor motion commands '''j k h l''' to locate your target, and don't leave the command mode.<br />
<br />
===How to insert text===<br />
<br />
While in command mode, move the cursor to the desired location.<br />
<br />
* '''i''' enter insert mode. This will '''i'''nsert before the current character.<br />
<br />
* '''a''' enter append mode. This will '''a'''ppend text after the current character.<br />
<br />
* <code>'''I'''</code> move the cursor to the beginning of the current line and subsequently enter insert mode. <br />
<br />
* '''A''' move the cursor to the end of the current line and subsequently enter insert append mode.<br />
<br />
* '''o''' create a new blank line ''below'' the current line into which you can insert text.<br />
<br />
* '''O''' (capital O) To create a new line ''above'' the current line.<br />
<br />
* '''cc''' cut and replace the entire current line with a new line.<br />
<br />
* '''c$''' cut and replace everything from the current cursor position to the end of the line. <br />
<br />
* '''c'''0 replace everything from the current cursor position to the beginning of the line. <br />
<br />
To re-enter command mode, press <esc><br />
<br />
===How to CUT, COPY and PASTE===<br />
<br />
If you run the GUI version of vim, gvim, you can use mouse and the pull-down menus to do that---the same fashion with other editors. However, that is not the preferred style. You'll feel better off if you can live without a mouse.<br />
<br />
1. Enter command mode by pressing ESC<br />
<br />
2. Move the cursor to the line which you want to copy, by pressing j or k<br />
<br />
3. press<br />
<br />
yy<br />
<br />
to make a copy of the line, or<br />
<br />
dd<br />
<br />
to cut it and make a copy<br />
<br />
4. now move cursor (by pressing k or j) to the the location where you want to put this copy<br />
<br />
5. press<br />
<br />
p<br />
<br />
to put the buffer after the current line, or<br />
<br />
P<br />
<br />
to put the buffer before the current line<br />
<br />
If you want to copy or cut several lines, put a number before the yy or dd command, like<br />
<br />
8yy<br />
<br />
to copy 8 lines.<br />
<br />
===CUT, COPY and PASTE with Visual mode===<br />
<br />
*Visual mode is like Command mode, but the movement commands extend a highlighted area. When a non-movement command is used, it is executed for the highlighted area. Cutting, copying and pasting large sections of text is more efficient in visual mode.<br />
<br />
Hit '''v''' to enter visual mode from command mode, then use the cursor to go up or down. As you do, the lines of text will become highlighted. (You may also use the mouse to highlight areas of text)<br />
<br />
To copy the highlighted section or 'yank':<br />
y<br />
To cut the highlighted section or 'delete':<br />
d<br />
To paste or 'put'<br />
p<br />
to place it before, or<br />
P<br />
for after.<br />
<br />
===Undo and Redo===<br />
Now that you have learned how to cut and delete, you may need to undo some mistakes<br />
u<br />
will undo the last function. Pressing it repeatedly will undo successive functions.<br />
Likewise, use<br />
Ctrl-R<br />
to redo.<br />
<br />
===How to search for a word===<br />
Suppose you want to find all the words apple in your file<br />
<br />
1. Make sure you are in command mode<br />
by hitting ESC<br />
<br />
2. type<br />
<br />
/apple<br />
<br />
followed by ENTER to find an occurrence of apple. When you type the slash, it and the following characters will be shown on the bottom of the screen. After you press ENTER, the cursor will go to the first occurrence of apple if found, and the target will be highlighted.<br />
<br />
3. after you got the first apple, you can keep typing<br />
<br />
n<br />
<br />
to find other apples<br />
<br />
<br />
Suppose you want to search for the word under the current cursor position there's no need to type the word. Instead<br />
<br />
1. Make sure you are in command mode by hitting ESC<br />
<br />
2. type<br />
<br />
*<br />
<br />
this will highlight the word under the curser. Then just like before use<br />
<br />
n<br />
<br />
to jump to the next occurence of word you're searching for.<br />
<br />
<br />
'''Hint:''' With default settings the search stops when you hit the end of the file. To make searches wrap around the end of a file add <br />
<br />
set wrapscan<br />
<br />
to your ~/.vimrc.<br />
<br />
===How to substitute text===<br />
<br />
First make sure you're in command mode by pressing '''<ESC>'''. <br />
<br />
* to replace a single character, move the cursor over the character and hit '''r''' followed by its replacement.<br />
<br />
The following commands utilize '''ex'''. Recall from above that '''ex''' commands are all preceded by a colon, ''':'''<br />
<br />
* replace first occurrence of old in current line with new<br />
<br />
:s/old/new/<br />
<br />
* replace all occurrence of old in current line with new<br />
<br />
:s/old/new/g<br />
<br />
* replace the first occurrence of old in each line between line n1 and n2 with new<br />
<br />
:n1,n2s/old/new/<br />
<br />
* replace all occurrence of oldbetween line n1 and n2 with new<br />
<br />
:n1,n2s/old/new/g<br />
<br />
* replace all occurrence of old in the whole buffer with new, prompt for confirmation.<br />
<br />
:1,$s/old/new/gc<br />
<br />
* replace all occurrence of old in the whole buffer with new, prompt for confirmation.<br />
<br />
:%s/old/new/gc<br />
<br />
===How to exit vim===<br />
<br />
* To save and exit: press '''<ESC>''' to enter command mode, then use '''ex''':<br />
<br />
:wq<br />
or<br />
:x<br />
or, from command mode, without '''ex''':<br />
ZZ<br />
<br />
* to save your file as '''newname''' before exiting: <br />
<br />
press '''<ESC>''' to enter command mode, then type<br />
<br />
:wq newname<br />
<br />
* To exit without saving, press '''<ESC>''', then type<br />
<br />
:q<br />
<br />
* Forced quit<br />
<br />
If :q doesn't work, it's probably because you didn't save the change. If you want to save, use :wq. If you don't want to save the changes, type<br />
<br />
:q!<br />
<br />
== Line Numbers and Jumping to Lines ==<br />
* Showing all line numbers - to show line numbers for a document, in insert mode, type ''':set number'''<br />
* Jumping to a line - If you want to jump to a particular line in a file, in insert mode, type ''':<line number>''', for example, :43 to jump to line #43.<br />
== Comparing or Merging 2 or more files (vimdiff and vsplit)==<br />
Occasionally, you may need to compare or merge multiple files. <br />
* Hypothetical 1<br />
While editing ~/.bashrc,<br />
vim ~/.bashrc<br />
you recall there are some global environment variables set within /etc/profile that you would like to merge into ~/.bashrc. <br />
<br />
Simply enter ex mode and invoke vsplit:<br />
:vsplit <br />
which will split the screen, and then re-enter ex mode and load /etc/profile with the ''e'' command: <br />
:e /etc/profile<br />
to load /etc/profile into the newly split window. <br />
<br />
Recall from above that <br />
CTRL-w<br />
and then '''h''' and '''l''' will allow you to switch windows.<br />
<br />
Subsequently invoking vsplit from ex mode will again split your sessions, so it is possible to compare 3, 4 or more files.<br />
<br />
* Hypothetical 2<br />
After a ''pacman -Syu'', pacman warns you that there are files to be merged, saved with the extension ''.pacnew''<br />
<br />
Invoke vimdiff from the shell:<br />
$ vimdiff ''filename filename.pacnew''<br />
Recall from above that <br />
CTRL-w<br />
and then '''h''' and '''l''' will allow you to switch windows. <br />
<br />
Cursor location will indicate the window for which commands will affect.<br />
<br />
==Vim Tutor==<br />
For more, run: <br />
<pre><br />
vimtutor<br />
</pre><br />
from a shell. Vim will open the tutor file.<br />
<br />
==External links==<br />
* [http://www.vim.org/ The Official website]<br />
* [http://vimdoc.sourceforge.net/ Vim Documentation]<br />
* [http://vim.wikia.com Vim Tips Wiki]]<br />
* [http://usalug.org/vi.html Vi tutorial and reference]</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=Openbox&diff=51009
Openbox
2008-10-13T01:32:20Z
<p>SkonesMickLoud: /* MenuMaker */</p>
<hr />
<div>[[Category:Desktop environments (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Openbox}}<br />
{{i18n_entry|Italiano|Openbox_(Italiano)}}<br />
{{i18n_entry|Русский|Openbox (Русский)}}<br />
{{i18n_entry|Español|Openbox (Español)}}<br />
{{i18n_entry|简体中文|Openbox(简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
= Introduction =<br />
<br />
Openbox is a lightweight and highly configurable window manager with extensive standards support. Its features are well-documented at the [http://icculus.org/openbox/ official website]. This article will pertain to running Openbox under Arch Linux.<br />
<br />
<br />
= Installation =<br />
Openbox is available from the standard repositories:<br />
# pacman -S openbox<br />
<br />
Once installed, pacman will direct you to copy the default <tt>menu.xml</tt> & <tt>rc.xml</tt> configuration files to <tt>~/.config/openbox/</tt>, for example:<br />
<br />
$ mkdir -p ~/.config/openbox/<br />
$ cp /etc/xdg/openbox/rc.xml ~/.config/openbox/rc.xml<br />
$ cp /etc/xdg/openbox/menu.xml ~/.config/openbox/menu.xml<br />
'''''Note:''' do this as a regular user, not as root.''<br />
<br />
<tt>rc.xml</tt> is the core configuration file for Openbox. It is used to manage keyboard shortcuts, themes, virtual desktops and other features.<br />
<br />
<tt>menu.xml</tt> controls the Openbox application menu that appears when you click on your desktop. The default items are pretty sparse, but it's very easy to modify the menu structure to suit your needs. See the menu section below for more details, or visit the [http://icculus.org/openbox/ Openbox website].<br />
<br />
= Getting Started =<br />
<br />
== Using Openbox ==<br />
To run Openbox on its own, simply add the following to the bottom of ~/.xinitrc:<br />
exec openbox-session<br />
<br />
== Using Openbox with GNOME ==<br />
# If you use GDM, select the "GNOME/Openbox" login option<br />
# If you use startx, add '''exec openbox-gnome-session''' to ~/.xinitrc<br />
# From the shell:<br />
xinit /usr/bin/openbox-gnome-session<br />
<br />
== Using Openbox with KDE ==<br />
# If you use KDM, select the "KDE/Openbox" login option<br />
# If you use startx, add '''exec openbox-kde-session''' to ~/.xinitrc<br />
# From the shell:<br />
$ xinit /usr/bin/openbox-kde-session<br />
<br />
== Using Openbox with Xfce4 ==<br />
Log into a normal Xfce4 session. From your terminal of choice, do:<br />
<br />
$ killall xfwm4 ; openbox & exit<br />
<br />
This will kill xfwm4, run Openbox, and close the terminal. <br />
<br />
Log out, making sure to check the "Save session for future logins" checkbox.<br />
<br />
On next login, Xfce4 will use Openbox as its WM.<br />
<br />
To be able to exit the session using xfce4-session, open your file ~/.config/openbox/menu.xml (if it isn't there, copy it from /etc/xdg/openbox/menu.xml). <br />
<br />
Look for the entry:<br />
<br />
<item label="Exit Openbox"><br />
<action name="Exit"><br />
<prompt>yes</prompt><br />
</action><br />
</item><br />
<br />
and change it to:<br />
<br />
<item label="Exit Openbox"><br />
<action name="Execute"><br />
<prompt>yes</prompt><br />
<command>xfce4-session-logout</command><br />
</action><br />
</item><br />
<br />
Otherwise, using the "Exit" entry of the root-menu will cause Openbox to terminate its execution, leaving you without a window manager.<br />
<br />
If you have an issue changing between virtual desktops with the mouse wheel skipping over virtual desktops, open your ~/.config/openbox/rc.xml file and move the mouse binds with actions "DesktopPrevious" and "DesktopNext" from the context "Desktop" to the context "Root" (you may need to define the Root context).<br />
<br />
If you want to use the Openbox root-menu instead of Xfce's, you may terminate Xfdesktop by running the following command in a terminal:<br />
<br />
$ xfdesktop --quit<br />
<br />
However, Xfdesktop manages the wallpaper and desktop icons, requiring you to use other utilities, such as ROX, for these functions.<br />
<br />
(When terminating Xfdesktop, the above issue with the virtual desktops is no longer a problem.)<br />
<br />
= Configuration =<br />
<br />
== Preferences ==<br />
Currently, there are two options for configuring the core Openbox preferences; manually edit the '''rc.xml''', or use the ObConf tool.<br />
<br />
=== Setting Preferences Manually ===<br />
<br />
To configure Openbox manually, simply edit '''~/.config/openbox/rc.xml''' with your favourite text editor. The config file provides plenty of comments throughout, and [http://icculus.org/openbox/index.php/Help:Contents full documentation] is available at the official website.<br />
<br />
=== Setting Preferences with ObConf ===<br />
<br />
[http://icculus.org/openbox/index.php/ObConf:About ObConf] is GUI-based Openbox configuration tool, which can be used to set most preferences including themes, virtual desktops, window properties and desktop margins.<br />
<br />
To install ObConf, run:<br />
# pacman -S obconf<br />
<br />
'''''Note:''''' ObConf cannot be used to configure keyboard shortcuts and some other advanced features. For these modifications, you must edit '''rc.xml''' manually (see above.)<br />
<br />
== Menu Management ==<br />
<br />
The default Openbox menu includes a variety of applications to get you started, but you'll probably want to customize this at some point. There are a number of ways to do so:<br />
<br />
=== Manually ===<br />
Similar to the '''rc.xml''' file, you can edit '''~/.config/openbox/menu.xml''' with your favourite text editor. Although many of the settings are self-explanatory, [http://icculus.org/openbox/index.php/Help:Menus full documentation] is available.<br />
<br />
=== MenuMaker ===<br />
[http://menumaker.sourceforge.net/ MenuMaker] is a powerful tool that creates XML-based menus for a variety of Window Managers, including Openbox. MenuMaker will search your computer for executable programs and create an XML menu based on the results. It can be configured to exclude Legacy X, GNOME, KDE, or Xfce applications if the user desires.<br />
<br />
MenuMaker is available in the community repository and installable via pacman.<br />
$ pacman -S menumaker<br />
<br />
Once installed, you can generate a complete menu by running:<br />
$ mmaker -v OpenBox3<br />
<br />
By default, MenuMaker will not overwrite an existing menu.xml. To do so, run it with the -f (force) argument:<br />
<br />
$ mmaker -vf OpenBox3<br />
<br />
To see a full list of options, run '''mmaker --help'''<br />
<br />
This will give you a pretty thorough menu. Now you can modify the menu.xml by hand, or simply regenerate the list whenever you install new software.<br />
<br />
=== Obmenu ===<br />
Obmenu is a GUI-based menu editor for Openbox. For those who don't enjoy editing XML source code, this is probably the best option for you.<br />
<br />
It is available in the community repository:<br />
# pacman -S obmenu<br />
<br />
Once installed, simply run '''obmenu''' and add or remove the desired applications.<br />
<br />
==== obm-xdg ====<br />
<tt>obm-xdg</tt> is a command-line tool that comes with Obmenu. It can generate a categorized sub-menu of installed GTK/GNOME applications.<br />
<br />
To use obm-xdg, add the following line to '''~/.config/openbox/menu.xml''':<br />
<br />
<menu execute="obm-xdg" id="xdg-menu" label="xdg"/><br />
<br />
Then run '''openbox --reconfigure''' to refresh the Openbox menu. You should now see a sub-menu labeled '''xdg''' in your menu.<br />
<br />
'''''NOTE:''' If you do not have GNOME installed, then you need to install '''gnome-menus''' package for obm-xdg to work.''<br />
<br />
== Startup Programs ==<br />
Openbox features support for running programs at startup. This is provided by the "openbox-session" command.<br />
<br />
There are two ways to enable autostart:<br />
# If you use startx/xinit to log into your X session, edit ~/.xinitrc and change the line that executes ''openbox'' to execute '''openbox-session''' instead.<br />
# If you log in with GDM/KDM, then select the ''Openbox'' session and it will automatically use autostart.<br />
<br />
Startup programs are managed in '''~/.config/openbox/autostart.sh'''. Full instructions and best practices for how to do this are available at the [http://icculus.org/openbox/index.php/Help:Autostart Openbox website].<br />
<br />
== Per-application settings ==<br />
Openbox features per-application settings, allowing you to define rules for your programs. For example, you can:<br />
* load your web browser on a certain desktop<br />
* load your terminal without a window border<br />
* load your torrent client at a certain position on your screen<br />
<br />
These are defined in '''~/.config/openbox/rc.xml'''. As you might expect, the instructions are well-documented within the file itself. Full details can also be found here: http://icculus.org/openbox/index.php/Help:Applications<br />
<br />
== Theming and Appearance ==<br />
With the exception of the Openbox Themes topic, the following section is intended for users who have configured Openbox to run as a standalone desktop, without the assistance of GNOME, KDE or Xfce.<br />
<br />
=== Openbox Themes ===<br />
Openbox themes control the appearance of window borders, including the titlebar and titlebar buttons. They also determine the appearance of the application menu and on-screen display (OSD). <br />
<br />
Additional themes are available from the standard repositories:<br />
<br />
# pacman -S openbox-themes<br />
<br />
This package is by no means definitive. You can download more themes at websites such as:<br />
*[http://www.box-look.org/index.php?xcontentmode=7402 box-look.org]<br />
*[http://customize.org/browse/tags/openbox customize.org]<br />
*http://www.minuslab.net/themes/<br />
*http://celo.wordpress.com/themes/<br />
*http://vault.openmonkey.com/pages/openbox<br />
*http://hewphoria.com/?p=submission&type=theme&cat=7<br />
<br />
Downloaded themes should be extracted to '''~/.themes''' and can be installed or selected with the [[Openbox#Preferences|ObConf]] tool.<br />
<br />
Creating new themes is fairly easy and again [http://icculus.org/openbox/index.php/Help:Themes well-documented].<br />
<br />
=== Desktop Wallpaper ===<br />
<br />
Openbox itself does not include a way to change the wallpaper. This can be done easily with programs like [[Feh]] or [[Nitrogen]]. Other options include ImageMagick, hsetroot and xsetbg.<br />
<br />
=== GTK Themes ===<br />
===== GTK2/GTK+ =====<br />
GTK+ themes can be managed easily with the ''[[LXDE | lxappearance]]'', ''gtk-chtheme'', or ''switch2'' utilities. To install, run:<br />
# pacman -S lxappearance<br />
and/or<br />
# pacman -S gtk-chtheme<br />
and/or<br />
# pacman -S gtk-theme-switch2<br />
<br />
Now you can simply run '''lxappearance''', '''gtk-chtheme''' or '''switch2''' to set the desired theme.<br />
<br />
===== GTK1 =====<br />
For legacy GTK1 themes, install the '''gtk-theme-switch''' package:<br />
# pacman -S gtk-theme-switch<br />
Then run '''''switch''''' to select a desired theme.<br />
<br />
=== GTK Fonts ===<br />
===== Manually edit the config file =====<br />
If you want to change the type and size of your fonts, add the following to '''~/.gtkrc.mine''':<br />
style "user-font"<br />
{<br />
font_name = "[font-name] [size]"<br />
}<br />
widget_class "*" style "user-font"<br />
gtk-font-name = "[font-name] [size]"<br />
<br />
where [font-name] [size] is the desired font and point size. For example:<br />
style "user-font"<br />
{<br />
font_name = "DejaVu Sans 8"<br />
}<br />
widget_class "*" style "user-font"<br />
gtk-font-name = "DejaVu Sans 8"<br />
<br />
Both <tt>font_name</tt> and <tt>gtk-font-name</tt> fields are required for backwards compatibility.<br />
===== Use GUI tools =====<br />
You can use '''gtk-chtheme''' or '''lxappearance''' to set GTK font settings. Please refer to the above section.<br />
<br />
=== GTK Icons ===<br />
First, extract the desired icon theme to '''/usr/share/icons''' (system-wide access) or '''~/.icons''' (local user access), then:<br />
===== Manually edit the config file =====<br />
Add the following to ~/.gtkrc.mine: <br />
gtk-icon-theme-name = "[name-of-icon-theme]"<br />
<br />
where [name-of-icon-theme] is the name of the icon theme directory. For example:<br />
gtk-icon-theme-name = "Tango"<br />
<br />
Ensure ~/.gtkrc-2.0 is configured to parse ~/.gtkrc.mine:<br />
<br />
# ~/.gtkrc-2.0<br />
# -- THEME AUTO-WRITTEN DO NOT EDIT<br />
include "/usr/share/themes/Rezlooks-Gilouche/gtk-2.0/gtkrc"<br />
include "/home/username/.gtkrc.mine"<br />
# -- THEME AUTO-WRITTEN DO NOT EDIT<br />
===== Use GUI tools =====<br />
You can use '''lxappearance''' to choose GTK icon themes. Please refer to the above section.<br />
<br />
=== Mouse cursor themes ===<br />
Extract the desired Xcursor theme to either '''/usr/share/icons''' (system-wide access) or '''~/.icons''' (local user access).<br />
<br />
Add this to ~/.Xdefaults:<br />
Xcursor.theme: [name-of-cursor-theme]<br />
where [name-of-cursor-theme] is the name of the cursor theme directory. For example:<br />
Xcursor.theme: Vanilla-DMZ-AA<br />
To change the size:<br />
Xcursor.size: [size]<br />
<br />
=== Desktop Icons ===<br />
Openbox does not provide a means to display icons on the desktop. PcmanFM, [http://rox.sourceforge.net ROX], [http://idesk.sourceforge.net iDesk], or even Nautilus (and the gnome-settings-daemon) can provide this function. <br />
<br />
ROX and PCmanFM have the additional advantage of being lightweight file managers.<br />
<br />
= Tips & Tricks =<br />
<br />
== Recommended Programs == <br />
<br />
=== Login Managers ===<br />
[http://slim.berlios.de/ SLiM] provides a lightweight and elegant graphical login solution for standalone Openbox configurations. Refer to Arch's [[SLiM]] wiki for detailed instructions.<br />
<br />
=== Composite Desktop ===<br />
[[Xcompmgr]] is a lightweight composite manager capable of rendering drop shadows, fading and simple window transparency within Openbox and other window managers.<br />
<br />
=== Application Launchers ===<br />
==== dmenu ====<br />
Set-up dmenu as described in the [[dmenu]] wiki article. Then, add the following entry to the <keyboard> section '''~/.config/openbox/rc.xml''' to enable a shortcut to launch dmenu:<br />
<keybind key="W-p"><br />
<action name="Execute"><br />
<command>~/path/to/your/dmenu-script</command><br />
</action><br />
</keybind><br />
<br />
==== Gmrun ====<br />
[http://sourceforge.net/projects/gmrun gmrun] provides an excellent Run dialog box, similar to the Alt+F2 features found in Gnome and KDE:<br />
pacman -S gmrun<br />
Add the following entry to the <keyboard> section '''~/.config/openbox/rc.xml''' to enable Alt+F2 functionality:<br />
<keybind key="A-F2"><br />
<action name="execute"><execute>gmrun</execute></action><br />
</keybind><br />
<br />
==== Bashrun ====<br />
[http://sourceforge.net/projects/bashrun bashrun] provides a simple, barebones approach to a run dialog. It is available in the [http://aur.archlinux.org/packages.php?ID=20511 AUR] and can be launched through the Alt+F2 style approach mentioned previously. To make bashrun act more like a traditional run dialog, add the following entry to the <applications> section '''~/.config/openbox/rc.xml''':<br />
<application name="bashrun"><br />
<decor>no</decor> # switch to yes if you prefer a bordered window<br />
<focus>yes</decor><br />
<skip_pager>yes</skip_pager><br />
<layer>above</layer><br />
</application><br />
<br />
=== File managers ===<br />
<br />
There are many possibilities, but the most popular lightweight file managers are:<br />
* [http://thunar.xfce.org Thunar]. Thunar supports auto-mount features and other plugins. <br />
pacman -S thunar<br />
Thunar may be started in daemon mode for tighter desktop integration. For instance, inserting a USB pendrive will invoke a Thunar window to popup, with the drive contents listed in the window. <br />
<br />
To start Thunar in daemon mode, edit ~/.config/openbox/autostart.sh and add:<br />
thunar --daemon &<br />
<br />
* [http://rox.sourceforge.net ROX] (ROX provides desktop icons)<br />
pacman -S rox<br />
* [http://pcmanfm.sourceforge.net PCMan] (pcmanfm also provides desktop icons)<br />
pacman -S pcmanfm<br />
For even lighter options, consider [http://www.obsession.se/gentoo/ Gentoo] or [http://emelfm.sourceforge.net/ emelFM], both of which use the familiar 'Midnight Commander' two pane layout (these two require gtk 1.2.x).<br />
<br />
Of course, you can also use GNOME's Nautilus. Although slower than the above solutions, it has the additional advantage of VFS support (e.g. remote SSH, FTP and Samba connections).<br />
<br />
=== Clipboard Managers and copy/paste===<br />
You may wish to install a clipboard manager for feature rich copy/paste ability. '''xfce4-clipman-plugin, parcellite,''' or '''glipper-old''' may be installed via pacman. Add your choice to autostart.sh. From the terminal, Ctrl+Insert as copy and Shift+Insert as paste generally works as well. You may also copy from terminal with Ctrl+Shift+C, and paste with mouse middle click.<br />
=== Panels, Trays, and Pagers ===<br />
<br />
There are quite a lot of utilities available that provide a panel (taskbar), system tray, and pager to Openbox. The most common are:<br />
<br />
'''Panels'''<br />
* [http://wiki.archlinux.org/index.php/PyPanel PyPanel]<br />
* [http://nsf.110mb.com/bmpanel/ bmpanel]<br />
* [http://code.google.com/p/tint2/ Tint2]<br />
* [http://sourceforge.net/projects/lxpanel LXPanel]<br />
* [http://fbpanel.sourceforge.net fbpanel]<br />
* [http://perlpanel.org/ PerlPanel]<br />
* [http://www.chatjunkies.org/fspanel/ fspanel]<br />
* [http://www.xfce.org/projects/xfce4-panel/ xfce4-panel]<br />
* [http://developer.gnome.org/arch/gnome/corecomponents/panel/ gnome-panel]<br />
* [http://code.google.com/p/avant-window-navigator/ avant-window-navigator]<br />
* [http://developer.berlios.de/projects/cairo-dock/ cairo-dock]<br />
* [http://code.google.com/p/wbar/ wbar]<br />
<br />
'''Trays'''<br />
* [http://stalonetray.sourceforge.net/ Stalonetray]<br />
* [http://download.gna.org/fvwm-crystal/trayer/1.0/ Trayer]<br />
<br />
'''Pagers'''<br />
* [http://projects.l3ib.org/trac/visibility Visibility]<br />
* [http://bbtools.sourceforge.net/ bbpager]<br />
* [http://aur.archlinux.org/packages.php?ID=970 netwmpager]<br />
* [http://useperl.ru/ipager/index.en.html IPager]<br />
<br />
Make your choice and add it to your startup file.<br />
<br />
== Get xprop values for per-app settings quickly ==<br />
If you use per-application settings frequently, you might find this bash alias handy:<br />
<br />
alias xp='xprop | grep "WM_WINDOW_ROLE\|WM_CLASS" && echo "WM_CLASS(STRING) = \"NAME\", \"CLASS\""'<br />
<br />
To use, run '''xp''' and click on the running program that you'd like to define with per-app settings. The result will display only the info that Openbox requires, namely the WM_WINDOW_ROLE and WM_CLASS (name and class) values:<br />
<br />
[thayer@dublin:~] $ xp<br />
WM_WINDOW_ROLE(STRING) = "roster"<br />
WM_CLASS(STRING) = "gajim.py", "Gajim.py"<br />
WM_CLASS(STRING) = "NAME", "CLASS"<br />
<br />
== Firefox/Gran Paradiso application rules == <br />
For whatever reason, Firefox and its open source equivalents will ignore application rules (e.g. <desktop>) unless '''<code>class="Firefox*"</code>''' is used, regardless of what xprop reports as the actually WM_CLASS values.<br />
<br />
== Linking the menu to a command ==<br />
Some people would want to link the Openbox main menu, or any other, to a command. This is useful for creating a menu button in a panel, for example. Although Openbox doesn't support this, a very simple script , xdotool, can simulate a keypress by running a command. Xdotool is available on AUR [http://aur.archlinux.org/packages.php?do_Details=1&ID=14789&O=0&L=0&C=0&K=xdotool&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd here]. To use it, simply add the following code to the <keyboard> section of your rc.xml:<br />
<keybind key="A-C-q"><br />
<action name="ShowMenu"><br />
<menu>root-menu</menu><br />
</action><br />
</keybind><br />
Restart/reconfigure Openbox. You can now magically summon your menu at your cursor position by running the following command:<br />
# xdotool key ctrl+alt+q<br />
Of course, you can change the shortcut to your liking.<br />
<br />
== Urxvt in the background == <br />
With Openbox, running a terminal as desktop background is easy. You won't need '''devilspie''' here.<br />
<br />
First you must enable transparency, open your '''.Xdefaults''' file (if it doesn't exist yet, create it in your home folder).<br />
URxvt*transparent:true<br />
URxvt*scrollBar:false<br />
URxvt*geometry:124x24 #I don't use the whole screen, if you want a full screen term don't bother with this and see below.<br />
URxvt*borderLess:true<br />
URxvt*foreground:Black #Font color. My wallpaper is White, you may wish to change this to White.<br />
<br />
Then edit your '''.config/openbox/rc.xml''' file :<br />
<application name="urxvt"><br />
<decor>no</decor><br />
<focus>yes</focus><br />
<position><br />
<x>center</x><br />
<y>20</y><br />
</position><br />
<layer>below</layer><br />
<desktop>all</desktop><br />
<maximized>true</maximized> #Only if you want a full size terminal.<br />
</application><br />
<br />
The ''magic'' comes from the '''<layer>below</layer>''' line, which place the application under all others. Here Urxvt is displayed on all desktops, change it to your convenience.<br />
<br />
= Additional Resources =<br />
* [http://icculus.org/openbox/ Openbox Website] - The official website<br />
* [http://planetob.openmonkey.com/ Planet Openbox] - Openbox news portal<br />
* [http://www.box-look.org/ Box-Look.org] - A good resource for themes and related artwork<br />
* [http://archux.com/page/application-recommendations Application recommendations]</div>
SkonesMickLoud
https://wiki.archlinux.org/index.php?title=Newcomers_Guide&diff=50477
Newcomers Guide
2008-10-02T07:08:36Z
<p>SkonesMickLoud: /* Eye Candy */</p>
<hr />
<div>[[Category:Getting and installing Arch (English)]]<br />
[[Category:About Arch (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|Provides a highly detailed, explanatory guide to installing, configuring and using a full-featured Arch Linux system.}}<br />
{{Article summary heading|Available Languages}}<br />
{{i18n_entry|Česky|Průvodce začátečníka (Česky)}}<br />
{{i18n_entry|Dansk|Dansk_Begynderguide}}<br />
{{i18n_entry|简体中文|Beginners Guide 新手指南}}<br />
{{i18n_entry|正體中文|Beginner's Guide 新手指南}}<br />
{{i18n_entry|Deutsch|Beginners Guide (Deutsch)}}<br />
{{i18n_entry|English|Beginners Guide}}<br />
{{i18n_entry|Español|Guía para Principiantes (Español)}}<br />
{{i18n_entry|Français|Manuel_du_Débutant_(Français)}}<br />
{{i18n_entry|Italiano|Beginners Guide (Italiano)}}<br />
{{i18n_entry|Lietuviškai|Pradedančiųjų gidas (Lietuviškai)}}<br />
{{i18n_entry|Português Brasil|Guia do Iniciante(Português do Brasil)}}<br />
{{i18n_entry|Türkçe|Başlangıç Rehberi (Türkçe)}}<br />
{{Article summary heading|Related articles}}<br />
{{Article summary wiki|Official Arch Linux Install Guide}} (provides a more general approach)<br />
{{Article summary end}}<br />
==Preface==<br />
<br />
=====Everything you ever wanted to know about Arch, but were afraid to ask=====<br />
Welcome. This self-contained document will guide you through the process of installing, configuring and using [[ArchLinux|Arch Linux]]; a simple, agile and lightweight GNU/Linux distribution, <code>UNIX</code>-like operating system. Arch Linux requires a certain level of intimate knowledge of its configuration and of <code>UNIX</code>-like system methodology and for this reason, extra explanatory information is included. This guide is aimed at new Arch users, but strives to serve as a strong reference and informative base for all. After reading it entirely, the reader will be well equipped to begin using Arch.<br />
<br />
Since GNU/Linux Distributions are fundamentally 'modular' by design, the guide is logically divided into 3 main components of a desktop <code>UNIX</code>-like operating system:<br />
<br />
'''[[#Part I: Install the Base System|Part I: Installing the Base system]]'''<br />
<br />
'''[[#Part II: Install X and configure ALSA|Part II: Installing X and configuring ALSA]]'''<br />
<br />
'''[[#Part III: Installing and configuring a Desktop Environment|Part III: Installing a Desktop Environment]]'''<br />
<br />
=====DON'T PANIC!=====<br />
The Arch Linux system is assembled by the ''user'', from the shell, using basic command line tools. This is '''[[The Arch Way]].''' Unlike the more rigid structures of other distributions and installers, there are no default environments nor configurations chosen for you. From the command line, ''you'' will add packages from the Arch repositories using the [[pacman]] tool via your internet connection and manually configure your installation until your system is customized to your requirements. This method allows for maximum flexibility, choice, and system resource control ''from the base up''.<br />
<br />
Arch Linux is aimed at GNU/Linux users who desire minimal 'code separation' from their machine.<br />
<br />
=====[[The Arch Way]]=====<br />
<br />
'''''The design principles behind Arch are aimed at keeping it [[The Arch Way|simple]].'' '''<br />
<br />
'Simple', in this context, shall mean 'without unnecessary additions, modifications, or complications'. In short; an elegant, minimalist approach.<br />
<br />
'''Some thoughts to keep in mind:'''<br />
<br />
*''" 'Simple' is defined from a technical standpoint, not a usability standpoint. It is better to be technically elegant with a higher learning curve, than to be easy to use and technically [inferior]." -Aaron Griffin''<br />
<br />
*''Entia non sunt multiplicanda praeter necessitatem'' or "Entities should not be multiplied unnecessarily." -Occam's razor. The term ''razor'' refers to the act of shaving away unnecessary complications to arrive at the simplest explanation, method or theory.<br />
<br />
*''"The extraordinary part of [my method] lies in its simplicity..I always believe that the simple way is the right way."'' - Bruce Lee<br />
<br />
{{Box Note |'''Following this guide closely is essential in order to successfully install a properly configured Arch Linux system, so ''please'' read it thoroughly. It is strongly recommended you read each section completely before carrying out the tasks contained.'''}}<br />
* You may wish to make a print out of this guide which will serve as a useful Arch Linux user reference. Simply click on the 'Printable Version' tab in the toolbox on the top-left.<br />
*''If you would like to add to this wiki, please include the "Why" as well as the "How", where appropriate. The best documentation teaches us how, as well as why!''<br />
* The Arch wiki is an excellent resource and should be consulted for issues [http://wiki.archlinux.org/index.php/Main_Page first]; IRC (freenode #archlinux), and the [http://bbs.archlinux.org/ forums] are also available if the answer cannot be found.<br />
----<br />
Welcome to Arch! Now, let's get started.<br />
<br />
==Part I: Install the Base System==<br />
<br />
===Obtain the latest Installation media ===<br />
<br />
You can obtain Arch's latest installation media from [http://archlinux.org/download/ here].<br />
<br />
*Both the Core installer and the FTP/HTTP-downloads provide only the necessary packages to create an '''Arch Linux base system'''. ''Note that the Base System does not include a GUI. It is mainly comprised of the GNU toolchain, (compiler, assembler, linker, libraries, shell, and a few useful utilities) the Linux kernel, and a few extra libraries and modules.'' <br />
*Expanding your Arch Linux system beyond the base system, to include extra software, a Graphical User Interface, etc., is achieved from the command line, ''by the user'', via the pacman package manager to grab i686/x86-64 binary packages. The process is covered in detail below.<br />
====CD installer====<br />
Burn the .iso to a CD with your favorite burner, and continue with [[#Boot Arch Linux Installer | Boot Arch Linux Installer]]<br />
{{Box Note| CD media quality varies greatly, but generally, using a slow burn speed is recommended for reliable burns; Some users recommend speeds '''''as low as 4x or 2x!''''' If you are experiencing unexpected behavior from the CD, try burning at the minimum speed supported by your system. }}<br />
<br />
====USB stick====<br />
<font color="red">'''WARNING''': This will destroy all data on your USB stick.</font><br />
<br />
Insert an empty or expendable USB stick, determine its path, and dump the .img to the USB stick with the <code>/bin/dd</code> program:<br />
dd if=archlinux-2008.06-[core_or_ftp]-i686.img of=/dev/sd''x''<br />
where ''if='' is the path to the img file and ''of='' is your USB device. Make sure to use /dev/sd''x'' and not /dev/sd''x1''.<br />
<br />
'''Check md5sum (optional):'''<br />
<br />
Make a note of the number of records (blocks) read in and written out, then perform the following check:<br />
dd if=/dev/sd''x'' count=''number_of_records'' status=noxfer | md5sum<br />
The md5sum returned should match the md5sum of the downloaded archlinux image file; they both should match the md5sum of the image as listed in the md5sums file in the mirror distribution site.<br />
<br />
Continue with [[#Boot Arch Linux Installer | Boot Arch Linux Installer]]<br />
<br />
===Boot Arch Linux Installer===<br />
As you follow these directions, you may find the [[Official Arch Linux Install Guide]] helpful as well. <br />
<br />
Insert the CD or USB stick and boot from it. You may have to <br />
change the boot order in your computer BIOS or press a key (usually DEL, F1, F2, F11 or F12) during the BIOS POST phase.<br />
<br />
Memory requirements:<br />
<br />
* CORE : 160 MB RAM x86_64/i686 (all packages selected, with swap partition)<br />
* FTP : 160 MB RAM x86_64/i686 (all packages selected, with swap partition)<br />
<br />
Choose Boot Archlive or Boot Archlive [legacy IDE] if you have trouble with libata/PATA. <br />
<br />
To change boot options press '''e''' for editing the boot lines. Many users may wish to change the resolution of the framebuffer, for more readable console output. Append:<br />
vga=773<br />
to the kernel line, followed by <ENTER>, for a 1024x768 framebuffer. Hit '''b''' to boot.<br />
<br />
The system will now boot and present a login prompt.<br />
<br />
===Login and Changing the keymap===<br />
Login as 'root'.<br />
<br />
If you have a non-US keyboard layout do:<br />
# km<br />
at the prompt, and choose your keymap/console font.<br />
<br />
That's right, the ever-popular '''km''' program is back as of 2008-06!<br />
<br />
===Documentation===<br />
The guide you are now reading is available on the live system. Change to vc/2 with <ALT>+F2 and do:<br />
# less /arch/beginnersguide.txt<br />
'''Less''' will allow you to page through the document. Change back to vc/1 with <ALT>+F1. <br />
<br />
Change back to vc/2 if you need to reference the Beginners' Guide at any time.<br />
<br />
===Start the Installation===<br />
As root, run the installer script from vc/1:<br />
# /arch/setup <br />
<br />
====Select an installation source====<br />
After a welcome screen, you will be prompted for an installation source. Choose the appropriate source for the installer you are using. <br />
* If you chose the CORE installer, continue below with [[#Prepare Hard Drive|Prepare Hard Drive]].<br />
* FTP/HTTP only: You shall be prompted to load ethernet drivers manually, if desired. Udev is quite effective at loading the required modules, so you may assume it has already done so. You may verify this by invoking ifconfig -a from vc/3. (Select OK to continue.)<br />
<br />
===Configure Network (FTP/HTTP)===<br />
Available Interfaces will be presented. If an interface and HWaddr is listed, then your module has already been loaded. If your interface is not listed, you may probe it from the installer, or manually do so from another virtual console.<br />
<br />
The following screen will prompt you to ''Select the interface, Probe,'' or ''Cancel''. Choose the appropriate interface and continue.<br />
<br />
The installer will then ask if you wish to use DHCP. Choosing Yes will run '''dhcpcd''' to discover an available gateway and request an IP address; Choosing No will prompt you for your static IP, netmask, broadcast, gateway DNS IP, HTTP proxy, and FTP proxy. Lastly, you will be presented with an overview to ensure your entries are correct.<br />
<br />
====Wireless Quickstart (If you need wireless connectivity during the installation process)====<br />
<br />
The wireless drivers and utilities are now available to you in the live environment of the installation media. <br />
<br />
If you need wireless functionality from the initial installation (live installer environment) onwards, the basic procedure will be:<br />
* Switch to a free virtual console, e.g.: <ALT>+F3<br />
* Identify your wireless card and appropriate module with <code>/sbin/hwdetect</code>:<br />
# hwdetect --show-net<br />
* Ensure udev has loaded the module with <code>/bin/lsmod</code>:<br />
# lsmod | grep <name_of_module><br />
* If not, probe it using <code>/sbin/modprobe</code>:<br />
# modprobe <name_of_module><br />
* Ensure the driver has created a usable wireless kernel interface with <code>/usr/sbin/iwconfig</code>:<br />
# iwconfig<br />
(Output should show an available wireless interface)<br />
* Bring the interface up with <code>/sbin/ifconfig <interface> up</code>. <br />
<br />
An example, using an atheros card and madwifi driver:<br />
# ifconfig ath0 up<br />
(Remember, your interface may be named something else, depending on your module (driver) and chipset: wlan0, eth1, etc.)<br />
* Specify the id of the wireless network with iwconfig <interface> essid <youressid> key <yourwepkey>, e.g.:<br />
# iwconfig ath0 essid linksys key 0241baf34c<br />
* Acquire an IP address with <code>/sbin/dhcpcd <interface> </code>. e.g.:<br />
# dhcpcd ath0<br />
* Ensure you can route using <code>/bin/ping</code>:<br />
# ping -c 3 www.google.com<br />
Done.<br />
<br />
After the initial Arch installation is complete, you may wish to refer to [[Wireless Setup]] to ensure a permanent configuration solution for your system.<br />
<br />
<br />
Return to vc/1 with <ALT>+F1. Continue with [[#Prepare Hard Drive|Prepare Hard Drive]]<br />
<br />
===Prepare Hard Drive===<br />
<font color="red"> '''WARNING:''' '''''Partitioning hard drives can destroy data. You are strongly cautioned and advised to backup your critical data if applicable.'''''</font><br />
<br />
Select the first menu entry "Prepare Hard Drive". <br />
* Option 1: Auto Prepare<br />
Auto-Prepare divides your disk into the following configuration:<br />
<br />
* ext2 /boot partition, default size 32MB. ''You will be prompted to modify the size to you requirement.''<br />
* swap partition, default size 256MB. ''You will be prompted to modify the size to you requirement.'' <br />
* A Separate / and /home partition, (sizes can also be specified). You may choose from ext2, ext3, reiserfs, xfs and jfs, but note that ''both / and /home must share the same fs type'' if choosing the Auto Prepare option.<br />
<br />
Be warned that Auto-prepare will completely erase the chosen hard drive. Read the <font color="red">warning</font> presented by the installer very carefully, and make sure the correct device is about to be partitioned.<br />
<br />
* Option 2: '''(Recommended)''' Partition Hard Drives (with cfdisk)<br />
<br />
This option will allow for the most robust and customized partitioning solution for your personal needs. <br />
<br />
''At this point, more advanced GNU/Linux users who are familiar and comfortable with manually partitioning may wish to skip down to '''[[#Select Packages|Select Packages]]''' below.''<br />
<br />
====Partition Hard Drives====<br />
<br />
=====Partition Info=====<br />
<br />
Partitioning a hard disk drive defines specific areas (the partitions) within the disk, that will each appear and behave as a separate disk and upon which a filesystem may be created (formatted). There exist 3 types of disk partitions: <br />
#Primary<br />
#Extended<br />
#Logical<br />
'''Primary''' partitions can be bootable, and are limited to 4. If a partitioning scheme requires more than 4 partitions, we are forced to use an '''extended''' partition which will contain '''logical''' partitions.<br />
<br />
Extended partitions are not usable by themselves; they are merely a "container" for logical partitions. If required, a hard disk shall contain only one extended partition; which shall then be sub-divided into logical partitions. <br />
<br />
When partitioning a disk, one can observe this numbering scheme by creating primary partitions sda1-3 followed by creating an extended partition, sda4, and subsequently creating logical partition(s) within the extended partition; sda5, sda6, and so on.<br />
<br />
=====Swap Partition=====<br />
A swap partition is a place on your hard drive where virtual ram resides, allowing the kernel to easily use disk storage for data that does not fit into physical RAM. <br />
<br />
Historically, the general rule for swap partition size was 2x the amount of physical RAM. Over time, as computers have gained ever larger memory capacities, this rule has become increasingly deprecated. Generally, on machines with up to 512MB RAM, the 2x rule is usually quite sufficient. On machines with 1GB RAM, generally a 1x rule is adequate. If you have gratuitous amounts of RAM (more than 1024 MB) it may be possible to completely forgo a swap partition altogether, though this is not recommended. We will create a 1 GB swap partition in this example.<br />
{{Box Note|If you plan on using suspend-to-disk, (hibernate) you must have a swap partition at least '''equal''' in size to the amount of physical RAM, and some Arch users even recommend oversizing it beyond the amount of physical RAM by 10-15%, to allow for possible bad sectors.}}<br />
<br />
=====Partition Scheme=====<br />
A disk partitioning scheme is a very personalized preference. Each user's choices will be unique to their own computing habits and requirements. <br />
<br />
Filesystem candidates for separate partitions include:<br />
<br />
'''/''' (root) ''The root filesystem is the primary filesystem from which all other filesystems stem; the top of the hierarchy. All files and directories appear under the root directory "/", even if they are stored on different physical devices. The contents of the root filesystem must be adequate to boot, restore, recover, and/or repair the system.'' <br />
<br />
'''/boot''' ''This directory contains the kernel and ramdisk images as well as the bootloader configuration file, and bootloader stages. /boot also stores data that is used before the kernel begins executing userspace programs. This may include saved master boot sectors and sector map files.''<br />
<br />
'''/home''' ''User data and user specific configuration files for applications are stored in each user's home directory in a file that starts with the '.' character (a "dot file").''<br />
<br />
'''/usr''' ''While root is the primary filesystem, /usr is the secondary hierarchy, for user data, containing the majority of (multi-)user utilities and applications. /usr is shareable, read-only data. This means that /usr shall be shareable between various hosts and must not be written to, except in the case of system update/upgrade. Any information that is host-specific or varies with time is stored elsewhere.''<br />
<br />
'''/tmp''' ''directory for programs that require temporary files''<br />
<br />
'''/var''' ''contains variable data; spool directories and files, administrative and logging data, pacman's cache, the ABS tree, etc.''<br />
{{Box Note | Directories essential for booting are: '/bin', '/boot', '/dev', '/etc', '/lib', '/proc' and '/sbin'. Therefore, they must not reside on a separate partition from /.}}<br />
There are several advantages for using discrete filesystems, rather than combining all into one partition:<br />
<br />
* Security: Each filesystem may be configured as 'nosuid', 'nodev', 'noexec', 'readonly', etc. (This is specified in /etc/fstab).<br />
* Stability: A user, or malfunctioning program can completely fill a filesystem with garbage if they have write permissions for it. Critical programs, which reside on a different filesystem remain unaffected.<br />
* Speed: A filesystem which gets written to frequently may become somewhat fragmented. (An effective method of avoiding fragmentation is to ensure that each filesystem is never in danger of filling up completely.) Separate filesystems remain unaffected, and each can be defragmented separately as well.<br />
* Integrity: If one filesystem becomes corrupted, separate filesystems remain unaffected.<br />
* Versatility: Sharing data across several systems becomes more expedient when independent filesystems are used. Separate filesystem types may also be chosen based upon the nature of data and usage. <br />
In this example, we shall use separate partitions for /, /var, /home, and a swap partition. <br />
<br />
{{Box Note | /var contains many small files. You may wish to take this into consideration when choosing a filesystem type for it.}}<br />
<br />
=====How big should my partitions be?=====<br />
This question is best answered based upon individual needs. If you have little or no experience with partitioning, you may wish to simply create one partition for root, and one partition for swap. Or, follow the example closely, and consider these guidelines to provide a frame of reference:<br />
* The root filesystem (/) in the example will contain the /usr directory, which can become moderately large, depending upon how much software is installed.<br />
<br />
* The /var filesystem will contain, among other data, the [[ABS]] tree and the pacman cache. Keeping cached packages is useful and versatile; it provides the ability to downgrade packages if needed. /var tends to grow in size; the pacman cache can grow large over long periods of time, but can be safely cleared if needed. 6-8 Gigs on a desktop system should therefore be sufficient for /var. Servers tend to have extremely large /var filesystems.<br />
* The /home filesystem is typically where user data, downloads, and multimedia reside. On a desktop system, /home is typically the largest filesystem on the drive by a large margin. <br />
* An extra 25% of space added to each filesystem will provide a cushion for unforeseen occurrence, expansion, and serve as a preventive against fragmentation.<br />
From the guidelines above, the example system shall contain a ~12GB root (/) partition, ~6GB /var, 1GB swap, and a /home containing the remaining disk space.<br />
<br />
=====cfdisk=====<br />
Start by creating the primary partition that will contain the '''root''', (/) filesystem. <br />
<br />
Choose '''N'''ew -> Primary and enter the desired size for root (/). Put the partition at the beginning of the disk. <br />
<br />
Also choose the '''T'''ype by designating it as '83 Linux'. The created / partition shall appear as sda1 in our example.<br />
<br />
Now create a primary partition for /var, designating it as '''T'''ype 83 Linux. The created /var partition shall appear as sda2 <br />
<br />
Next, create a partition for swap. Select an appropriate size and specify the '''T'''ype as 82 (Linux swap / Solaris). The created swap partition shall appear as sda3.<br />
<br />
Lastly, create a partition for your /home directory. Choose another primary partition and set the desired size.<br />
<br />
Likewise, select the '''T'''ype as 83 Linux. The created /home partition shall appear as sda4.<br />
<br />
Example:<br />
<br />
Name Flags Part Type FS Type [Label] Size (MB)<br />
-------------------------------------------------------------------------<br />
sda1 Primary Linux 12440 #root<br />
sda2 Primary Linux 6256 #/var<br />
sda3 Primary Linux swap / Solaris 1024 #swap<br />
sda4 Primary Linux 140480 #/home<br />
<br />
Choose '''W'''rite and type ''''yes''''. Beware that this operation may destroy data on your disk. Choose '''Q'''uit to leave the partitioner. <br />
Choose Done to leave this menu and continue with "Set Filesystem Mountpoints".<br />
<br />
{{Box Note | Since the latest developments of the Linux kernel which include the libata and PATA modules, all IDE, SATA and SCSI drives have adopted the sd''x'' naming scheme. This is perfectly normal and should not be a concern.}}<br />
<br />
====Set Filesystem Mountpoints====<br />
First you will be asked for your swap partition. Choose the appropriate partition (sda3 in this example). You will be asked if you want to create a swap filesystem; select yes. Next, choose where to mount the / (root) directory (sda1 in the example). At this time, you will be asked to specify the filesystem type.<br />
<br />
=====Filesystem Types=====<br />
<br />
Again, a filesystem type is a very subjective matter which comes down to personal preference. Each has its own advantages, disadvantages, and unique idiosyncrasies. Here is a very brief overview of supported filesystems:<br />
<br />
1. '''ext2''' ''Second Extended Filesystem''- Old, reliable GNU/Linux filesystem. Very stable, but ''without journaling support''. May be inconvenient for root (/) and /home, due to very long fsck's. ''An ext2 filesystem can easily be converted to ext3.'' Generally regarded as a good choice for /boot/.<br />
<br />
2. '''ext3''' ''Third Extended Filesystem''- Essentially the ext2 system, but with journaling support. ext3 is completely compatible with ext2. ''Extremely'' stable, mature, and by far the most widely used, supported and developed GNU/Linux FS.<br />
<br />
'''High Performance Filesystems:'''<br />
<br />
3. '''ReiserFS''' - Hans Reiser's high-performance journaling FS uses a very interesting method of data throughput based on an unconventional and creative algorithm. ReiserFS is touted as very fast, especially when dealing with many small files. ReiserFS is fast at formatting, yet comparatively slow at mounting. Quite mature and stable. ReiserFS is not actively developed at this time (Reiser4 is the new Reiser filesystem). Generally regarded as a good choice for /var/.<br />
<br />
4. '''JFS''' - IBM's '''J'''ournaled '''F'''ile'''S'''ystem- The first filesystem to offer journaling. JFS had many years of use in the IBM AIX® OS before being ported to Linux. JFS currently uses the least CPU resources of any GNU/Linux filesystem. Very fast at formatting, mounting and fsck's, and very good all-around performance, especially in conjunction with the deadline I/O scheduler. (See [[JFS]].) Not as widely supported as ext or ReiserFS, but very mature and stable.<br />
<br />
5. '''XFS''' - Another early journaling filesystem originally developed by Silicon Graphics for the IRIX OS and ported to Linux. XFS offers very fast throughput on large files and large filesystems. Very fast at formatting and mounting. Generally benchmarked as slower with many small files, in comparison to other filesystems. XFS is very mature and is currently the only available stable Linux FS with online defragmentation ability.<br />
<br />
===== A note on Journaling=====<br />
All above filesystems, except ext2, use [http://en.wikipedia.org/wiki/Journaling_file_system journaling]. Journaling file systems are fault-resilient file systems that use a journal to log changes before they're committed to the file system to avoid metadata corruption in the event of a crash. Note that not all journaling techniques are alike; specifically, only ext3 offers ''data-mode journaling'', (though, not by default), which journals ''both'' data ''and'' meta-data (but with significant speed penalty). The others only offer ''ordered-mode journaling'', which journals meta-data only. While all will return your filesystem to a valid state after recovering from a crash, ''data-mode journaling'' offers the greatest protection against file system corruption and data loss but can suffer from performance degradation, as all data is written twice (first to the journal, then to the disk). Depending on how important your data are, this may be a consideration in choosing your filesystem type.<br />
<br />
Choose and create the filesystem (format the partition) for / by selecting '''yes'''. You will now be prompted to add any additional partitions. In our example, sda2 and sda4 remain. For sda2, choose a filesystem type and mount it as /var. Finally, choose the filesystem type for sda4, and mount it as /home. Return to main menu.<br />
<br />
===Select Packages===<br />
<br />
*Core ISO: Choose CD as source and select the appropriate CD drive if you have more than one.<br />
*FTP ISO: Select an FTP/HTTP mirror. ''Note that archlinux.org is throttled to 50KB/s''.<br />
* 2008.06 installation media: Package category BASE is now installed by default.<br />
<br />
Package selection is split into two stages. First, you will select the base package category, then you will be presented will the full lists of packages, allowing you to fine-tune your selections. Use the space bar to select and unselect.<br />
<br />
Choose OK to continue and then choose 'yes' for 'Select all packages by default', for now.<br />
<br />
The next screen will present you with the selected packages within your selected categories. Leaving all selected is a safe choice for beginners, while more experienced users will wish to trim a few unnecessary packages. (For instance, an unneeded filesystem type utility, unneeded drivers, etc.)<br />
<br />
===Install Packages===<br />
Next, choose 'Install Packages'. You will be asked if you wish to keep the packages in the pacman cache. If you choose 'yes', you will have the flexibility to [[Downgrade packages|downgrade]] to previous package versions in the future, so this is recommended (you can always clear the cache in the future). The installer script will now install the selected packages, as well as the default Arch 2.6 kernel, to your system. <br />
*FTP ISO: The [[Pacman]] package manager will now download and install your selected packages. (See vc/5 for output, vc/1 to return to the installer)<br />
*CORE ISO: The packages will be installed from the CD.<br />
<br />
Note: For Arch 2007.08 FTP installation: after 'Install Packages' you have to upgrade pacman (<ALT>+F3, pacman -Sy pacman) and again 'Install Packages'.<br />
<br />
===Configure the System===<br />
''Closely following and understanding these steps is of key importance to ensure a properly configured system.'' <br />
<br />
At this stage of the installation, you will configure the primary configuration files of your Arch Linux base system.<br />
<br />
The installer will ask if you want to choose [[Hwdetect|hwdetect]] to gather information for your configuration. Beginners should choose 'yes'. <br />
<br />
Advanced users who are thoroughly familiar with their hardware, required modules, and who are able and willing to manually configure /etc/rc.conf, /etc/mkinitcpio, /etc/fstab, and other system-critical configuration files from scratch may wish to choose 'no'. (Needless to say, this option is very involved, beyond the scope of this guide, and therefore is not covered.)<br />
<br />
Next, you will be asked if you need support for booting from USB devices, FireWire devices, PCMCIA devices, NFS shares, software RAID arrays, LVM2 volumes, encrypted volumes, and DSDT support. Choose yes if you need it; in our example nothing is needed. <br />
<br />
Now you will be asked which text editor you want to use; choose [http://en.wikipedia.org/wiki/Nano_%28text_editor%29 nano] or, if you are familiar with it, [http://en.wikipedia.org/wiki/Vim_%28text_editor%29 vim]. You will be presented with a menu including the main configuration files for your system. <br />
<br />
{{Box Note | ''It is very important at this point to edit, or at the very least, to verify by opening, every configuration file.'' The installer script relies on your input to create these files on your installation. A common error is to skip over these critical steps of configuration.}}<br />
<br />
=====Can the installer handle this more automatically?=====<br />
Hiding the process of system configuration is in direct opposition to [[The Arch Way]]. While it is true that recent versions of the kernel and hardware probing tools offer excellent hardware support and auto-configuration, Arch presents the user all pertinent configuration files during installation for the purposes of ''transparency and system resource control''. By the time you have finished modifying these files to your specifications, you will have learned the simple method of manual Arch Linux system configuration and become more familiar with the base structure, leaving you better prepared to use and maintain your new installation productively.<br />
<br />
====='''/etc/rc.conf'''=====<br />
Arch Linux follows in the '''*BSD''' tradition of utilizing '''/etc/rc.conf''' as the principal location for system configuration. This one file contains a wide range of configuration information, principally used at system startup. As its name directly implies, it also contains settings for and invokes the /etc/rc* files, and is, of course, sourced ''by'' these files. /etc/rc.conf offers a simple, elegant method of streamlining system resource configuration by encompassing a wide range of control, readily accessible for the Arch user. <br />
* '''LOCALIZATION''' section<br />
** '''LOCALE'''=: This sets your system locale, which will be used by all i18n-aware applications and utilities. You can get a list of the available locales by running 'locale -a' from the command line. This setting's default is fine for US English users. <br />
** '''HARDWARECLOCK'''=: Specifies whether the hardware clock, which is synchronized on boot and on shutdown, stores '''UTC''' time, or the '''localtime'''. UTC makes sense because it greatly simplifies changing timezones and daylight savings time. localtime is necessary if you dual boot with an operating system such as Windows, that only stores localtime to the hardware clock.<br />
** '''TIMEZONE'''=: Specify your TIMEZONE. (All available zones are under /usr/share/zoneinfo/).<br />
** '''KEYMAP'''=: The available keymaps are in /usr/share/kbd/keymaps. Please note that this setting is only valid for your TTYs, not any graphical window managers or '''X'''.<br />
** '''CONSOLEFONT'''=: Available console fonts reside under /usr/share/kbd/consolefonts/ if you must change. The default (blank) is safe.<br />
** '''CONSOLEMAP'''=: Defines the console map to load with the setfont program at boot. Possible maps are found in /usr/share/kbd/consoletrans, if needed. The default (blank) is safe. <br />
** '''USECOLOR'''=: Select "yes" if you have a color monitor and wish to have colors in your consoles.<br />
<br />
LOCALE="en_US.utf8"<br />
HARDWARECLOCK="localtime"<br />
TIMEZONE="US/Eastern"<br />
KEYMAP="us"<br />
CONSOLEFONT=<br />
CONSOLEMAP=<br />
USECOLOR="yes"<br />
* '''HARDWARE''' section<br />
** '''MOD_AUTOLOAD'''=: Setting this to "yes" will use '''udev''' to automatically probe hardware and load the appropriate modules during boot-up, (convenient with the default modular kernel). Setting this to "no" will rely on the user's ability to specify this information manually, or compile their own custom kernel and modules, etc. <br />
** '''MOD_BLACKLIST'''=: This has become deprecated in favor of adding blacklisted modules directly to the '''MODULES=''' line below. <br />
** '''MODULES'''=: Specify additional MODULES if you know that an important module is missing, ('''hwdetect''' should have filled in the most important modules). Also specify any blacklisted modules by prefixing them with a bang (!). Udev will be forced NOT to load blacklisted modules. In the example, the IPv6 module as well as the annoying pcspeaker are blacklisted. <br />
# Scan hardware and load required modules at boot<br />
MOD_AUTOLOAD="yes"<br />
# Module Blacklist - Deprecated<br />
MOD_BLACKLIST=()<br />
#<br />
MODULES=(e100 eepro100 mii slhc snd-ac97-codec snd-intel8x0 soundcore !net-pf-10 !pcspkr)<br />
* '''NETWORKING''' section<br />
** '''HOSTNAME'''=:Set your HOSTNAME to your liking.<br />
** '''eth0'''=: 'Ethernet, card 0'. Adjust the interface IP address, netmask and broadcast address ''if'' you are using '''static IP'''. Set eth0="dhcp" if you want to use '''DHCP'''<br />
** '''INTERFACES'''=: Specify any/all interfaces here. If you do not use DHCP to configure a device, just keep in mind that the value of the variable (whose name must be equal to the name of the device which is supposed to be configured) equals the line which would be appended to the ifconfig command if you were to configure the device manually in the shell.<br />
** '''gateway'''=: If you are using '''static IP''', set the gateway address. If using '''DHCP''', you can usually ignore this variable, though some users have reported the need to define it.<br />
** '''ROUTES'''=: If you are using static '''IP''', remove the '''!''' in front of 'gateway'. If using '''DHCP''', you can usually leave this variable commented out with the bang (!), but again, some users require the gateway and ROUTES defined. If you experience networking issues with pacman, for instance, you may want to return to these variables. <br />
<br />
Example, using '''DHCP''':<br />
HOSTNAME="arch"<br />
#eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255" <br />
eth0="dhcp"<br />
INTERFACES=(eth0)<br />
gateway="default gw 192.168.0.1"<br />
ROUTES=(!gateway)<br />
{{Box Note | Arch uses the '''dhcpcd''' DHCP client. Alternatively, '''dhclient''' is available from the [extra] repository via pacman.}}<br />
* '''DAEMONS''' section<br />
This array simply lists the names of those scripts contained in /etc/rc.d/ which are to be started during the boot process, and the order in which they start. <br />
DAEMONS=(@network syslog-ng netfs crond)<br />
*If a script name is prefixed with a bang (!), it is not executed. <br />
*If a script is prefixed with an "at" symbol (@), then it will be executed in the background; the startup sequence will not wait for successful completion of each daemon before continuing to the next. (Useful for speeding up system boot).<br />
*Edit this array whenever new system services are installed, if starting them automatically during boot is desired. <br />
<br />
This 'BSD-style' init, is the Arch way of handling what others handle with various symlinks to an /etc/init.d directory.<br />
<br />
=====About DAEMONS=====<br />
You do not have to change the [[daemons]] line at this time, but it is useful to explain what daemons are, because we need them later in this guide. <br />
A ''daemon'' is a program that runs in the background, waiting for events to occur and offering services. A good example is a webserver that waits for a request to deliver a page or an SSH server waiting for someone trying to log in. While these are full-featured applications, there are daemons whose work is not that visible. Examples are a daemon which writes messages into a log file (e.g. syslog, metalog), a daemon which lowers your CPU's frequency if your system has nothing to do (e.g.:cpufreq), and a daemon which offers you a graphical login (e.g.: gdm, kdm). All these programs can be added to the daemons line and will be started when the system boots. Useful daemons will be presented during this guide.<br />
<br />
Historically, the term ''daemon'' was coined by the programmers of MIT's Project MAC. They took the name from ''Maxwell's demon'', an imaginary being from a famous thought experiment that constantly works in the background, sorting molecules. <code>UNIX</code> systems inherited this terminology and created the backronym '''d'''isk '''a'''nd '''e'''xecution '''mon'''itor. <br />
<br />
*<font color="blue">'''Tip:</font> All Arch daemons reside under /etc/rc.d/'''<br />
<br />
=====/etc/fstab=====<br />
The '''fstab''' (for '''f'''ile '''s'''ystems '''tab'''le) is part of the system configuration listing all available disks and disk partitions, and indicating how they are to be initialized or otherwise integrated into the overall system's filesystem. The '''/etc/fstab''' file is most commonly used by the '''mount''' command. The mount command takes a filesystem on a device, and adds it to the main system heirarchy that you see when you use your system. '''mount -a''' is called from /etc/rc.sysinit, about 3/4 of the way through the boot process, and reads /etc/fstab to determine which options should be used when mounting the specified devices therein. If '''noauto''' is appended to a filesystem in /etc/fstab, '''mount -a''' will not mount it at boot.<br />
<br />
An example '''/etc/fstab''':<br />
# <file system> <dir> <type> <options> <dump> <pass><br />
none /dev/pts devpts defaults 0 0<br />
none /dev/shm tmpfs defaults 0 0<br />
#/dev/cdrom /media/cdrom auto ro,user,noauto,unhide 0 0<br />
#/dev/dvd /media/dvd auto ro,user,noauto,unhide 0 0<br />
#/dev/fd0 /media/fl auto user,noauto 0 0<br />
/dev/disk/by-uuid/0ec-933.. / jfs defaults,noatime,nodiratime 0 1<br />
/dev/disk/by-uuid/7ef-223.. /home jfs defaults,noatime,nodiratime 0 2<br />
/dev/disk/by-uuid/530-1e-.. swap swap defaults 0 0<br />
/dev/disk/by-uuid/4fe-110.. /var reiserfs defaults,noatime,notail 0 2 <br />
{{Box Note | '''''The 'noatime' and 'nodiratime' options may safely be appended to / and /home regardless of your specified filesystem type for increased speed, performance, and power efficiency, for laptops as well as desktops. 'notail' disables the ReiserFS tailpacking feature, for added performance at the cost of slightly less efficient disk usage.'''''}}<br />
<br />
* The first field, '''<file system>''', describes the block device or remote filesystem to be mounted. For regular mounts, this field will contain a link to a block device node (as created by mknod which is called by udev at boot) for the device to be mounted; for instance, '/dev/cdrom' or '/dev/sda1'. Instead of giving the device explicitly, the Arch installer indicates the filesystem that is to be mounted by its UUID by default.<br />
{{Box Note | As of 2008-04rc, Arch is now utilizing the UUID, or Universally Unique Identifier naming convention, for consistent device mapping. This is due to active developments in the kernel and also udev, which may randomly change the ordering in which drivers for storage controllers are loaded, yielding an unbootable system/kernel panic. Nearly every motherboard has several controllers (onboard SATA, onboard IDE), and due to the aforementioned development updates, /dev/sda may become /dev/sdb on the next reboot- hence the persistent device naming convention of UUID has been adopted for reliability. ''If you do not need nor wish to use UUID, simply change your fstab to use whatever naming convention desired.'' (See [[Persistent block device naming| this wiki article]] for more information on persistent block device naming. )}}<br />
ls -lF /dev/disk/by-uuid/<br />
Will list all partitions by uuid.<br />
<br />
* The second field, '''<dir>''', describes the mount point for the filesystem. For swap partitions, this field should be specified as 'swap'; (Swap partitions are not actually mounted.)<br />
<br />
* The third field, '''<type>''', describes the type of the filesystem. The Linux kernel supports many filesystem types. (For the filesystems currently supported by the running kernel, see /proc/filesystems). An entry 'swap' denotes a file or partition to be used for swapping. An entry 'ignore' causes the line to be ignored. This is useful to show disk partitions which are currently unused. <br />
<br />
* The fourth field, '''<options>''', describes the mount options associated with the filesystem. It is formatted as a comma separated list of options. It contains at least the type of mount plus any additional options appropriate to the filesystem type. For documentation on the available options for non-nfs file systems, see mount(8).<br />
<br />
* The fifth field, '''<dump>''', is used for these filesystems by the dump(8) command to determine which filesystems need to be dumped. dump is a backup utility. If the fifth field is not present, a value of zero is returned and dump will assume that the filesystem does not need to be backed up. ''Note that dump is not installed by default.''<br />
<br />
* The sixth field, '''<pass>''', is used by the fsck(8) program to determine the order in which filesystem checks are done at boot time. The root filesystem should be specified with a <pass> of 1, and other filesystems should have a <pass> of 2 or 0. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to use parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked. <br />
<br />
*If you plan on using '''hal''' to automount media such as DVDs, you may wish to comment out the cdrom and dvd entries in preparation for '''hal''', which will be installed later in this guide.<br />
<br />
<br />
<br />
Expanded information available in the [[Fstab]] wiki entry.<br />
<br />
====='''[[Configuring mkinitcpio | /etc/mkinitcpio]].conf'''=====<br />
Editing this configuration is unnecessary at this point; this information is provided for explanation. <br />
<br />
This file allows you to fine-tune the initial ram filesystem (also commonly referred to as the initial ramdisk or "initrd") for your system. The initrd is a gzipped image that is read by the kernel during boot. The purpose of the initrd is to bootstrap the system to the point where it can access the root filesystem. This means it has to load any modules that are required for devices like IDE, SCSI, or SATA drives (or USB/FW, if you are booting off a USB/FW drive). Once the initrd loads the proper modules, either manually or through udev, it passes control to the Arch system and your boot continues. For this reason, the initrd only needs to contain the modules necessary to access the root filesystem. It does not need to contain every module you would ever want to use. The majority of your everyday modules will be loaded later on by udev, during the init process.<br />
<br />
'''mkinitcpio''' is the next generation of '''initramfs creation'''. It has many advantages over the old '''mkinitrd''' and '''mkinitramfs''' scripts.<br />
<br />
* It uses '''klibc''' and '''kinit''' which are developed by Linux kernel devs to provide a small and lightweight base for early userspace.<br />
* It can use '''udev''' for hardware autodetection at runtime, thus prevents you from having tons of unnecessary modules loaded.<br />
* Its hook-based init script is easily extendable with custom hooks, which can easily be included in pacman packages without having to modifiy mkinitcpio itself.<br />
* It already supports '''lvm2''', '''dm-crypt''' for both legacy and luks volumes, '''raid''', '''swsusp''' and '''suspend2''' resuming and booting from '''usb mass storage''' devices.<br />
* Many features can be configured from the kernel command line without having to rebuild the image.<br />
* The '''mkinitcpio''' script makes it possible to include the image in a kernel, thus making a self-contained kernel image is possible.<br />
* Its flexibility makes recompiling a kernel unnecessary in many cases. <br />
'''mkinitcpio''' was developed by Aaron Griffin and Tobias Powalowski with some help from the community.<br />
<br />
===== /etc/modprobe.conf=====<br />
It is unnecessary to configure this file at this time.<br />
<br />
* '''modprobe.conf''' can be used to set special configuration options for the kernel modules<br />
<br />
=====/etc/resolv.conf (for Static IP)=====<br />
The ''resolver'' is a set of routines in the C library that provide access to the Internet Domain Name System (DNS). One of the main functions of DNS is to translate domain names into IP addresses, to make the Web a friendlier place. The resolver configuration file, or /etc/resolv.conf, contains information that is read by the resolver routines the first time they are invoked by a process.<br />
<br />
*''If you are using DHCP, you may safely ignore this file, as by default, it will be dynamically created and destroyed by the dhcpcd daemon. You may change this default behavior if you wish. (See [http://wiki.archlinux.org/index.php/Network#For_DHCP_IP Network]]).''<br />
<br />
If you use a static IP, set your DNS servers in /etc/resolv.conf (nameserver <ip-address>). You may have as many as you wish.<br />
An example, using OpenDNS:<br />
nameserver 208.67.222.222<br />
nameserver 208.67.220.220<br />
<br />
If you are using a router, you will probably want to specify your DNS servers in the router itself, and merely point to it from your '''/etc/resolv.conf''', using your router's IP (which is also your gateway from '''/etc/rc.conf'''), e.g.:<br />
nameserver 192.168.1.1<br />
<br />
If using '''DHCP''', you may also specify your DNS servers in the router, or allow automatic assignment from your ISP, if your ISP is so equipped.<br />
<br />
=====/etc/hosts=====<br />
<br />
This file associates IP addresses with hostnames and aliases, one line per IP address. For each host a single line should be present with the following information:<br />
<IP-address> <hostname> [aliases...]<br />
Add your ''hostname'', coinciding with the one specified in /etc/rc.conf, as an alias, so that it looks like this:<br />
127.0.0.1 localhost.localdomain localhost '''''yourhostname'''''<br />
{{Box Note |''This format, '''including the 'localhost' and your actual host name''', is required for program compatibility! Errors in this entry may cause poor network performance and/or certain programs to open very slowly, or not work at all. This is a very common error for beginners.''}}<br />
<br />
If you use a static IP, add another line using the syntax: <static-IP> <hostname.domainname.org> <hostname> e.g.:<br />
192.168.1.100 '''''yourhostname'''''.domain.org '''''yourhostname'''''<br />
<br />
*<font color="blue">'''TIP''':</font> For convenience, you may also use /etc/hosts aliases for hosts on your network, and/or on the Web, e.g.:<br />
64.233.169.103 www.google.com g<br />
192.168.1.90 media<br />
192.168.1.88 data<br />
The above example would allow you to access google simply by typing 'g' into your browser, and access to a media and data server on your network by name and without the need for typing out their respective IP addresses.<br />
<br />
=====/etc/hosts.deny and /etc/hosts.allow=====<br />
Modify these configurations according to your needs if you plan on using the [[SSH|ssh]] daemon. The default configuration will reject all incoming connections, not only ssh connections. Edit your '''/etc/hosts.allow '''file and add the appropriate parameters: <br />
<br />
* let everyone connect to you<br />
sshd: ALL<br />
<br />
* restrict it to a certain ip<br />
sshd: 192.168.0.1<br />
<br />
* OR restrict for an IP range<br />
sshd: 10.0.0.0/255.255.255.0<br />
<br />
If you do not plan on using the [[SSH|ssh]] daemon, leave this file at the default, (empty), for added security.<br />
<br />
=====/etc/locale.gen=====<br />
<br />
The '''/usr/sbin/locale-gen''' command reads from '''/etc/locale.gen''' to generate specific locales. They can then be used by '''glibc''' and any other locale-aware program or library for rendering "peculiar" text, correctly displaying regional monetary values, time and date formats, alphabetic idiosyncrasies, and other locale-specific standards. The ability to setup a default locale is a great built-in privilege of using a <code>UNIX</code>-like operating system.<br />
<br />
By default /etc/locale.gen is an empty file with commented documentation. Once edited, the file remains untouched. '''locale-gen''' runs on every '''glibc''' upgrade, generating all the locales specified in /etc/locale.gen.<br />
<br />
Choose the locale(s) you need (remove the # in front of the lines you want), e.g.:<br />
en_US ISO-8859-1<br />
en_US.UTF-8 <br />
<br />
The installer will now run the locale-gen script, which will generate the locales you specified. You may change your locale in the future by editing /etc/locale.gen and subsequently running 'locale-gen' as root.<br />
<br />
{{Box Note |'''''If you fail to choose your locale, this will lead to a "The current locale is invalid..." error. This is perhaps the most common mistake by new Arch users, and also leads to the most commonly asked questions on the forum.'''''}}<br />
<br />
=====Root password=====<br />
Finally, set a root password and make sure that you remember it later. Return to the main menu and continue with installing bootloader.<br />
<br />
=====Pacman-Mirror=====<br />
Choose a mirror repository for '''pacman'''. <br />
*''archlinux.org is throttled, limiting downloads to 50KB/s'' <br />
<br />
Return to the main menu.<br />
<br />
===Install Bootloader===<br />
Because we have no secondary operating system in our example, we will need a bootloader. [http://www.gnu.org/software/grub/ GNU GRUB] is the recommended bootloader. Alternatively, you may choose [http://lilo.go.dyndns.org/ LILO]. <br />
====GRUB====<br />
The provided '''GRUB''' configuration ('''/boot/grub/menu.lst''') should be sufficient, but verify its contents to ensure accuracy. You may want to alter the resolution of the console by adding a vga=<number> kernel argument corresponding to your desired virtual console resolution. (A table of resolutions and the corresponding numbers is printed in the menu.lst.)<br />
<br />
Example: <br />
title Arch Linux (Main)<br />
root (hd0,0) <br />
kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/0ec1-9339.. ro vga=773<br />
initrd /boot/kernel26.img<br />
{{Box Note | ''The linux kernel, 'vmlinuz', is so named because it incorporated '''v'''irtual '''m'''emory capability early in its development. The '''z''' denotes a zipped (compressed) image.''}}<br />
<br />
Explanation:<br />
<br />
Line 1: '''title''': A printed menu selection. "Arch Linux (Main)" will be printed on the screen as a menu selection.<br />
<br />
Line 2: '''root''': '''GRUB''''s root; the drive and partition where the kernel (/boot) resides, according to system BIOS. (More accurately, where GRUB's stage2 file resides). '''NOT necessarily the root''' (/) file system, as they can reside on separate partitions. GRUB's numbering scheme starts at 0, and uses an hd''x,x'' format regardless of IDE or SATA, and enclosed within parentheses. <br />
<br />
The example indicates that /boot is on the first partition of the first drive, according to BIOS, or, (hd0,0).<br />
<br />
Line 3: '''kernel''': This line specifies:<br />
<br />
* The path and filename of the kernel '''''relative to GRUB's root'''''.<br />
In the example, /boot is merely a directory residing on the same partition as / and '''vmlinuz26''' is the kernel filename; '''/boot/vmlinuz26'''. ''If /boot were on a separate partition, the path and filename would be simply '''/vmlinuz26''', being relative to '''GRUB''''s root.'' <br />
<br />
* The root= argument to the kernel statement specifies the partition containing the root (/) directory in the booted system, (more accurately, the partition containing '''/sbin/init'''), ''according to the UUID numbering scheme'' as of 2008-04rc, which uses the /dev/disk/by-uuid/xxxx-xxxx-xxxx format. <br />
<br />
*An easy way to distinguish the 2 appearances of 'root' in /boot/grub/menu.lst is to remember that the first root statement ''informs GRUB where the kernel resides'', whereas the second root= kernel argument ''tells the kernel where the root filesystem (/) resides''.<br />
<br />
* Kernel options. <br />
<br />
In our example, '''ro''' mounts the filesystem as read only during startup, and the '''"vga=773"''' argument will give a 1024x768 framebuffer with 256 color depth.<br />
<br />
Line 4: '''initrd''': (For Initial RAM disk) The path and filename of the initial RAM filesystem '''relative to GRUB''''s root. Again, in the example, /boot is merely a directory residing on the same partition as / and '''kernel26.img''' is the initrd filename; '''/boot/kernel26.img'''. ''If /boot were on a separate partition, the path and filename would be simply '''/kernel26.img''', being relative to '''GRUB''''s root.'' <br />
<br />
Install the '''GRUB''' bootloader to the master boot record, (sda in our example).<br />
<br />
===Reboot===<br />
<br />
That's it; You have configured and installed your Arch Linux base system. Exit the install, and reboot:<br />
<br />
# reboot<br />
(Be sure to remove the installer CD)<br />
<br />
Your new Arch Linux system will boot up and finish with a login prompt (you may want to change the boot order in your '''BIOS''' back to booting from hard disk).<br />
<br />
'''Congratulations, and welcome to your shiny, new Arch Linux base system!'''<br />
<br />
Your new Arch Linux base system is now a functional GNU/Linux environment ready for customization. From here, you may build this elegant set of tools into whatever you wish or require for your purposes. <br />
<br />
Login with the root account. We will configure pacman and update the system as root, then add a normal user. <br />
{{Box Note |Virtual consoles 1-6 are available.}}<br />
<br />
===Configuring the network (if necessary)===<br />
*''This section will assist you in configuring most types of networks, if your network configuration is not working for you.''<br />
<br />
If you properly configured your system, you should have a working network. Try to ping www.google.com to verify this.<br />
# ping -c 3 www.google.com<br />
<br />
''If you have successfully established a network connection, continue with '''[[#Update, Sync and Upgrade the system with pacman|Update, Sync and Upgrade the system with pacman]]'''.''<br />
<br />
If, after trying to ping www.google.com, you get an "unknown host" error, you may conclude that your network is not properly configured. You may choose to double-check the following files for integrity and proper settings:<br />
<br />
'''/etc/rc.conf''' # Specifically, check your HOSTNAME= and NETWORKING section for typos and errors.<br />
<br />
'''/etc/hosts''' # Double-check your format. (See above.)<br />
<br />
'''/etc/resolv.conf''' # If you are using a static IP. If you are using DHCP, this file will be dynamically created and destroyed by default, but can be changed to your preference. (See [[Network]].)<br />
<br />
Advanced instructions for configuring the network can be found in the [[Network]] article.<br />
<br />
====Wired LAN====<br />
<br />
Check your Ethernet with<br />
# ifconfig -a<br />
All interfaces will be listed. You should see an entry for eth0, or perhaps eth1. <br />
*'''Static IP'''<br />
<br />
If required, you can set a new static IP with:<br />
# ifconfig eth0 <ip address> netmask <netmask> up <br />
and the default gateway with<br />
# route add default gw <ip address of the gateway><br />
Verify that /etc/resolv.conf contains your DNS server and add it if it is missing. <br />
Check your network again with ping www.google.com. If everything is working now, adjust /etc/rc.conf as described above for static IP. <br />
*'''DHCP'''<br />
If you have a DHCP server/router in your network try:<br />
# dhcpcd eth0<br />
If this is working, adjust /etc/rc.conf as described above, for dynamic IP.<br />
<br />
====Wireless LAN====<br />
Detailed setup guide: [[Wireless Setup]]<br />
<br />
====Analog Modem====<br />
To be able to use a Hayes-compatible, external, analog modem, you need to at least have the ppp package installed. Modify the file /etc/ppp/options to suit your needs and according to man pppd. You will need to define a chat script to supply your username and password to the ISP after the initial connection has been established. The manpages for pppd and chat have examples in them that should suffice to get a connection up and running if you're either experienced or stubborn enough. With udev, your serial ports usually are /dev/tts/0 and /dev/tts/1.<br />
Tip: Read [[Dialup without a dialer HOWTO]].<br />
<br />
Instead of fighting a glorious battle with the plain pppd, you may opt to install wvdial or a similar tool to ease the setup process considerably. In case you're using a so-called WinModem, which is basically a PCI plugin card working as an internal analog modem, you should indulge in the vast information found on the [http://www.linmodems.org/ LinModem] homepage.<br />
<br />
====ISDN====<br />
<br />
Setting up ISDN is done in three steps:<br />
# Install and configure hardware<br />
# Install and configure the ISDN utilities<br />
# Add settings for your ISP <br />
<br />
The current Arch stock kernels include the necessary ISDN modules, meaning that you will not need to recompile your kernel unless you're about to use rather odd ISDN hardware. After physically installing your ISDN card in your machine or plugging in your USB ISDN-Box, you can try loading the modules with modprobe. Nearly all passive ISDN PCI cards are handled by the hisax module, which needs two parameters: type and protocol. You must set protocol to '1' if your country uses the 1TR6 standard, '2' if it uses EuroISDN (EDSS1), '3' if you're hooked to a so-called leased-line without D-channel, and '4' for US NI1.<br />
<br />
Details on all those settings and how to set them is included in the kernel documentation, more specifically in the isdn subdirectory, and available online. The type parameter depends on your card; a list of all possible types can be found in the README.HiSax kernel documentation. Choose your card and load the module with the appropriate options like this:<br />
<br />
# modprobe hisax type=18 protocol=2<br />
<br />
This will load the hisax module for my ELSA Quickstep 1000PCI, being used in Germany with the EDSS1 protocol. You should find helpful debugging output in your /var/log/everything.log file, in which you should see your card being prepared for action. Please note that you will probably need to load some USB modules before you can work with an external USB ISDN Adapter.<br />
<br />
Once you have confirmed that your card works with certain settings, you can add the module options to your /etc/modprobe.conf:<br />
<br />
alias ippp0 hisax<br />
options hisax type=18 protocol=2<br />
<br />
Alternatively, you can add only the options line here, and add hisax to your MODULES array in the rc.conf. It's your choice, really, but this example has the advantage that the module will not be loaded until it's really needed.<br />
<br />
That being done, you should have working, supported hardware. Now you need the basic utilities to actually use it!<br />
<br />
Install the isdn4k-utils package, and read the manpage to isdnctrl; it'll get you started. Further down in the manpage you will find explanations on how to create a configuration file that can be parsed by isdnctrl, as well as some helpful setup examples. Please note that you have to add your SPID to your MSN setting separated by a colon if you use US NI1.<br />
<br />
After you have configured your ISDN card with the isdnctrl utility, you should be able to dial into the machine you specified with the PHONE_OUT parameter, but fail the username and password authentication. To make this work add your username and password to /etc/ppp/pap-secrets or /etc/ppp/chap-secrets as if you were configuring a normal analogous PPP link, depending on which protocol your ISP uses for authentication. If in doubt, put your data into both files.<br />
<br />
If you set up everything correctly, you should now be able to establish a dial-up connection with<br />
# isdnctrl dial ippp0<br />
as root. If you have any problems, remember to check the logfiles!<br />
<br />
====DSL (PPPoE)====<br />
<br />
These instructions are relevant to you only if your PC itself is supposed to manage the connection to your ISP. You do not need to do anything but define a correct default gateway if you are using a separate router of some sort to do the grunt work.<br />
<br />
Before you can use your DSL online connection, you will have to physically install the network card that is supposed to be connected to the DSL-Modem into your computer. After adding your newly installed network card to the modules.conf/modprobe.conf or the MODULES array, you should install the rp-pppoe package and run the pppoe-setup script to configure your connection. After you have entered all the data, you can connect and disconnect your line with<br />
<br />
# /etc/rc.d/adsl start<br />
<br />
and<br />
<br />
# /etc/rc.d/adsl stop<br />
<br />
respectively. The setup usually is rather easy and straightforward, but feel free to read the manpages for hints. If you want to automatically 'dial in' on boot-up, add adsl to your DAEMONS array.<br />
<br />
===Update, Sync and Upgrade the system with [[pacman]]===<br />
Now we will update the system using [[pacman]]. <br />
<br />
====What is pacman ?====<br />
[[Pacman]] is the '''pac'''kage '''man'''ager of Arch Linux. Pacman is written in ''C'' and is designed from the ground up to be lightweight with a very modest memory footprint, fast, simple, and versatile. It manages your entire package system and handles installation, removal, package downgrade (through cache), custom compiled package handling, automatic dependency resolution, remote and local searches and much more. Arch uses the .tar.gz package format, which further enhances pacman's speed; Gzipped tarballs, though slightly larger, are decompressed many times faster than their Bzipped counterparts, and are therefore installed much more expediently. <br />
<br />
We will use pacman to download software packages from remote repositories and install them onto your system.<br />
<br />
Pacman is the most important tool in your Arch Linux toolbox for building the base system into whatsoever you please.<br />
<br />
====Configuring pacman====<br />
<br />
=====Package Repositories and /etc/pacman.conf=====<br />
Arch currently offers the following 4 repositories readily accessible through pacman:<br />
<br />
'''[core]'''<br />
<br />
The simple principle behind [core] is to provide only one of each necessary tool for a base Arch Linux system; The GNU toolchain, the Linux kernel, one editor, one command line browser, etc. (There are a few exceptions to this. For instance, both vi and nano are provided, allowing the user to choose one or both.) It contains all the packages that MUST be in perfect working order to make sure your system continues to run. These are the absolute system-critical packages. Developer maintained.<br />
<br />
*''The Core installation media simply contains an installer script, and a snapshot of the core repository at the time of release.''<br />
<br />
'''[extra]'''<br />
<br />
The [extra] repository contains all Arch packages that are not themselves necessary for a base Arch system, but contribute to a more full-featured environment. '''X''', KDE, and Apache, for instance, can be found here. Developer maintained.<br />
<br />
'''[testing]'''<br />
<br />
The [testing] repository contains packages that are candidates for the [core] or [extra] repositories. New packages go into [testing] if:<br />
* they are expected to break something on update and need to be tested first<br />
* they require other packages to be rebuilt. In this case, all packages that need to be rebuilt are put into [testing] first and when all rebuilds are done, they are moved back to the other repositories. Developer maintained.<br />
<br />
[testing] is the only repository that can have name collisions with any of the other official repositories. If enabled, [testing] must be the first repo listed in your ''pacman.conf'' file.<br />
<br />
<font color="red">'''WARNING''': '''''Your system may break after you update with [testing] enabled. Only experienced users should use it.'''''</font><br />
<br />
'''[community]'''<br />
<br />
The [community] repository is maintained by the ''Trusted Users (TUs)'' and is part of the ''Arch User Repository ([[AUR]])''. It contains binary packages from the ''AUR'' that have enough votes and were adopted by a ''TU''. Like all repos listed above, [community] may be readily accessed by pacman.<br />
<br />
The '''[[AUR]]''' also contains the '''unsupported''' branch, which cannot be accessed directly by pacman*. [unsupported] contains more than eight thousand PKGBUILD scripts for building packages from source, that may be unavailable through the other repos. <br />
<br />
<nowiki>*</nowiki> '''''[[AUR Helpers]]''''' can help you seamlessly access AUR.<br />
<br />
'''/etc/pacman.conf'''<br />
<br />
pacman will attempt to read /etc/pacman.conf each time it is invoked. This configuration file is divided into sections, or repositories. Each section defines a package [[Official Repositories|repository]] that pacman can use when searching for packages. The exception to this is the options section, which defines global options.<br />
# nano /etc/pacman.conf<br />
Example:<br />
#<br />
# /etc/pacman.conf<br />
#<br />
# See the pacman.conf(5) manpage for option and repository directives<br />
<br />
#<br />
# GENERAL OPTIONS<br />
#<br />
[options]<br />
# The following paths are commented out with their default values listed.<br />
# If you wish to use different paths, uncomment and update the paths.<br />
#RootDir = /<br />
#DBPath = /var/lib/pacman/<br />
#CacheDir = /var/cache/pacman/pkg/<br />
#LogFile = /var/log/pacman.log<br />
HoldPkg = pacman glibc<br />
# If upgrades are available for these packages they will be asked for first<br />
SyncFirst = pacman<br />
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u<br />
#XferCommand = /usr/bin/curl %u > %o<br />
<br />
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup<br />
#IgnorePkg =<br />
#IgnoreGroup =<br />
<br />
#NoUpgrade =<br />
#NoExtract =<br />
<br />
# Misc options (all disabled by default)<br />
#NoPassiveFtp<br />
#UseSyslog<br />
#ShowSize<br />
#UseDelta<br />
#TotalDownload<br />
<br />
#<br />
# REPOSITORIES<br />
# - can be defined here or included from another file<br />
# - pacman will search repositories in the order defined here<br />
# - local/custom mirrors can be added here or in separate files<br />
# - repositories listed first will take precedence when packages<br />
# have identical names, regardless of version number<br />
# - URLs will have $repo replaced by the name of the current repo<br />
#<br />
# Repository entries are of the format:<br />
# [repo-name]<br />
# Server = ServerName<br />
# Include = IncludePath<br />
#<br />
# The header [repo-name] is crucial - it must be present and<br />
# uncommented to enable the repo.<br />
# <br />
<br />
# Testing is disabled by default. To enable, uncomment the following<br />
# two lines. You can add preferred servers immediately after the header,<br />
# and they will be used before the default mirrors.<br />
#[testing]<br />
#Include = /etc/pacman.d/mirrorlist<br />
<br />
[core]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
[extra]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist <br />
<br />
[community]<br />
# Add your preferred servers here, they will be used first<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
# An example of a custom package repository. See the pacman manpage for<br />
# tips on creating your own repositories.<br />
#[custom]<br />
#Server = file:///home/custompkgs<br />
<br />
Enable all desired repositories (remove the # in front of the 'Include =' and '[repository]' lines).<br />
<br />
<br />
*'''''When choosing repos, be sure to uncomment both the repository header lines in [brackets] as well as the 'Include =' lines. Failure to do so will result in the selected repository being omitted! This is a very common error.'' '''<br />
<br />
=====/etc/pacman.d/mirrorlist=====<br />
Faster mirrors will dramatically improve pacman performance, and your overall Arch Linux experience.<br />
<br />
Edit /etc/pacman.d/mirrorlist:<br />
# nano /etc/pacman.d/mirrorlist<br />
Remove all mirrors which are not on your continent, or are extremely distant. (Using nano, you may use CTRL-K to cut each unneeded line.) <br />
<br />
Edit /etc/pacman.d/mirrorlist by placing the best mirror at the top of the list. (Recall that archlinux.org is throttled to 50KB/s). If using nano, you can cut a line with CTRL-K and paste with CTRL-U. <br />
<br />
After changing mirrors, issue the following command:<br />
# pacman -Syy<br />
Passing two --refresh or -y flags forces a refresh of all package lists even if they are considered by pacman to be up to date. Issuing pacman -Syy ''whenever a mirror is changed'', is good practice and will avoid possible headaches.<br />
<br />
=====Ignoring packages=====<br />
When you execute the command "pacman -Syu", your entire system will be updated. It is possible that you want to prevent a package from being upgraded. An example could be the kernel (kernel26) or a package for which an upgrade may prove problematic for your system. In this case, you have two options; indicate the packages you want to skip in the pacman command line using the --ignore switch (do pacman -S --help for details) or permanently indicate the packages you want to skip in your /etc/pacman.conf file:<br />
<br />
IgnorePkg = kernel26<br />
The typical way to use Arch is to use pacman to install all packages unless there is no package available, in which case you can build your own package using [[ABS]]. Many user-contributed package build scripts are also available in the [[AUR]]. <br />
<br />
You are expected to keep your system up to date with pacman -Syu, rather than selectively upgrading packages. You may diverge from this typical usage as you wish; just be warned that there is a greater chance that things will not work as intended and that it could break your system. The majority of complaints happen when selective upgrading, unusual compilation or improper software installation is performed. Use of '''IgnorePkg''' in /etc/pacman.conf is therefore discouraged, and should only be used sparingly, if you know what you are doing.<br />
<br />
=====Ignoring Configuration Files=====<br />
In the same vein, you can also "protect" your configuration/system files from being overwritten during "pacman -Su" using the following option in your /etc/pacman.conf<br />
<br />
NoUpgrade = etc/lilo.conf boot/grub/menu.lst<br />
<br />
===Update System===<br />
Sync, refresh, and '''upgrade''' your entire new system with:<br />
# pacman -Syu<br />
pacman will now download a fresh copy of the master package list from the server(s) defined in pacman.conf(5) and perform all available upgrades. (You may be prompted to upgrade pacman itself at this point. If so, say yes, and then reissue the pacman -Syu command when finished.) <br />
Reboot if a kernel upgrade has occurred. <br />
{{Box Note|'''''Occasionally, configuration changes may take place requiring user action during an update; read pacman's output for any pertinent information.'''''}}<br />
If the messages go by too fast to read, you can look at them later at /var/log/pacman.log.<br />
<br />
=====The beauty of the Arch rolling release model=====<br />
Keep in mind that Arch is a '''rolling release''' distribution. This means there is never a reason to reinstall or perform elaborate system rebuilds to upgrade to the newest version. Simply issuing '''pacman -Syu''' periodically keeps your entire system up-to-date and on the bleeding edge. At the end of this upgrade, your system is completely current. <br />
Reboot if a kernel upgrade has occurred.<br />
<br />
====Get familiar with pacman====<br />
Pacman is the Arch user's best friend. It is highly recommended to study and learn how to use the pacman(8) tool. Try:<br />
man pacman<br />
Check out the bottom of this article, and look up the [[pacman]] wiki entries at your leisure.<br />
<br />
===Add a user and setup groups===<br />
<code>UNIX</code> is a multi-user environment. You should not do your everyday work using the root account. It is more than poor practice; it is dangerous. Root is for administrative tasks. Instead, add a normal, non-root user account using the <code>/usr/sbin/useradd</code> program:<br />
# useradd -m -G [groups] -s [login_shell] [username] <br />
* '''-m''' Creates user home directory as /home/'''username'''. Within their home directory, a user can write files, delete them, install programs, etc. Users' home directories shall contain their data and personal configuration files, the so-called 'dot files' (their name is preceded by a dot), which are 'hidden'. (To view dotfiles, enable the appropriate option in your file manager or run ls with the -a switch.) If there is a conflict between ''user'' (under /home/username) and ''global'' configuration files, (usually under /etc/) the settings in the ''user'' file will prevail. Dotfiles likely to be altered by the end user include .xinitrc and .bashrc files. The configuration files for xinit and Bash respectively. They allow the user the ability to change the window manager to be started upon login and also aliases, user-specified commands and environment variables respectively. When a user is created, their dotfiles shall be taken from the /etc/skel directory where system sample files reside.<br />
* '''-G''' A list of supplementary groups which the user is also a member of. ''Each group is separated from the next by a comma, with no intervening spaces''. The default is for the user to belong only to the initial group (users). <br />
* '''-s''' The name of the user´s login shell. Leaving this field blank will cause the system to select the default login shell.<br />
Useful groups for your non-root user include:<br />
*'''audio''' - for tasks involving sound card and related software<br />
*'''floppy''' - for access to a floppy if applicable<br />
*'''lp''' - for managing printing tasks<br />
*'''optical''' - for managing tasks pertaining to the optical drive(s)<br />
*'''storage''' - for managing storage devices<br />
*'''video''' - for video tasks and 3d acceleration<br />
*'''wheel''' - for using sudo/su<br />
A typical example, adding a user named "archie" specifying bash as the login shell:<br />
# useradd -m -G users,audio,lp,optical,storage,video,wheel -s /bin/bash archie<br />
Next, add a password for your new user using <code>/usr/bin/passwd</code>.<br />
<br />
An example for our user, 'archie':<br />
# passwd archie<br />
(You will be prompted to provide the new <code>UNIX</code> password.)<br />
<br />
Your new non-root user has now been created, complete with a home directory and a login password.<br />
<br />
'''Alternative method, using <code>/usr/sbin/adduser</code>:'''<br />
<br />
Alternatively, you may use <code>adduser</code>, an interactive user adding program which will prompt you for the above data:<br />
# adduser<br />
<br />
See the [[Groups]] article and check the man pages for <code>usermod(8)</code> and <code>gpasswd(8)</code> for further information.<br />
<br />
In the event of error, or if you wish to delete this user account in favor of a different name or for any other reason, use <code>/usr/sbin/userdel</code>:<br />
# userdel -r [username]<br />
* '''-r ''' Files in the user´s home directory will be removed along with the home directory itself and the user´s mail spool.<br />
<br />
===Install and setup Sudo (Optional)===<br />
To install Sudo:<br />
# pacman -S sudo<br />
To add a user as a sudo user (a "sudoer"), the visudo command must be run as root. <br />
# visudo<br />
This will open the file /etc/sudoers in a special session of vi. visudo copies the file to be edited to a temporary file, edits it with an editor, (vi by default), and subsequently runs a sanity check. If it passes, the temporary file overwrites the original with the correct permissions. <br />
<br />
Alternatively, or if you do not know how to use vi, you may set the EDITOR environment variable to the editor of your choice before running visudo. e.g.:<br />
# EDITOR=nano visudo<br />
<font color="red">'''WARNING: Do not edit /etc/sudoers directly with an editor; Errors in syntax can cause annoyances (like rendering the root account unusable). You must use the ''visudo'' command to edit /etc/sudoers.'''</font><br />
<br />
To give the user full root privileges when he/she precedes a command with "sudo", add the following line:<br />
USER_NAME ALL=(ALL) ALL<br />
where USER_NAME is the username of the individual.<br />
<br />
For more information, such as sudoer <TAB> completion, see [[Sudo]]<br />
<br />
==Part II: Install X and configure ALSA==<br />
<br />
<br />
===Configure the audio card with alsamixer===<br />
The Advanced Linux Sound Architecture (known by the acronym '''ALSA''') is a Linux kernel component intended to replace the original Open Sound System (OSS) for providing device drivers for sound cards. Besides the sound device drivers, '''ALSA''' also bundles a user space library for application developers who want to use driver features with a higher level API than direct interaction with the kernel drivers. <br />
-----<br />
{{Box Note| Alsa is included in the Arch mainline kernel and udev will automatically probe your hardware on boot-up, loading the corresponding kernel module for your audio card. Therefore, your sound should already be working, but is muted by default.}} <br />
The alsa-utils package contains the alsamixer userspace tool, which will allow us to configure the sound device from the console. (You may also run alsamixer from an '''X''' environment later.)<br />
<br />
Install the alsa-utils package:<br />
# pacman -S alsa-utils<br />
Did you add your normal user to the audio group? If not, use <code>/usr/bin/gpasswd</code>. As root do:<br />
# gpasswd -a ''yourusername'' audio<br />
As '''''normal, non-root''''' user, invoke <code>/usr/bin/alsamixer</code>:<br />
# su - ''yourusername'' <br />
'''$''' alsamixer<br />
Unmute the Master and PCM channels by scrolling to them with cursor left/right and pressing '''M'''. Increase the volume levels with the cursor-up key. (70-90 Should be a safe range.) Some machines, (like the Thinkpad T61), have a '''Speaker''' channel which must be unmuted and adjusted as well. Leave alsamixer by pressing ESC. <br />
==== Sound Test ====<br />
Ensure your speakers are properly connected, and test your sound configuration as normal user using <code>/usr/bin/aplay</code>:<br />
$ aplay /usr/share/sounds/alsa/Front_Center.wav<br />
You should hear a very eloquent woman say, "Front, center."<br />
<br />
Then run <code>/usr/bin/alsactl</code> as root:<br />
$ su -<br />
# alsactl store<br />
This will create '/etc/asound.state', saving the alsamixer settings. <br />
<br />
Also, add the alsa ''daemon'' to your DAEMONS section in /etc/rc.conf to automatically restore the mixer settings on boot-up.<br />
# nano /etc/rc.conf<br />
DAEMONS=(syslog-ng network crond '''alsa''')<br />
''Note that the alsa daemon merely restores your volume mixer levels on boot up by reading /etc/asound.state. It is separate from the alsa audio library (and kernel level API).''<br />
<br />
Expanded information available in the [[ALSA]] wiki entry.<br />
<br />
===Installing and configuring X===<br />
The '''X''' Window System (commonly '''X11''', or just simply '''X''') is a networking and display protocol which provides windowing on bitmap displays. It provides the standard toolkit and protocol to build graphical user interfaces (GUIs) on <code>UNIX</code>-like operating systems.<br />
<br />
'''X''' provides the basic framework, or primitives, for building GUI environments: drawing and moving windows on the screen and interacting with a mouse and/or keyboard. '''X''' does not mandate the user interface — individual client programs handle this. <br />
<br />
'''X''' is so named because it was preceded by the '''W''' Window System, originally developed at Stanford University. <br />
-----<br />
<br />
{{Box Note| If you plan on using an '''open-source''' video driver, and need 3d acceleration, it is recommended to install the libgl library before installing Xorg:}}<br />
# pacman -S libgl<br />
''(Proprietary video drivers provide their own gl library implementations.)''<br />
----- <br />
Now we will install the base Xorg packages using pacman. This is the first step in building a GUI.<br />
<br />
# pacman -S xorg<br />
3d utilities such as glxgears are included in the '''mesa''' package:<br />
# pacman -S mesa<br />
<br />
Now we have the base packages we need for running the '''X''' Server. You should add the driver for your graphics card now (e.g. xf86-video-<name>). The easiest way to configure X.org is by installing the correct driver packages first, and then generating /etc/X11/xorg.conf using an autoconfiguration script, like Xorg -configure.<br />
<br />
You will need knowledge of which video chipset your machine has. If you do not know, use the <code>/usr/sbin/lspci</code> program:<br />
# lspci | grep VGA<br />
<br />
If you need a list of all '''open-source''' video drivers, do: <br />
# pacman -Ss xf86-video | less<br />
Here is a list of '''open source''' drivers, and the corresponding video chipsets.<br />
*'''xf86-video-apm''' Alliance ProMotion video driver<br />
*'''xf86-video-ark''' ark video driver<br />
*'''xf86-video-ati''' ATI(AMD) video driver<br />
*'''xf86-video-chips''' Chips and Technologies video driver<br />
*'''xf86-video-cirrus''' Cirrus Logic video driver<br />
*'''xf86-video-dummy''' dummy video driver<br />
*'''xf86-video-fbdev''' framebuffer video driver<br />
*'''xf86-video-glint''' GLINT/Permedia video driver<br />
*'''xf86-video-i128''' Number 0 i128 video driver<br />
*'''xf86-video-i740''' Intel i740 video driver<br />
*'''xf86-video-i810''' Intel i810/i830/i9xx video drivers (deprecated - use -intel)<br />
*'''xf86-video-intel''' Newer Version of Intel i810/i830/i9xx video drivers<br />
*'''xf86-video-imstt''' Integrated Micro Solutions Twin Turbo vidoe driver<br />
*'''xf86-video-mga''' mga video driver (Matrox Graphics Adapter)<br />
*'''xf86-video-neomagic''' neomagic video driver<br />
*'''xf86-video-nv''' Nvidia nv video driver<br />
*'''xf86-video-rendition''' Rendition video driver<br />
*'''xf86-video-s3''' S3 video driver<br />
*'''xf86-video-s3virge''' S3 Virge video driver<br />
*'''xf86-video-savage''' savage video driver<br />
*'''xf86-video-siliconmotion''' siliconmotion video driver<br />
*'''xf86-video-sis''' SiS video driver<br />
*'''xf86-video-sisusb''' SiS USB video driver<br />
*'''xf86-video-tdfx''' tdfx video driver<br />
*'''xf86-video-trident''' Trident video driver<br />
*'''xf86-video-tseng''' tseng video driver<br />
*'''xf86-video-unichrome''' VIA S3 Unichrome video drivers<br />
*'''xf86-video-v4l''' v4l video driver<br />
*'''xf86-video-vesa''' vesa video driver<br />
*'''xf86-video-vga''' VGA 16 color video driver<br />
*'''xf86-video-via''' via video driver<br />
*'''xf86-video-vmware ''' vmware video driver<br />
*'''xf86-video-voodoo ''' voodoo video driver<br />
<br />
* Note that the '''vesa''' driver is the most generic, and should work with almost any modern video chipset. If you cannot find a suitable driver for your video chipset, vesa '''should''' work.<br />
<br />
*If you have an NVIDIA or ATI video adapter, you may wish to install the proprietary NVIDIA or ATI drivers. '''Installing proprietary video drivers is covered [[#Using proprietary Graphics Driver (NVIDIA, ATI)|below]].'''<br />
<br />
Use pacman to install the appropriate video driver for your video card/onboard video. e.g.:<br />
# pacman -S xf86-video-savage<br />
(for the Savage driver.)<br />
<br />
===Create /etc/X11/xorg.conf===<br />
=====What is /etc/X11/xorg.conf?=====<br />
/etc/X11/xorg.conf is the main configuration file for your '''X''' Window System, the foundation of your '''G'''raphical '''U'''ser '''I'''nterface. It is a plain text file ordered into sections and subsections. Important sections are ''Files, InputDevice, Module, Monitor, Modes, Screen, Device, and ServerLayout''. Sections can appear in any order and there may be more than one section of each kind, for example, if you have more than one monitor, or if your laptop has a trackpoint as well as a mouse. <br />
------<br />
By default, you will not have an Xorg config file, as the newest versions of Xorg feature autodetection. ''If'' the autodetection ''works satisfactorily'' and you do not need to specify special features such as aiglx, compositing and so forth, you may forgo creating an xorg.conf file. <br />
<br />
''Most people will still find that they need to generate a config file, however.''<br />
<br />
Advanced users may wish to manually create their own xorg.conf file. You may also use the <code>/usr/bin/Xorg</code> program with the -configure option to generate a basic config file; As root, do:<br />
# Xorg -configure<br />
This will create a config file at /root/xorg.conf.new <br />
<br />
To test the server, run:<br />
# X -config /root/xorg.conf.new<br />
'''X''' should start with the white hollow vector '''X''' in the center of the screen, which should respond to mouse, trackpoint or touchpad movement. Use CTRL-Alt-Backspace to exit '''X'''.<br />
<br />
Inspect your config file in case of errors:<br />
<br />
# nano /root/xorg.conf.new<br />
<br />
Ensure the Xorg -configure script has correctly specified your video driver. e.g.:<br />
Section "Device"<br />
<br />
...<br />
<br />
Driver "savage"<br />
<br />
...<br />
<br />
EndSection<br />
<br />
Ensure there are horizontal sync and vertical refresh specs under section "Monitor". If not, add them:<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
VendorName "Monitor Vendor"<br />
ModelName "Monitor Model"<br />
HorizSync 30.0 - 130.0 # Safe for LCD's<br />
VertRefresh 50.0 - 100.0 # Safe for LCD's and most CRT's.<br />
EndSection<br />
(If you do not know these specs, consult your monitor's documentation.)<br />
<br />
Specify your default color depth under section "Screen":<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Card0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
(Typically, this will be set to 24 for true color.)<br />
<br />
Also add your desired Modes to your "Display" subsection, at least under the Depth 24 header, e.g.:<br />
SubSection "Display"<br />
Viewport 0 0<br />
Depth 24<br />
Modes "1024x768" "800x600" "640x480"<br />
Add the following section, if you wish to enable eye candy which requires the composite extension: <br />
Section "Extensions"<br />
Option "Composite" "Enable"<br />
EndSection<br />
Try your config again, after modifying:<br />
# X -config /root/xorg.conf.new<br />
Ensure an '''X''' session opens, without errors, and copy or move the generated config file to /etc/X11/:<br />
# cp /root/xorg.conf.new /etc/X11/xorg.conf<br />
Detailed instructions in the [[Xorg]] article.<br />
<br />
====Alternative xorg.conf generation====<br />
* Note that if your machine has a successfully configured xorg.conf under another distribution, you may easily copy it over to your current Arch system.<br />
* If Xorg -configure is not generating a usable xorg.conf, you may alternatively use the <code>/usr/bin/hwd</code> tool. Install with:<br />
# pacman -S hwd<br />
And run with<br />
# hwd -xa<br />
* You may also try the <code>/usr/bin/xorgcfg</code> script:<br />
# xorgcfg <br />
* Lastly, you may choose <code>/usr/bin/xorgconfig</code>, which will interactively prompt you for hardware information to create a basic xorg.conf:<br />
# xorgconfig<br />
Continue with '''[[#Simple baseline X test|Simple baseline X test]]'''<br />
<br />
===Using proprietary Graphics Driver (NVIDIA, ATI)===<br />
You may choose to use the proprietary video drivers from NVIDIA or ATI. <br />
====NVIDIA Graphic Cards====<br />
The NVIDIA proprietary drivers are generally considered to be of good quality, and offer 3D performance, whereas the open source '''nv''' driver offers only 2d support at this time. <br />
<br />
Before you configure your Graphics Card you will need to know which driver fits. Arch currently has 3 different driver packages that each match a certain subset of Cards: <br />
<br />
'''1. nvidia-71xx''' ''for very old Cards like TNT and TNT2''<br />
<br />
'''2. nvidia-96xx''' ''slightly newer cards up to the GF 4''<br />
<br />
'''3. nvidia''' ''newest GPUs after the GF 4''<br />
<br />
Consult the NVIDIA-Homepage to see which one is for you. The difference is only for the installation; Configuration works the same with every driver.<br />
<br />
Select and install the appropriate NVIDIA driver ''for your card'', e.g.: <br />
# pacman -S nvidia-96xx<br />
<br />
The NVIDIA package has a utility for updating your existing /etc/X11/xorg.conf for use with the NVIDIA driver:<br />
# nvidia-xconfig<br />
<br />
It also has several options which will further specify the contents and options of the xorg.conf file.<br />
For example,<br />
# nvidia-xconfig --composite --add-argb-glx-visuals<br />
<br />
For more detailed information, see nvidia-xconfig(1).<br />
<br />
Some useful tweaking options in the device section are (beware that these may not work on your system):<br />
Option "RenderAccel" "true"<br />
Option "NoLogo" "true"<br />
Option "AGPFastWrite" "true"<br />
Option "EnablePageFlip" "true"<br />
Make sure all instances of DRI are commented out:<br />
# Load "dri"<br />
Double check your /etc/X11/xorg.conf to make sure your default depth, horizontal sync, vertical refresh, and resolutions are acceptable.<br />
<br />
Update kernel module dependencies using <code>/sbin/depmod</code>:<br />
# depmod -a<br />
(A reboot may be necessary.)<br />
Advanced instructions for nvidia configuration can be found in the [[NVIDIA]] article.<br />
<br />
Continue with '''[[#Simple baseline X test|Simple baseline X test]]'''<br />
<br />
====ATI Graphic Cards====<br />
ATI owners have two options for drivers. If you are unsure which driver to use, please try the open-source one first. The open-source driver will suit most needs along with being generally less problematic.<br />
<br />
Install the '''proprietary''' ATI Driver with<br />
# pacman -S catalyst<br />
Use the aticonfig tool to modify the xorg.conf.<br />
<br />
Install the '''open-source''' ATI Driver with<br />
# pacman -S xf86-video-ati<br />
Currently, the performance of the open-source driver is not on par with that of the proprietary one. It also lacks TV-out, dual-link DVI support, and possibly other features. On the other hand, it supports Aiglx and has better dual-head support.<br />
{{Box Note| The latest proprietary driver does support [[AIGLX]] now. To use [[Compiz]] or [[Beryl]] add Option "AIGLX" "True" to Section ServerFlags and Option "Composite" "True" to Section Extensions.}}<br />
Advanced instructions for ATI configuration can be found in the [[ATI | ATI wiki]].<br />
<br />
===Simple baseline X test===<br />
<br />
At this point, you should have xorg installed, with a suitable video driver and an /etc/X11/xorg.conf configuration file. If you want to test your configuration quickly, to ensure your ability to successfully start '''X''' from the command line before installing a complete desktop environment, you can do so by invoking '''xterm'''. Xterm is a very simple terminal emulator which runs in the '''X '''Server environment; it is installed as part of the base xorg packages. More advanced users who are comfortable with '''X''' configuration may choose to skip this optional step.<br />
<br />
Prepare for the test by configuring a ~/.xinitrc:<br />
<br />
===== ~/[[.xinitrc]] =====<br />
One of the main functions of this file is to dictate what '''X''' Window client is invoked with the '''/usr/bin/startx''' and/or '''/usr/bin/xinit''' program ''on a per-user basis''. (The '''startx''' script is merely a front end to the more versatile '''xinit''' command.) There are vast amounts of additional configurable specifications and commands that may also be added to ~/[[.xinitrc]] as you further customize your system. <br />
{{Box Note | '''[[.xinitrc]]''' is a so-called 'dot' (.) file. Files in a UNIX filesystem which are preceded with a dot (.) are 'hidden', and will not show up with a regular 'ls' command, usually for the sake of keeping directories tidy. Dot files may be seen by issuing '''ls -a'''. The 'rc' denotes ''Run Commands'' and simply indicates that it is a configuration file. Since it controls how a program runs, it is (although historically incorrect) also said to stand for "Run Control".}}<br />
<br />
'''startx/xinit''' will start the '''X''' server and clients. To determine the client to run, '''startx/xinit''' will first look to parse a [[.xinitrc]] file in the user's home directory. In the absence of file ~/[[.xinitrc]], it defaults to the global xinitrc in the xinit library directory; /etc/X11/xinit/xinitrc, which defaults to using the TWM window manager. (Hence, if you invoke startx without a ~/[[.xinitrc]] file, a TWM session will start.) Further details in the [[.xinitrc]] wiki entry.<br />
<br />
Switch to your '''''normal, non-root''''' user:<br />
# su - ''yourusername''<br />
* /etc/skel/ contains files and directories to provide sane defaults for newly created user accounts. The name '''skel''' is derived from the word '''skeleton''', because the files it contains form the basic structure for users' home directories.<br />
Copy the sample xinitrc file from /etc/skel/ to your home directory: <br />
<br />
$ cp /etc/skel/[[.xinitrc]] ~/<br />
Edit the file: <br />
$ nano ~/.xinitrc<br />
and add:<br />
<br />
exec xterm<br />
<br />
So that it looks like this:<br />
<br />
#!/bin/sh<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
#<br />
exec xterm<br />
# exec wmaker<br />
# exec startkde<br />
# exec icewm<br />
# exec blackbox<br />
# exec fluxbox<br />
<br />
''Be sure to have only one uncommented '''exec''' line in your ~/.xinitrc''. Below, we shall edit this file again to specify the appropriate desktop environment/window manager of your choice.<br />
<br />
Finally, test your configurations by starting '''X''' as '''normal, non-root''' user, with:<br />
<br />
$ startx<br />
or<br />
$ xinit<br />
You should have an '''xterm''' session open up. You can exit the '''X''' Server with Ctrl+Alt+Backspace, or by typing "exit". If you have problems starting '''X''', you can look for errors in the /var/log/Xorg.0.log file and on the console output of the console you started '''X''' from.<br />
<br />
If you prove a properly configured /etc/X11/xorg.conf by successfully running the test, you can be assured that your DE/WM of choice will work smoothly.<br />
<br />
Advanced instructions for Xorg configuration can be found in the [[Xorg]] article.<br />
<br />
==Part III: Installing and configuring a Desktop Environment ==<br />
While The '''X''' Window System provides the basic framework for building a ''graphical user interface'' (GUI), a '''Desktop Environment''' (DE), works atop and in conjunction with '''X''', to provide a completely functional and dynamic GUI. A DE typically provides icons, applets, windows, toolbars, folders, wallpapers, applications and abilities like drag and drop. The particular functionalities and designs of each DE will uniquely affect your overall environment and experience. Therefore, choosing a DE is a very subjective and personal decision. Choose the best environment for ''your'' needs.<br />
<br />
* If you want something full-featured and similar to Windows and Mac OSX, '''[[#KDE|KDE]]''' is a good choice<br />
* If you want something slightly more minimalist, which follows the K.I.S.S. principle more closely, '''[[#GNOME|GNOME]]''' is a good choice<br />
* '''[[#Xfce|Xfce]]''' is generally perceived as similar to GNOME, but lighter and less demanding on system resources, yet still visually pleasing and providing a very complete environment.<br />
* '''[[#LXDE|LXDE]]''' is a minimal DE based on the Openbox window manager. It provides most things you need for a modern desktop while keeping relatively low system resource usage. LXDE is a good choice for those who want a quick way of setting up a pre-configured Openbox system.<br />
<br />
If you desire a lighter, less demanding GUI to configure manually, you may choose to simply install a '''Window Manager''', or WM. A WM controls the placement and appearance of application windows in conjunction with the X Window System but does NOT include such features as panels, applets, icons, applications, etc., by default.<br />
* Lightweight floating WM's include: [[#Openbox|'''Openbox''']], [[#Fluxbox|'''Fluxbox''']], [[#fvwm2|'''fvwm2''']], '''Windowmaker, Pekwm, and TWM'''.<br />
* If you need something completely different, try '''Awesome, ion, wmii, dwm, or xmonad'''.<br />
<br />
===Install Fonts===<br />
At this point, you may wish to save time by installing visually pleasing, true type fonts, before installing a desktop environment/window manager. Dejavu and bitstream-vera are good, general-purpose font sets. You may also want to have the Microsoft font sets, which are especially popular on websites. <br />
<br />
Install with:<br />
# pacman -S ttf-ms-fonts ttf-dejavu ttf-bitstream-vera<br />
<br />
===~/.xinitrc (again)===<br />
<br />
As '''non-root user''', edit your /home/username/.xinitrc to specify the DE you wish to use. This will allow you to use '''startx/xinit''' from the shell, in the future, to open your DE/WM of choice:<br />
<br />
$ nano ~/.xinitrc<br />
<br />
Uncomment or add the ''''exec''' ..' line of the appropriate desktop environment/window manager. Some examples are below:<br />
<br />
For the Xfce4 desktop environment:<br />
exec startxfce4 <br />
<br />
For the KDE desktop environment:<br />
exec startkde<br />
A '''startkde''' or '''startxfce4''' command starts the KDE or Xfce4 desktop environment. This command does not finish until you logout of the DE. Normally the shell would wait for KDE to finish, then run the next command. The "exec" prefix to this command tells the shell that this is the last command, so the shell does not need to wait to run a subsequent command.<br />
<br />
Remember to have only one uncommented '''exec''' line in your ~/.xinitrc. <br />
<br />
Continue below, installing the DE/WM of your choice.<br />
<br />
* [[#GNOME|'''GNOME''']]<br />
* [[#KDE|'''KDE''']]<br />
* [[#Xfce|'''Xfce''']]<br />
* [[#LXDE|'''LXDE''']]<br />
* [[#Openbox|'''Openbox''']]<br />
* [[#Fluxbox|'''Fluxbox''']]<br />
* [[#fvwm2|'''fvwm2''']]<br />
<br />
===GNOME===<br />
====About GNOME====<br />
The '''G'''NU '''N'''etwork '''O'''bject '''M'''odel '''E'''nvironment. The GNOME project provides two things: The GNOME desktop environment, an intuitive and attractive desktop for end-users, and the GNOME development platform, an extensive framework for building applications that integrate into the rest of the desktop.<br />
<br />
====Installation====<br />
Install the base GNOME environment with:<br />
# pacman -S gnome<br />
<br />
Additionally, you can install the extras:<br />
# pacman -S gnome-extra<br />
<br />
It's safe to choose all packages shown in the extra package. <br />
<br />
====Useful DAEMONS for GNOME====<br />
Recall from above that a daemon is a program that runs in the background, waiting for events to occur and offering services. The '''hal''' daemon, among other things, will automate the mounting of disks, optical drives, and USB drives/thumbdrives for use in the GUI. The '''fam''' daemon will allow real-time representation of file alterations in the GUI, allowing instant access to recently installed programs, or changes in the file system. Both '''hal''' and '''fam''' make life easier for the GNOME user. The hal and fam packages are installed when you install GNOME, but must be invoked to become useful.<br />
<br />
You may want to install a graphical login manager. For GNOME, the '''gdm''' daemon is a good choice. <br />
<br />
As root:<br />
# pacman -S gdm<br />
You will almost certainly want the '''hal''' and '''fam''' daemons.<br />
<br />
Start hal and fam:<br />
# /etc/rc.d/hal start<br />
<br />
# /etc/rc.d/fam start<br />
<br />
Add them to your /etc/rc.conf DAEMONS section, so they will be invoked at boot:<br />
# nano /etc/rc.conf<br />
<br />
DAEMONS=(syslog-ng network crond alsa '''hal fam gdm''')<br />
(If you prefer to log into the console and manually start X, leave out gdm.)<br />
<br />
<br />
As normal user, start X:<br />
$ startx<br />
or<br />
$ xinit<br />
If ~/.xinitrc is not configured for GNOME, you may always start it with '''xinit''', followed by the path to GNOME:<br />
$ xinit /usr/bin/gnome-session<br />
<br />
Advanced instructions for installing and configuring GNOME can be found in the [[Gnome]] article.<br />
<br />
Congratulations! Welcome to your GNOME desktop environment on your new Arch Linux system! You may wish to continue by viewing '''[[#Tweaks/Finishing touches|Tweaks and finishing touches]]''', or the rest of the information below. You may also be interested in the [[Post Installation Tips]] wiki article.<br />
<br />
====Eye Candy====<br />
You may find the default GNOME theme and icons not very attractive. A nice gtk theme is murrine. Install it with<br />
# pacman -S gtk-engine-murrine<br />
and select it with System->Preferences->Appearance->Theme tab. You can find more themes, icons, and wallpaper at [http://www.gnome-look.org Gnome Look].<br />
<br />
===KDE===<br />
====About KDE====<br />
The '''K''' '''D'''esktop '''E'''nvironment. KDE is a powerful Free Software graphical desktop environment for GNU/Linux and <code>UNIX</code> workstations. It combines ease of use, contemporary functionality, and outstanding graphical design with the technological superiority of <code>UNIX</code>-like operating systems.<br />
<br />
====Installation====<br />
Choose one of the following, and continue below with '''[[#Useful KDE DAEMONS|Useful KDE DAEMONS]]''': <br />
<br />
1. Package '''kde''' is the complete, vanilla KDE 4.1<br />
<br />
Install this before: <br />
# pacman -S zlib shared-mime-info<br />
Install with pacman: <br />
# pacman -S kde<br />
<br />
2. '''KDEmod''' is an Arch Linux exclusive community-driven system designed for modularity and also offers a choice between KDE 3.5 or 4.1. KDEmod can be installed with pacman, after adding the proper repository to /etc/pacman.conf. The project website, including complete instructions can be found at [http://kdemod.ath.cx/ http://kdemod.ath.cx/].<br />
<br />
====Useful KDE DAEMONS====<br />
<br />
KDE will require the '''hal''' ('''H'''ardware '''A'''bstraction '''L'''ayer) and '''fam''' ('''F'''ile '''A'''lteration '''M'''onitor) daemons. The '''kdm''' daemon is the '''K''' '''D'''isplay '''M'''anager, which provides a '''graphical login''', if desired.<br />
<br />
Recall from above that a daemon is a program that runs in the background, waiting for events to occur and offering services. The hal daemon, among other things, will automate the mounting of disks, optical drives, and USB drives/thumbdrives for use in the GUI. The fam daemon will allow real-time representation of file alterations in the GUI, allowing instant access to recently installed programs, or changes in the file system.. Both '''hal''' and '''fam''' make life easier for the KDE user. The hal, fam and kdm packages are installed when you install KDE, but must be invoked to become useful.<br />
-----<br />
Start hal and fam:<br />
<br />
# /etc/rc.d/hal start<br />
<br />
# /etc/rc.d/fam start<br />
{{Box Note|The hal daemon relies on, and will automatically start, the dbus daemon.}}<br />
Edit your DAEMONS section in /etc/rc.conf:<br />
# nano /etc/rc.conf<br />
Add '''hal''' and '''fam''' to your DAEMONS section, to invoke them on boot. If you prefer a graphical login, add '''kdm''' as well: <br />
DAEMONS=(syslog-ng network crond alsa '''hal fam kdm''')<br />
*This method will start the system at runlevel 3, (/etc/inittab default, multiuser mode), and then start KDM as a daemon. <br />
<br />
*Some users prefer an alternative method of starting a display manager like KDM on boot by utilizing the /etc/inittab method and starting the system at runlevel 5. See [[Adding a login manager (KDM, GDM, or XDM) to automatically boot on startup]] for more.<br />
<br />
*If you prefer to log into the '''console''' at runlevel 3, and manually start X, leave out kdm, or comment it out with an exclamation. ( ! )<br />
<br />
Now try starting your X Server as normal user:<br />
$ startx<br />
Advanced instructions for installing and configuring KDE can be found in the [[KDE]] article.<br />
<br />
Congratulations! Welcome to your KDE desktop environment on your new Arch Linux system! You may wish to continue by viewing '''[[#Tweaks/Finishing touches|Tweaks and finishing touches]]''', or the rest of the information below. You may also be interested in the [[Post Installation Tips]] wiki article.<br />
<br />
===Xfce===<br />
====About Xfce====<br />
The cholesterol-free '''X''' environment. Xfce, like GNOME or KDE, is a desktop environment, but aims to be fast and lightweight while remaining visually appealing and easy to use. It contains a suite of apps like a root window app, window manager, file manager, panel, etc. Xfce is written using the GTK2 toolkit (like GNOME) and contains its own development environment (libraries, daemons, etc) similar to other big DEs. Unlike GNOME or KDE, Xfce is lightweight and designed more around CDE than Windows or Mac. It has a much slower development cycle, but is very stable and extremely fast. Xfce is great for older hardware, and will fly with especially great speed on newer machines as well.<br />
<br />
====Installation====<br />
Install Xfce: <br />
# pacman -S xfce4 <br />
You may also wish to install themes and extras:<br />
# pacman -S xfce4-goodies gtk2-themes-collection<br />
Note: '''xfce4-xfapplet-plugin''' (a plugin that allows the use of GNOME applets in the Xfce4 panel) is part of the '''xfce4-goodies''' group and depends on '''gnome-panel''', which in turn depends on '''gnome-desktop'''. You may wish to take this into consideration before installing, since it represents a significant number of extra dependencies.<br />
<br />
If you wish to admire 'Tips and Tricks' on login, install the '''fortune-mod''' package:<br />
# pacman -S fortune-mod<br />
<br />
====Useful DAEMONS====<br />
Recall from above that a daemon is a program that runs in the background, waiting for events to occur and offering services. The hal daemon, among other things, will automate the mounting of disks, optical drives, and USB drives/thumbdrives for use in the GUI. The fam daemon will allow real-time representation of file alterations in the GUI, allowing instant access to recently installed programs, or changes in the file system. The hal and fam packages are installed when you install Xfce, but must be invoked to become useful.<br />
<br />
Start hal and fam:<br />
<br />
# /etc/rc.d/hal start<br />
<br />
# /etc/rc.d/fam start<br />
{{Box Note|The hal daemon relies on, and will automatically start, the dbus daemon.}}<br />
Edit your DAEMONS section in /etc/rc.conf:<br />
# nano /etc/rc.conf<br />
Add '''hal''' and '''fam''' to your DAEMONS section, to invoke them at boot.<br />
<br />
Advanced instructions for installing and configuring Xfce can be found in the [[Xfce]] article.<br />
<br />
If you wish to install one, see [[Adding a login manager (KDM, GDM, or XDM) to automatically boot on startup]]. Otherwise you can login in via the console and run:<br />
<br />
$ startxfce4<br />
<br />
Congratulations! Welcome to your Xfce desktop environment on your new Arch Linux system! You may wish to continue by viewing '''[[#Tweaks/Finishing touches|Tweaks and finishing touches]]''', or the rest of the information below. You may also be interested in the [[Post Installation Tips]] wiki article.<br />
<br />
===LXDE===<br />
====About LXDE====<br />
LXDE, (for ''L''ightweight ''X''11 ''D''esktop ''E''nvironment), is a new project focused on providing a modern desktop environment which aims to be lightweight, fast, intuitive and functional while keeping system resource usage low. LXDE is quite different from other desktop environments, since each component of LXDE is a discrete and independent application, and each can be easily substituted by other programs. This modular design eliminates all unnecessary dependencies and provides more flexibility. Details and screenshots available at: http://lxde.org/ <br />
<br />
LXDE provides:<br />
# The OpenBox windowmanager<br />
# PCManFM File manager<br />
# LXpanel system panel<br />
# LXSession session manager<br />
# LXAppearance GTK+ theme switcher<br />
# GPicView image viewer<br />
# Leafpad simple text editor<br />
# XArchiver: Lightweight, fast, and desktop-independent gtk+-based file archiver<br />
# LXNM (still under development): Lightweight network manager for LXDE supporting wireless connections<br />
These lightweight and versatile tools combine for quick setup, modularity and simplicity.<br />
<br />
Install LXDE with: <br />
# pacman -S lxde<br />
Add:<br />
exec startlxde<br />
to your ~/.xinitrc and start with ''startx'' or ''xinit''<br />
<br />
Further information available at the [[LXDE]] wiki article.<br />
<br />
===*box===<br />
====Fluxbox====<br />
Fluxbox © is yet another windowmanager for X.<br />
It's based on the Blackbox 0.61.1 code. Fluxbox looks like blackbox and handles styles, colors, window placement and similar things exactly like blackbox (100% theme/style compability).<br />
<br />
Install Fluxbox using <br />
# pacman -S fluxbox fluxconf<br />
<br />
If you use gdm/kdm a new fluxbox session will be automatically added. Otherwise, you should modify your user's .xinitrc and add this to it:<br />
exec startfluxbox <br />
<br />
More information is available in the [[Fluxbox]] article.<br />
<br />
====Openbox====<br />
Openbox is a standards compliant, fast, light-weight, extensible window manager.<br />
<br />
Openbox works with your applications, and makes your desktop easier to manage. This is because the approach to its development was the opposite of what seems to be the general case for window managers. Openbox was written first to comply with standards and to work properly. Only when that was in place did the team turn to the visual interface.<br />
<br />
Openbox is fully functional as a stand-alone working environment, or can be used as a drop-in replacement for the default window manager in the GNOME or KDE desktop environments. <br />
<br />
Install openbox using<br />
# pacman -S openbox<br />
Additional configuration tools are also available, if desired:<br />
# pacman -S obconf obmenu<br />
<br />
Once openbox is installed you will get a message to move menu.xml & rc.xml to ~/.config/openbox/ in your home directory:<br />
# su - ''yourusername''<br />
$ mkdir -p ~/.config/openbox/<br />
$ cp /etc/xdg/openbox/rc.xml ~/.config/openbox/<br />
$ cp /etc/xdg/openbox/menu.xml ~/.config/openbox/<br />
<br />
'''rc.xml''' is the main configuration file for OpenBox. It may be manually edited, (or you can use OBconf). '''menu.xml''' configures the right-click menu.<br />
<br />
You may log into OpenBox via graphical login using KDM/GDM, or from the shell using '''startx''', in which case you will need to edit your ~/.xinitrc (as non-root user) and add the following:<br />
<br />
exec openbox-session<br />
You may also start OpenBox from the shell using '''xinit''':<br />
$ xinit /usr/bin/openbox-session<br />
* Openbox may also be used as the window manager for GNOME, KDE, and Xfce.<br />
For KDM there is nothing left to do; openbox is listed in the sessions menu in KDM.<br />
<br />
Some useful, lightweight programs for OpenBox are:<br />
* PyPanel or LXpanel if you want a panel<br />
* feh if you want to set the background<br />
* ROX if you want a simple file manager (also provides simple icons)<br />
* PcmanFM a lightweight but versatile file manager (also provides desktop icon functionality)<br />
* iDesk (available in [[AUR]]) for providing desktop icons<br />
<br />
More information is available in the [[Openbox]] article.<br />
<br />
===fvwm2===<br />
FVWM is an extremely powerful ICCCM-compliant multiple virtual desktop window manager for the X Window system. Development is active, and support is excellent. <br />
<br />
Install fvwm2 with<br />
# pacman -S fvwm <br />
<br />
fvwm will automatically be listed in kdm/gdm in the sessions menu. Otherwise, add <br />
exec fvwm <br />
<br />
to your user's .xinitrc.<br />
<br />
==Browser and Video Player==<br />
===Web Browser===<br />
The ever-popular Firefox web browser is available through pacman, although it does not have its official branding. Therefore, the program appears as its development codename, ''Gran Paradiso'', when opened.<br />
<br />
Install with:<br />
<br />
pacman -S firefox<br />
Be sure and install 'flashplugin', 'mplayer', 'mplayer-plugin', and the 'codecs' packages for a complete web experience:<br />
pacman -S flashplugin mplayer mplayer-plugin codecs<br />
<br />
''For newbies: if you install the x86_64 version of Archlinux don`t use the option flashplugin in pacman, like above, or you will get an error. Unfortunately Adobe does not offer a 64 bit version of flash plugin. Please see [http://wiki.archlinux.org/index.php/Install_Flash_on_Arch64 this wiki] entry to workaround the problem'' <br />
<br />
(The codecs package contains most codecs, including those for Win32, Quicktime and Realplayer9 content.)<br />
===VLC===<br />
VLC Player is a versatile multimedia player which can many different formats, from a disc or file. It also provides the ability to stream multimedia over a lan. To install it, simply type the code below.<br />
<br />
pacman -S vlc<br />
The libdvdcss library provides DVD decoding for encrypted DVDs. Ensure the legality of using libdvdcss in your country before installing!<br />
<br />
pacman -S libdvdcss<br />
For more, see [[Useful Applications]].<br />
<br />
=APPENDIX=<br />
<br />
==An Introduction to [[ABS]]==<br />
<br />
[[ABS]] is the Arch Linux Build System. It is a ports-like system for compiling sources into installable packages. <br />
<br />
'Ports' is a system used by *BSD, which uses simple build scripts residing in a directory tree on the local machine. Each port is simply a directory, named for the installable 3rd party software, and containing a build script. Typically, a *BSD user who wanted to build and install ''firefox'', would cd into the corresponding firefox port residing under /usr/ports and do <code>make install clean</code>. The ''firefox'' sourcecode would then be downloaded from a 3rd party source. According to the port build script, the sources would then be compiled, patched (if directed), and finally, installed to the system.<br />
<br />
[[ABS]] offers the same functionality by providing build scripts called [[#ABS PKGBUILD Explained | PKGBUILD]]s, which contain all information for a given piece of software; The md5sums, source URL, version, license and compilation instructions. In addition, [[ABS]] provides the advantage of compiling the sources ''into an installable package'' with the extension ''.pkg.tar.gz''. Obviously, it is a simple g-zipped tarball, but it is cleanly installable/removable/trackable via pacman.<br />
<br />
Install the abs package:<br />
# pacman -Sy abs<br />
<br />
After installing the ''abs'' package with pacman, run the <code>/usr/bin/abs</code> script as root:<br />
# abs <br />
The ''ABS tree'' is then extracted under /var/abs, organized according to the installable software. <br />
<br />
To build a package from source, create a build directory and copy the abs directory for a given application to the build directory:<br />
$ mkdir ~/abs<br />
$ cp -r /var/abs/extra/x11/slim ~/abs<br />
This will move the slim subdir and PKGBUILD script for slim to the build directory.<br />
{{Box Note | In addition to PKGBUILDs, some software requires an additional *.install file. See the '''[[ABS]]''' and '''[[makepkg]]''' wiki entries for more information}}<br />
navigate to the slim build directory and, after modifying the PKGBUILD if desired or necessary, invoke the abs <code>/usr/bin/makepkg</code> tool<br />
$ [[makepkg]] -cs<br />
* -'''c''' Cleans up any leftover files from the source compilation<br />
* -'''s''' Downloads and installs any missing dependencies by invoking pacman<br />
Install with pacman's -U (upgrade) switch:<br />
# pacman -U slim<version>.pkg.tar.gz<br />
Done. Slim sources are downloaded, compiled, compressed into a package and finally, installed.<br />
{{Box Note | You may build, clean, install any needed dependencies and finally install the package with one command: '''makepkg -csi'''. The above example used pacman -U to install as a separate step for informational purposes. See the '''makepkg(8)''' man page.}} <br />
Q: Why would I need [[ABS]] to compile and create an installable package from source, when I have access to all of the same software via pacman and the binary repos?<br />
<br />
A: A few reasons:<br />
*For installing newer, unstable, custom, or development versions of an application.<br />
PKGBUILDs are transparent and simple. Edit the software version and the md5sums of the desired versions within the PKGBUILD, and build and install your custom packages.<br />
*For [[Patching in ABS | patching]].<br />
Copy the corresponding PKGBUILD to a build directory along with your patch, edit the PKGBUILD, and build/install with <code>/usr/bin/makepkg</code>.<br />
*For [[The Arch package making HOW-TO - with guidelines | creating your own packages]] for yourself, or to share with the community on the [[AUR]].<br />
You are not limited to the PKGBUILDs under /var/abs. Create your own to build from 3rd party sourcecode. They are simple, open and transparent. Explore the prototpe PKGBUILD provided at /usr/share/pacman/PKGBUILD.proto<br />
*ABS provides an expedient method for recompiling, if necessary. <br />
For example, to recompile your video or wireless drivers.<br />
* To build an installable package with custom configurations<br />
Enable or disable options in any package by modifying the PKGBUILD<br />
* To build an installable package, further optimized for your machine's architecture, <br />
Specify your [[#makepkg.conf | CFLAGS]] in /etc/[[makepkg]].conf.<br />
* To rebuild your entire system, BSD-style, further optimized for your machine's architecure.<br />
Use the makeworld script, or the community-contributed [http://bbs.archlinux.org/viewtopic.php?id=48957 pacbuilder]<br />
<br />
==An Introduction to The [[AUR]]==<br />
The '''A'''rch '''U'''ser '''R'''epository<br />
<br />
The [[ABS]] tree provides the ability to build all Arch software available in the [core], [extra], [community], and [testing] repositories by providing build scripts on the local machine. In contrast, the [[AUR]] does not provide a tree on the local machine, but rather, an unsupported repository of build scripts, sporting a handsome web interface at http://aur.archlinux.org/index.php Also, there is an AUR link tab at the top right of every page on the Arch site.<br />
<br />
Once you have navigated to the AUR web page, click on the '''Packages''' button on the top right. You will be brought to the packages search page. <br />
<br />
The general procedure will be:<br />
# Enter the search criteria into the '''keywords''' field and click on '''go'''. The next screen will present all related results.<br />
# Take note of the '''Location''' on the package listing. If the package location is in '''community''', you have not done your homework, and should simply use pacman or ABS to install. If the location is '''unsupported''', continue. <br />
# Click on the name of the package on the package listing. You will be brought to the Package Details page.<br />
An example for the '''yaourt''' package:<br />
yaourt 0.9-2<br />
http://www.archlinux.fr/yaourt-en/<br />
A Pacman frontend with more features and AUR support<br />
unsupported :: system<br />
Maintainer: wain<br />
Votes: 943<br />
License: GPL<br />
Last Updated: Sat, 15 Mar 2008 17:15:20 +0000<br />
First Submitted: Tue, 04 Jul 2006 20:37:58 +0000<br />
Tarball :: Files :: PKGBUILD<br />
Click on the '''Tarball''' link in the last line of the details, and save to a build directory.<br />
<br />
Navigate to, and extract the tarball:<br />
$ tar -xvf yaourt.tar.gz<br />
Enter the build directory and invoke makepkg, which will download the sources, compile, and compress the installation into an installable .pkg.tar.gz package:<br />
$ makepkg -cs<br />
* -'''c''' Cleans up any leftover files from the source compilation<br />
* -'''s''' Downloads and installs any missing dependencies by invoking pacman <br />
Install with pacman's '''-U''' (upgrade) switch:<br />
# pacman -U yaourt<version>.pkg.tar.gz<br />
Done.<br />
<br />
See the [[AUR]] wiki entry for more information.<br />
===Install an AUR Helper===<br />
[[AUR Helpers]] add seamless access to the [[AUR]]. They vary in their features, but can ease in searching, fetching, building, and installing from over 9000 PKGBUILDs found in AUR.<br />
<br />
==File and directory explanation==<br />
<br />
"Shareable" files are defined as those that can be stored on one host and<br />
used on others. "Unshareable" files are those that are not shareable. For<br />
example, the files in user home directories are shareable whereas device<br />
lock files are not. "Static" files include binaries, libraries,<br />
documentation files and other files that do not change without system<br />
administrator intervention. "Variable" files are defined as files that<br />
are not static.<br />
<br />
'''/''' (root) The root filesystem is the primary filesystem from which all other filesystems stem; the top of the hierarchy. All files and directories appear under the root directory "/", even if they are stored on different physical devices. The contents of the root filesystem must be adequate to boot, restore, recover, and/or repair the system.<br />
<br />
'''/bin/''' Essential command binaries that must be available in single user mode; for all users (e.g., cat, ls, cp). /bin/ provides programs that must be available even if only the partition containing / is mounted. This situation may arise should one need to repair other partitions but have no access to shared directories (i.e. you are in single user mode and therefore have no network access). Unlike /sbin, the /bin directory contains several useful commands that are of use to both the root user as well as non-root users.<br />
<br />
'''/boot/''' Unshareable, static directory containing the kernel and ramdisk images as well as the bootloader configuration file, and bootloader stages. /boot also stores data that is used before the kernel begins executing userspace programs. This may include saved master boot sectors and sector map files.<br />
<br />
'''/dev/''' Essential device nodes created by udev during the boot process and as machine hardware is discovered by events. This directory highlights one important aspect of the <code>UNIX</code> filesystem - everything is a file or a directory. Exploring this directory will reveal many files, each representing a hardware component of the system. The majority of devices are either block or character devices; however other types of devices exist and can be created. In general, 'block devices' are devices that store or hold data, whereas 'character devices' can be thought of as devices that transmit or transfer data. For example, hard disk drives and optical drives are categorized as block devices while serial ports, mice and USB ports are all character devices.<br />
<br />
'''/etc/''' Host-specific, unshareable global configuration files shall be placed in the /etc directory. If more than one configuration file is required for an application, it is customary to use a subdirectory in order to keep the /etc/ area as clean as possible. It is considered good practice to make frequent backups of this directory as it contains all system related configuration files. <br />
:'''/etc/conf.d/''' Some daemon scripts will have a matching configuration file in this directory that contains some useful default values. When a daemon is started, it will first source the settings from its config file within this directory, and then source /etc/rc.conf. Arch's simple, transparent scripting approach means you can easily centralize all your daemon configuration options in your /etc/rc.conf simply by setting an appropriate variable value, or, split up your configuration over multiple files if you prefer a decentralized approach to this issue. <br />
:'''/etc/rc.d/''' All Arch daemons reside here. Custom scripts may also be placed here and invoked from the DAEMONS= array in /etc/rc.conf<br />
:'''/etc/X11/''' Configuration files for the X Window System<br />
:::'''/etc/X11/xinit/''' xinit configuration files. 'xinit' is a configuration method of starting up an X session that is designed to be used as part of a script. <br />
:::'''/etc/X11/xinit/xinitrc''' Global xinitrc file, used by all X sessions started by xinit (startx). Its usage is of course overridden by a .xinitrc file located in the home directory of a user.<br />
<br />
'''/home/''' <code>UNIX</code> is a multi-user environment. Therefore, each user is also assigned a specific directory that is accessible only to them and to the root user. These are the user home directories, which can be found under '/home/$USER' (~/). Within their home directory, a user can write files, delete them, install programs, etc. Users' home directories contain their data and personal configuration files, the so-called 'dot files' (their name is preceded by a dot), which are 'hidden'. To view dotfiles, enable the appropriate option in your file manager or run ls with the -a switch. If there is a conflict between personal and system wide configuration files, the settings in the personal file will prevail. Dotfiles most likely to be altered by the end user include .xinitrc and .bashrc files. The configuration files for xinit and Bash respectively. They allow the user the ability to change the window manager to be started upon login and also aliases, user-specified commands and environment variables respectively. When a user is created, their dotfiles shall be taken from the /etc/skel directory where system sample files reside. <br />
'''/home''' can become quite large as it is typically used for storing downloads, compiling, installing and running programs, mail, collections of multimedia files etc.<br />
<br />
'''/lib/''' Contains kernel modules and essential shared library images (the C programming code library) needed to boot the system and run the commands under /bin/ and /sbin/. Libraries are collections of frequently used program routines and are readily identifiable through their filename extension of *.so. They are essential for basic system functionality. Kernel modules (drivers) are in the subdirectory /lib/modules/<kernel-version>.<br />
<br />
'''/lost+found''' <code>UNIX</code>-like operating systems must execute a proper shutdown sequence. At times, a system might crash or a power failure might take the machine down. Either way, at the next boot, a filesystem check using the ''fsck'' program shall be performed. ''Fsck'' will go through the system and try to recover any corrupt files that it finds. The result of this recovery operation will be placed in this directory. The files recovered are not likely to be complete or make much sense but there always is a chance that something worthwhile is recovered.<br />
<br />
'''/media/''' Mount points for removable media. CDROMs, DVD's, and USB sticks shall have an appropriate mount point under /media/. The motivation for the creation of this directory has been that historically there have been a number of other different places used to mount removeable media such as /cdrom, /mnt or /mnt/cdrom. Placing the mount points for all removeable media directly in the root directory would potentially result in a large number of extra directories in /. Although the use of subdirectories in /mnt as a mount point has recently been common, it conflicts with a much older tradition of using /mnt directly as a temporary mount point. Therefore, Arch allocates /media as the mountpoint for removable media. On systems where more than one device exists for mounting a certain type of media, mount directories shall be created by appending a digit to the name of those available above starting with '0', but the unqualified name must also exist.<br />
* hal mounts removable media to /media as /media/<name_of_removable_filesystem><br />
<br />
'''/mnt/''' This is a generic mount point for temporary filesystems or devices. Mounting is the process of making a filesystem available to the system. After mounting, files will be accessible under the mount-point. Additional mount-points (subdirectories) may be created under /mnt/. There is no limitation to creating a mount-point anywhere on the system, but by convention and for practicality, littering a file system with mount-points should be avoided.<br />
<br />
'''/proc/''' /proc is very special in that it is also a virtual filesystem. It is sometimes referred to as the ''process information pseudo-file system''. It doesn't contain 'real' files, but rather, runtime system information (e.g. system memory, devices mounted, hardware configuration, etc). For this reason it can be regarded as a control and information center for the kernel. In fact, quite a lot of system utilities are simply calls to files in this directory. For example, 'lsmod' is the same as 'cat /proc/modules' while 'lspci' is a synonym for 'cat /proc/pci'. By altering files located in this directory, kernel parameters may be read/changed (sysctl) while the system is running.<br />
<br />
The most distinctive facet about files in this directory is the fact that all of them have a file size of 0, with the exception of '''kcore, mounts''' and '''self'''. <br />
<br />
'''/root/''' Home directory of the System Administrator, 'root'. This may be somewhat confusing, ('/root under root') but historically, '/' was root's home directory (hence the name of the Administrator account). To keep things tidier, 'root' eventually got his own home directory. Why not in '/home'? Because '/home' is often located on a different partition or even on another system and would thus be inaccessible to 'root' when - for some reason - only '/' is mounted. <br />
<br />
'''/sbin/''' <code>UNIX</code> discriminates between 'normal' executables and those used for system maintenance and/or administrative tasks. The latter reside either here or - the less important ones - in /usr/sbin. Programs executed after /usr is known to be mounted (when there are no problems) are generally placed into /usr/sbin. This directory contains binaries that are essential to the working of the system. These include system administration as well as maintenance and hardware configuration programs. grub (the command), fdisk, init, route, ifconfig, etc., all reside here. <br />
<br />
'''/srv/''' Site-specific data which is served by the system. The main purpose of specifying this is so that users may find the location of the data files for a particular service, and so that services which require a single tree for readonly data, writable data and scripts (such as cgi scripts) can be reasonably placed. Data of interest to a specific user shall be placed in that user's home directory.<br />
<br />
'''/tmp''' This directory contains files that are required temporarily. Many programs use this to create lock files and for temporary storage of data. Do not remove files from this directory unless you know exactly what you are doing! Many of these files are important for currently running programs and deleting them may result in a system crash. On most systems, this directory is cleared out at boot or at shutdown by the local system. The basis for this was historical precedent and common practice.<br />
<br />
'''/usr/''' While root is the primary filesystem, /usr is the secondary hierarchy, for user data, containing the majority of (multi-)user utilities and applications. /usr is shareable, read-only data. This means that /usr shall be shareable between various hosts and must not be written to, except in the case of system administrator intervention (installation, update, upgrade). Any information that is host-specific or varies with time is stored elsewhere. <br />
<br />
Aside from /home/, /usr/ usually contains by far the largest share of data on a system. Hence, this is one of the most important directories in the system as it contains all the user binaries, their documentation, libraries, header files, etc. X and its supporting libraries can be found here. User programs like telnet, ftp, etc., are also placed here. In the original <code>UNIX</code> implementations, /usr/ (for ''user''), was where the home directories of the system's users were placed (that is to say, /usr/''someone'' was then the directory now known as /home/''someone''). Over time, /usr/ has become where userspace programs and data (as opposed to 'kernelspace' programs and data) reside. The name has not changed, but its meaning has narrowed and lengthened from ''everything user related'' to ''user usable programs and data''. As such, the backronym ''''U'''ser '''S'''ystem '''R'''esources' was created. <br />
::'''/usr/bin/''' Non-essential command binaries (not needed in single user mode); for all users. This directory contains the vast majority of binaries (applications) on your system. Executables in this directory vary widely. For instance vi, gcc, and gnome-session reside here.<br />
::'''/usr/include/''' Header files needed for compiling userspace source code..<br />
::'''/usr/lib/''' Libraries for the binaries in /usr/bin/ and /usr/sbin/.<br />
::'''/usr/sbin/''' Non-essential system binaries of use to the system administrator. This is where the network daemons for the system reside, along with other binaries that (generally) only the system administrator has access to, but which are not required for system maintenance and repair. Normally, these directories are never part of normal user's $PATHs, only of root's (PATH is an environment variable that controls the sequence of locations that the system will attempt to look in for commands).<br />
::'''/usr/share/''' This directory contains 'shareable', architecture-independent files (docs, icons, fonts etc). Note, however, that '/usr/share' is generally not intended to be shared by different operating systems or by different releases of the same operating system. Any program or package which contains or requires data that don't need to be modified should store these data in '/usr/share/' (or '/usr/local/share/', if manually installed - see below). It is recommended that a subdirectory be used in /usr/share for this purpose.<br />
::'''/usr/src/''' The 'linux' sub-directory holds the Linux kernel sources, and header-files.<br />
::'''/usr/local/''' Optional tertiary hierarchy for local data. The original idea behind '/usr/local' was to have a separate ('local') '/usr/' directory on every machine besides '/usr/', which might be mounted read-only from somewhere else. It copies the structure of '/usr/'. These days, '/usr/local/' is widely regarded as a good place in which to keep self-compiled or third-party programs. This directory is empty by default in Arch Linux. It may be used for manually compiled software installations if desired. Pacman installs to /usr/, therefore, manually compiled/installed software installed to /usr/local/ may peacefully co-exist with pacman-tracked system software. <br />
<br />
'''/var/''' Variable files, such as logs, spool files, and temporary e-mail files. On Arch, the [[ABS]] tree and pacman cache also reside here. Why not put the variable and transient data into /usr/? Because there might be circumstances when /usr/ is mounted as read-only, e.g. if it is on a CD or on another computer. '/var/' contains variable data, i.e. files and directories the system must be able to write to during operation, whereas /usr/ shall only contain static data. Some directories can be put onto separate partitions or systems, e.g. for easier backups, due to network topology or security concerns. Other directories have to be on the root partition, because they are vital for the boot process. 'Mountable' directories are: '/home', '/mnt', '/tmp', '/usr' and '/var'. Essential for booting are: '/bin', '/boot', '/dev', '/etc', '/lib', '/proc' and '/sbin'. <br />
::'''/var/abs/''' The [[ABS]] tree. A ports-like package build system hierarchy containing build scripts within subdirectories corresponding to all installable Arch software.<br />
::'''/var/cache/pacman/pkg/''' The pacman package cache. <br />
::'''/var/lib/''' State information. Persistent data modified by programs as they run (e.g. databases, packaging system metadata etc.).<br />
::'''/var/lock/''' Unsharable Lock files data. Files keeping track of resources currently in use.<br />
::'''/var/log/''' Log files. <br />
::'''/var/mail/''' Shareable directory for users' mailboxes.<br />
::'''/var/run/''' Unshareable data about the running system since last boot (e.g. currently logged-in users and running daemons).<br />
::'''/var/spool/''' Spool for tasks waiting to be processed (e.g. print queues and unread mail).<br />
::'''/var/spool/mail/''' Deprecated location for users' mailboxes.<br />
::'''/var/tmp/''' Temporary files to be preserved between reboots.<br />
'''/opt/''' Packages and large static files that do not fit cleanly into the above GNU filesystem layout can be placed in /opt. A package placing files in the /opt/ directory creates a directory bearing the same name as the package. This directory in turn holds files that otherwise would be scattered throughout the file system.<br />
For example, the acrobat package has Browser, Reader, and Resource<br />
directories sitting at the same level as the bin directory. This<br />
doesn't fit into a normal GNU filesystem layout, so Arch places all the<br />
files in a subdirectory of /opt.<br />
<br />
==Arch Boot Process==<br />
<br />
After the initial POST, the BIOS directs the computer to load a boot sector from the hard drive. Actually, a small program called GRUB stage1 is within this sector. This is a tiny program. Its only function is to load GRUB stage1.5 or stage2 (depending on filesystem type). <br />
<br />
GRUB stage1.5/stage2 will present a boot menu with various (customizable) choices of operating systems to boot. The path to the device, partition and filename of the kernel and initial ram filesystem is contained for GRUB in /boot/grub/menu.lst.<br />
<br />
After choosing an Arch Linux entry, GRUB loads the Linux kernel. The kernel is the core of an operating system. It functions on a low level (''kernelspace'') interacting between the hardware of the machine, and the programs which use the hardware to run. To make efficient use of the cpu, the kernel uses a scheduler to arbitrate which tasks take priority at any given moment, creating the illusion (to human perception) of many tasks being executed simultaneously. <br />
<br />
After the kernel is loaded, it reads from the initramfs. The purpose of the initramfs is to bootstrap the system to the point where it can access the root filesystem. This means it has to load any modules that are required for devices like IDE, SCSI, or SATA drives (or USB/FW, if you are booting off a USB/FW drive). Once the initramfs loads the proper modules, either manually or through udev, it passes control to the kernel and the boot process continues. For this reason, the initrd only needs to contain the modules necessary to access the root filesystem. It does not need to contain every module you would ever want to use. The majority of your everyday modules will be loaded later on by udev, during the init process. <br />
<br />
The kernel then looks for the program <code>init</code> which resides at <code>/sbin/init</code>. <code>init</code> relies on <code>glibc</code>, the GNU C library. Libraries are collections of frequently used program routines and are readily identifiable through their filename extension of *.so. They are essential for basic system functionality. This part of the boot process is called ''early userspace''.<br />
<br />
The purpose of <code>init</code> is to bring (and keep) the system up into a usable state. It uses the boot scripts to do so. As you may be aware, Arch uses BSD-style boot scripts. <code>init</code> reads the file <code>/etc/inittab</code>, which tells it what to do. Looking over the <code>inittab</code> script, you will find that the first uncommented line defines the default system runlevel, or, 3. The next thing it is told to do is to run an initialization script. The program that executes (or interprets) this script is bash, the same program that gives you a command prompt. In Arch Linux, the main initialization script is <code>/etc/rc.sysinit</code>. <code>/etc/inittab</code> also defines your virtual consoles, which are 'respawned' by <code>/sbin/init</code> if terminated. Lastly, <code>inittab</code> defines a login manager, if starting the system at runlevel 5 is desired. By default the login manager is also respawned by <code>/sbin/init</code> if terminated.<br />
<br />
<code>/etc/inittab</code> directs <code>init</code> to call the first boot script, <code>/etc/rc.sysinit</code>, after which <code>/etc/rc.multi</code> will be called (in a normal boot). The last script to run will be <code>/etc/rc.local</code>, which is empty by default. <br />
<br />
When started in runlevel 1, the single user mode, the script <code>/etc/rc.single</code> is run instead of <code>/etc/rc.multi</code>. You will not find an endless symlink collection in the /etc/rc?.d/ directories to define the boot sequence for all possible runlevels. In fact, due to this approach Arch only really has three runlevels, if you take starting up X in runlevel 5 into account. The boot scripts are using the variables and definitions found in the <code>/etc/rc.conf</code> file and also a set of general functions defined in the <code>/etc/rc.d/functions</code> script. If you plan to write your own daemon files, you should consider having a look at this file and existing daemon scripts.<br />
<br />
===Boot Script Overview===<br />
#/etc/inittab (covered above)<br />
#/etc/rc.sysinit<br />
#/etc/rc.single<br />
#/etc/rc.multi<br />
#/etc/rc.local<br />
#/etc/profile<br />
#/etc/rc.shutdown<br />
#/etc/rc.local.shutdown<br />
#/etc/rc.d/*<br />
<br />
<br />
'''/etc/rc.sysinit'''<br />
<br />
The main system boot script, which mounts filesystems, runs udev, activates swap, loads modules, sets localization parameters, etc. When called, udev shall probe system hardware, loading appropriate kernel modules and creating device nodes under /dev. For more, open /etc/rc.sysinit in your editor of choice; the file is well commented.<br />
<br />
'''/etc/rc.single'''<br />
<br />
Single-user startup. Not used in a normal boot-up. If the system is started in single-user mode, for example with the kernel parameter 1 before booting or during normal multi-user operation with the command init 1, this script makes sure no daemons are running except for the bare minimum; syslog-ng and udev. The single-user mode is useful if you need to make any changes to the system while making sure that no remote user can do anything that might cause data loss or damage. <br />
For desktop users, this mode is usually quite useless.<br />
<br />
'''/etc/rc.multi'''<br />
<br />
Multi-user startup script. It starts all daemons (such as a logger, a network script, etc) specified in the DAEMONS= array in /etc/rc.conf, after which it calls /etc/rc.local. <br />
<br />
'''/etc/rc.local'''<br />
<br />
Local multi-user startup script. Empty by default. It is a good place to put any last-minute commands you want the system to run at the very end of the boot process. Most common system configuration tasks, like loading modules, changing<br />
the console font or setting up devices, usually have a dedicated place where they belong. To avoid confusion, you should make sure that whatever you intend to add to your rc.local is not already residing in /etc/profile.d/, or any other existing configuration location instead.<br />
<br />
'''/etc/profile''' This script is run on each user login to initialize the system. It globally defines PS1, $PATH, bash aliases, etc. It is kept quite simple under Arch Linux, as most things are. You may wish to edit or customize it to suit your needs.<br />
<br />
'''/etc/rc.shutdown''' <br />
<br />
System shutdown script. It stops daemons, unmounts filesystems, deactivates the swap, etc. <br />
<br />
'''/etc/rc.local.shutdown''' (Optional)<br />
<br />
Analogous to the /etc/rc.local file, this file may contain any commands you want to run right before the common rc.shutdown is executed. Please note that this file does not exist by default, and for it to work properly, it must be set as executable.<br />
<br />
<br />
'''/etc/rc.d/*'''<br />
<br />
This directory contains the daemon scripts referred to from the rc.conf's DAEMONS= array. In addition to being called on boot, you can use these scripts when the system is running to manage the services of your system. For example the command<br />
/etc/rc.d/postfix stop<br />
<br />
will stop the postfix daemon. This directory is not in the $PATH by default, but may be added for convenience. Obviously a corresponding daemon script only exists when the appropriate package has been installed (in this case postfix). With a base system install, there are few scripts in here, but rest assured that all relevant daemon scripts end up here. If you wish, you can, of course, create your own scripts and place them here, to be called by the DAEMONS= array in /etc/rc.conf on system startup. <br />
<br />
This directory is pretty much the equivalent to the /etc/rc3.d/ or /etc/init.d/ directories of other distributions, but without all the symlink hassle. The lack of symlink requirement is a defining difference of a *BSD-style init framework, vs a sysvinit.<br />
<br />
===agetty and login===<br />
After the Arch boot scripts are completed, the <code>agetty</code> program prompts you for a login name. After a login name is received, <code>agetty</code> calls <code>login</code> to prompt for the login password.<br />
<br />
Finally, with a successful login, the <code>login</code> program starts your default shell. The default shell and environment variables may be globally defined within /etc/profile. All variables within a users home directory shall take precedence over those globally defined under /etc. For instance, if 2 conflicting variables are specified within /etc/profile and ~/.bashrc, the one dictated by ~/.bashrc shall prevail.<br />
<br />
For more, see [[The Arch boot process]]<br />
<br />
==Maintaining the system==<br />
===su===<br />
'''su''' or '''su -''' ?<br />
<br />
The default behavior of <br />
su<br />
is to remain within the current directory and to maintain the environmental variables of the original user (rather than switch to those of the new user).<br />
It sometimes can be advantageous for a system administrator to use the shell account of an ordinary user rather than its own. In particular, occasionally the most efficient way to solve a user's problem is to log into that user's account in order to reproduce or debug the problem.<br />
<br />
However, in many situations it is not desirable, or it can even be dangerous, for the root user to be operating from an ordinary user's shell account and with that account's environmental variables rather than from its own. While inadvertently using an ordinary user's shell account, root could install a program or make other changes to the system that would not have the same result as if they were made while using the root account. For instance, a program could be installed that could give the ordinary user power to accidentally damage the system or gain unauthorized access to certain data.<br />
<br />
Thus, it is advisable that administrative users, as well as any other users that are authorized to use su (of which there should be very few, if any), acquire the habit of always following the su command with a space and then a hyphen. (login shell option) The hyphen has two effects: (1) it switches from the current directory to the home directory of the new user (e.g., to /root in the case of the root user) by ''logging in'' as that user, and (2) it changes the environmental variables to those of the new user as dictated by their ~/.bashrc. That is, if the first argument to su is a hyphen, the current directory and environment will be changed to what would be expected if the new user had actually logged on to a new session (rather than just taking over an existing session).<br />
<br />
'''''Thus, administrators should generally use su as follows''''':<br />
$ su -<br />
An identical result is produced by adding the username root, i.e.,<br />
$ su - root<br />
Likewise, the same can be done for any other user, e.g., for a user named bob:<br />
# su - bob<br />
<br />
===Pacman===<br />
[[Pacman]] is both a binary and source package manager which is able to download, install, and upgrade packages from both remote and local repositories with full dependency handling, and has easy-to-understand tools for crafting your own packages too.<br />
<br />
A more-detailed description of Pacman can be found in [[Pacman|its article]].<br />
<br />
====Useful commands====<br />
To view the options available for a particular operational command, say '''-Q''', just append it with '''-h''':<br />
pacman -Qh<br />
<br />
To synchronize and update the local packages database with the remote repositories (it is a good idea to do this before installing and upgrading packages):<br />
pacman -Sy<br />
<br />
To '''upgrade''' all packages on the system:<br />
pacman -Su<br />
<br />
To sync, update, and '''upgrade''' all the packages on the system with one command:<br />
pacman -Syu<br />
<br />
To install or upgrade a single package or list of packages (including dependencies):<br />
pacman -S packageA packageB<br />
<br />
You can also sync, update the package database, and install packages in one command:<br />
pacman -Sy packageA packageB<br />
<br />
To remove a single package, leaving all of its dependencies installed:<br />
pacman -R package<br />
<br />
To remove a package and all of the package's dependencies which are not used by any other installed package:<br />
pacman -Rs package<br />
('''-Rs''' is typically preferred vs '''R''' to remove any package as it will clean up all unused dependencies)<br />
<br />
To remove all of the package's now unneeded dependencies and also instruct pacman to ignore file backup designations. (Normally, when a file is removed from the system the database is checked to see if the file should be renamed with a ".pacsave" extension.):<br />
pacman -Rsn package<br />
<br />
To search the remote (repo) package database for a list of packages matching a given keyword:<br />
pacman -Ss keyword<br />
List all available packages in a given repo. e.g., core:<br />
pacman -Sl core<br />
To list all packages on your system<br />
pacman -Q<br />
<br />
To list all packages on your system without the version strings, we add the '''-q''' option:<br />
pacman -Qq<br />
<br />
To search (query) the local (your machine) package database for a given package:<br />
pacman -Q package <br />
<br />
To search (query) the local (your machine) package database for a given package and list all pertinent information:<br />
pacman -Qi package<br />
<br />
To list all files installed by a given ''package'':<br />
<tt>pacman -Ql ''package''</tt><br />
Conversely, to find the package that owns a given file (in this example, the ''ls'' executable):<br />
<tt>pacman -Qo /bin/ls</tt><br />
To find all unused packages (orphans):<br />
pacman -Qdt<br />
Missing libraries: Suppose you receive an error message like this:<br />
<tt>mplayer: error while loading shared libraries: ''libgssapi.so.2'': cannot open shared object file: No such file or directory</tt><br />
This may be an indication that a package you have previously installed is now corrupt (some or all of its files are missing). You should try to find the package name that provides the missing shared library. In this example, you could type:<br />
<tt>pacman -Ql | grep ''libgssapi.so.2''</tt><br />
The first column in the output is the package name:<br />
<tt>heimdal /usr/lib/libgssapi.so.2<br />
heimdal /usr/lib/libgssapi.so.2.0.0<br />
</tt><br />
Then, you can just re-install it:<br />
<tt>pacman -Sy heimdal</tt><br />
<br />
To defragment pacman's cache database and optimize for speed:<br />
pacman-optimize<br />
<br />
To count how many packages are currently on your system:<br />
pacman -Q | wc -l<br />
<br />
To install a package compiled from source using ABS and makepkg:<br />
pacman -U packagename.pkg.tar.gz<br />
<br />
Note: There are countless additional pacman functions and commands. Try man pacman and consult the [[pacman]] wiki entries.<br />
<br />
====Files====<br />
There are a number of files left and created by pacman and other programs to facilitate maintenance and to conform to a safe computing practice. When pacman is installing something, the package contains information on whether to back up a particular file. Such files will have the '''.pacsave''' extension. When you force a "NoUpgrade" on a file via [http://www.archlinux.org/pacman/pacman.conf.5.html pacman.conf], it will not be replaced during an upgrade and the new file will come with the '''.pacnew''' extension. For example, you have edited a configuration file thoroughly and you do not want an upgrade of the respective package to replace the file with a new one, we must have the following line in '''/etc/pacman.conf''':<br />
NoUpgrade = /path/to/config/file<br />
To view the differences of the old and new versions of these files, we can either edit them manually or use a '''diff''' utility to take note of the differences. There is an automated tool to find and view such files available from the '''community''' repository:<br />
pacman -S pacman-contrib<br />
cd ~/<br />
pacdiff # as root<br />
There is a bug in the above tool where if you navigate to '''/etc''' and run it from there, the paths will be messed up. We remain on the safer side by being at "home". You may want to run it as user first in case you happen to be a careless person (you may just overwrite or remove files because you ''think'' that is the right way).<br><br />
<br />
There are other types of leftovers depending on the programs available on your system. Some will create backups with a '''.bak''' extension, while others with something like "'''~'''" or "'''-'''". Unfortunately, there is currently no way to "automatically" find and review them. Fear not, as we have no need for automated tools to deal with such trivial tasks. Simply use '''locate''' to search for them:<br />
locate -e *.~ *.- *.bak<br />
And we can use something useful like '''vimdiff''' to look at the differences manually:<br />
pacman -S vim<br />
vimdiff file1 file2<br />
<br />
==Tweaks/Finishing touches==<br />
<br />
<br />
===HAL===<br />
Since you have now installed a desktop environment/window manager, and if you did not do so earlier, now would be a good time to also install HAL. HAL allows plug-and-play for your mobile phone, your iPod, your external HD's, etc. It will mount the device and make a nice visual icon on your desktop and/or in 'My Computer', allowing you to access the device after you have plugged it in instead of having to manually configure the /etc/fstab file or udev rules for each and every new device.<br />
<br />
KDE, GNOME and XFCE all use HAL.<br />
<br />
The installation procedure is described in the [[HAL]] article. Some information can also be found at [http://en.wikipedia.org/wiki/HAL_(software) Wikipedia].<br />
<br />
===Backgrounding DAEMONS on startup===<br />
<br />
To speed up system start up procedure, background selected DAEMONS in /etc/rc.conf by prefixing them with a '@' e.g.:<br />
<br />
DAEMONS=(syslog-ng @network crond @alsa @hal @fam @kdm)<br />
This will enable daemons to load in the background, without waiting for the preceding daemon to load first.<br />
<br />
Prefix any daemons which you do not need with a bang (!) e.g.:<br />
<br />
DAEMONS=(syslog-ng @network !netfs !crond @alsa @hal @fam @kdm)<br />
<br />
Alternatively, you may also simply remove unneeded daemons.<br />
<br />
===Beautifying Fonts for LCD's===<br />
See [[Fonts]]<br />
<br />
===Adjusting Mouse for scroll wheel===<br />
While your mouse should be working out of the box, you may want to use your scroll wheel. Add this to your Input Section (mouse0):<br />
Option "ZAxisMapping" "4 5 6 7"<br />
<br />
===Get All Mouse Buttons Working===<br />
See [[Get All Mouse Buttons Working]]<br />
<br />
===Configuring Touchpad for Laptops===<br />
See [[Touchpad Synaptics]]<br />
<br />
===Adjusting Keyboard Layout===<br />
You may want to change your keyboard layout. To do this edit your /etc/X11/xorg.conf and add these lines in the InputDevice Section (Keyboard0) (the example shows a German keyboard layout with no dead keys; alter this to fit your needs).<br />
Option "XkbLayout" "de"<br />
Option "XkbVariant" "nodeadkeys"<br />
<br />
===Additional tweaks for laptops===<br />
ACPI support is needed if you want to use some special functions on your notebook (e.g. sleep, sleep when lid is closed, special keys...). Install <tt>acpid</tt> using<br />
pacman -S acpid<br />
and add it to the daemons in /etc/rc.conf. If you already have '''hal''' specified in your DAEMONS, there is no need to add '''acpid'''. HAL will automatically detect and load the acpid daemon. Manually, it can be started by<br />
/etc/rc.d/acpid start<br />
<br />
More-specific information about Arch Linux on various Laptops can be found at [[:Category:Laptops (English)]]<br />
<br />
===Configuring CPU frequency scaling===<br />
Modern processors can decrease their frequency and voltage to reduce heat and power consumption. Less heat leads to a quieter system; Laptop users will definitely want this, but even a desktop system will benefit from it. Install cpufrequtils with<br />
pacman -S cpufrequtils<br />
Edit the config file /etc/conf.d/cpufreq and change <br />
governor="ondemand"<br />
which dynamically increases the CPU frequency if needed (which is a safe choice on desktop systems too). Alter min_freq and max_freq to match your system's CPU spec. If you do not know the frequencies, run ''cpufreq-info'' after loading one of the frequency scaling modules. You can also comment out or delete the min_freq and max_freq lines: things will work automatically. Add the frequency scaling modules to your /etc/rc.conf modules line. Most modern notebooks and desktops can simply use the ''acpi-cpufreq'' driver, however other options include the ''p4-clockmod, powernow-k6, powernow-k7, powernow-k8, and speedstep-centrino'' drivers. Load the module with<br />
modprobe <modulname> <br />
and start cpufreq with<br />
/etc/rc.d/cpufreq start<br />
For more details, see [[Cpufrequtils]]<br />
<br />
===Pm-Utils===<br />
The pm-utils package will allow you to suspend-to-RAM and hibernate: <br />
pacman -S pm-utils<br />
[[Pm-utils]] wiki page.<br />
<br />
===Laptop-Mode===<br />
The laptop-mode-tools package is sort of a one-stop configuration for all laptop power management utilities. It works in conjunction with other installed tools to fully configure everything from hard disk spin-down to X display DPMS standby times, if desired.<br />
pacman -S laptop-mode-tools<br />
Add laptop-mode to your DAEMONS= line in /etc/rc.conf and configure /etc/laptop-mode/laptop-mode.conf.<br />
<br />
<br />
<br />
<br />
<br />
==Polishing & Further information==<br />
For further information and support you can go to the [http://www.archlinux.org/ homepage], [[Special:Search|search the wiki]], the [http://bbs.archlinux.org/ forums], the [[ArchChannel|IRC channel]], and the [http://www.archlinux.org/mailman/listinfo/ mailing lists].<br />
=====FAQs=====<br />
See [[Arch FAQs for newbies]]<br />
<br />
There is also an [http://bbs.archlinux.org/viewforum.php?id=23 Arch Subforum] devoted to beginners.<br />
<br />
=====Terminology=====<br />
For more information on the jargon used in Arch, look at [[Arch Terminology/Jargon for newbies|this article]].<br />
<br />
=====Where to go from here?=====<br />
<br />
You may also be interested in:<br />
<br />
[[Post Installation Tips]]<br />
<br />
[[ArchLinux User-community Repository (AUR)]]<br />
<br />
[[Get All Mouse Buttons Working]]<br />
<br />
[[Improve Pacman Performance]]<br />
<br />
[[Kernel Compilation]]<br />
<br />
[[Pm-utils]]<br />
<br />
[[Cpufrequtils]]<br />
<br />
[[:Category:Eye candy (English)| Eye Candy]]<br />
<br />
[[Useful Applications]]<br />
<br />
==External links==<br />
* [http://archux.com/page/installation-guide/ Arch Linux installation guide with images]<br />
* [http://archux.com/page/arch-linux-video-installation-guide Arch Linux video installation guide]</div>
SkonesMickLoud