Sunday, January 9, 2011

Linux

First, I did make a UTF-8 filter in Python. Been a big help.

My computer (laptop) crashed a couple of weeks ago. Backup was a month old, but was able to extract hard drive with help of son-in-law. My brother checked other components. Probable dead motherboard. Bought new laptop -- at my new job we get deals from Dell.

Have long wanted to try Unix. I wanted a dual boot system (sometimes just gotta have Windows) and shared data. Seemed like a perfect time to try on a new clean machine.

First question: Which distribution? But I figured I didn't need to answer or download right away. What I needed right away was getting my disk partitioned. Then I could always load whatever Linux into the space reserved for it. Found Dual-Boot Windows 7 and Ubuntu in Perfect Harmony. Good info about dual boot, but maybe a bit dated. Promotes idea of a windows partition, a unix partition and a data partition. Liked it, tried to set up. I have a 500Gb disk. Not huge for today, but plenty big. "Dual-Boot" uses a 100Gb disk, cramming windows and linux into 15Gb each. My old disk had about 120Gb with everything and I had done no space management. So I figure 100Gb Windows, 100Gb Linux and 300Gb data.

First tried to reduce the size of my windows partition. How-to-Geek has a great article on how to do it. I messed up the getting rid of the restore points at first, and it had an unmovable file in the middle of my disk, but finally got my 100Gb Windows partition. (Ended up buying Raxco's PerfectDisk because it was a big help seeing what was going on.)

"Dual-Boot" uses Linux to make the Linux partition, so I thought it was time to check out a distro. The Top 7 Best Linux Distributions for You has lots of good info. I almost went with its suggestion of openSuse as best for laptops. I heard wireless connectivity is a big issue. However, I had a Kubuntu 10.04 disk (from my son or son-in-law?). Thought I'd try it. Lower right of desktop has icons like Windows. Wireless connectivity right there. Select, picked my home network, boom I'm in! Maybe because Dell supports Ubuntu its wireless hardware is well-supported. Whatever, worked great for me. Ubuntu is top rated desktop. Kubuntu replaces the Gnome GUI with KDE, which is supposed to be great. Since I had the disk I went with it.

First, used partition manager. Found out I need to translate "g" (Gnome) apps to kde apps. Instead of Gparted used qtparted. (Actually I think the first time I didn't used Gparted by installing, but that's not the best way to do it. Learned stuff since.) Created Linux partition, all seemed good. Then tried to make data part. Fail!! Can only have 4 parts on disk! Apparently a hard limit supported by all. But why is that a problem?

Turns out Dell computers ship with three partitions. A DelUtility, a restore and a windows partition. Inside the Dell Utility Partition has a good explanation. Basically the DelUtility is for first turn on, but is also reactivated when the Restore partition is used. I had made restore disk, so figured I could wipe out. Didn't like that solution. Talked to my son. He suggested keeping the data in Windows. But could Linux work with Windows NTFS partitions?

Read some scary stuff that said no, especially writing was a problem. But this was old. (Warning: lots of Linux discussions about issues show up. But they can be old to very old. Makes sense discussion stops when no longer an issue.) Turns out it's no problem. Went back and up my windows part so that Linux had 100Gb (Windows less than 400Gb)

Finally went to install Linux. Easy. Scary part is disk. First choice is to wipe disk!! Just select manual (advanced!!). It let me pick what to do with each part. Default for each is to ignore (good for Dell parts). For Windows, picked ntfs, NO format. Can set mount point, gives you /dos and /windows but I think you can type whatever. I picked /windows. For Linux part picked ext4 journaling (that's what "Dual-Boot" used) and format. Mounted on "/". Installed fairly quickly (well less than 1 hour). Set up dual boot automatically, in fact now have many boot choices because of all parts. (Dual boot is default, can be changed in advanced button on disk setup.)

Worked great. Made swap file (How much swap do I need?, made 4G instead, use kdesudo and kate to edit). Downloaded Google Chrome -- fav browser. 64 bit didn't work. OH, I had 32 bit Kubuntu. Still played a bit for a couple of days (between work and other stuff). Finally decided to download 64 bit Kubuntu 10.10. Had some download and CD adventures (burn with K3b on multimedia menu) but got a good copy.

Now that I was a pro should be easy. Brought computer to fam room to watch TV while install. Slightly different interface. Told me no internet connection, but didn't worry about it. Also checked to download packages and updates (I know, I was stupid).

Result: flaky system. Boot errors. No internet, Chrome download failed. Kubuntu crashed. Lots of flakey behavior. Windows reported problems. Got a chkdsk run on one reboot. Aaaaaargh!!!

Slowly figured out the internet issue. First time I'd set up wireless on Live CD. This time didn't. Then downloads etc. failed. Also 10.10 has a slightly different wireless interaction.

While playing I saw Dolphin (file manager) showed my Dell parts. Clicked on utility. Did this mess something up? I get how my internet screw up caused Linux probs, but why disk?

Figured it out, reinstalled and now all seems good. Writing this while GnuCash package is intalling (very cool instead of normal windows download setup).

Wednesday, December 8, 2010

UTF-8

Having some issues with UTF-8 files with illegal characters. Trying to make a filter, or at least a problem reporter. Good info by dwheeler.

Sunday, December 5, 2010

Using Scomp

I'm working on a project that deals with XMPP information. I'm using xmlbeans scomp to compile xsd files into java classes. I got the source code to work, but scomp failed to generate a jar file. I got the error described by Three Wise Men and Celinio Fernandes. I'm working on Windows XP.

With the scomp src I built an Eclipse project and could build against it, but got this run time exception:
ClassNotFoundException : Cannot load SchemaTypeSystem. Unable to load class with name schemaorg_apache_xmlbeans.system.s68C41DB812F52C975439BA10FE4FEE54
In trying to solve it I learned to use javac from the command line (I have only used the Eclipse JDE until now.) I installed Ant (I thought there was a dependency) and learned to use. I learned how to produce a jar in Eclipse. None of these solved the problem.

Three Wise Men set me on the right track. The problem is a space in the javac path. Three Wise Men fix it by using scomp's -compiler option. However, for me, scomp still choked on the space. So I found out about junction (see Wikipedia). I used junction to make Program-Files link to Program Files (skip the md step in the junction example). Put the hypen in my JAVA_HOME and path. Still scomp failed to make jar. Finally used compiler option with hypen and it worked. Added jar to my build path in Eclipse and finally my project ran correctly.

Whew! Lotta work just for that.

Wednesday, December 1, 2010

Lots!

Learned this morning that Python compiles when a module is called up. However, Apache, default Windows settings with wsgi, seems to cache Python code. Need to stop and start server after every Python change.

Learned more than I can describe at new job today. Much more to pickup. Need to shelve home Django & Python stuff for a while. Two projects at work, lower priority uses Dj & Py, so may be back to it soon.

Tuesday, November 30, 2010

Django install on Apache server

Django doc on using with wsgi server.

Learned that the base wsgi file (django.wsgi) needs to be in a legal server path. On my machine that's c:/xampp/htdocs. Otherwise get 403 error. However, the wsgi file can refer to projects anywhere on computer. The project does need to be on the path, as the doc says (and shows how to do. However, the setting of DJANGO_SETTINGS_MODULE is a little misleading. I added my project to the path (c:/xampp/django/avppng). Then DJANGO_SETTINGS_MODULE = 'settings' because it is relative to the path. The doc shows setting path to django (c:/xampp/django) and DJANGO_SETTINGS_MODULE='avppng.settings'. But this makes some relative paths in the project not work.

Python errors produce 500 errors. Look at Apache error log file c:/xampp/apache/logs/error.log to see Python errors. The doc mentioned setting LogLevel info in httpd.conf, but the default warn setting worked fine for me. Tried to use sys.stderr.write to write to log file, but didn't work.

Now I see something disturbing. I just saw an error that my administration module couldn't be found in avppng.urls. So in wsgi file I changed the path to c:/xampp/django/avppng/ and DJANGO_SETTINGS_MODULE to settings. Shut down, made a change. Then it told me a django py couldn't find avppng.urls. So I changed path back to c:/xampp/django and DJANGO_SETTINGS_MODULE to avppng.settings and it worked! How can one way work then not and visa versa?? (Slash at end of path doesn't seem to make a difference.)


Django tag cloud

Tag clouds for Django. Stackoverflow post has info. Logarithmic tag algorithm. Napes intro to using tag clouds. Django-tagging package.

Django social authorization

Post about package to allow login through social media (Facebook, Google, etc) ids.