Author: Carl

Moving MariaDB Data Drama

For those of you who work with MySQL on CentOS or RedHat servers on a regular basis, running out of room for large MySQL databases on the root partition is pretty common.  The default options in the OS installer suggest a 30GB root partition which has probably been the default value for at least ten years.  Normally, this is easy to remedy. However, I was trying this on a server with MariaDB …

Trying this both via editing my.cnf and by simply a symlink produces failure:

Sep 14 16:49:06 id27131.1wpo.com mysqld[22796]: 2017-09-14 16:49:06 140313610287360 [Note] /usr/sbin/mysqld (mysqld 10.1.26-MariaDB) starting as process 22796 …
Sep 14 16:49:06 id27131.1wpo.com mysqld[22796]: 2017-09-14 16:49:06 140313610287360 [Warning] Can’t create test file /var/lib/mysql/id27131.lower-test64 ID=15680 PROTO=UDP SPT=53 DPT=60246 LEN=192 UID=25 GID=25

Looks like it may be due to a bug with mariadb!

A tutorial on DO says you need to specify the socket for the MySQL client.. i didnt even try that as mysqld fails to start!
Seems like this would have to be done by changing  the variable basedir not datadir, I have yet to try that reddit post >>

Chicony Close Up

Chicony Close Up

Ergodox Scavenge Build

I bought my first ErgoDox from a coworker. Bringing a keyboard back and forth to work is a pain in the ass, so I built another one.

I used to have what I am pretty sure was a Chicony 5581.

Chicony 5581 Keyboard

Chicony 5581 Keyboard

For whatever reason some years back, during the height of my take-shit-apart-without-a-concrete-goal-in-mind phase, I lost the top half of the case, some components of the track ball, and some keycaps. Well, turns out this sucker used Cherry MX Blue switches. They feel quite a bit different from the low mile switches in my aluminum-acrylic-sandwich bodied ErgoDox I use at work. I’m not sure if the MX blues from ’88 are equivalent to modern days ones. Anyway I figured I would put those to use eventually.

Naked Chicony Keyboard

Naked Chicony Keyboard

Chicony Controller

Chicony Controller

Chicony Close Up

Chicony Close Up

Chicony Printed Circuit Board Back

Chicony Printed Circuit Board Back

Chicony Printed Circuit Board Back Detail

Chicony Printed Circuit Board Back Detail

Weller Soldering Iron

Weller Soldering Iron

There have been several ways to order ErgoDox keyboards either completely assembled or as a kit.  Currently you can get an assembled ErgoDox from ergodox-ez.com but starting at $270 its awfully expensive. Well, I have these key switches just waiting for a purpose, and key switches make up a large amount of the price of any mechanical keyboard.  Also, I already had a set of keycaps which aren’t included in kits anyway, so, instead of a kit I went ahead and ordered a pair of PCBs from mechanicalkeyboards.com, a teensy from PJRC and other miscellaneous bits from DigiKey.

It took a while and more than a little elbow grease to harvest the switches.  If you have not done something like this it involves jamming a screw driver under the switch while alternating between which leads you hit with a soldering iron.  The trusty ol’ Weller I inherited from my dad’s days of television repair got the job done, love that thing.

ErgoDox Printed Circuit Board

ErgoDox Printed Circuit Board

While the keycaps from the Chicony are doubleshot, they do not suit the ErgoDox well as they are sculpted, not flat DSA, which does not facilitate customizing your layout.  I did end up using a different set of non-DSA keycaps for the alpha which looked better matched with blank DSA caps I had for the modifier keys.

 

ErgoDox Teensy Controller

ErgoDox Teensy Controller

ErgoDox 3D Printed Assembly in Progress 1

ErgoDox 3D Printed Assembly in Progress 1

ErgoDox 3D Printed Assembly in Progress Close Up

ErgoDox 3D Printed Assembly in Progress Close Up

ErgoDox 3D Printed Assembled 2

ErgoDox 3D Printed Assembled 2

ErgoDox 3D Printed Assembled 4

ErgoDox 3D Printed Assembled 4

ErgoDox 3D Printed Assembled 3

ErgoDox 3D Printed Assembled 3

[Top]

Less Syntax Highlighting on Ubuntu 16.04 and Debian 8

Looking at shell scripts or just about anything without highlighting is painful. I use less a lot to page through long stuff, so why not have some color?

sudo apt install source-highlight

then add the following to your .bashrc:

export LESSOPEN="| /usr/share/source-highlight/src-hilite-lesspipe.sh %s"
export LESS=" -R "

This is modified from a script on GitHub. That script is specific to CentOS

[Top]

MechWarrior Chronological Playthrough Intro

For a few months I’ve been on a bit of a BattleTech / MechWarrior kick. One of the things that crossed my mind is how disjointed most of the MechWarrior games are chronologically:

    The first releases, BattleTech: Crescent Hawk’s Inception in 1988 and MechWarrior in 1989 were sensibly enough set in the original or ‘classic’ BT time period in 3028.
    The sequel to BT:CHI, Crescent Hawk’s Revenge began right after BT:CHI but made jumps forward as far as the Battle of Luthien in 3052. This one covers a lot of ground.
    Next, released in 1995 the ground breaking MechWarrior 2: 31st Century Combat inexplicably advances the timeline to 3057. In a major departure the backdrop is in Clan space rather than the Inner Sphere. The story is basically completely unrelated to events in prior titles, and I’m not even sure if they are explained in-game / a link is made to earlier titles in-game.
    1996’s MechWarrior2: Mercenaries reverts to a spheroid protagonist and takes a time machine back to 3044 and concludes at the Battle of Luthien .. uh, again.
    For 1998’s MechCommander and 1999’s MechWarrior 3 the timeline leaped forward to 3059 and finally from here on out the releases actually increment the timeline predictably. What a mess

Trying to wrap your head around any of that is a waste, not to mention the glaring differences from cannon that many of the games exhibit.
But hey why not figure out the chronological order and play them? So, here are all 18 games:


Game		Year		Published	Plot/Era/Locale		
------		----		---------	--------------
mw1		3024-3028+	1989
mw snes		3027		1993	
bt: chi		3028		1988	Chara III (Pacifica)	
bt: chr		3028-3052	1990	Lyons, War of 3039, Luthien
mw2 mercs	3044-3052	1996	Clan Invasion!
mw 3050		3050		1995	Clan Invasion
mw2 31cc	3057		1995	Refusal War
mw2 gbl?	late 3050s	1995
mc1		3059		1998	Operation Bulldog
mw3		3059		1999	Post OpBulldog, Serpent
mw3 pm		3060		1999	
mcx		3060		1999	Post OpBulldog
mw4: v		3062		2000	FedCom civil war
mw4: bk		3060s		2000	FedCom civil war
mw4: mercs	3062-67		2002	FedCom civil war
mc2		3063		2001	FedCom civil war
ma		~3067-81	2002	WoB Jihad
ma2		~3067-81	2004
[Top]

MechWarrior Retrospective

I came across a great YouTube channel The Examined Life (of Gaming). You can tell this guy is a true nerd by his fofxStudios YouTube URL … my kind of guy! Well he happens to be as nerdy as I am about all things MechWarrior and has a great series of videos critiquing the games and going over their history. Check out the playlist here MechWarrior Retrospective

[Top]
Select from multiple Java versions

Select from multiple Java versions

Pick from different Java Versions when launching JNLP

Extenuating circumstances require me to run more than one version of Java JRE for work. Instead of using packages from the distro, I got the .tar.gz’s right from Oracle. I had to manually add the plugin to Firefox. Then, I extracted both JRE into /opt/java, added /opt/java to my path and made symlinks:


[email protected]:/opt/java$ ls -l
total 8
lrwxrwxrwx 1 carl carl 20 Jul 1 15:01 java -> jre1.7.0_80/bin/java
lrwxrwxrwx 1 carl carl 20 Jul 7 16:05 java7-java -> jre1.7.0_80/bin/java
lrwxrwxrwx 1 carl carl 22 Jul 7 16:49 java7-javaws -> jre1.7.0_80/bin/javaws
lrwxrwxrwx 1 carl carl 20 Jul 19 14:52 java8-java -> jre1.8.0_92/bin/java
lrwxrwxrwx 1 carl carl 22 Jul 7 16:06 java8-javaws -> jre1.8.0_92/bin/javaws
drwxr-xr-x 6 carl carl 4096 Apr 10 2015 jre1.7.0_80
drwxr-xr-x 6 carl carl 4096 Apr 1 00:17 jre1.8.0_92

I wrote a little helper script which I use as the default application in Firefox for this, using zenity (actually I use Palemoon, but same difference).
firefox-java-web-start-application

#!/bin/bash
command=$(zenity --list --text "Is linux.byexamples.com helpful?" --radiolist \
--column "Pick" --column "Opinion" TRUE /opt/java/java8-javaws FALSE /opt/java/java7-javaws );
$command $1

Java Selector

Java Selector

[Top]
Password Safe logo

Password Safe logo

Password safe and GnuPG on Ubuntu 14.04

Once again here is how to verify and install Password safe. This is an update of an earlier post. Considering this software is guarding some of your most important secrets I see it worthwhile to verify the GnuPG signature. OS this time is Ubuntu 14.04 Trusty Tahr (Linux Mint 17.2 Rafaela).

Password safe

To verify the signature we need GnuPG.

  1. install gnupg

    $ sudo apt-get install gnupg

  2. import project administrator’s signing key (RSA)
    i. We’re going to import Rony Shapiro’s Password Safe Signing key. Go to https://pwsafe.org/contact.php click the link for “this public key”.
    ii. Save the page it gives you as pwsafe.key and strip out the HTML tags.
    iii. import the key

    $ gpg –import pwsafe.key
    gpg: key 5CCF8BB3: public key “Rony Shapiro (PasswordSafe Signing Key) <[email protected]>” imported
    gpg: Total number processed: 1
    gpg: imported: 1 (RSA: 1)
    gpg: no ultimately trusted keys found

    iiii. verify the key fingerprint against what is listed at the bottom of https://pwsafe.org/contact.php

    $ gpg –fingerprint
    /home/mrdesk/.gnupg/pubring.gpg
    ——————————-
    pub 2048R/5CCF8BB3 2011-02-10
    Key fingerprint = A703 C132 8EAB C7B2 0175 3BA3 9194 6451 5CCF 8BB3
    uid Rony Shapiro (PasswordSafe Signing Key) <[email protected]>
    sub 2048R/04B638E7 2011-02-10

  3. Download the package
    i. SourceForge (bleh) is the only place the .deb package is available. https://sourceforge.net/projects/passwordsafe/files/ Don’t be fooled, SourceForge lists 0.94BETA as the newest release, actually 0.97BETA is the newest as of the time of writing this article. In my case, passwordsafe-ubuntu-0.97BETA.amd64.deb. There are also .debs specific to debian, RPMs and source packages available.
    ii. Download the pakage signature. In my case, passwordsafe-ubuntu-0.97BETA.amd64.deb.sig
  4. Verify the Password Safe .deb package
    You need to have the .deb and the .sig file in the same directory.

    $ gpg –verify passwordsafe-ubuntu-0.97BETA.amd64.deb.sig gpg: Signature made Fri 09 Oct 2015 05:21:50 AM EDT using RSA key ID 5CCF8BB3
    gpg: Good signature from “Rony Shapiro (PasswordSafe Signing Key) <[email protected]>”
    gpg: WARNING: This key is not certified with a trusted signature!
    gpg: There is no indication that the signature belongs to the owner.
    Primary key fingerprint: A703 C132 8EAB C7B2 0175 3BA3 9194 6451 5CCF 8BB3

    Notice the fingerprint matches the one we verified earlier listed on http://pwsafe.org/contact.shtml — ok good!

  5. Go ahead and install

    $ sudo dpkg -i passwordsafe-ubuntu-0.97BETA.amd64.deb

  6. It will complain about dependencies for libwxgtk3.0-0, libxerces-c3.1, and libykpers-1-1. So, install your dependencies

    $ sudo apt-get -f install

Done! To verify your .deb has been installed:

$ dpkg –get-selections | grep passwordsafe
passwordsafe install

You can launch the password safe gui either by

$ pwsafe &

or by finding ‘Password Safe’ it in your launcher menu.

[Top]

Password Safe and GnuPG on Ubuntu 13.10

This was actually done on Linux Mint Petra but in this case its entirely Ubuntu compatible.  Yes, I know 13.10 is about to expire, don’t worry, I’ll fix this for 14.4 as soon as Linux Mint XFCE Qiana comes out and I put it on my desktop.

I am tired of resetting passwords, so the other day I set up Password Safe on my laptop.  It wasn’t hard but did take a little time so here is how to do it.  I took the extra few steps of verifying Password Safe’s signature because I take my passwords seriously.   As such, this guide steps through basics of GNU Privacy Guard (GnuPG).

Password safe

To verify the signature we need GnuPG.

  1. install gnupg

    $ sudo apt-get install gnupg

  2. import Rony Shapiro’s Password Safe Signing key (RSA)
    i. go to http://pwsafe.org/contact.shtml click the link for “this public key”.ii. Save the page it gives you as pwsafe.key and strip out the HTML tags.iii. import the key

    $ gpg –import pwsafe.key

  3. Verify the Password Safe .deb package

    $ gpg –verify passwordsafe-ubuntu-0.93BETA.amd64.deb.sig
    gpg: Signature made Fri 07 Feb 2014 01:07:50 PM EST using RSA key ID 5CCF8BB3
    gpg: Good signature from “Rony Shapiro (PasswordSafe Signing Key) <[email protected]>”
    gpg: WARNING: This key is not certified with a trusted signature!
    gpg: There is no indication that the signature belongs to the owner.
    Primary key fingerprint: A703 C132 8EAB C7B2 0175 3BA3 9194 6451 5CCF 8BB3

    Notice the fingerprint matches the one listed on http://pwsafe.org/contact.shtml — ok good!

  4. go ahead and install

    $ sudo dpkg -i passwordsafe-ubuntu-0.93BETA.amd64.deb

  5. it will complain about dependencies for libwxgtk2.8-0, libxerces-c3.1, and libykpers-1-1. So, install your dependencies

    $ sudo apt-get -f isntall

Done! To verify your .deb has been installed:

$ dpkg –get-selections | grep passwordsafe
passwordsafe install

You can launch the password safe gui either by

$ pwsafe &

or by finding ‘Password Safe’ it in your launcher menu.

, , , ,
[Top]

HP Laptop Audio Hack Part 2

The TS2012 came in the other day and I couldn’t help but play with it before I headed off to bed.

The testing setup

The Full Testing Setup

Actually I ended up staying up entirely too late so I could test the amp in conjunction with the USB sound device. The breakout board makes working with the amp integrated circuit a completely brainless affair; just wire up your audio source and power it with a decent 5 volt current source. I actually wired it straight up to the USB power on my desktop with no issue.

So right there I’m just showing the amp plugged into my ZTE Open C to test it alone.  It’s really surprising to see that dinky little thing power a speaker like that even if there is distortion at the highest gain setting (+24dB).   The pauses between actual sound output were where I changed the gain using the pair of DIP switches.

So the next video is why I went to bed late that night and why I am going to bed late again tonight: it’s so damn exciting! Here I demo the USB sound adapter being used as primary sound device wired directly to the amp which I am actually powering off my desktop’s USB 5V. I was a little shocked that there was enough current available; if you look in the video you can see my back-of-the-envelope-math for power and I was expecting 700mA draw.  Either that number represents peak current modern desktops have sweet USB 5V power!

, , , ,
[Top]

HP Laptop Audio Hack Part 1

So I’ve had my friend’s laptop for some time and now that I’m through with school I can finally make good on my promise to attempt to finally solve his long standing audio problems. On his HP dv2500 laptop, the sound only works intermittently.  We’ve tried all manner of driver fixes to no avail. Finally, one day I half joking suggested we just bypass the entire on-board audio. My idea at first was actually to make use of the on-board power amplifier and just ignore the audio codec IC.  Ultimately I thought it wiser to just take everything on-board out of the equation and come up with a solution where I wire up the built-in speakers to a little audio amplifier board which is fed by a USB sound card.

TS2012 Audo Amplifier

Adafruit TS2012 Audo Amplifier

The USB sound card I opted for is a small guy from Sabrent. They have since updated it, but that’s par for the course — these kind of products are always being revised.

Sabrent USB-SBCV USB Adapter

Sabrent USB-SBCV Sound Adapter

When I got the adapter I promptly removed the case to see just how much size I would be attempting to stuff into the cavity of a laptop. Basically what I am looking to do is remove the USB A connector and solder it directly to one of the ports on the motherboard.  We could have elected to get a USB hub so he doesn’t lose a USB port but my customer said he didn’t really care about the lost port, more about having functional audio.

One issue I have certainly faced before is extending USB cables. You can read up a on USB cabling and signaling at Wikipedia though what you won’t really come away with from that article  is the fact that USB is not really tolerant of hacky wiring jobs — it’s a sophisticated differential signaling scheme. Some care and dare I say engineering might be involved in this project.

Despite being a tight fit, the WIFI area looks like the best location to stick the USB Sound Adapter, its roughly 100mm/4inch’s away from the nearest USB port and basically as close as I can get. Well, if we ditched the optical drive and stuck it in there that would be even closer but I doubt he’d want that! The added benefit of putting it here is the opposite side only has one USB port; hijacking that port would be inconvenient since only one side of the laptop would then have an available USB port.

Dismantled Sabrent Sound Adapter

Dismantled Sabrent Sound Adapter

One of the interesting issues I’m going to have is what to do about the buttons. I wonder if taking them off the board and replacing them with leads to buttons attached to the laptop chassis somewhere will introduce noise?

Here is what the laptop looks like, half dismantled:

HP dv2500 Laptop

HP dv2500 Laptop

I was thinking to put my ‘added components’ in either the bluetooth area (empty except for the CMOS battery), RAM area, or Wifi area.  Here is the underside:

HP dv2500 underside

HP dv2500 underside

Fitting the sound adapter

Fitting the sound adapter

If I do put the USB sound adapter in here, I’m going to have to get creative with the capacitors, LEDs, and 1/8th inch stereo jacks. There is not much room here.

For now, I am waiting on the Adafruit TS2012 audio amp to come in. I ordered two in the event that I nuke one in this project.  I doubt I will though, so I’m planning on making a my own little cell-phone amp/speaker device out of the spare in the future.

, , , ,
[Top]