Linux.com

Community Blogs



NEWB's adventure's in Linux From Scratch

Ouch!

 Started thinking for myself. Asked a question in an IRC support room and got barked at again. Good thing I've got a thick skin. When multiple people try to chat to you and sentences get crossed and they don't comprehend or you don't comprehend , seems you either get RTFM or some other not so friendly comment.

   Oddly enough, I got to the glibc build three times today because of user errors, once totally my fault not explicitly following the manual, the other, I forgot to install patches on glibc and already had it installed. BEWARE

They don't remind you about needed patches in the book/manual. I'm on my third attempt wish me luck! 

 

NEWB's adventure's in Linux From Scratch

 Back again,

   This time I've started a new LFS install,  The install of the binutils tools went rather well. However, I cannot say the same with Gcc. I first read the entry on the manual and assumed that my install would require that i build mpfr and gmp then install them in the gcc-build directory and then compile, after trying four or five times to get it to work, I had to go to IRC chat. Well, now configure would run you see I was supposed to untar mpfr and gmp then gcc. Then mv mpfr and gmp into gcc directory then cd to gcc-build directory. But from where I stand, it doesn't communcate that in the book??? Am I the only one?

 Currently, I'm building glibc. No problems as of yet.  Something that I will point out though. Once the day is through is how successful I am at stop/resume of the install. :) 

 

Working with filesystems using NFSV4 ACLs

Here's a great cheet sheet on managing NFSv4 ACLs on different filesystem with different commands. This article discusses and compares the different commands that you might use to migrate from one filesystem to another.
 

Getting HAL to allow Horizontal Scrolling

This is how I got it working on my little netbook.  Seems somehow more and more websites are being designed for larger than 1024 wide screens and so horizontal scrolling is becoming more of a need.

Two steps are needed 1st I edited Firefox and then I edited the files for HAL.  In the end we have to reboot the system because somehow the implemintation of X on a number of modern distro's (cough *buntu cough) are more windows like and so every change now requires a reboot. (CNTRL-ALT-BKSpace doesn't work, even when enabled) 

So on to the needed changes.  Open Fx (Firefox) and enter "about:config" (without the quotes) in the URL bar.  If this is the first time you have to promise the Mozilla gods that you'll be a good boy/girl and you are presented with a list of all of the configuration options Fx has.  Now in it's equivalant of a URL bar enter this:

mousewheel.horizscroll.withnokey.action

double click on the config line that is below the bar, and change the 0 to a 1.  Now you are done with Fx. 

Now on to getting it working in X.  Gone are the days of a single config file no matter how long.  Additionally some distro's (see above cough) have decided not to follow the FHS and have put the config files outside of /etc.  No problem despite attempts to hide them so that "dumb users" don't find them (tounge firmly in cheek on that btw) we can locate them.  

The correct place to find the file would be 

 /etc/hal/fdi/policy/

With *buntu and it's derivatives the file is in /usr/share

 /usr/share/hal/fdi/policy/20thirdparty/

The correct file we will edit will be *synaptic.fdi (where the full name can vary by distro) If you don't find it there then at a command line run this:

 locate synaptic | grep fdi

This should allow you to find the correct file.  Now let the editing begin.  open the file you found in your favorite editor. (remember to save a backup copy just in case of an "oh S***" moment, and to edit it as root).  With *ubuntu the file would look something like this: (The code here is edited so that the blog software doesn't pick it up as code, the real version uses angle braces instead of square ones. If you cut and paste be sure to make the required brace change or else it won't work and you may be left with a dead mouse cursor.)

[deviceinfo version="0.2"]
  [device]
    [match key="info.capabilities" contains="input.touchpad"]
        [merge key="input.x11_driver" type="string"]synaptics[/merge]
           [!-- Arbitrary options can be passed to the driver using
             the input.x11_options property since xorg-server-1.5. --]
        [!-- EXAMPLE:
        [merge key="input.x11_options.LeftEdge" type="string"]12[/merge]
        --]
    [/match]
  [/device]
[/deviceinfo]

The important part for us is the lines that start with 

[merge key...... 

We are going to add(or if it exists edit) the line 

 [merge key="input.x11_options.HorizEdgeScroll" type="string"]true[/merge]

Other distro's may have this line there already, and if horizontal scrolling didn't work in regular apps it will say "false" instead of "true".  Edit and change this and you are off and running.   In your *buntu system the file will now look like this:

[deviceinfo version="0.2"]
  [device]
    [match key="info.capabilities" contains="input.touchpad"]
        [merge key="input.x11_driver" type="string"]synaptics[/merge]
        [merge key="input.x11_options.HorizEdgeScroll" type="string"]true[/merge]
        [!-- Arbitrary options can be passed to the driver using
             the input.x11_options property since xorg-server-1.5. --]
        [!-- EXAMPLE:
        [merge key="input.x11_options.LeftEdge" type="string"]120[/merge]
        --]
    [/match]
  [/device]
[/deviceinfo]

Note: In an xml file anything between !-- and -- is a comment make sure you don't add lines in the middle of a comment.  

Now to get your mouse working right.  As mentioned on *buntu you probably need to reboot (cough), however the following procedure should work on all others.  As root restart the hal daemon (/etc/init.d/hal restart), with some you may additionally need to restart X (logout and use Cntrl-Alt-Backspace).  At this point enjoy the scrolling.

More config options for HAL do exist and one place I found a "list" is here in an article at thinkwiki.

 

We don't need you either Asus.

After reading articles like this one today. It's safe to say that this sucks.  Linux MADE Asus the market leader it is.  Xandros bent over backwards to tailor a UI specifically for the tiny 7inch screeen that really did make the first netbooks fly.  Now this crap.

Some of the things that I've learned by asking (off the record) some local retailers of the Asus systems.  These retailers tend to be more hands on than a "Best Buy".

1.  Linux outsold XP until Asus stopped shipping Linux

2.  The average buyer was either a college age buyer, or the over 50 crowed. Both wanted something light, fast and reliable. These two groups tended to like the Linux UI, more, but the over 50 crowed was more dismayed that the software they had wouldn't run (surprised at the cost of replacement) 

3.  They were able to sell more addons to the Windows systems. (anti-virus 3rd party software) 

4.  Windows systems had a higher customer complaint rate.  

In the end.  Asus did with Linux what Lee Iacoca said Ford did with the Mustang market in the 70's "We walked away from the market, It didn't walk away from us" Asus has walked away from a market that it proved exists.  Especially bad move now that, Intel and Dell are getting harder into the Linux market. Even more foolish now that Microsoft has declared that it is going to "define" what is or isn't a netbook and charge it's partners more based on the screen size.  Now the horse has taken charge of the cart once again, and Asus is left hoping that Microsoft will lead it to the promised land.

What can we do.  Well we can do what we always do.  Buy from those who support what we support. 

UPDATE:  Asus now apologizes to Microsoft for a partner company showing an Adroid (Linux) based system at Computex instead of the Asus mandated XP only displays. 

 

Linux market share growing, growing, growing

Q: What's the true market share of Linux?

A: Depends who you ask!

Some reports say Linux has broken 1% desktop market share, while other findings put it up to 4%. Meanwhile, of course, server adoption is 46% or more.

Read all about it!

 

Swapping STDOUT and STDERR under Bash Shell

I usually forgot this simple command so I've decided to write down some notes on it so I can cut 'n' paste from here easily, here's another common question:

"How to swap stdout and stderr descriptors ?" 

This enables your scripts to parse stderr and forget stdout (or redirect it to a file)

Here's:

command <parameters> 3>&1 1>/dev/null 2>&3-

Here's what it does:

Moves stdout to /dev/null (or your preferred file if needed).
Moves stderr to file descriptor (3)
Moves file descriptor (3) (containing stderr) to stdout (real stdout, not null!)

 

This is what I use to parse errors with my scripts when I got something bad from external programs

 

Glad to see comments

Ben 

 

The monkeygame

Apparently a certain harware store have decided that they will not sell machines with Linux. In Taiwan Asus appears determined to abandon Linux. I do not have much to say about it really...  Apart from this:

 

Fill a room with nothing but bananas and let the monkeys in. Count the number of apples they eat and you'll understand that all monkeys prefer bananas. Monkeys are obviously extremely intelligent and know their fruitbasket. No need for apples.

 

Pods and Blogs and the Open Source movement from the point of view of a Cambridge Professor.

Pods & Blogs LogoWelcome to my first blog post. I tend to write long, but I'll try to make it entertaining.

Pods and Blogs is my favourite non-comedy BBC podcast. It tends to be very informative and fun, and I recommend it to anyone who listens to podcasts.

The last podcast (dated June 2nd 2009) was again another excellent show. They had several interviews from Cambridge University, celebrating it's 800th anniversery, including some interviews with venerable computing people.

One such person was an Alan Blackwell (who is strangely absent from the show notes) but is an inter-disciplinary-designer who says some pretty damning things about Linux. If you want to listen to the podcast you can grab it only for the next 7 days.

Ok, so a few caviets, the interview is clearly edited, to what extent I don't know, and the really incriminating sentance (transcribed below) is pretty garbled.

Interviewer (Jamillah): So therefore is it worth trying to spread the word of things like Open Source online? You've got more of general society on things like Facebook than maybe are addressing something like open source or looking at Ubuntu or how they can make things themselves... how can you break down those barriers?
Alan Blackwell: I think the philosophy of open source is exactly the way that the internet is taking us, and Wikipedia is a great example of something where everybody is an expert on some small thing, and everybody can make useful contributions to Wikipedia. I think the assumption has been when it comes to creating the source code that runs the internet that that's something that is only for the experts. And the experts that original created the open source movement are people like Richard Stallman [rms]. He was working at MIT, at one of the centres of hardcore technology, and the whole world and I think they accidentally made open source to be something that was useable to people like themselves. They created programming languages that weren't easy to understand and they created tools that weren't as easy to use as every day products like Macintoshes or indeed the iPhone.

[I'm giving you a break here to breathe. The bit that really piqued my interest is just coming up.]

AB: It would be very nice if the open source movement had people in it who were sympathetic to user needs and were interested in giving other people that power, not just people like themselves. So a very good start for the open source movement would be for them to ask themselves why no women write open source software. I think about 0.1% of open source programmers are w... one of the biggest open source err... operating system projects are women.

I: That's a pretty sad fact.

AB: And it has a lot of implications. I think that is a reflection of the fact that although the philosophy of open source is wonderful, not all open source programmers are able to apply that internal philosophy to the outside world. And I think there is a lack of social engagement, and I think the gender politics in the open source world are reflective of their politics with respect to their world as a whole. Though still sadly something of a technocratic elite and not really a democratic movement for all that they like to use the word 'democracy' to describe their own relationships amongst themselves.

I: Well I am sure that will please all of our OS audience no end, but if you are a female open source coder do drop me a line.

So listening to it, it's clearly heavily edited, and a lot of it doesn't make a whole lot of sense you can kind of get the jist of it, I recommend you listen to the whole thing (from about 5mins in and 5mins long) to get better context.

To be fair on Alan Blackwell, I think the guy is a bit out of his depth, he, like a lot of people, has a 1980s view of Linux and Open Source and doesn't even mention Ubuntu. He also manages to claim RMS invented C and that GNU tools was built in the same era as the iPhone.

If anyone knows how to get in contact with Alan Blackwell there is a LUG event happening on August 1st in Cambridge that I would be interested in him seeing Linux users being social.

I think this post is getting a bit long now, so I might leave the discussion to another day, I have a copy of the podcast so it ain't going anywhere. But I'd be interested to hear anyone elses point of view.

Personally I don't belive the lack of women in Linux is as much of a problem as the lack graphic designers and ergonomists. If we can get them to build the bridges then women, men, children, and intelligent monkeys with laptops will come, rather than having to carry each one of them across the moat.

 

Enhancing the Scala Twitter library for Java Clients

Make it substantially easier to access Twitter than just opening an HTTP connection and doing the work by hand as well as making Twitter easily accessible to Java clients and Java developers. With this new Scala Scitter library you wont have too much to do to get started leveraging  the Twitter API.
 

Configuring iSCSI initiator on Red Hat Linux 4 and 5


I was configuring iSCSI initiator in one of our Red Hat Linux 4 server, couple of weeks ago, after a day's work at last I became successful. Ohhh thank GOD. Last week again I have asked to configure iSCSI on Red Hat Linux 5 server I was cool, I already did this on RHEL 4, but after installing the package on RHEL 5 and looking at configuration file takes my breath away, a completely new configuration file not even able to compare with RHEL4. Ohhhh GOD help me. Again after a days work I was successful sharing my work with you guys it may helpful to you.

Configuring iSCSI initiator in Red Hat Enterprise Server 4

iSCSI (Internet Small Computer System Interface)

Concepts

Initiator

An initiator functions as an iSCSI client. An initiator typically serves the same purpose to a computer as a SCSI bus adapter would, except that instead of physically cabling SCSI devices (like hard drives and tape changers), an iSCSI initiator sends SCSI commands over an IP network. An initiator falls into two broad types:

Software initiator

A software initiator uses code to implement iSCSI. Typically, this happens in a kernel-resident device driver that uses the existing network card (NIC) and network stack to emulate SCSI devices for a computer by speaking the iSCSI protocol. Software initiators are available for most mainstream operating systems, and this type is the most common mode of deploying iSCSI on computers.

Hardware initiator

A hardware initiator uses dedicated hardware, typically in combination with software (firmware) running on that hardware, to implement iSCSI. A hardware initiator mitigates the overhead of iSCSI and TCP processing and Ethernet interrupts, and therefore may improve the performance of servers that use iSCSI.

Target

iSCSI refers to a storage resource located on an iSCSI server (more generally, one of potentially many instances of iSCSI running on that server) as a "target". An iSCSI target usually represents hard disk storage. As with initiators, software to provide an iSCSI target is available for most mainstream operating systems.
Common deployment scenarios for an iSCSI target include:

Storage array

In a data center or enterprise environment, an iSCSI target often resides in a large storage array, such as a NetApp filer or an EMC Corporation NS-series computer appliance. A storage array usually provides distinct iSCSI targets for numerous clients.[1]

Software target

In a smaller or more specialized setting, mainstream server operating systems (like Linux, Solaris or Windows Server 2008) and some specific-purpose operating systems (like NexentaStor, StarWind iSCSI Target, FreeNAS, iStorage Server, OpenFiler or FreeSiOS) can provide iSCSI target's functionality.

Addressing

Special names refer to both iSCSI initiators and targets. iSCSI provides three name-formats:

iSCSI Qualified Name (IQN)
Format: iqn.yyyy-mm.{reversed domain name} (e.g. iqn.2001-04.com.acme:storage.tape.sys1.xyz) (Note: there is an optional colon with arbitrary text afterwards. This text is there to help better organize or label resources.)

Extended Unique Identifier (EUI)

Format: eui.{EUI-64 bit address} (e.g. eui.02004567A425678D)
T11 Network Address Authority (NAA)
Format: naa.{NAA 64 or 128 bit identifier} (e.g. naa.52004567BA64678D)
IQN format addresses occur most commonly. They are qualified by a date (yyyy-mm) because domain names can expire or be acquired by another entity.

Installation on Red Hat Linux 4

# rpm -ivh iscsi-initiator-utils-4.0.3.0-7.i386.rpm

IQN no of Red Hat Linux 4 Server (/etc/initiatorname.iscsi file)

Each iSCSI device on the network, be it initiator or target, has a unique iSCSI node name. Red Hat uses the iSCSI Qualified Name (IQN) format with the initiator that ships with Red Hat Enterprise Linux. In the IQN format, a node name consists of a predefined section, chosen based on the initiator manufacturer, and a unique device name section which is editable by the administrator.
Provide this IQN number to your IPSAN Administrator he will create and assign LUN to this IQN

Configuration ( /etc/iscsi.conf)

Terms

To globally configure a CHAP username and password for initiator
authentication by the target(s), uncomment the following lines:

Outgoingusername is something we create at Target to authenticate the LUN assigned to this

OutgoingUsername=
OutgoingPassword=


To globally configure a CHAP username and password for target(s)
authentication by the initiator, uncomment the following lines:

IncomingUsername=
IncomingPassword=


Settings in config file ( /etc/iscsi.conf)

DiscoveryAddress=ipaddress or hostname of your IPSAN
OutgoingUsername=username created in targetserver for accssing this LUN
OutgoingPassword= password created in targetserver for accssing this LUN
LoginTimeout=15

Installation on Red Hat Linux 5

# rpm -ivh iscsi-initiator-utils-6.2.0.868-0.18.el5.i386.rpm

IQN no of Red Hat Linux 5 Server (/etc/iscsi/initiatorname.iscsi)

Configuration ( /etc/iscsi/iscsid.conf)

Settings

# To enable CHAP authentication set node.session.auth.authmethod
# to CHAP. The default is None.
node.session.auth.authmethod = CHAP

# To set a CHAP username and password for initiator
# authentication by the target(s), uncomment the following lines:
node.session.auth.username = testuser
node.session.auth.password = testpassword


# To enable CHAP authentication for a discovery session to the target
# set discovery.sendtargets.auth.authmethod to CHAP. The default is None.
discovery.sendtargets.auth.authmethod = CHAP

# To set a discovery session CHAP username and password for the initiator
# authentication by the target(s), uncomment the following lines:
discovery.sendtargets.auth.username = testuser
discovery.sendtargets.auth.password = testpassword

#service iscsi restart

Will get the output like this

Stopping iSCSI daemon:
iscsid dead but pid file exists [ OK ]
Turning off network shutdown. Starting iSCSI daemon: [ OK ]
[ OK ]
Setting up iSCSI targets: iscsiadm: No records found!
[ OK ]

Now discover the targets.

#iscsiadm -m discovery -t sendtargets -p 192.168.x.x ( IP address of Target)

# service iscsi restart

Will get like this
Logging out of session [sid: 1, target: iqn.1991-05.com.microsoft:aio1200-oracle-rac-target, portal: 192.168.x.x,3260]
Logout of [sid: 1, target: iqn.1991-05.com.microsoft:aio1200-oracle-rac-target, portal: 192.168.x.x,3260]: successful
Stopping iSCSI daemon:
iscsid dead but pid file exists [ OK ]
Turning off network shutdown. Starting iSCSI daemon: [ OK ]
[ OK ]
Setting up iSCSI targets: Logging in to [iface: default, target: iqn.1991-05.com.microsoft:aio1200-oracle-rac-target, portal: 192.168.251.10,3260]
Logging in to [iface: default, target: iqn.1991-05.com.microsoft:aio1200-oracle-rac-target, portal: 192.168.x.x,3260]


Important.

If you made any changes to the configuration file first remove the iqn from cache using this command

#iscsiadm -m node -T iqn.1991-05.com.microsoft:aio1200-oracle-rac-target -o delete

After issuing this command restart the iscsi to take effect the configuration you changed

#Service iscsi restart

After restarting the service discover again using

#iscsiadm -m discovery -t sendtargets -p 192.168.x.x (IP address of Target)

 
Page 111 of 145

Upcoming Linux Foundation Courses

  1. LFS201 Essentials of System Administration
    12 Jan » 30 Mar - Online Self-Paced
    Details
  2. LFD331 Developing Linux Device Drivers
    01 Jun » 05 Jun - Virtual (GUARANTEED TO RUN)
    Details
  3. LFD320 Linux Kernel Internals and Debugging
    08 Jun » 12 Jun - San Jose - CA + Virtual (GUARANTEED TO RUN)
    Details

View All Upcoming Courses


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board