inserting F10 / CTRL+X control character to a minicom terminal

I ran into this interesting issue tonight, where I had malformed entry in my kernel flags which was causing the system to reboot as soon as it loaded the kernel.

So, I needed to edit my GRUB setting at the command line… however, my only physical console on this system is via a 19200 8N1 serial console, running through “minicom”.

After hitting “e” to edit my grub boot item, the following familiar message is displayed towards the end of the screen:

Minimum Emacs-like screen editing is supported. TAB lists
completions. Press Ctrl-x or F10 to boot, Ctrl-c or F2 for
a command-line or ESC to discard edits and return to the GRUB menu.

I was not able to enter the “CTRL+X” or “F10” keystrokes in minicom.

I found a couple articles about this:

Send F10 to GRUB with Minicom
How to send F10 from minicom?

The first looked promising, but didn’t seem to work for me. The answer to the second post didn’t seem to understand the issue at hand.

Anyways, I eventually found this askubuntu article: how do I send control characters to serial device

which eventually pointed me to the idea passing control characters directly to the device.

You’ll want to use the octal representation of your control character.

According to this ASCII Table , the decimal representation of “CTRL+X” is “24”. We must then convert to octal:

$ echo "obase=8; 24" | bc
30

so now, to solve our issue, we simply run:

$ echo -e '\030' > /dev/ttyUSB0

And boom! GRUB has the “CTRL+X” sequence it was looking for!

Getting Solaris 11.3 x86 to output to serial console

I just set up a new Solaris 11 system for the first time in ages. I was struggling to remember how to configure terminal output through this system’s serial port…

I found this article: Solaris 11 Serial Console

which confidently seems say that the only commands necessary are:

# bootadm set-menu console=serial serial_params=0,19200,8,n,1
# bootadm change-entry -i 0 'kargs=-B console=ttya'

Note: according to Solaris doc Using the set-menu Command, if you’re using ttyb instead of ttya, you’ll want to set "serial_params=1,19200,8,n,1"

However, my serial output seemed to end as soon as GRUB started loading the kernel…

I found that I also needed to set the following

# eeprom console="ttya"
# eeprom ttya-mode="19200,8,n,1,-"

Changing this eeprom setting will create a new default “Solaris bootenv rc” entry in GRUB.

You can see this new entry like such:

# bootadm list-menu

And delete it (assuming the index is “1”) via:

# bootadm remove-entry -i 1

BTW (since this also took me a while to figure out) my USB<-->RS232 setup is a HL-340 chipset USB-A to RS-232 male cable hooked up to the male RS-232 port on this old Supermicro motherboard using a female/female RS-232 “null modem” cable (StarTech part #SCNM9FF2MBK), though a simple null adapter should work as well. During the confusion, I also bought a PL2303 chipset USB-A to RS-232 female cable (CableCreation part #CD0489) which can be plugged in directly (no need for a null modem or adapter). The benefit to the PL2303 chipset is that Solaris 11.3 has driver support for the USB end of it, whereas my HL-340 cable doesn’t seem to work out of the box on Solaris.

1000 Genomes Phase 1 and Phase 3 Ethnic Breakdown

At one point in time, I had the answer committed to memory, but now that I’ve moved out of the world of genetic epi, I had to spend some time researching this question today:

What are the ethnic breakdowns of the 1000 Genomes Phase 1 and Phase 3 populations?

From this rather hard to find file on the 1000GP FTP site, we have the following for phase 1:

ASW	AFR	61
LWK	AFR	97
YRI	AFR	88
CLM	AMR	60
MXL	AMR	66
PUR	AMR	55
CHB	EAS	97
CHS	EAS	100
JPT	EAS	89
CEU	EUR	85
FIN	EUR	93
GBR	EUR	89
IBS	EUR	14
TSI	EUR	98

yielding the following phase 1 “super population” totals:

AFR	246
AMR	181
EAS	286
EUR	379

For phase 3, it’s a bit trickier. There were originally 2,535 samples sequenced, but 31 were removed due to unexpected relatedness, leaving us with 2504 samples found in the Phase 3 release VCF files. I had to download a phase 3 VCF file, look at the header to get the list of 2504 individuals, then compare against the 1000 Genomes “sample info” spreadsheet to derive the required information.

Here’s the breakdown of the 2504 samples included in phase 3:

ACB	AFR	96
ASW	AFR	61
ESN	AFR	99
GWD	AFR	113
LWK	AFR	99
MSL	AFR	85
YRI	AFR	108
CLM	AMR	94
MXL	AMR	64
PEL	AMR	85
PUR	AMR	104
CDX	EAS	93
CHB	EAS	103
CHS	EAS	105
JPT	EAS	104
KHV	EAS	99
CEU	EUR	99
FIN	EUR	99
GBR	EUR	91
IBS	EUR	107
TSI	EUR	107
BEB	SAS	86
GIH	SAS	103
ITU	SAS	102
PJL	SAS	96
STU	SAS	102

with the phase 3 super populations as follows:

AFR	661
AMR	347
EAS	504
EUR	503
SAS	489

By the way, here’s a legend of those rather vague ethnicity IDs:

CDX	Chinese Dai in Xishuangbanna, China
CHB	Han Chinese in Bejing, China
JPT	Japanese in Tokyo, Japan
KHV	Kinh in Ho Chi Minh City, Vietnam
CHS	Southern Han Chinese, China
BEB	Bengali in Bangladesh
GIH	Gujarati Indian in Houston,TX
ITU	Indian Telugu in the UK
PJL	Punjabi in Lahore,Pakistan
STU	Sri Lankan Tamil in the UK
ASW	African Ancestry in Southwest US
ACB	African Caribbean in Barbados
ESN	Esan in Nigeria
GWD	Gambian in Western Division, The Gambia
LWK	Luhya in Webuye, Kenya
MSL	Mende in Sierra Leone
YRI	Yoruba in Ibadan, Nigeria
GBR	British in England and Scotland
FIN	Finnish in Finland
IBS	Iberian populations in Spain
TSI	Toscani in Italy
CEU	Utah residents with Northern and Western European ancestry
CLM	Colombian in Medellin, Colombia
MXL	Mexican Ancestry in Los Angeles, California
PEL	Peruvian in Lima, Peru
PUR	Puerto Rican in Puerto Rico

checking whether a statically linked program can dlopen itself… hangs

I’ve had this issue many times over when running “./configure” scripts on my Linux From Scratch 6.7 system:

checking for dlopen... no
checking for dlopen in -ldl... yes
checking whether a program can dlopen itself... yes
checking whether a statically linked program can dlopen itself...

The script will then hang at the “checking whether a statically linked program can dlopen itself…” step and will not exit until I terminate the process (CTRL+C).

The configure script is typically creating a C program to test dlopen, like such:

int main ()
{
  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
  int status = $lt_dlunknown;
  if (self)
    {
      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
      else
        {
          if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
          else puts (dlerror ());
        }
      /* dlclose (self); */
    }
  else
    puts (dlerror ());

  return status;
}

where the $variables are provided by shell script.

Here’s a quick fix that works for me:

 int main ()
 {
   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
+  int status = $lt_dlunknown; return status;
   if (self)
     {
       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;

It doesn’t return a valid test result, but at least you’ll be able to finish configuring your program.