The eternal fight between admins and computers

(and very often users, as well)

Archive for December, 2007

HOWTO: mount samba shares in fstab using a credential file

Posted by rga on December 17, 2007

Hello,

If you want to mount share files using samba but you don’t want to put the username or password on fstab file, you could use an external file, this is useful if you want to increase a little security since fstab usually is world readable.

Using /etc/fstab

# insecure and common usage
//share/dir /mnt/myshare cifs username=user,password=pass

# more secure usage
mkdir /path/securedir
chmod 0700 /path/securedir
chown root /path/securedir
//share/dir /mt/myshare cifs credentials=/path/securedir/fileshare

cat /path/securedir/fileshare
username=yourusername
password=youpass

As you can see, it’s easy and increase a little security if more users can access in you machine.

of course you can use smbmount too:

smbmount //share/dir /mnt/myshare -o credentials=/path/securedir/fileshare

See you!

Posted in Linux, Tips, Unix | 3 Comments »

Using Wanem to simulate a wide-area network

Posted by Vide on December 14, 2007

If you (or your company) are in the web-development business, one thing you need when testing your application, besides trying it in different browsers, is trying the user experience at differents conenction speed.

This can be achieved easily with Wanen, a live CD that enables you to create a gateway for your test computer which slows down (or intruduces errors, jitters, random disconnections) the network experience. Wanem uses the almighty iproute2 tools (more in details, tc) to accomplish its tasks.

The easiest way is to try Wanem is to boot it in a virtual environment (for example, VMWare Server, for easy management). Its use is quite straightforward, so I won’t nag you here and I’ll just invite you to read the documentation the project provides, but I let you know a couple of things/errors I found while using it (I’m going to report them to the developers as well)

  • The remote administration interface, which is basically a web page, it’s so bad written HTML that onlky works with Internet Explorer 6. Firefox will render a completely useless mess instead of the simple, plain HTML table that is supposed to be. I can’t understand how is this still possible in 2007 from people using Linux (it’s a Knoppix-based live cd!). So, be careful with the advanced settings.
  • Even if you specify a static IP address on startup (in the end it’s meant as a gateway, so DHCP is almost useless), there’ll always be a “pump” (DHCP client) process active in memory, resetting your IP from time to time, if you are in a DHCP’ed environment. To solve this, you have to do a couple of tricks because by default Wanem only gives you access to a limited control shell.
    So, acces Wanem from a remote ssh with these options:

    ssh perc@$WANEM_IP -t /bin/bash

    and enter the password you created at boot time. Now you’re in the live cd and you may try to kill the pump process. But you can’t since you don’t have enough permissions! And sudo/su ask you an inexistent root password. The solution is the “dosu” executable found in the home you’ve just entered. Resuming:

    dosu killall pump

Posted in Fixes, Linux, Networking, Tips | Tagged: , | 6 Comments »

Enable IMAP support in GMail

Posted by Vide on December 7, 2007

If you are one of those unlucky people who still don’t have IMAP support (and other neat brand new features) in GMail, try to change you language to US English. For me, it did the trick in every account I own that were not in english.

Switching back to your preferred language, downgrades the Gmail version as well, what a pity… well, I think it’s only a question of time. Meanwhile, if IMAP support is vital for you, this works quite well.

Posted in Google, Tips | Tagged: , , | 3 Comments »

Eix: enhancing the Gentoo experience

Posted by Vide on December 5, 2007

Everyone knows that if you want to search for a package in Gentoo portage, emerge -s is a real PITA, because is so slooooooooow.
The solution is named Eix, and you can install it with a simple

emerge eix

and, after the package has been emerged, issue a

update-eix

to sync EIX DB with portage or even a

eix-sync

to automatically do an emerge --sync && eix-sync

Now, you can do your search with a simple

eix $pattern

and it will be lightning-fast! eix –help for a load of neat options :)

Posted in Gentoo, Linux, Tips | Tagged: | 8 Comments »