Sunday, December 3, 2017

xquartz mac nvvp

From a mac terminal run: DISPLAY=:0 xterm

this creates a Xterm Quartz session indicating quartz gas been installed correctly.

Using the Xterm Quartz window ssh in and
>export DISPLAY=
> xhost +

You should see a message indicating xhost is running properly.

localhost:~ dc$ xhost +
access control disabled, clients can connect from any host

Once you see this... may have to wait several minutes ...I didn't do anything but reran the command xhost + after a couple minutes.. the first time failed with xhost:  unable to open display ""

>export DISPLAY=

and should see nvpp running on macbook

Saturday, October 28, 2017

fan control dell 7600 ubuntu

The default ubuntu fan control isn't installed. 
sudo apt-get install lm-sensors xsensors fancontrol

#sudo apt install lm-sensors fancontrol
sudo sensors-detect
/etc/init.d/kmod start
sudo pwmconfig
sudo service fancontrol start

Sunday, June 11, 2017

Virtual environment path

from python command line:

>>os.environ will return the enviroment env settings

>>> os.environ
environ({'PS1': '(py35) \\[\\e[0;33m\\]\\h:\\W \\u\\$\\[\\e[m\\] ', 'USER': 'dc', 'CONDA_HOME': '/Users/dc/anaconda', 'GROOVY_HOME': '/Users/dc/groovy-2.4.6', 'PWD': '/Users/dc', 'Apple_PubSub_Socket_Render': '/private/tmp/', 'COMMAND_MODE': 'unix2003', 'VLC_PLUGIN_PATH': '/Applications/', 'LOGNAME': 'dc', 'TERM_PROGRAM': '', 'TMPDIR': '/var/folders/mb/br6t4l8d5svbdx8w4r966y1w0000gn/T/', 'JAVA_HOME': '/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home/', 'LSCOLORS': 'cxFxBxDxCxegedabagacad', 'SHELL': '/bin/bash', 'COLORFGBG': '7;0', 'LANG': 'en_US.UTF-8', 'ITERM_PROFILE': 'Default', 'DISPLAY': '/private/tmp/', 'MAC_JAVA': '/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/MacOS', 'TERM_PROGRAM_VERSION': '3.0.15', 'SSH_AUTH_SOCK': '/private/tmp/', 'TERM_SESSION_ID': 'w0t0p1:6C68B3C0-5374-4E9C-B424-125BAB6B03F4', 'CONDA_PS1_BACKUP': '\\[\\e[0;33m\\]\\h:\\W \\u\\$\\[\\e[m\\] ', 'SECURITYSESSIONID': '186a8', 'ITERM_SESSION_ID': 'w0t0p1:6C68B3C0-5374-4E9C-B424-125BAB6B03F4', 'CONDA_PREFIX': '/Users/dc/anaconda/envs/py35', 'XPC_FLAGS': '0x0', 'CONDA_DEFAULT_ENV': 'py35', 'ITERM_ORIG_PS1': '(py35) \\[\\e[0;33m\\]\\h:\\W \\u\\$\\[\\e[m\\] ', 'PATH': '/Users/dc/anaconda/envs/py35/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin:/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/MacOS:/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home//bin:/Users/dc/apache-maven-3.3.9/bin:/Users/dc/anaconda/bin:/Users/dc/gradle-2.11/bin:/Users/dc/groovy-2.4.6/bin:/usr/local/include:/usr/local/lib:/usr/local/Cellar/opencv/2.4.13/include:/usr/local/Cellar/opencv/2.4.13/lib', '_': '/Users/dc/anaconda/envs/py35/bin/python', 'OLDPWD': '/Users/dc', 'ITERM_PREV_PS1': '\\[\x1b]133;D;$?\x07\x1b]1337;RemoteHost=dc@localhost\x07\x1b]1337;CurrentDir=/Users/dc\x07\x1b]133;A\x07\\](py35) \\[\\e[0;33m\\]\\h:\\W \\u\\$\\[\\e[m\\] \\[\x1b]133;B\x07\\]', 'HOME': '/Users/dc', 'CLICOLOR': '1', 'CONDA_PATH_BACKUP': '/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin:/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/MacOS:/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home//bin:/Users/dc/apache-maven-3.3.9/bin:/Users/dc/anaconda/bin:/Users/dc/gradle-2.11/bin:/Users/dc/groovy-2.4.6/bin:/usr/local/include:/usr/local/lib:/usr/local/Cellar/opencv/2.4.13/include:/usr/local/Cellar/opencv/2.4.13/lib', 'XPC_SERVICE_NAME': '0', '__CF_USER_TEXT_ENCODING': '0x1F5:0x0:0x0', 'MAVEN_HOME': '/Users/dc/apache-maven-3.3.9', 'GRADLE_HOME': '/Users/dc/gradle-2.11', 'TERM': 'xterm-256color', 'SHLVL': '1'})

From the above we can see we should use echo $CONDA_PREFIX as the equivalent to $VIRTUAL_ENV

Monday, March 13, 2017

network and broadcast address calculation

To simplify that article: network is the lowest possible address in the range of ip addresses left over from the netmask. broadcast is the highest numbered ip address in that range. The "range of ip addresses left over from the netmask" is known as the local network.
"The network" typically means everyone above you, including the Internet. To get to "the network", the network address is used. In reality, most people call "the network" anything with ethernet cables that can talk to each other.
Example: your ISP gives you info to type into a wireless router: a static IP address of and your netmask is Now you're wanting to set up an ubuntu firewall and need to set up your public interface:
Calculate network IP address: -> last octet = E0
 99.  1. 81.209 -> last octet = D1
Logical AND the mask and your ip: 
E0 & D1 = C0 = 192
--> network =

Calculate broadcast address: : E0 -> there are 1F = 31,
-> broadcast = + .31 =
The other way...
Calculate broadcast address: -> last octet = E0
 99.  1. 81.209 -> last octet = D1
Hosts' IPs = 1F 
Logical OR the hosts ips with your ip:
1F | D6 = DF = 223 
--> broadcast =
Often, you'll see networks described with a /. Here's this network: is the netmask, add up the "1" bits:
 8 + 8 + 8 + 3  = 27
so "this network" gets /27 notation
and can be described as
BROADCAST=`ip address show $DEV | grep 'inet .* brd ' | head -1 | sed -e 's/^.* brd \([0-9\.]*\) .*$/\1/'`
dc@dc-Precision-T7600:/etc/network$ echo $BROADCAST

Sunday, February 12, 2017

github emote: error: GH001: Large files detected.

After changing .gitignore and removing from cache this error message still shows up. Instead of hard reset clear file from git commit history with:

git gc --prune=now --aggressive

This may not work.

 git filter-branch --tag-name-filter cat --index-filter 'git rm -r --cached --ignore-unmatch kaggle/rossmann/original/train.csv' --prune-empty -f -- --all

where kaggle/rossmann/original/train.csv is the large file to be removed

Wednesday, February 1, 2017

ImportError: cannot import name imread cs231n

ImportError                               Traceback (most recent call last)
 in ()
      3 import random
      4 import numpy as np
----> 5 from cs231n.data_utils import load_CIFAR10
      6 import matplotlib.pyplot as plt

/Users/dc/cs231n/assignment1/cs231n/ in ()
      2 import numpy as np
      3 import os
----> 4 from scipy.misc import imread
      6 def load_CIFAR_batch(filename):

ImportError: cannot import name imread

pip install pillow

Monday, January 30, 2017

ubuntu 16.04 install python 2.7 and 3.5

conda create -n python2 python=2.7 anaconda
source activate python2
Repeat for python 3.5 or leave 3.5 as default and deactivate python2