Bill's Long Term Memory

I put things here that I want to remember at some future time.

Sunday, December 4, 2011

Blackjack for current Ubuntu and LinuxMint

I was personally very disappointed when Blackjack (BJ) was dropped from the Gnome-Games.
An issue I still have is that there is not explanation for WHY BJ was dropped. The “news” files for version 2.26 (version at which BJ is missing) give no clue that BJ was dropped or why.

I decided to compile BJ. It seemed straight forward, get the source and compile.

The current Ubuntu source packages for Gnome-Games did not contain BJ. So I went back to get the source from live.gnome.org . The last source release for Gnome-Games that contained BJ is version 2.25.92.

I needed to follow the instructions given under Gnome Games - Developer's Guidelines to be able to compile BJ. However, the instructions as given leave many things unsaid for those who are not Linux developers. These are listed below.
  • The list of required supporting software packages is quite helpful, but not complete.
    • glib2 should be added to the list.

  • The supporting packages are probably best retrieved using Synaptic
    • Most of the packages will be
      • prefixed with “lib”
      • suffixed with “-dev”

  • In the games source directory:
    • Configure the games for BJ only
    • Build and install BJ
./autogen.sh --prefix=/usr/games --enable-games=blackjack
sudo make install

Note: For Gnome 3 systems it may be necessary to use the menu editor alacarte to put Blackjack into the system menu. If not already present on the system, you will need to use Synaptic to install it.

Sunday, August 21, 2011

On-Line Storage

This is a brief tutorial about online storage. Here are some online storage sites I am most familiar with.
Name
Amount of Free Storage
URL
Dropbox
2 Gb
Ubuntu One
5 Gb
SugarSync
5 Gb
Wuala
2 Gb
Google Docs
1 Gb ($0.25 per additional Gb)

The free storage listed above totals 9 Gb. That is plenty for most of us, if we practice a bit of storage management
All but Google Docs have sync-your-computer(s)-with-online-storage software and share-with-your-friends-for-more-storage schemes. My point-of-view is that the sync software and share schemes are “honey buckets” designed to get you to use additional online storage.
My recommendation is to not download the sync software. There is typically a “Files” tab with most of these sites that takes you to you files and has mechanisms for uploading and downloading.

Thursday, January 21, 2010

Getting Conky 1.7.2 compiled on OpenSolaris svn_130

Seeking something like BGInfo for Windows, I found Conky.
On Debian based systems like Ubuntu and Knoppix, it is available.
Unfortunately for OpenSolaris, it is not.
So off to compile it for myself....

I downloaded the source 1.7.2 from SourceForge.
I found a blog (in Italian) with patches for the source and instructions.

I had trouble getting the ./configure to work properly because of a pkg-config version issue.
You need at least version 0.23 .

Below is what I currently have showing on my background.
It took some time to get the options right for what I wanted.
I eventually opted to go from a 1 second update cycle to a 5 second one.
That eliminated the flicker and distraction of frequent updates.


Thursday, December 17, 2009

Meta II - A compiler/compiler that preceeded Lex/Yacc by More that a Decade

A college buddy of mine has posted a tutorial on Meta II, a simple compiler/compiler that could express itself in just over a dozen lines.
We were impressed with what could be done with this "meta" compiler that dated back to 1964.
It still has uses today and can be easier to use for some projects than Lex/Yacc or LALRn compilers.
The tutorial can be found at his company website: http://www.bayfronttechnologies.com/mc_tutorial.htm.com

Wednesday, April 15, 2009

Expanding a ZFS OpenSolaris (VirtualBox) VDI

Intro

I have been working using a OpenSolaris guest OS in VirtualBox hosted on XP.
My original disk was set to a maximum of 16Gb.
Recently, my Boot Environment reached 12Gb, leaving little space for my stuff and not enough space to perform the next update.

If my guest OS was XP or Linux, I could have used the published technique of dd copying into a new VDI and using GParted or PartitionMagic to expand the partition in the new volume. XFS bring the different animal it is, and not finding an tool to expand the partition under OpenSolaris, I have found the following procedure to work.

Overview

In brief, here are the steps I took.
  1. dd copied VDI contents into a larger VDI
  2. Expanded the partition definition.
  3. Edited the segment table to match the new partition

Gory Details

Going from a 16Gb VDI to a 30Gb VDI.

  1. Use the "VBoxManage clonehd" command to make a copy of the VDI.
    This is necessary to create a new VDI with a different UUID.

  2. Create an new (suggest "dynamically expanding") VDI of the larger size.

  3. Attach the clone copy and the new VDIs to a Linux virtual machine.
    My personal preference is Knoppix, because I can get it to boot into non-graphical multi-user mode by entering "knoppix 2" at the "boot:" prompt.

  4. Find out the devices that the disks are mounted on using fdisk:
    > fdisk -l
    Disk /dev/hda: 2147 MB, 2147483648 bytes

    16 heads, 63 sectors/track, 4161 cylinders
    Units = cylinders of 1008 * 512 = 516096 bytes
    Disk identifier: 0xeb5b91f0

    Device Boot Start End Blocks Id System
    /dev/hda1 1 4161 2097112+ 82 Linux swap / Solaris

    Disk /dev/hdb: 32.2 GB, 32212254720 bytes
    255 heads, 63 sectors/track, 3916 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x00000000

    Disk /dev/hdb doesn't have a valid partition table

    Disk /dev/hdd: 17.1 GB, 17179869184 bytes
    255 heads, 63 sectors/track, 2088 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x00000000

    Device Boot Start End Blocks Id System
    /dev/hdd1 * 2 2088 16763827+ bf Solaris

    From the above we can tell the following:
    • /dev/hdb is the new disk (no partition table)
    • /dev/hdd is the clone (System=Solaris)

  5. Further we note the start/end cylinders for partition 1 on both the drives of interest:
    • hdb 2/3916
    • hdd 2/2088

  6. With the Linux virtual machine, dd copy the clone contents into the new (empty) VDI.
    e.g. dd if=/dev/hdc of=/dev/hdn bs=M
    where c and n are for the drives are the clone and new VDIs.

    For this specific case:
    dd if=/dev/hdd of=/dev/hdb bs=M

    Note: This copy operation will have duplicated the UUID of the clone into the new VDI. This means that you cannot have both the clone VDI and the new VDI registered with VirtualBox at the same time.

  7. In the new VDI, using fdisk, delete the partition 1 definition and recreate it with a new ending cylinder.
    > fdisk /dev/hdn
    Command (m for help): p
    Disk /dev/hdb: 32.2 GB, 32212254720 bytes
    255 heads, 63 sectors/track, 3916 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x00000000

    Device Boot Start End Blocks Id System
    /dev/hdb1 * 2 2088 16763827+ bf Solaris

    Command (m for help):
    d

    Selected partition 1
    Command (m for help): n
    e extended
    p primary partition (1-4)
    p
    Partition number (1-4): 1
    First cylinder (1-3916, default 1): 2
    Last cylinder or +size or +sizeM or +sizeK (1-3916, default 3916):
    Using default value 3916
    Command (m for help): t
    Selected partition 1
    Hex code (type L to list codes): bf
    Command (m for help): a
    Command (m for help): p
    Disk /dev/hdb: 32.2 GB, 32212254720 bytes
    255 heads, 63 sectors/track, 3916 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x00000000

    Device Boot Start End Blocks Id System
    /dev/hdb1 * 2 3916 31447237+ bf Solaris

    Command (m for help): w


    Note the following in the above about the partition on the new VDI:
    • The original end cylinder is the same as on the clone VDI we dd'ed from.
    • The final end cylinder matches the number of cylinders in the new VDI.
      Write this value down, you will need it later.

  8. Exit the Linux VM and define a new virtual machine that uses the new VDI as the primary disk.

  9. Start the new virtual machine, and look at the disk usage using df -h .
    This shoud be identical the the original VDI you started with.

  10. Expand the Solaris partition to use the full partition:
    > pfexec su -
    # format -e
    Searching for disks...done

    AVAILABLE DISK SELECTIONS:
    0. c3d0
    /pci@0,0/pci-ide@1,1/ide@0/cmdk@0,0
    Specify disk (enter its number): 0
    selecting c3d0
    NO Alt slice
    No defect list found
    [disk formatted, no defect list found]
    /dev/dsk/c3d0s0 is part of active ZFS pool rpool. Please see zpool(1M).

    FORMAT MENU:
    :
    format> p
    PARTITION MENU:
    0 - change `0' partition
    1 - change `1' partition
    2 - change `2' partition
    :
    partition>
    print
    Current partition table (original):
    Total disk cylinders available: 3913 + 2 (reserved cylinders)

    Part Tag Flag Cylinders Size Blocks
    0 root wm 1 - 2084 15.96GB (2084/0/0) 33479460
    1 unassigned wm 0 0 (0/0/0) 0
    2 backup wu 0 - 2084 15.97GB (2085/0/0) 33495525
    3 unassigned wm 0 0 (0/0/0) 0
    4 unassigned wm 0 0 (0/0/0) 0
    5 unassigned wm 0 0 (0/0/0) 0
    6 unassigned wm 0 0 (0/0/0) 0
    7 unassigned wm 0 0 (0/0/0) 0
    8 boot wu 0 - 0 7.84MB (1/0/0) 16065
    9 unassigned wm 0 0 (0/0/0) 0


  11. Note the available cylinders value. This should be very close to the end cylinder value seen in Linux. The end value you want to set in this next step, should be the available cylinders less 1. This value should be suffixed with the letter "e". We set the end cylinder for both partition 0 and 2. After that we write out changes out using the label command.

    partition>
    0
    Part Tag Flag Cylinders Size Blocks
    0 root wm 1 - 2084 15.96GB (2084/0/0) 33479460

    Enter partition id tag[root]:
    Enter partition permission flags[wm]:
    Enter new starting cyl[1]:
    Enter partition size[33479460b, 2084c, 2084e, 16347.39mb, 15.96gb]: 3912e
    partition> 2
    Part Tag Flag Cylinders Size Blocks
    2 root wm 0 - 2084 15.96GB (2084/0/0) 33479460

    Enter partition id tag[root]:
    Enter partition permission flags[wm]:
    Enter new starting cyl[1]:
    Enter partition size[33479460b, 2084c, 2084e, 16347.39mb, 15.96gb]: 3912e

    partition> label
    [0] SMI Label
    [1] EFI Label
    Specify Label type[0]: 0
    Ready to label disk, continue? y

    partition> quit
    format> quit


  12. Finally we setup to have devices reconfigured:
    > touch /reconfigure

  13. Reboot guest OpenSoalris system

  14. Log in and verify with df -h that the disk size has changed.

  15. Done.

Followers