Month: April 2016

Fishing for wall trout.

April 28, 2016 Uncategorized , , ,

Before we finished the kids half of the basement (2 bedrooms, 1 rec room, and a bathroom), I ran a couple cat5 cables through the ceiling alongside the cable modem line.  I didn’t know if I’d ever need them, but it seemed like a good idea at the time.

Now that I want ethernet lines in other parts of the house, I’m really glad I’d done that.  All I had to do was fish the unterminated lines out of the wall and put a couple jack inserts on them.  I bought a cheap non-cutting push down tool from home depot a while ago and finally got to use it:

 

 

IMG_1128 IMG_1129 IMG_1130

Because the push down tool didn’t have a blade, I just used an exacto knife to cut the lines before capping the jack inserts.  That worked very nicely since there is a small lip on the jack insert, and you can cut the wires right against that easily.

Next step was terminating the lines in the basement on the patch panel.

13055125_10209823933941722_9152519273805908410_o

That was a bit easier to do since the wiring block for the patch panel keeps all pairs together.  With the jack, it was more random, with some pairs pushed down next to each other, and others opposite.

IMG_1132IMG_1138

I used the 568B wiring convention.  It sounds like that is generally preferred for wiring data, although 568A is sometimes used for wiring phone.  I have no intention of ever simultaneously running both phone and data through any single wire, so I don’t think it really matters which of the conventions to use (so long as I do the same thing at both the patch panel and the jack insert).

Next step was testing the connections.  I bought a cheap ethernet cable tester at Sayal a while ago when I saw it on sale, so I got to play with that too.

IMG_1133 IMG_1136

I saw no red lights at either end as it proceeded with the wire check cycle, and the termination point sequence was monotonic as desired.  With both cables tested, I was ready to put the plate on the wall.  I’ve got speaker wire for the rear surround sound speakers coming out of that too, in a rather ugly fashion.  Eventually, I may try to figure out what to do to pretty that up, but most of the time I don’t think about it, since it hides back there sight unseen.

IMG_1142

The next step was the fishing trip.  I thought it was going to be easy to get through the wall into the unfinished section of the basement below, but I wasn’t able to find a route in one try (I kept hitting rafters and other obstructions).  I actually have three holes in the wall now, and have some patching to do (and probably have to pull the trim on that wall and reinstall it, since it is now pushed out).

IMG_1143 IMG_1144

Once I got my lines in place, I replaced my electric tape “numbering” sequence with some numbers, and started terminating them.

 

.IMG_1146 IMG_1147

Finally, a bit of patch panel work for these new lines, and I am left with something functional.

IMG_1149IMG_1150IMG_1152

This gives me wired connections to the two NUCs that I’m going to be using as development boxes (the RHEL7 + linux 4-5 kernel iwlwifi driver is pretty erratic, and has erratic and frequent hangs).

IMG_1151

I have a whole bunch of finishing to do for this project.  For example I haven’t even put in the box to attach the wall plate to in the office, and have unsecured lines in the basement, and don’t have the patch panel mounted yet.  I’d also like to run a new RG6 line to the office and put the router in there.  Because I ran lots of lines into the office space, this will allow me to feed other locations in the house through the patch panel.

 

All that said, I have accomplished the task I set out to do.  Get myself up and running with NUCs and monitor all in the office, and no more flaky wireless to those devices.

 

 

Some random svn notes.

April 28, 2016 C/C++ development and debugging. , , , , , , , , ,

Pull

svn update

If there are conflicts, then an (e) edit option is available.  SVN isn’t smart enough to notice that resolving the conflict can be complete at edit completion, so you have to mark each such resolved change (r) resolved explicitly after invoking edit.

For unfathomable reasons, SVN (e)dit conflicts are shown in ‘diff -u’ output instead of ‘diff3 -m’.  I’m hoping that oddity can be confligured away.

svn status -u : if you mark a merge conflict as deferred, then this will show what all the contributors were.  In particular, you can construct a ‘diff3 -m’ command for such a deferred conflict, by running:

$ svn status -u | grep -A3 ^C
C            30427   lz_ios/lz_ios_srv/src/ios_config.c
?                    lz_ios/lz_ios_srv/src/ios_config.c.mine
?                    lz_ios/lz_ios_srv/src/ios_config.c.r30417
?                    lz_ios/lz_ios_srv/src/ios_config.c.r30427

From this you can run:

$ diff3 -m \
                    lz_ios/lz_ios_srv/src/ios_config.c.mine \
                    lz_ios/lz_ios_srv/src/ios_config.c.r30417 \
                    lz_ios/lz_ios_srv/src/ios_config.c.r30427 \
> lz_ios/lz_ios_srv/src/ios_config.c

After resolving the conflict, and updating the file, you must run:

svn resolve –accept=working foo.c # (say)

Merge branch

For a branch off of the project ‘foo’ :

svn up
svn merge --accept postpone ^/foo/trunk
svn commit 

Then resolve conflicts as above with ‘svn update’

Push (local branch, or local changes to trunk)

$ svn commit

Query stuff

svn diff, and svn log.

Cleanup state from failed update

When running over flaky wireless, my svn update’s failed a few times.  You have to run ‘svn cleanup’ to handle such a failure (but it tells you to do so).

Build tree root and repo info

‘svn info’ gives you useful information about the build tree you are in (the svn checkout).

List files and other info for a commit

svn log -v -r 30414

Commit selectively.

List the files:

svn ci -F ../../tools/svn-commit.tmp `cat c`

 

Configuring wireless on a RHEL7 NUC6i5SYH

April 26, 2016 Incoherent ramblings , , ,

I don’t currently have ethernet lines running to my new office space.  The NUC does have builtin wireless, but doesn’t appear functional in the linux 3.10 kernel that is installed by default on RHEL7


#  lspci -nn | grep -n net
00:1f.6 Ethernet controller [0200]: Intel Corporation Ethernet Connection I219-V [8086:1570] (rev 21)

01:00.0 Network controller [0280]: Intel Corporation Wireless 8260 [8086:24f3] (rev 3a)

#  grep -i 8086.*24f3 /lib/modules/*/modules.alias

alias pci:v00008086d000024F3sv*sd00000010bc*sc*i* iwlwifi

#  lsmod | grep wifi
# [nothing]

I can load it explicitly by doing:

#  modprobe iwlwifi

iwlwifi               112501  0 

cfg80211              514740  1 iwlwifi

but the NetworkManager doesn’t see the interface. Running ‘systemctl restart NetworkManager’ doesn’t help.

If I switch to the 4.5 kernel and install the latest iwlwifi firmware I’m able to get things up and running:

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
yum -y install yum-plugin-fastestmirror
yum --enablerepo=elrepo-kernel install kernel-ml

git clone https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
cp linux-firmware/iwlwifi*.ucode /lib/firmware/

After boot, I get dmesg errors from the iwlwifi driver:

# dmesg | grep wifi

[    2.612790] iwlwifi 0000:01:00.0: enabling device (0000 -> 0002)

[    2.618136] iwlwifi 0000:01:00.0: Unsupported splx structure

[    2.619632] iwlwifi 0000:01:00.0: Direct firmware load for iwlwifi-8000C-20.ucode failed with error -2

[    2.619635] iwlwifi 0000:01:00.0: Falling back to user helper

[   63.005134] iwlwifi 0000:01:00.0: Direct firmware load for iwlwifi-8000C-19.ucode failed with error -2

[   63.005137] iwlwifi 0000:01:00.0: Falling back to user helper

[  122.981747] iwlwifi 0000:01:00.0: Direct firmware load for iwlwifi-8000C-18.ucode failed with error -2

[  122.981751] iwlwifi 0000:01:00.0: Falling back to user helper

[  182.977468] iwlwifi 0000:01:00.0: Direct firmware load for iwlwifi-8000C-17.ucode failed with error -2

[  182.977472] iwlwifi 0000:01:00.0: Falling back to user helper

The firmware copied from linux-firmware had version: iwlwifi-8000C-21.ucode which is newer than the any of the ones in the failed to load messages. I wonder if that splx structure error is from attempting to load 8000C-21?

It turns out that the user mode driver works, but you have to be really patient. A number of minutes after boot it kicks in, which can be seen by the mac80211 driver now running:

# lsmod | grep wifi

iwlwifi               139264  1 iwlmvm

cfg80211              577536  3 iwlwifi,mac80211,iwlmvm

I then also see the following additional dmesg log points from the wifi driver:


# dmesg | grep iwlwifi

[  122.544157] iwlwifi 0000:01:00.0: Falling back to user helper

[  182.549189] iwlwifi 0000:01:00.0: loaded firmware version 17.254495.0 op_mode iwlmvm

[  182.557558] iwlwifi 0000:01:00.0: Detected Intel(R) Dual Band Wireless AC 8260, REV=0x208

[  182.557910] iwlwifi 0000:01:00.0: L1 Enabled - LTR Enabled

[  182.558824] iwlwifi 0000:01:00.0: L1 Enabled - LTR Enabled

[  182.559866] iwlwifi 0000:01:00.0: can't access the RSA semaphore it is write protected

[  182.707622] iwlwifi 0000:01:00.0 wlp1s0: renamed from wlan0

[  182.719296] iwlwifi 0000:01:00.0: L1 Enabled - LTR Enabled

[  182.719562] iwlwifi 0000:01:00.0: L1 Enabled - LTR Enabled

[  182.720422] iwlwifi 0000:01:00.0: can't access the RSA semaphore it is write protected

[  182.855388] iwlwifi 0000:01:00.0: L1 Enabled - LTR Enabled

[  182.855958] iwlwifi 0000:01:00.0: L1 Enabled - LTR Enabled


[  182.857102] iwlwifi 0000:01:00.0: can't access the RSA semaphore it is write protected

At this point the wifi connection shows up in the NetworkManager, and I’m able to configure the WPA password, giving me a wlp1s0 interface configured and available for use.

Some basic keyboard operations on a mac

April 22, 2016 mac , , , , , , ,

I unpacked the macbook pro that I’ll be using for work, and quickly found myself slightly flummoxed by a combination of the keyboard and the os.  This blog post accumulates a running list of notes made as I learned my way around the new machine.

The list below was accumulated over time.  Here’s a recent popular science article that includes many of the shortcuts below, plus some other good ones.

Cut and Paste

The usual windows shortcuts work on a mac if you replace control with command:

copy: command-c
cut: command-x
paste: command-v

On a PC keyboard mapped mac-style (i.e. command=Alt, option=Windows, control=Ctrl):

Screen Shot 2016-05-12 at 10.08.21 AM
these would be Alt-c, Alt-x, and Alt-v respectively.

Navigation

right click: control-click, or two fingers simultaneously on the touchpad

page up/down: fn+arrow up/down

home: function left-arrow
end: function right-arrow

control-arrow (word skip in text editors): use option-arrow (Windows-arrow with a PC keyboard).

Some applications seem to use Alt-arrow (i.e. mac command-arrow)

command-tab switching to minimized window:

command-tab to select window.  hold option key, release command key.

trackpad tricks:

three finger swipe left/right.  This is like Windows control-tab switching but only between maximized applications.

“tab” switching between windows of the same application (i.e. Mathematica):

command-tilde (~)

Misc

delete in finder: command-delete

enter/exit fullscreen mode: command-control f

delete next character: Fn+delete

Terminal

undo accidental split of terminal (command d): command-shift d (command D)

function keys in terminal window: Fn+function-key

cycle between all terminal windows, even minimized ones: command left/right arrow

cycle between active windows: command `

equivalent to cmd explorer . : terminal: open .

equivalent to powershell open here:

System Preferences > Keyboard > Shortcuts > Services

Enable New Terminal at Folder.

There’s also a MacVim open service that you can use in Finder that I’d never noticed until trying this.

smooth scroll up/down

alt/option + command <arrow up/down>.  Not sure what keys to do this with on the mac keyboard itself, but with my windows keyboard this ends up being the page up/down keys.  Also doesn’t work properly in a screen session.

Moving Windows between displays

I found no builtin method to do Windows-Arrow like monitor switching, but the Sizeup freeware app seems to work nicely.

Cntl-Windows Arrows (i.e. mac Control-Options Arrows) does the window move for me with how I have my PC keyboard mapped.

There are also some split screen shortcuts:

^ \- % [arrow]

That work really nicely on a big thunderbolt monitor.

Virtual Desktops

On the mac keyboard, the virtual desktop manager control is available by pressing the F3 key (which shows three windows).

On a PC keyboard, use Ctrl-UpArrow

I’m using this to move any non-work windows to a separate space before starting work for the day.  This way I can’t be distracted by having a cool mathematics or physics puzzle left open and taunting.

This is also a way to move windows between multiple monitor displays.

PC keyboard

One nice thing about a PC keyboard is the function key mappings in Terminal might just work (without having to press Fn-Function-key).  That was true of my logitech keyboard, but not a Windows wireless keyboard (I still haven’t figured out how to get that wireless keyboard to work well with the mac).

Can use Karabiner to map the Menu key to Fn. After installing select:

Screen Shot 2016-04-29 at 12.35.37 PM

Screenshot

snip: command shift 4

full: command shift 3

Browser

page down: spacebar

page up: shift spacebar

two figures up/down: scrolling

tab switching: option-cmd <- ->

new tab: cmd t

close tab: cmd w

Finder dialogue

Go to the parent directory: Command+up-arrow

Another way is to add a Path button to the finder using View -> Customize, as described in method 5 of the linked article.

Save as, to a different directory: Use the little sneaky triangle symbol in the file dialogue.

Safari

Copy a link: Link on the url tab, then Cmd+L ; Cmd+C