"God is not external to anyone, but is present with all things, though they are ignorant that he is so."
Here my little rant and praise place, where the daily experiences of my programming work are expressed.
I publish them with the idea that others might find it useful and benefit from it.
Check also other posts
with other tags.
UNIX Man on Windows 7: VirtualBox + Ubuntu + LXC
last edited 2013/12/14 07:40 (*
I code nowadays (2012/11) on a bunch of laptops (with 2nd screens attached) which run on Windows 7 (Win7) mostly - with one keyboard and mouse controlling 2-4 machines using Synergy
Win7 is suitable for basic works, but in the moment serious programming is required, a real UNIX is required. I used to install Cygwin.com (UNIX framework for Windows) but switched now (2012/10) to VirtualBox.org (VB), which I virtualize an entire LINUX/Ubuntu Server Edition (12.10) box with.
Once it's running and up, I use PuTTY to ssh/login into the virtual machine, and I follow up and install LXC:
% sudo apt-get install lxc lxc-utils
% sudo lxc-create -t ubuntu -n ubu00
% sudo lxc-console -n ubu00
and you will see an actual login:
Ubuntu 12.10 ubu00 tty1
ubu00 login: |
LinuX Containers (LXC) is a lightweight LINUX virtualization approach with little demands on the CPU unlike other approaches such as Xen.org or KVM ; and therefore it is possible to run LXC containers within a VB-box:
- Windows 7 (e.g. 192.168.0.10)
- VirtualBox (with "Bridged Network")
- LXC Host (e.g. 192.168.0.32)
- LXC machine 1 (e.g. 10.0.3.12)
- LXC machine 2 (e.g. 10.0.3.20)
or Windows7(VirtualBox(LXC Host(LXC machine 1, LXC machine 2,..)))
The computational overhead of LXC containers to its host is minimal, as LXC is just process isolation, all using the same LINUX kernel.
As a sidenote, VirtualBox.org the Open Source Software (OSS) performs along the commercial competition like VMWare Player , only apprx. 6% difference, VMWare Player slightly faster.
LXC framework on Ubuntu 12.10 provides various templates:
- busybox: 2MB small functional LINUX system
- debian: works right away (apprx. 300MB)
- fedora: requires yum to be installed first (apprx. 485MB)
- opensuse: requires zypper to be installed, failed to compile due immature 'cmake' mess
- ubuntu: works flawlessly (apprx. 310MB)
- ubuntu-cloud: works flawlessly (apprx. 670MB)
Additionally you can clone existing LXC containers, e.g. I created
- ubu00 as default Ubuntu, and
- ubu01, ubu02 are cloned from ubu00,
- alike with deb00 Debian.org etc.
I personally prefer Ubuntu.com LINUX flavor due the solid package manager, and installing the usual components is done quickly, e.g.
% sudo apt-get install screen lighttpd mysql-server mysql-client mongodb samba
With a decent equipped laptop (e.g. 3GB RAM, 2 cores, 2GHz) a reasonable responsive LINUX box with LXC-based virtualized sub-machines is possible, ideal for development (e.g. CMS like Wordpress.org
) and testing configurations intensively.
Update 2012/11/30: I began to work with server hardware, where I was creating 40 LXC machines, and start and stop them in batch, and I noticed larger amount of LXC do not start and stop reliable as of Ubuntu 12.10, e.g. out of 40 about 1-7 machines fail to start or stop (lxc-stop hangs actually) every 2nd or 3rd time of starting or stopping. So, it's good for experimenting, but for production it seems not yet ready. A quick solution is to put a sleep of one second before starting the next container. I will issue a bug report addressing problem.
Update 2012/12/21: Nested LXC and juju cloud framework: LXC in Ubuntu 12.04 , useful overview and details.
MacOS-X for a UNIX Man with a PC
last edited 2009/10/30 11:28 (*
Dell Latitude D600
Well, I've got another occassion laptop, a Dell Latitude D600
- 1.4GHz Pentium M
- 512MB RAM (2x 256MB, max 2GB)
- 14.1" 1024x768
- IDE 20GB local disk
The 1024x768 are meager, but external LCD supports up to 1600x1200.
And I remembered that a hacked version of MacOS-X 10.5.x actually installs quite well. So I gave it a try with iDeneb v1.3 (MacOS-X 10.5.5), and
- booting from DVD
- clicked through until the installation location was listing no disk at all
- entered "Utilities" - "Disk Utility" and erased the disk with HFS+ Journaled, as next I created 1 partition, and exited afterwards the "Disk Utility" and went back to the installer
- the "Installation Volume" appeared (the partition I just made)
- followed the "Customize" and enabled most patches, in particular the wireless "Broadcom" (which I later saw didn't make a difference, wireless doesn't work)
- skipping DVD integrity checking
- installation starts, it took a bit more than 1.5 hours to install the system
As next it booted, since I have only 1024x768 XGA resolution, I set the fonts down to 10px, and antialiasing, making the amount of information dense enough for the small resolution again.
iDeneb V1.3 (MacOS-X 10.5.5) on Dell Latitude D600 (1024x768)
I started to install the usual Open Source pearls:
- Firefox, Thunderbird
- GIMP, Inkscape, OpenOffice
and also Closed Source apps like
Since my 1TB was NTFS, I thought it would like a charm, the read-only works, but when I enabled the write support via MacFUSE and NTFS for Mac as well, and connected the USB external disk, and began to copy some data the system froze for a moment of 10secs, and tried again to repeat and at first sight it seemed to work, but when I put the USB disk back on the Windows XP or the Kubuntu 9 system, ._ files seem to lay around unable to delete - I tried to fix it with ntfswipe but no available, the program crashed. Reattached on Windows I ran in the shell chkdsk /f g: which corrected the corruption. Very bad, but I didn't lost any data from a 80% filled 1TB disk.
Anyway, here a list of failed programs under iDeneb 1.3 (MacOS-X 10.5.5) on the Dell Latitude D600:
- external WD My Book Essential 1TB NTFS disk: data corruption
- iCal: coredumps
is a great setup, but first I required to install XCode-3.1.3 from Apple.com
so make/gcc is around - torrents also exist, 1GB to download. As next I made sure my MacPorts' Perl is used and all subsequent modules:
cd /usr/bin; mv perl perl.dist; ln -s /opt/local/bin/perl
port install perl5
and make sure /opt/local/bin and /opt/local/sbin are in the path of your shell (.profile or .cshrc).
I gonna get iDeneb 1.5.1 (MacOS-X 10.5.7) seems to solve some problems, yet, the unreliable USB/NTFS issue is the biggest problem with this setup, as this machine has USB 2.0 and with my 1TB be sufficiently faster than with USB 1.1 on the older Dell C600. As soon I tried it I will post an update.
iDeneb 1.5.1 (MacOS-X 10.5.7): can't finish install, stays in a loop for the last "3 minutes" for hours - incomplete bootloader, no network - finally could make it bootable by stripping down drivers and bootloader, but then system was unusable only booting via DVD and F8 defining "rd=disk0s1" I could boot - unuseable.
It's clear, putting MacOS-X on an ordinary PC is a hassle and probably also good so - as that OS is really meant to run on Apple made hardware, and there it runs like a charm. For myself I keep iDeneb 1.3 (MacOS-X 10.5.5) running for some more time, and then choose an alternative, e.g. either iPC-OSX86 or going for the awaited Kubuntu 9.10 again.
Windows XP for a UNIX Man
last edited 2009/10/30 11:34 (*
Dell Latitude C600 Laptop
I got an older Dell Latitude C600
(2003), with 1440x1050 pixels large 14.1" LCD screen, still functional, but 256MB RAM only (upgraded to 384MB). Kubuntu 9.04 didn't work on it, the screen was unreadable, the drivers for the ATI Mobility M3 Video Accelerator
seem not working for the rather odd resolution (update: found HOW TO: Fix video problem on the Dell Latitude C600/C500
). In order to still use the machine, I installed Windows XP SP2 - for me as Open Source evangelist a difficult task compromising my life long attitude to avoid Windows by Microsoft.
Here are the most useful packages to make Windows XP useable:
- Cygwin.org , most UNIX commands natively compiled like useful programs: screen, ssh, scp, tar etc.
- Terminator, descent terminal emulator, requires python and ruby from Cygwin (dropped its use and rather run sshd and use putty)
- VirtualWin , virtual screens for Windows XP (alternatively also Dexpot.de , or parts of XP Power Tools )
- VirtualBox.org , virtual machine, installing Ubuntu Mini distribution on it to have a pure UNIX
- and the usual programs: Mozilla Firefox , Mozilla Thunderbird , Opera.com , OpenOffice.org , GIMP,org , Inkscape.org
- SMplayer, plays DVDs and most video formats
- Putty, ssh client
- Skype.com , to voice/video chat
- Flash Plugin, to view streamed video in webpages
Windows XP on a Dell Latitude C600 (1440x1050)
Since this laptop has only USB 1.1, the 1TB USB HD My Book Essential
(CHF 100, MediaMarkt.ch 2009/9) is slow, about 200-500KB/s transfer rate. The USB webcam Genius Eye 312
(CHF 20, MediaMarkt.ch 2009/9) works, but the USB wireless adapter Netgear WG111v3
(CHF 30, MediaMarkt.ch 2009/9) isn't working properly, every 30Min I'm cut off, even the access point is close by and good signal strength is indicated - the typical low quality of network drivers from all the "cheap" adapters like Netgear.
Anyway, I try to make the best out of the situation to use Windows XP
with this machine:
- 1GHz Pentium III
- 384MB RAM (256MB+128MB)
- IDE 20GB local disk
- USB 1TB external disk
- USB 54Mbps wifi adapter
- USB Webcam 640x480/30fps
total cost CHF 150 (apprx. Euro 100), plus a laptop bag (CHF 30, MediaMarkt.ch 2009/9)
I have to say, there are a few things which please me to use XP:
- USB devices can be plugged in, and icons show up, and I can explore the content, like for USB sticks and other devices, hassle free.
- Webcam works right away with Skype
- GUI is responsive, basic features are intuitive
- Easy to change fonts to be antialiasing
- Widerange of apps available, but I'm rather reluctant to download from unknown companies or individuals
- Rebooting the machine, and often low resolution of 1024x768 shows up, all desktop icons are rearranged - and have to change resolution again to 1440x1050 and arrange the desktop icons again
- Annoying "Auto Play" feature for new USB devices, even I turned it off it's ignored
- Unstable wireless, very annoying
- I tried to NAT between the wifi and the ethernet LAN, followed the tutorials but still didn't work, little debugging information (no /var/log/*)
- External USB disk turns off when machine goes into sleep/hibernation (which is good), when it awakes, the USB disk is considered newly plugged in
Western Digital 1TB My Book Essential
I use the laptop for an off-grid setting where I will have limited electricity, like from a small solar panel, and therefore an older laptop is just right for this application.
The 1TB My Book Essential from Western Digital for just roughly CHF 100 / Euro 68 was a good option to carry my data of the past 20 years with me, formated under XP with NTFS (r/w also under Linux and MacOS-X) - but there was no way to copy all my data via USB 1.1 and 200-500KB/s only. So I attached it to a desktop with Kubuntu 9.04 with USB 2.0 ports, and it worked right away (ntfsprogs was already installed), after plugin in the /dev/sdb was listed, and I mounted it via
mkdir /mnt/mybook1tb/; mount /dev/sdb1/ /mnt/mybook1tb/
and then I started to copy all my data from the server which exports all data to the desktop via NFS, on the USB disk using piped tar like this
tar cf - dir1 dir2 ... | (cd /mnt/mybook1tb/; tar xfv -)
and this copy session I started within a screen session.
The transfer rate is about 10GB/h or 2.7MB/s, which is about 4-10x faster than with USB 1.1; so the transfer of 900GB takes 90hrs or 3.75 days.
Since I still do pretty much web development, and switched from Apache to Lighttpd I was pleased to see lighttpd ported to Cygwin as well.
Now I needed a small dns server to resolve my local web-sites like
http://test.local, and MaraDNS.org compiled just fine.
Note: the loopback device 127.0.0.1 isn't up by default, you actually need to install it as a device; e.g. when you are off-line without any network connection this might be needed so your local DNS is considered, as there is no way to define a default DNS lookup at Windows XP like at UNIX with /etc/resolv.conf - when you have a network connection, then the DNS entries of that network is considered.
I run my own little CMS as a Perl CGI and it required a module Image::Size, which I installed like this
perl -MCPAN -e 'install Image::Size'
the first attempt failed, as it was quite memory hungry to fetch and compile it, and the 'child_fork' emulation using longjmp failed; after quitting some other apps it worked, and the module was in. Impressive to see Perl install compiled modules on a Non-UNIX system like Windows XP with Cygwin; needless to say this is also due the GCC which is so widerange supported.
X11 is also ported, and in order to use X11 apps mixed with native XP apps, start
X -multiwindow &
and export DISPLAY=:0.0
so other apps know which display to use.
- Most UNIX commands using Cygwin incl. xterm
- Local DNS using MaraDNS.org , locally compiled
- Lightweight webserver using Lighttpd.net , precompiled in Cygwin
Install the init.d structure from the Cygwin package, and adding in /etc/rc.d/rc.local a few lines to start up DNS, HTTPD and X11.
Chicken Egg problem caught me, I was using a bare laptop, and tried to get Kubuntu on it, failed at the first attempt; installed XP and installed the stuff I need, and discovered there is a solution for the X11 config. After a few hours I concluded following:
- X11 with 1400x1050 works, dedicated xorg.conf required (probing doesn't work)
- Webcam works under Linux with a new driver and dedicated compiling
- Netgear Wifi works under Linux with a new driver and dedicated compiling (see solution )
which is the "usual" additional work to get peripherie working, also something I'm not willing to invest anymore.
I tried Kubuntu 9.04 on various systems, and I'm rather disappointed of the unfinished piece of software, and I'm tired to configure simple networking by editing 2-3 files, instead by a handy one page GUI. So, I wait til Kubuntu 9.x has matured, and give it a try with a Live System, and then if I get full resolution, and decent GUI for network administration incl. WPA Wifi settings, I gonna switch again to Linux.
While trying to resolve the annoying wifi connectivity loss, I discovered that it did matter a lot of the orientation of the USB wifi adapter: I attached the stick with "klett" on the back of the laptop screen, first vertically, and then turned it horizontally and the signal strength of the access point increased significantly. I also discovered my older Netgear WG602v2 AP was much better than the brand new D-Link DIR-301, very odd - but what remained was occasionally wifi network drops and reconnection, definitely Netgear WG111v3 network driver issue.
MacOSX: My First Steps
last edited 2009/04/10 13:13 (*
I admit, I was very excited to get my hand on a MacBookPro, I was expecting everything working out of the box.
MacBookPro with MacOS-X 10.5.6
MacBook Pro System Profile
The dock is made intuitively, I click on the icon, the applications starts, and I can put it drag & drop it there and inserts nicely, or close it.
Installing a .dmg is a bit non-intuitive, as you donwload a .dmg and open it, and you see a few files,
sometimes you see two icons, one of the application, and one of the folder "Application", you are supposed to drag it over, why this is so, no clue.
When I click on an installer, I want to install it, and not be taught how to drag one icon over another, stupid.
MacOS-X in Action
So, starting an application doesn't mean that it is installed, not so, you require to drag the application into the folder "Application" to ensure it
is in the system, after then you disconnect the .dmg disk image by . . . moving it into the Trash.
I thought the Trash is where you put things when you want to delete things? E.g. to eject a CD or DVD, throw it into the Trash . . . . very strange.
Expose/Spaces, multiple screens work fine, fast switching, key shortcuts definable.
As next I installed Firefox 3, and Opera 9.63 and GIMP 2.6, and Inkscape 0.46, each application I downloaded from the respective homepages.
Then I installed MacPorts, there the first fiddling around was required, the /opt/local folder was populated, but the xterm/bash didn't find it,
so you had to edit .profile or .cshrc in case you ran tcsh. As next installing screen using sudo port install screen which worked perfectly.
Unforunately, the default behaviour of screen wasn't acceptable, still calling bash at startup instead tcsh as defined in the xterm/Terminal.app.
Anyway, Google has all the answers, the .screenrc edit to do what I want, and I'm almost done.
termcapinfo xterm* ti@:te@
Update: you can change the login shell in "System Preferences" -> "Account", select your own login, make sure you can make changes, and click with right button or with CTRL pushed, "Advanced Options" appears . . . one of the few inconsistancies I found, to hide this important menu.
I start to install various perl modules, and I realize there are two perls now in the system, one in /opt/local and another in /usr/bin/, not good.
I sym link /usr/bin/perl to use /opt/local/bin/perl, and then install perl modules using
perl -MCPAN -e "install Digest::SHA"
and so forth, the few handy modules, including DBD::SQLite, but that requires the sqlite3, which I install via sudo port install sqlite3
I also compile my own old text editor, and it compiles without problems (the source code is over 20 years old).
That what I was hoping for, flash and quicktime seem to work, not perfectly, but ok. E.g. the video stream at zdf.de doesn't work seamless, the wifi connection
quicktime has problens, audio fails and I have to restart the player again a few times . . . not really mature the quicktime streaming, surprising.
I installed VBox on Kubuntu 8.1 as host a few days ago, and ran Windows XP SP2 as guest, and it installed without problems,
under MacOS-X 10.5.6 and VBox 2.1.2 the very same CD failed to install (report of a "I386\asms: Error Message: the parameter is incorrect") . . . not very convincing, whoever is the culprit.
I even burnt another CD from the iso file I had with the Mac, same error message, finally I mounted the .iso file and fed that as CD, and that worked.
This means, likely the Mac/VBox/WindowsXP CD Driver chain is somewhere broken, likely the Windows XP CD driver based on findings on the net, that people with real machines, not VirtualBox, encountering the same error.
I installed Kubuntu 8.1 (only at 800x600, higher resolution wasn't possible, bad) and FreeBSD 7.0 ("boot only" did not work as ftp access to Internet failed, but "disk 1" did work) as guests,
but it seems VirtualBox on Mac is a bit behind compared to the Linux host variant, surprising.
At the right upper corner you have a magnifying glas, no it doesn't magnify the screen buffer, it does . . . searching.
It's much faster to type the name of the application you like to start instead to search through the directories via Finder, in
particular when you installed the iPhone SDK which is . . . somewhere deep in filesystem installed . . .
So, the full text index is great via Spotlight, I hoped KDE/Kubuntu invest more time to provide a seamless working desktop search of that quality.
When switching spaces, the window order is reset, e.g. when I clicked on a window to get in the front, and I switch the space, and get back, the window I had on top is hidden and another window is top, a slight annoyance.
It's a Safari web browser which is scaled down to the size of the iPhone, ideal to test web apps for the iPhone, but do you think you can quit the application? No, the quit in the menu doesn't work, it remains running ...
so, we are back on the console, as we were using a half finished KDE program and terminate with the kill
command, so on the MacOS-X also half finished programs exist, a reality check for me.
Asked me to quit all "active browsers" (without offer to start them up later again), which I did, and still can't install it . . . wow, Google makes software which doesn't work, first time for me.
I don't like the keyboard, too small RETURN/ENTER key, bright screen, good battery, warms your hands while working on the computer (is heating a bit too much I think).
Software wise, a bit dimmed expectation, but mostly I'm very pleased with the entire setup, most stuff is intuitive, very few options are missing,
most functionality is sufficient. I like the fast graphics, no delays, I can compile, watch movies, hear streamed radio, all at the same time (just for test purpose) and don't sense a slow down in GUI interaction.
Most things are intuitively layed out when using MacOS-X, yet, a few keyboard shortcuts are not known to newbies:
- File Rename: in Finder, click on name, and hit ENTER/RETURN
- File Delete: in Finder, click on name, and hit APPLE + DEL/BACKSPACE
- Exit/Terminate Running Program: APPLE + 'q'
Check also other posts with other tags.