Showing posts with label Systems. Show all posts
Showing posts with label Systems. Show all posts

Friday, January 1, 2010

Linux and Debian simple boot

Today I've been researching on Linux and Debian booting.

There is an excellent article from IBM, which explains the procedure, and the involved parts:

http://www.ibm.com/developerworks/linux/library/l-linuxboot/

Basically:
  • BIOS checks CMOS and choose the booting device
  • Control is given to device's MBR (physically first 512 bytes)
  • MBR checks for partitions on the device (in a self contained table), and gives control to bootable partition.
  • Then, Grub, LILO or whatever takes control, to load the kernel, and the file system.
  • Usually a initrd filesystem is loaded before the "real" one. This way, the kernel can access this filesystem, while the modules for loading the one in the root partition are not yet loaded.
  • Finally, init program is called, to load all user-space applications.
To set this up in a USB drive (my idea), in a simple way, we need:

Make the drive bootable, using the syslinux tool, which is used for FAT filesystems:
syslinux /dev/sdb (or whatever device you want)

Then, mount the filesystem, and copy:
linux: the linux kernel binary
initrd.gz: compressed cpio file containing the initrd file tree

and

syslinux.cfg: syslinux settings, to let syslinux know where to find the kernel and the initrd. Basically:

default linux
append initrd=initrd.gz

Then, just restart, and your device will boot your kernel, and your filesystem.

Here, you can find a Linux kernel, and a initrd file, which will load a basic linux system, running the Debian installer:


Some more info on it at:


Sunday, August 17, 2008

Brother printer and GNU (aka Linux)

Some time ago I purchased a Brother multifunctional priner/scanner/fax, the MFC-235C.

Today, after reinstalling my laptop, I had to install it again, and it has been as easy as the first. Specially because Brother has GNU (aka Linux) support, including GPL drivers for all printer features.

As well as the deserved publicity that I want to give to Brother in this post, I want to write a quick installation howto. I'm installing the printer locally using USB, and CUPS in my Debian. You should have this installed in your computer before starting the next steps (otherwise you'll have to add some steps, or change some).

And that's it! Very easy compared with the problems that I had doing the same installation for HP all-in-one printers.

Thursday, October 18, 2007

Leopard coming soon

After some delays, and some lack of official information, today I finally realized that Apple's new operating will be released on Friday October 26th.

I actually checked it in Apple's headquarters at Cupertino, in my last visit to California, but just for few minutes.

I haven't changed my Free Software philosophy, but I want to complement my GNU/vaio development laptop  with a hopefully better one for desktop working.

I specially don't like working with OpenOffice.org, I hope that working with iMail will fix some problems that I have with Thunderbird, having screenshots is too much complicated in my lightweight system, it'll be great having all major browsers installed on same computer... And after many good references to Steve Jobs work, I'll try to solve all that problems and more without investing time checking new applications and setups.

Sunday, July 8, 2007

Convert a GNU/Linux PC in a router

For converting a simple computer with two interfaces (or more) in a router, it's necessary just to type two sentences in a console:

echo 1 > /proc/sys/net/ipv4/ip-forward

iptables -t nat -A POSTROUTING -o <interface> -j MASQUERADE

Thursday, June 7, 2007

File encodings

Many times, specially when writing web pages, you have to deal with texts with different encodes (if web site isn't in us-ascii, of course). Here are some useful tips for not spending too much time with this:

bash# file -i <filename> (for knowing the encoding for a specific file)

vim# :set fileencoding=utf-8 (for changing encoding of current file, converting characters from one charset to the new one in a human understandable way)

vim# :set encoding=utf-8 (for setting encode of new files; default is system locale)

Remember that those thinks just apply to plain files, that are saved without any header or any information about encoding (editors try to figure out encodes).

A little bit offtopic, but an interesting vim command is also:

vim# :set ff=unix (for changing eol from dos/mac to unix)

UPDATE: If you have many files to convert, or don't know how to use vim... :) you can use GNU iconv program.

Saturday, May 12, 2007

chmod and umask

Both UNIX commands are used to set permissions, chmod is for changing permissions of a specific file, and umask is for setting default creation permissions for a user.

Basics
Simple UNIX permissions are:
r (read)
w (write)
x (execute)
and them can be assigned to users:
u (user/owner)
g (group)
o (others)
a (all/last 3)

Easy chmod:
chmod

+ (add permissions)
chmod

- (remove permissions)Examples:
chmod a+r myfile (everybody can read)
chmod o-w myfile (only owner and users in group can write)

"Difficult" chmod:
Use numbers for setting permissions. 3 digits, first for owner, second for group and third for others.
To calculate a number you have to sum next values: 4 for read, 2 for write, 1 for execute.

Example:
Want to add read and write for owner, just read for group, and nothing for others...
1st: 4 (read) + 2 (write) = 6
2nd: 4 (read) = 4
3rd: 0
chmod 640 myfile

umask
umask value is calculated in next way; maximum permissions less chmod desired value.
If we want 750 permissions (rwxr-x---):
0777
-0750
------
0027

so add...
umask 0025
to
~/.bashrc

Tuesday, April 17, 2007

Allow user to execute root files

Sometimes it's useful allowing users to execute programs reserved for root. For example if we have a desktop system, we can allow users to halt or reboot computer.

There are several ways to achieve it, the proposed here is the simplest one (probably not the securest one).

Just add +s to file permissions; for example:
chmod +s /sbin/halt

I don't recommend doing it without reading some documentation, and comparing this method with "sudo"...

GPG Error updating Debian Etch

Probably not happening anymore with Debian Etch as stable, but that error happened sometimes when apt-get update:

W: GPG error: http://security.debian.org etch/updates Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A70DAF536070D3A1
W: GPG error: ftp://ftp.hr.debian.org testing Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A70DAF536070D3A1
W: You may want to run apt-get update to correct these problems

I've solved it just with:
apt-get install debian-archive-keyring

Source: LinuxQuestions

Sunday, April 8, 2007

Debian GNU/Linux 4.0 released

Finally, after 21 months of constant development, last version of Debian distribution has been released. Oppositely to previous versions of Debian, Etch has a "up-to-date flavour", including last version packages such as Linux kernel 2.6, MySQL 5, PHP 5, Python 2.5, OpenOffice 2.0, Iceweasel (Firefox) 2.0...

I'm using Etch for some months in different beta and release candidates versions, with very good results. For me Debian has been probably the best system for many time, but with a big handicap, versions. Now I think that there is no good competitor for this distribution, for a medium/advanced GNU user.

You can find more information in announcements at Debian page and distribution list.

Convinced? Just download here and enjoy!

Tuesday, February 27, 2007

Sony Vaio support

Some days ago, my laptop's screen crashed. It's a Sony Vaio, and my experience hasn't been good at all.
My first problems were when contacting vaio support spain, I had to do many calls to know the whole procedure, register my laptop in the support center, and finally register the issue. More problems about data in my disk, so they were no responsible for any data on my disk -even when it was a screen problem-, and then because they asked me to install the original operating system (w32), for being able to do testing on it.
The worse part of the story was not directly with sony, it has been with dhl, the company that picked up the laptop at my home, and the give it back to me. The tracking service of this company is pretty good, but in both visits they don't come when they were supposed to come. The courier notified that I wasn't at home, but I was there, and the visit notes are still missing.
The good part of the history has been the quick reparation at Sony, with a good delivery system I would had my computer back in less than one week.
So my rating of both companies:
Sony VAIO support: 7
DHL: 4