Saturday, June 27, 2009

GCC Update Problem

So after running emerge --update --deep --newuse world, and then emerge --depclean, somehow I lost Firefox, my gentoo sources (used to compile/recompile the kernel), and I could no longer compile any emerged packages... Somehow the update shot GCC. I googled the problem, and found this forum post about my very problem, so I unset GCC_SPECS and reemerged gcc (which takes forever to compile), and was able to reinstall firefox and install gtk+, to play with some Gnome eye-candy later...

Alas, I still can't recompile my kernel to enable extra CIFS support required to use Windows WINS names. Everytime I try running make menuconfig, I get


make: *** No rule to make target `menuconfig'. Stop.


and when I try to reemerge gentoo sources, I get


* Messages for package sys-kernel/gentoo-sources-2.6.29-r5:

* If you are upgrading from a previous kernel, you may be interested
* in the following document:
* - General upgrade guide: http://www.gentoo.org/doc/en/kernel-upgrade.xml
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

* GNU info directory index is up-to-date.

even though my kernel is a few minor revisions behind (2.6.24-r8)... I looked in /usr/src and saw that the /usr/src/linux symlink was still pointing to 2.6.24-r8, and not the new minor revision... portage did pull down the newer kernel, but didn't update the symlink (duh).

I went back and modularized CIFS support, with the following options:


CIFS support (advanced network filesystem, SMBFS successor) │ │
│ │ [*] CIFS statistics │ │
│ │ [*] Extended statistics │ │
│ │ [ ] Support legacy servers which use weaker LANMAN security (NEW) │ │
│ │ [ ] Kerberos/SPNEGO advanced session setup (NEW) │ │
│ │ [*] CIFS extended attributes │ │
│ │ [*] CIFS POSIX Extensions │ │
│ │ [*] Enable additional CIFS debugging routines │ │
│ │ [ ] CIFS Experimental Features (EXPERIMENTAL) (NEW)

Currently I'm compiling the new kernel and will deploy it when it finishes. As of right now, I can mount the Windows share using mount -t cifs, but only using the IP address, and not the host name. I can also see my workgroup and computers in nautilus, but still can't access the Windows shares.

Hopefully the added CIFS support (namesly CIFS extneded attributes and CIFS statistics) will get me working all the way.

Sunday, June 21, 2009

FreeBSD

Got bored waiting for the Gentoo box to emerge and compile all the new packages, so...





Now I just need to familiarize myself with the different file structure, and get Gnome running faster. Install was comparatively painless, it did most of the hard part for me. First adjustment: no /etc/init.d, this is true blue Unix, so I'm looking at /etc/rc.d and /usr/local/etc/rc.d

Repositories

So I've got Samba server running flawlessly on my Gentoo box, but I'm still struggling to get the server to see my Vista machine's shares. I've approached this problem from two angles, the first trying to get nautilus to recognize smb:// shares and the second using smbclient to browser shares. I ensured that cifs support was enabled in the kernel (I think I'm going to go back and modularize it...) and after a little googling, I made sure that gnome-base/gnome-vfs was emerged. Even after that, and restarting X, I could not get nautilus to browser netwrok shares. I next moved on to try smbclient (smbclient -L ). To aid in the process, I've set up a Ubuntu VM to test smbclient between the two *nixes, to ensure that the problem does not lie within the server's configuration.

The Ubuntu VM is able to access both the shares on the Gentoo machine and the Vista machine using nautilus, although accessing the Vista share is definitely cumbersome and seems to work inconsistently and I'm not entirely sure why. When using smbclient from the console on the Ubuntu box, I am able to scan the shares on the Gentoo box, however I first had to enable lanman auth and client lanman auth in the Ubuntu VM's smb.conf to connect to the server. I'm not really sure why the server is requesting lanman authentication, although maybe some sort of authentication/encryption is required by samba to connect to shares that don't use user-level security. Theoretically, no authentication should be necessary using smbclient since guests are allowed. I'm still digging to find the answer...

In the process, I definitely had one big *duh* moment. After changing my USE flags in /etc/make.conf to add samba, I wanted to ensure all packages now would support samba (particularly gnome). I ran emerge --update --deep --newuse world, only to get stopped immediately with a "masked package error," as well as an error stating that I needed to update portage. So I updated portage and ran emerge --update --deep --newuse world again, only to hit a brick wall trying to update /sys-lib/timezone-data. Portage could not find timezone-data-2008c. This seemed a bit odd to me, as obviously, its now 2009, so why is portage trying to find a package marked 2008? So after a minute of twiddling my thumbs, I recalled having to always run 'apt-get update' on my Ubuntu laptop to update the repository tree... and I hadn't been doing the same on my gentoo machine with portage. AHA! Well a simple emerge --sync should do the trick, and I should be home free!

Well about this time, Charter decided to throw the Internet switch from "working" to "broken," for my router and I couldn't pull down the new portage tree, at least not within a reasonable amount of time. After a failed rsync, I tried again (I was still getting about 40% of my packets through, and I really wasn't in the mood to call Charter), and got responses from the rsync server... all of which were 404. So instead of giving in, and just calling Charter, I tried switching my SYNC parameter within etc/make.conf to a different server, first to Georgia Tech's (biting my tongue... I'm a UGA grad) with no success. After having a near aneurysm due to frustration, I figured out that I needed to emerge mirrorselect and run mirrorselect -r -i to find a new server. I managed to find a new rsync server, but finally gave in and decided it was about time to call Charter, as I was now experience around 80% packet loss *grrr.

So I dialed up the dreaded 1-888 number, I repeatedly hit '0' and was patched right through to a representative who was very helpful, and in fact got a technician out to me in a matter of two hours (unprecedented for Charter!), who came out and checked my levels, reran a cable, and swapped out my dying Motorola Surfboard modem, and got me back on my feet- he didn't even bitch about me using a router!

So now I was able to successfully sync portage, and again, ran emerge --update --deep --newuse world only to get another error that I needed to add a USE flag to do that...

So I just did it the quick, temporary way USE="###" emerge --update --deep --newuse world and it worked... until I got smacked with another error <sys-apps/man-pages-3 ("<sys-apps/man-pages-3" is blocking sys-apps/man-pages-posix-2003a). this forum post which seemed to the trick...

So that's where I am now, running a deep update with new use flags, hopefully not fruitlessly, currently on package 49 of 391. I guess at the very least, my server will be all up to date! More to come later....

Friday, June 19, 2009

Slowloris DoS

This looks like it could be some fun... and some trouble. As of yet, Apache has no patch. Too bad it doesn't work for IIS, however given my personal experience, IIS doesn't need a DoS attack to be brought down, just let it run for an hour, and it'll eventually crash

45 Seconds

The time it takes for my Gentoo box to cold boot.

I still need to time my Vista machine, but I imagine it won't be anywhere close!

Wednesday, June 17, 2009

POP vs IMAP

E-mail infrastructure has always been one of those things that I've never really taken the time to think about. You set up your client to use POP, or IMAP, or Exchange, and don't think twice about it. I've always been more familiar with how POP (post office protocol) works, as it is one of the oldest methods of e-mail retrieval, but IMAP has always been a bit more obscure to me, simply because I never really needed to use it because I always just used POP.

Well after reviewing this article, I've learned that IMAP may in fact be the superior protocol, at least for my purposes. IMAP, unlike traditional POP, supports online processing, using a more interactive client-server model. The obvious advantage to IMAP is that it allows users to access their email from different machines at different times (similar to just using a web mail client), wheras the POP paradigm is best suited for individuals that use only one client computer all the time.

So next time, given the choice, I will opt for IMAP over POP.

SAMBA

So after completing my iptables exercise, I proceeded to work on configuring SAMBA, only to find that it was already configured how I wanted. I had forgotten that shortly after I finished installing Gentoo, I went ahead and used this Gentoo wiki article as well as this quick Gentoo how-to . I really only need a simple share between my Vista machine and my Gentoo box, as I don't have any printers installed on the gentoo machine, and I don't need granular permissions for the share as it within my LAN.

One thing I did not do was learn how to effectively use CIFS and smbclient, so I'll have to familiarize myself with both and figure out how to mount and search samba shares.

On another note, I spoke with our web designer at work, and he shared with me that I should check out Inkscape, a free/open source vector graphics editor, similar to Adobe Illustrator. I really do need to familiarize myself with software such as this, as when it comes to web design, I am lacking most in creating and manipulating images.

He also pointed me to click2try.com, a pretty cool site with a bunch of hosted VMs, allowing users to try open source software for free, without having to install anything on the user's machine.