Sunday, October 26, 2014

FIRST INSTALL

Many of the steps here can be considered optional, depending on how you intend to use your Raspberry Pi. The steps described here assume typical usage, and if you're not already familiar with the system are recommended.
Install Sudo
It's not wise to use your system always as the root user, so you'll want to create a regular user account with permision to perform root functions under sudo. To install sudo:
# pacman -S sudo
  • To give your regular user permission to use sudo, you need to edit the configuration file using visudo:
# EDITOR=nano visudo
  • Locate the section marked as:
##
## User privilege specification
##
and uncomment the line below to say
 %wheel ALL=(ALL) ALL
  • Save and exit.
Create Regular User Account
Create a new user to use regularly:
On a typical desktop system, use the following command to add a new user, specify Bash as their login shell and add them to the wheel group:
# useradd -m -G wheel -s /bin/bash newuser
This command will also automatically create a group called after your username with the same GID as the UID of the user and makes this the default group for your account on login. Making each user have their own group (with group name same as user name and GID same as UID) is the preferred way to add users.
Now set a password:
# passwd newuser
  • Logout, and relogin as the regular user:
# logout
login: newuser
password: yourpassword
$
(Note the change in prompt from # to $. This will help you know if you're logged in as root or not.) From now on, you should use your regular user for everything. When root needs to do something on your system, use sudo. (The first time you use it, the display will show some general good-behavior rules for its use.)

WEBMIN

from : http://obihoernchen.net/wordpress/tag/webmin/
for my own documentation

Change hostname and timezone

Note: For GUI lovers: skip this step and set hostname and timezone in the webmin interface (next step)
The default hostname is “alarm”. Let’s change it!
1
hostnamectl set-hostname myhostname
To get all available timezones use:
1
timedatectl list-timezones
And to set your timezone:
1
timedatectl set-timezone <Zone>/<SubZone>
For example:
1
timedatectl set-timezone Europe/Berlin
Now reboot:
1
reboot
Wait a few seconds and reconnect to SSH.

5. Install Webmin

Webmin is a pretty cool web-based interface for system administration.
It’s easy to use  and will help you to configure stuff faster.
To install it use:
1
pacman -Sy webmin perl-net-ssleay
Now we have to allow access from more IP addresses.
You have to edit the configuration file.
1
nano /etc/webmin/miniserv.conf
Find the following line: allow=127.0.0.1
Now add a new allow line with your local network broadcast ip or a specific ip and save the file.
For example:
allow=127.0.0.1 192.168.1.0

Now we’ll enable & start the webmin service so it autostarts.
1
2
systemctl enable webmin
systemctl start webmin
To access the Webmin interface open a browser and go to:
https://deviceip:10000
To lower memory usage go to:
Webmin>Webmin Configuration>Advanced Configuration and disable Pre-load Webmin functions library?”

6. USB Auto Mount

If you want to remove your USB HDD and use it anywhere else it would be cool to have automounting like Windows.
There are a lot of auto mounting mechanisms for Arch Linux but a lot of them are outdated.
This one is using udevil to auto mount all USB HDDs on attach as /media/PARTITION_LABEL. So make sure all partitions have a label!
1
pacman -Sy udevil
I want to access my HDDs via Samba to use them in Windows so I have to use either FAT32 or NTFS.
This sucks because FAT32 isn’t able to handle files >4GB so it’s useless.
And NTFS is fucking slow on Linux.
But with some special mount options we are able to increase the speed dramatically!
I’ve did some benchmarks with hdparm and dd before and after the optimization.
The read speed was pretty good already (about 29MB/s –> USB 2.0 limit).
But the write speed was really bad!
Before: ~6,5 MB/s write speed
After: ~28,5 MB/s write speed
As you can see the write speed on NTFS was really slow before. But there is a way to fix it :)
We have to edit the mount options and add a special ntfs-3g option to our udevil automount settings.
Open the udevil config file and edit it:
1
nano /etc/udevil/udevil.conf
Search for default_options_ntfs= and allowed_options=
Now we add the option “big_writes” to both lines so it looks like:
1
..., noatime, big_writes, uid=...
Save the file.
Create the /media directory
1
mkdir /media
Add the udevil service to autostart.
1
systemctl enable devmon@root
Let’s reboot to see whether it works
1
reboot
Wait a few seconds and reconnect to SSH.
Now you’ll have a new folder: /media/yourHDDname where your HDD is mounted.
And you should see something like /dev/sdX1 on /media/… if you type:
1
mount
Note: All USB HDDs should go to standby automatically.
You can check with:
1
hdparm -C /dev/sda