Zobrazujú sa príspevky s označením BSD. Zobraziť všetky príspevky
Zobrazujú sa príspevky s označením BSD. Zobraziť všetky príspevky

štvrtok 9. februára 2012

Post install settings 2

We will continue in "tcsh" shell customization.

3. Customize shell prompt.:
You can achieve nice and pragmatic prompt really fast but what's perfect, you can use colors in your prompt. It's a little bit hard to understand, because of color syntax but you will be rewarded with fancy prompt. First take a look at b/w prompt and colored afterwards.

In "if" section of ".tcshrc" check the "set prompt" line.
The prompt is bordered with quotes.
You can put your "own words and symbols" to your prompt with combination of system variables like hostname, username, date, time and so. The list of variables can be found in "man tcsh".
The b/w prompt which I use:

set prompt = "[%n@%m|%~]>"
- [: my own character
- %n: prints username
- @: my own character to separate username and hostname
- %m: prints hostname
- |: (pipe character) my own character do separate directory from others
- %~: prints current directory (~will show instead home dir.)
- ]: my own character
- >: my own character
My prompt then looks like: 
[root@MCBSD|/etc]>

I use above prompt, but with colors. I use red for username letters, blue for [@|] and white for the rest. To understand color syntax, practice with it. Below example is for color of letters, you can set color even for background and so.

Color codes:
30m - black
31m - red
32m - green
36m - cyan
and so...for more check google: bash prompt color codes

Syntax:[starting string][your string][ending/reset string]

[starting string]: %{\033[36m%}
-just change "36m" to color you want. 36 is for cyan
[your string]: your symbol "etc. @" or variable "%n" for username"
[ending/reset string]: %{\033[0m%}
- leave this as it is, it resets color back to default


You have to use this syntax for every symbol in prompt in order to have colored this symbol.


Small example: word TEST with half cyan and half  red


%{\033[36m%}TE%{\033[0m%}{\033[31m%}ST{\033[0m%}
- %{\033[36m%} will make  "TE" to have cyan color 
- {\033[0m%} will reset color after "TE" back to default
- {\033[31m%} will make "ST" to have red color
- {\033[0m%} will reset color after "ST" back to default 


My prompt:
set prompt = "%{\033[36m%}[%{\033[0m%}%{\033[31m%}%n%{\033[0m%}%{\033[36m%}@%{\033[0m%}%m%{\033[36m%}|%{\033[0m%}%~%{\033[36m%}]%{\033[0m%}>"


If you compare letters marked with red, it's the same as in b/w prompt. Rest contains starting and ending strings.

That's it. Your life in CLI is more comfortable now. 
You have nice overview where and "who" you are by nice prompt.
You can use TAB key for better orientation in usable commands and for overview of listed files/folders in actual position.
You have shortcuts for faster executing your frequent commands.

 
 







nedeľa 5. februára 2012

Base install (minimal)

As I mentioned, I prefer minimal install and then adjust the system in way of my ideas.
Here you have a list of few installation steps. 
(FBSD 8.2-Release,64Bit).
(I suggest to install 64 bit version if you can, anyway everything is going towards 64bits)
1.Select country and eventually key-map after
2.Main menu
We are not installing Standard or Express install so choose "Custom" as we have everything under control.

3.Main menu
"Options" are not interesting at this moment. First we'll create a slice. More about disk geometry see etc. handbook. Everything regarding our BSD system will be stored in slice.

4. Partition - select disk
Select a disk you want to BSD install on. If you are not sure on which you have free space selected for your install there is a hint. In Windows etc. via Partition Magic or similar create random partition with space you want to spend on it. Etc. ext4(linux partition) with 60GB space. So this way your space for BSD will be marked and then you can browse disks (ad0/ad2 on the picture) and look for this partition. Then you can select that "marked" partition and delete it, so you are sure the new space created after is safely selected and you can't make a mistake by removing "live" filesystem. If you have hard drive dedicated for new BSD installation, then don't bother with that.
5. Partition - create slice
As you can see, there is a legend with letters assignment. See the unused space, select this row and press "C". The new slice is going to be created. Assign all possible space, so don't touch the number and press OK. That's it. 
 6. Create labels
See the step 3. Select the label. Then you will see picture below.
See the highlighted row. Every time you want to create "label" or mount point, go to this row first.
So you have highlighted the row and now press C. As description says, you can specify amount of space for particular mount point. If you don't know what the mount point is, check the google.
You can assign selected space to file-system or to swap. We are going to do both.
I prefer to create isolated mount points for root(/), /usr, /var, and /tmp. You can even create one mount point  associated with the root (/). Check the google if you don;t know how much space assign to particular mount points. It depends on purpose of your system. You will do nothing apocalyptic if you mounted all space to the root(/). Do not forget to reserve the space for SWAP partition. How much the size? Check the google. I have 6GB of RAM so its generally enough to live without SWAP, but for sure, I have 2GB of swap but I have not seen the SWAP in use on my system.
7. Select stuff to install
Check the step 3. Select the "Distributions". 
Here you can choice, what will be installed on your system. We prefer minimal install so choose minimal and then little bit more so select "Custom" on the same page and press OK.
Choice "Minimal" ends in self "base" and "kernels" selection. I have 64 bit system and i want to compatibility with i386 system so I've selected lib32 and for better orientation in commands we will need "man" pages. That's it. All further we are going to do or add manually - that's the purpose.
Select OK and you should appear in step 3.
8. Commit 
In step 3. select the media you want to istall from and again from step 3. menu select "Commit" and above dialogue will appear. "Yes" you want. Consequently the installation will start. 
At the end the following will appear:

 Select "No". Then select "Cancel" to end the installation.
Don't be scared, everything is installed and OK, remove CD eventually, select "YES" and system will be rebooted. Afterwards select default boot option and see the system booting. BSD will scan all the system to gather information about CPU, motherboard and connected devices. Than some self-checks and basic services will start. You should end in LOG IN prompt. 
That's it, you have fresh and powerful BSD install on your computer waiting to play with.

Why FreeBSD?

FreeBSD, in my opinion, is the best to start with from all BSDs.
It's well supported with ports (linux like packages), always up to date and increasingly supported by vendors.
FBSD little differs from Linux distributions in way of system administration.
I've tried many Linux distributions but FBSD fits me the best.
(Update: FBSD is UNIX-like system, not Linux-like or Linux distro)
I prefer to install minimal-base and adjust everything according to my ideas. The benefit of doing this, you are always familiar with your system, you don't have unnecessary balast arround and you will become professional by solving all snags on the way of adjustment your system.
FBSD is great as server OS or even Desktop. 
There is one "negative" about all of this: It often takes a long time to get your system adjusted and familiarized with so patient is appreciated and for those who has IT as hobby it won't be the problem, even vice versa.