tag:blogger.com,1999:blog-51100587497553209242024-03-13T06:34:43.293-07:00scottchillAnonymoushttp://www.blogger.com/profile/07264806579798928822noreply@blogger.comBlogger22125tag:blogger.com,1999:blog-5110058749755320924.post-65943931420769888402016-08-14T12:53:00.000-07:002016-08-14T12:53:13.915-07:00SCP (Secure Copy) Examples<!DOCTYPE html><html><head><meta charset="utf-8"><style>@font-face {
font-family: octicons-anchor;
src: url(data:font/woff;charset=utf-8;base64,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) format('woff');
}
* {
box-sizing: border-box;
}
body {
width: 980px;
margin-right: auto;
margin-left: auto;
}
body .markdown-body {
padding: 45px;
border: 1px solid #ddd;
border-radius: 3px;
word-wrap: break-word;
}
pre {
font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
.markdown-body {
-webkit-text-size-adjust: 100%;
text-size-adjust: 100%;
color: #333;
font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
font-size: 16px;
line-height: 1.6;
word-wrap: break-word;
}
.markdown-body a {
background-color: transparent;
}
.markdown-body a:active,
.markdown-body a:hover {
outline: 0;
}
.markdown-body strong {
font-weight: bold;
}
.markdown-body h1 {
font-size: 2em;
margin: 0.67em 0;
}
.markdown-body img {
border: 0;
}
.markdown-body hr {
box-sizing: content-box;
height: 0;
}
.markdown-body pre {
overflow: auto;
}
.markdown-body code,
.markdown-body kbd,
.markdown-body pre {
font-family: monospace, monospace;
font-size: 1em;
}
.markdown-body input {
color: inherit;
font: inherit;
margin: 0;
}
.markdown-body html input[disabled] {
cursor: default;
}
.markdown-body input {
line-height: normal;
}
.markdown-body input[type="checkbox"] {
box-sizing: border-box;
padding: 0;
}
.markdown-body table {
border-collapse: collapse;
border-spacing: 0;
}
.markdown-body td,
.markdown-body th {
padding: 0;
}
.markdown-body input {
font: 13px / 1.4 Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
.markdown-body a {
color: #4078c0;
text-decoration: none;
}
.markdown-body a:hover,
.markdown-body a:active {
text-decoration: underline;
}
.markdown-body hr {
height: 0;
margin: 15px 0;
overflow: hidden;
background: transparent;
border: 0;
border-bottom: 1px solid #ddd;
}
.markdown-body hr:before {
display: table;
content: "";
}
.markdown-body hr:after {
display: table;
clear: both;
content: "";
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
margin-top: 15px;
margin-bottom: 15px;
line-height: 1.1;
}
.markdown-body h1 {
font-size: 30px;
}
.markdown-body h2 {
font-size: 21px;
}
.markdown-body h3 {
font-size: 16px;
}
.markdown-body h4 {
font-size: 14px;
}
.markdown-body h5 {
font-size: 12px;
}
.markdown-body h6 {
font-size: 11px;
}
.markdown-body blockquote {
margin: 0;
}
.markdown-body ul,
.markdown-body ol {
padding: 0;
margin-top: 0;
margin-bottom: 0;
}
.markdown-body ol ol,
.markdown-body ul ol {
list-style-type: lower-roman;
}
.markdown-body ul ul ol,
.markdown-body ul ol ol,
.markdown-body ol ul ol,
.markdown-body ol ol ol {
list-style-type: lower-alpha;
}
.markdown-body dd {
margin-left: 0;
}
.markdown-body code {
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-size: 12px;
}
.markdown-body pre {
margin-top: 0;
margin-bottom: 0;
font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
.markdown-body .select::-ms-expand {
opacity: 0;
}
.markdown-body .octicon {
font: normal normal normal 16px/1 octicons-anchor;
display: inline-block;
text-decoration: none;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.markdown-body .octicon-link:before {
content: '\f05c';
}
.markdown-body:before {
display: table;
content: "";
}
.markdown-body:after {
display: table;
clear: both;
content: "";
}
.markdown-body>*:first-child {
margin-top: 0 !important;
}
.markdown-body>*:last-child {
margin-bottom: 0 !important;
}
.markdown-body a:not([href]) {
color: inherit;
text-decoration: none;
}
.markdown-body .anchor {
display: inline-block;
padding-right: 2px;
margin-left: -18px;
}
.markdown-body .anchor:focus {
outline: none;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
margin-top: 1em;
margin-bottom: 16px;
font-weight: bold;
line-height: 1.4;
}
.markdown-body h1 .octicon-link,
.markdown-body h2 .octicon-link,
.markdown-body h3 .octicon-link,
.markdown-body h4 .octicon-link,
.markdown-body h5 .octicon-link,
.markdown-body h6 .octicon-link {
color: #000;
vertical-align: middle;
visibility: hidden;
}
.markdown-body h1:hover .anchor,
.markdown-body h2:hover .anchor,
.markdown-body h3:hover .anchor,
.markdown-body h4:hover .anchor,
.markdown-body h5:hover .anchor,
.markdown-body h6:hover .anchor {
text-decoration: none;
}
.markdown-body h1:hover .anchor .octicon-link,
.markdown-body h2:hover .anchor .octicon-link,
.markdown-body h3:hover .anchor .octicon-link,
.markdown-body h4:hover .anchor .octicon-link,
.markdown-body h5:hover .anchor .octicon-link,
.markdown-body h6:hover .anchor .octicon-link {
visibility: visible;
}
.markdown-body h1 {
padding-bottom: 0.3em;
font-size: 2.25em;
line-height: 1.2;
border-bottom: 1px solid #eee;
}
.markdown-body h1 .anchor {
line-height: 1;
}
.markdown-body h2 {
padding-bottom: 0.3em;
font-size: 1.75em;
line-height: 1.225;
border-bottom: 1px solid #eee;
}
.markdown-body h2 .anchor {
line-height: 1;
}
.markdown-body h3 {
font-size: 1.5em;
line-height: 1.43;
}
.markdown-body h3 .anchor {
line-height: 1.2;
}
.markdown-body h4 {
font-size: 1.25em;
}
.markdown-body h4 .anchor {
line-height: 1.2;
}
.markdown-body h5 {
font-size: 1em;
}
.markdown-body h5 .anchor {
line-height: 1.1;
}
.markdown-body h6 {
font-size: 1em;
color: #777;
}
.markdown-body h6 .anchor {
line-height: 1.1;
}
.markdown-body p,
.markdown-body blockquote,
.markdown-body ul,
.markdown-body ol,
.markdown-body dl,
.markdown-body table,
.markdown-body pre {
margin-top: 0;
margin-bottom: 16px;
}
.markdown-body hr {
height: 4px;
padding: 0;
margin: 16px 0;
background-color: #e7e7e7;
border: 0 none;
}
.markdown-body ul,
.markdown-body ol {
padding-left: 2em;
}
.markdown-body ul ul,
.markdown-body ul ol,
.markdown-body ol ol,
.markdown-body ol ul {
margin-top: 0;
margin-bottom: 0;
}
.markdown-body li>p {
margin-top: 16px;
}
.markdown-body dl {
padding: 0;
}
.markdown-body dl dt {
padding: 0;
margin-top: 16px;
font-size: 1em;
font-style: italic;
font-weight: bold;
}
.markdown-body dl dd {
padding: 0 16px;
margin-bottom: 16px;
}
.markdown-body blockquote {
padding: 0 15px;
color: #777;
border-left: 4px solid #ddd;
}
.markdown-body blockquote>:first-child {
margin-top: 0;
}
.markdown-body blockquote>:last-child {
margin-bottom: 0;
}
.markdown-body table {
display: block;
width: 100%;
overflow: auto;
word-break: normal;
word-break: keep-all;
}
.markdown-body table th {
font-weight: bold;
}
.markdown-body table th,
.markdown-body table td {
padding: 6px 13px;
border: 1px solid #ddd;
}
.markdown-body table tr {
background-color: #fff;
border-top: 1px solid #ccc;
}
.markdown-body table tr:nth-child(2n) {
background-color: #f8f8f8;
}
.markdown-body img {
max-width: 100%;
box-sizing: content-box;
background-color: #fff;
}
.markdown-body code {
padding: 0;
padding-top: 0.2em;
padding-bottom: 0.2em;
margin: 0;
font-size: 85%;
background-color: rgba(0,0,0,0.04);
border-radius: 3px;
}
.markdown-body code:before,
.markdown-body code:after {
letter-spacing: -0.2em;
content: "\00a0";
}
.markdown-body pre>code {
padding: 0;
margin: 0;
font-size: 100%;
word-break: normal;
white-space: pre;
background: transparent;
border: 0;
}
.markdown-body .highlight {
margin-bottom: 16px;
}
.markdown-body .highlight pre,
.markdown-body pre {
padding: 16px;
overflow: auto;
font-size: 85%;
line-height: 1.45;
background-color: #f7f7f7;
border-radius: 3px;
}
.markdown-body .highlight pre {
margin-bottom: 0;
word-break: normal;
}
.markdown-body pre {
word-wrap: normal;
}
.markdown-body pre code {
display: inline;
max-width: initial;
padding: 0;
margin: 0;
overflow: initial;
line-height: inherit;
word-wrap: normal;
background-color: transparent;
border: 0;
}
.markdown-body pre code:before,
.markdown-body pre code:after {
content: normal;
}
.markdown-body kbd {
display: inline-block;
padding: 3px 5px;
font-size: 11px;
line-height: 10px;
color: #555;
vertical-align: middle;
background-color: #fcfcfc;
border: solid 1px #ccc;
border-bottom-color: #bbb;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #bbb;
}
.markdown-body .pl-c {
color: #969896;
}
.markdown-body .pl-c1,
.markdown-body .pl-s .pl-v {
color: #0086b3;
}
.markdown-body .pl-e,
.markdown-body .pl-en {
color: #795da3;
}
.markdown-body .pl-s .pl-s1,
.markdown-body .pl-smi {
color: #333;
}
.markdown-body .pl-ent {
color: #63a35c;
}
.markdown-body .pl-k {
color: #a71d5d;
}
.markdown-body .pl-pds,
.markdown-body .pl-s,
.markdown-body .pl-s .pl-pse .pl-s1,
.markdown-body .pl-sr,
.markdown-body .pl-sr .pl-cce,
.markdown-body .pl-sr .pl-sra,
.markdown-body .pl-sr .pl-sre {
color: #183691;
}
.markdown-body .pl-v {
color: #ed6a43;
}
.markdown-body .pl-id {
color: #b52a1d;
}
.markdown-body .pl-ii {
background-color: #b52a1d;
color: #f8f8f8;
}
.markdown-body .pl-sr .pl-cce {
color: #63a35c;
font-weight: bold;
}
.markdown-body .pl-ml {
color: #693a17;
}
.markdown-body .pl-mh,
.markdown-body .pl-mh .pl-en,
.markdown-body .pl-ms {
color: #1d3e81;
font-weight: bold;
}
.markdown-body .pl-mq {
color: #008080;
}
.markdown-body .pl-mi {
color: #333;
font-style: italic;
}
.markdown-body .pl-mb {
color: #333;
font-weight: bold;
}
.markdown-body .pl-md {
background-color: #ffecec;
color: #bd2c00;
}
.markdown-body .pl-mi1 {
background-color: #eaffea;
color: #55a532;
}
.markdown-body .pl-mdr {
color: #795da3;
font-weight: bold;
}
.markdown-body .pl-mo {
color: #1d3e81;
}
.markdown-body kbd {
display: inline-block;
padding: 3px 5px;
font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
line-height: 10px;
color: #555;
vertical-align: middle;
background-color: #fcfcfc;
border: solid 1px #ccc;
border-bottom-color: #bbb;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #bbb;
}
.markdown-body .plan-price-unit {
color: #767676;
font-weight: normal;
}
.markdown-body .task-list-item {
list-style-type: none;
}
.markdown-body .task-list-item+.task-list-item {
margin-top: 3px;
}
.markdown-body .task-list-item input {
margin: 0 0.35em 0.25em -1.6em;
vertical-align: middle;
}
.markdown-body .plan-choice {
padding: 15px;
padding-left: 40px;
display: block;
border: 1px solid #e0e0e0;
position: relative;
font-weight: normal;
background-color: #fafafa;
}
.markdown-body .plan-choice.open {
background-color: #fff;
}
.markdown-body .plan-choice.open .plan-choice-seat-breakdown {
display: block;
}
.markdown-body .plan-choice-free {
border-radius: 3px 3px 0 0;
}
.markdown-body .plan-choice-paid {
border-radius: 0 0 3px 3px;
border-top: 0;
margin-bottom: 20px;
}
.markdown-body .plan-choice-radio {
position: absolute;
left: 15px;
top: 18px;
}
.markdown-body .plan-choice-exp {
color: #999;
font-size: 12px;
margin-top: 5px;
}
.markdown-body .plan-choice-seat-breakdown {
margin-top: 10px;
display: none;
}
.markdown-body :checked+.radio-label {
z-index: 1;
position: relative;
border-color: #4078c0;
}
</style><title>temp</title></head><body><article class="markdown-body"><h1>
<a id="user-content-scp-secure-copy-examples" class="anchor" href="#scp-secure-copy-examples" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>SCP (Secure Copy) Examples</h1>
<p>Copy the file "foo.txt" from a remote host to the local host</p>
<pre><code>$ scp you@remotehost.edu:foo.txt /local/dir
</code></pre>
<p>Copy the file "foo.txt" from the local host to a remote host</p>
<pre><code>$ scp foo.txt you@remotehost.edu:/remote/dir
</code></pre>
<p>Copy the directory "foo" from the local host to a remote host's directory "bar"</p>
<pre><code>$ scp -r foo you@remotehost.edu:/remote/dir/bar
</code></pre>
<p>Copy the file "foo.txt" from remote host "rh1.edu" to remote host "rh2.edu"</p>
<pre><code>$ scp you@rh1.edu:/remote/dir/foo.txt you@rh2.edu:/remote/dir/
</code></pre>
<p>Copying the files "foo.txt" and "bar.txt" from the local host to your home directory on the remote host</p>
<pre><code>$ scp foo.txt bar.txt you@remotehost.edu:~
</code></pre>
<p>Copy the file "foo.txt" from the local host to a remote host using port 2264</p>
<pre><code>$ scp -P 2264 foo.txt you@remotehost.edu:/remote/dir
</code></pre>
<p>Copy multiple files from the remote host to your current directory on the local host</p>
<pre><code>$ scp you@remotehost.edu:/remote/dir/\{a,b,c\} .
$ scp you@remotehost.edu:~/\{foo.txt,bar.txt\} .
</code></pre>
</article></body></html>Anonymoushttp://www.blogger.com/profile/07264806579798928822noreply@blogger.com0tag:blogger.com,1999:blog-5110058749755320924.post-69508118602306369372016-08-14T12:40:00.000-07:002016-08-15T13:14:34.794-07:00SSH Cheatsheet<!DOCTYPE html><html><head><meta charset="utf-8"><style>@font-face {
font-family: octicons-anchor;
src: url(data:font/woff;charset=utf-8;base64,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) format('woff');
}
* {
box-sizing: border-box;
}
body {
width: 980px;
margin-right: auto;
margin-left: auto;
}
body .markdown-body {
padding: 45px;
border: 1px solid #ddd;
border-radius: 3px;
word-wrap: break-word;
}
pre {
font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
.markdown-body {
-webkit-text-size-adjust: 100%;
text-size-adjust: 100%;
color: #333;
font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
font-size: 16px;
line-height: 1.6;
word-wrap: break-word;
}
.markdown-body a {
background-color: transparent;
}
.markdown-body a:active,
.markdown-body a:hover {
outline: 0;
}
.markdown-body strong {
font-weight: bold;
}
.markdown-body h1 {
font-size: 2em;
margin: 0.67em 0;
}
.markdown-body img {
border: 0;
}
.markdown-body hr {
box-sizing: content-box;
height: 0;
}
.markdown-body pre {
overflow: auto;
}
.markdown-body code,
.markdown-body kbd,
.markdown-body pre {
font-family: monospace, monospace;
font-size: 1em;
}
.markdown-body input {
color: inherit;
font: inherit;
margin: 0;
}
.markdown-body html input[disabled] {
cursor: default;
}
.markdown-body input {
line-height: normal;
}
.markdown-body input[type="checkbox"] {
box-sizing: border-box;
padding: 0;
}
.markdown-body table {
border-collapse: collapse;
border-spacing: 0;
}
.markdown-body td,
.markdown-body th {
padding: 0;
}
.markdown-body input {
font: 13px / 1.4 Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
.markdown-body a {
color: #4078c0;
text-decoration: none;
}
.markdown-body a:hover,
.markdown-body a:active {
text-decoration: underline;
}
.markdown-body hr {
height: 0;
margin: 15px 0;
overflow: hidden;
background: transparent;
border: 0;
border-bottom: 1px solid #ddd;
}
.markdown-body hr:before {
display: table;
content: "";
}
.markdown-body hr:after {
display: table;
clear: both;
content: "";
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
margin-top: 15px;
margin-bottom: 15px;
line-height: 1.1;
}
.markdown-body h1 {
font-size: 30px;
}
.markdown-body h2 {
font-size: 21px;
}
.markdown-body h3 {
font-size: 16px;
}
.markdown-body h4 {
font-size: 14px;
}
.markdown-body h5 {
font-size: 12px;
}
.markdown-body h6 {
font-size: 11px;
}
.markdown-body blockquote {
margin: 0;
}
.markdown-body ul,
.markdown-body ol {
padding: 0;
margin-top: 0;
margin-bottom: 0;
}
.markdown-body ol ol,
.markdown-body ul ol {
list-style-type: lower-roman;
}
.markdown-body ul ul ol,
.markdown-body ul ol ol,
.markdown-body ol ul ol,
.markdown-body ol ol ol {
list-style-type: lower-alpha;
}
.markdown-body dd {
margin-left: 0;
}
.markdown-body code {
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-size: 12px;
}
.markdown-body pre {
margin-top: 0;
margin-bottom: 0;
font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
.markdown-body .select::-ms-expand {
opacity: 0;
}
.markdown-body .octicon {
font: normal normal normal 16px/1 octicons-anchor;
display: inline-block;
text-decoration: none;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.markdown-body .octicon-link:before {
content: '\f05c';
}
.markdown-body:before {
display: table;
content: "";
}
.markdown-body:after {
display: table;
clear: both;
content: "";
}
.markdown-body>*:first-child {
margin-top: 0 !important;
}
.markdown-body>*:last-child {
margin-bottom: 0 !important;
}
.markdown-body a:not([href]) {
color: inherit;
text-decoration: none;
}
.markdown-body .anchor {
display: inline-block;
padding-right: 2px;
margin-left: -18px;
}
.markdown-body .anchor:focus {
outline: none;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
margin-top: 1em;
margin-bottom: 16px;
font-weight: bold;
line-height: 1.4;
}
.markdown-body h1 .octicon-link,
.markdown-body h2 .octicon-link,
.markdown-body h3 .octicon-link,
.markdown-body h4 .octicon-link,
.markdown-body h5 .octicon-link,
.markdown-body h6 .octicon-link {
color: #000;
vertical-align: middle;
visibility: hidden;
}
.markdown-body h1:hover .anchor,
.markdown-body h2:hover .anchor,
.markdown-body h3:hover .anchor,
.markdown-body h4:hover .anchor,
.markdown-body h5:hover .anchor,
.markdown-body h6:hover .anchor {
text-decoration: none;
}
.markdown-body h1:hover .anchor .octicon-link,
.markdown-body h2:hover .anchor .octicon-link,
.markdown-body h3:hover .anchor .octicon-link,
.markdown-body h4:hover .anchor .octicon-link,
.markdown-body h5:hover .anchor .octicon-link,
.markdown-body h6:hover .anchor .octicon-link {
visibility: visible;
}
.markdown-body h1 {
padding-bottom: 0.3em;
font-size: 2.25em;
line-height: 1.2;
border-bottom: 1px solid #eee;
}
.markdown-body h1 .anchor {
line-height: 1;
}
.markdown-body h2 {
padding-bottom: 0.3em;
font-size: 1.75em;
line-height: 1.225;
border-bottom: 1px solid #eee;
}
.markdown-body h2 .anchor {
line-height: 1;
}
.markdown-body h3 {
font-size: 1.5em;
line-height: 1.43;
}
.markdown-body h3 .anchor {
line-height: 1.2;
}
.markdown-body h4 {
font-size: 1.25em;
}
.markdown-body h4 .anchor {
line-height: 1.2;
}
.markdown-body h5 {
font-size: 1em;
}
.markdown-body h5 .anchor {
line-height: 1.1;
}
.markdown-body h6 {
font-size: 1em;
color: #777;
}
.markdown-body h6 .anchor {
line-height: 1.1;
}
.markdown-body p,
.markdown-body blockquote,
.markdown-body ul,
.markdown-body ol,
.markdown-body dl,
.markdown-body table,
.markdown-body pre {
margin-top: 0;
margin-bottom: 16px;
}
.markdown-body hr {
height: 4px;
padding: 0;
margin: 16px 0;
background-color: #e7e7e7;
border: 0 none;
}
.markdown-body ul,
.markdown-body ol {
padding-left: 2em;
}
.markdown-body ul ul,
.markdown-body ul ol,
.markdown-body ol ol,
.markdown-body ol ul {
margin-top: 0;
margin-bottom: 0;
}
.markdown-body li>p {
margin-top: 16px;
}
.markdown-body dl {
padding: 0;
}
.markdown-body dl dt {
padding: 0;
margin-top: 16px;
font-size: 1em;
font-style: italic;
font-weight: bold;
}
.markdown-body dl dd {
padding: 0 16px;
margin-bottom: 16px;
}
.markdown-body blockquote {
padding: 0 15px;
color: #777;
border-left: 4px solid #ddd;
}
.markdown-body blockquote>:first-child {
margin-top: 0;
}
.markdown-body blockquote>:last-child {
margin-bottom: 0;
}
.markdown-body table {
display: block;
width: 100%;
overflow: auto;
word-break: normal;
word-break: keep-all;
}
.markdown-body table th {
font-weight: bold;
}
.markdown-body table th,
.markdown-body table td {
padding: 6px 13px;
border: 1px solid #ddd;
}
.markdown-body table tr {
background-color: #fff;
border-top: 1px solid #ccc;
}
.markdown-body table tr:nth-child(2n) {
background-color: #f8f8f8;
}
.markdown-body img {
max-width: 100%;
box-sizing: content-box;
background-color: #fff;
}
.markdown-body code {
padding: 0;
padding-top: 0.2em;
padding-bottom: 0.2em;
margin: 0;
font-size: 85%;
background-color: rgba(0,0,0,0.04);
border-radius: 3px;
}
.markdown-body code:before,
.markdown-body code:after {
letter-spacing: -0.2em;
content: "\00a0";
}
.markdown-body pre>code {
padding: 0;
margin: 0;
font-size: 100%;
word-break: normal;
white-space: pre;
background: transparent;
border: 0;
}
.markdown-body .highlight {
margin-bottom: 16px;
}
.markdown-body .highlight pre,
.markdown-body pre {
padding: 16px;
overflow: auto;
font-size: 85%;
line-height: 1.45;
background-color: #f7f7f7;
border-radius: 3px;
}
.markdown-body .highlight pre {
margin-bottom: 0;
word-break: normal;
}
.markdown-body pre {
word-wrap: normal;
}
.markdown-body pre code {
display: inline;
max-width: initial;
padding: 0;
margin: 0;
overflow: initial;
line-height: inherit;
word-wrap: normal;
background-color: transparent;
border: 0;
}
.markdown-body pre code:before,
.markdown-body pre code:after {
content: normal;
}
.markdown-body kbd {
display: inline-block;
padding: 3px 5px;
font-size: 11px;
line-height: 10px;
color: #555;
vertical-align: middle;
background-color: #fcfcfc;
border: solid 1px #ccc;
border-bottom-color: #bbb;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #bbb;
}
.markdown-body .pl-c {
color: #969896;
}
.markdown-body .pl-c1,
.markdown-body .pl-s .pl-v {
color: #0086b3;
}
.markdown-body .pl-e,
.markdown-body .pl-en {
color: #795da3;
}
.markdown-body .pl-s .pl-s1,
.markdown-body .pl-smi {
color: #333;
}
.markdown-body .pl-ent {
color: #63a35c;
}
.markdown-body .pl-k {
color: #a71d5d;
}
.markdown-body .pl-pds,
.markdown-body .pl-s,
.markdown-body .pl-s .pl-pse .pl-s1,
.markdown-body .pl-sr,
.markdown-body .pl-sr .pl-cce,
.markdown-body .pl-sr .pl-sra,
.markdown-body .pl-sr .pl-sre {
color: #183691;
}
.markdown-body .pl-v {
color: #ed6a43;
}
.markdown-body .pl-id {
color: #b52a1d;
}
.markdown-body .pl-ii {
background-color: #b52a1d;
color: #f8f8f8;
}
.markdown-body .pl-sr .pl-cce {
color: #63a35c;
font-weight: bold;
}
.markdown-body .pl-ml {
color: #693a17;
}
.markdown-body .pl-mh,
.markdown-body .pl-mh .pl-en,
.markdown-body .pl-ms {
color: #1d3e81;
font-weight: bold;
}
.markdown-body .pl-mq {
color: #008080;
}
.markdown-body .pl-mi {
color: #333;
font-style: italic;
}
.markdown-body .pl-mb {
color: #333;
font-weight: bold;
}
.markdown-body .pl-md {
background-color: #ffecec;
color: #bd2c00;
}
.markdown-body .pl-mi1 {
background-color: #eaffea;
color: #55a532;
}
.markdown-body .pl-mdr {
color: #795da3;
font-weight: bold;
}
.markdown-body .pl-mo {
color: #1d3e81;
}
.markdown-body kbd {
display: inline-block;
padding: 3px 5px;
font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
line-height: 10px;
color: #555;
vertical-align: middle;
background-color: #fcfcfc;
border: solid 1px #ccc;
border-bottom-color: #bbb;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #bbb;
}
.markdown-body .plan-price-unit {
color: #767676;
font-weight: normal;
}
.markdown-body .task-list-item {
list-style-type: none;
}
.markdown-body .task-list-item+.task-list-item {
margin-top: 3px;
}
.markdown-body .task-list-item input {
margin: 0 0.35em 0.25em -1.6em;
vertical-align: middle;
}
.markdown-body .plan-choice {
padding: 15px;
padding-left: 40px;
display: block;
border: 1px solid #e0e0e0;
position: relative;
font-weight: normal;
background-color: #fafafa;
}
.markdown-body .plan-choice.open {
background-color: #fff;
}
.markdown-body .plan-choice.open .plan-choice-seat-breakdown {
display: block;
}
.markdown-body .plan-choice-free {
border-radius: 3px 3px 0 0;
}
.markdown-body .plan-choice-paid {
border-radius: 0 0 3px 3px;
border-top: 0;
margin-bottom: 20px;
}
.markdown-body .plan-choice-radio {
position: absolute;
left: 15px;
top: 18px;
}
.markdown-body .plan-choice-exp {
color: #999;
font-size: 12px;
margin-top: 5px;
}
.markdown-body .plan-choice-seat-breakdown {
margin-top: 10px;
display: none;
}
.markdown-body :checked+.radio-label {
z-index: 1;
position: relative;
border-color: #4078c0;
}
</style><title>temp</title></head><body><article class="markdown-body"><h2>
<a id="user-content-ssh-notes" class="anchor" href="#ssh-notes" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>SSH Notes</h2>
<h3>
<a id="user-content-configure-aliases-for-hosts" class="anchor" href="#configure-aliases-for-hosts" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Configure aliases for hosts</h3>
<p>For example, to set up named aliases for dev and qa, create a file at <code>~/.ssh/config</code>: </p>
<div class="highlight highlight-source-shell"><pre>Host dev
HostName foo.somewhere.com
User dev_username
Host qa
HostName foo.somewhere.com
User qa_usermname</pre></div>
<p>Usage:</p>
<div class="highlight highlight-source-shell"><pre>$ ssh dev</pre></div>
<h3>
<a id="user-content-passwordless-auth-with-ssh-copy-id" class="anchor" href="#passwordless-auth-with-ssh-copy-id" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Passwordless auth with <code>ssh-copy-id</code>
</h3>
<p>Use <code>ssh-copy-id</code> to copy your public key to the remotehost. After you've logged in once, you get passwordless authentication thereafter.</p>
<div class="highlight highlight-source-shell"><pre>$ ssh-copy-id -i <span class="pl-k">~</span>/.ssh/id_rsa.pub remotehost</pre></div>
<p>This will not work if you are connecting to a Windows remotehost.</p>
<h3>
<a id="user-content-executing-multiple-commands-with-ssh" class="anchor" href="#executing-multiple-commands-with-ssh" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Executing Multiple Commands with <code>ssh</code>
</h3>
<h4>
<a id="user-content-the-here-document-syntax" class="anchor" href="#the-here-document-syntax" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>the <em>here document</em> syntax</h4>
<p>The <a href="http://tldp.org/LDP/abs/html/here-docs.html">here document</a> syntax lets you include everything in between <code><< EOF</code> and <code>EOF</code> as a list of commands. Like so:</p>
<div class="highlight highlight-source-shell"><pre>$ ssh remotehost <span class="pl-k"><<</span> EOF
<span class="pl-c1">cd</span> some_folder
git pull
EOF</pre></div>
<h4>
<a id="user-content-a-script-with-commands-only" class="anchor" href="#a-script-with-commands-only" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>a script with commands only</h4>
<p>Use a script of just the commands.</p>
<p>File: <code>runner.sh</code></p>
<pre><code>#!/usr/bin/env bash
cd some_project
./do_it.sh
ls
</code></pre>
<p>Use:</p>
<pre><code>$ ssh user@remote 'bash -s' < /path/to/runner.sh
</code></pre>
<h3>
<a id="user-content-transfer-files-with-sftp" class="anchor" href="#transfer-files-with-sftp" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Transfer files with SFTP</h3>
<p>You can use <code>sftp</code> in the same way <code>ssh</code> is used, to get an old-school ftp cli interface.</p>
<h3>
<a id="user-content-compare-files-with-diff" class="anchor" href="#compare-files-with-diff" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Compare files with <code>diff</code>
</h3>
<div class="highlight highlight-source-shell"><pre>$ ssh user@host cat /path/to/remotefile <span class="pl-k">|</span> diff /path/to/localfile –</pre></div>
<h3>
<a id="user-content-port-forwarding" class="anchor" href="#port-forwarding" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Port forwarding</h3>
<p>Connects to a remote port, forward it to local.</p>
<div class="highlight highlight-source-shell"><pre>$ ssh -L 4444:localhost:4000 remotehost</pre></div>
<p>After that, from localhost, requests to http://localhost:4444 will get a response from http://remotehost:4000</p>
</article></body></html>Anonymoushttp://www.blogger.com/profile/07264806579798928822noreply@blogger.com0tag:blogger.com,1999:blog-5110058749755320924.post-70352277208598915172016-03-25T10:46:00.002-07:002016-03-25T11:03:54.111-07:00Hello World with Node, Express, and React
<p>Node and npm handle the server-side components of the app. We will build a basic <a href="http://expressjs.com/">Express</a> web framework serving <a href="http://jade-lang.com/">Jade</a> templated files, which is the default for the <a href="http://expressjs.com/en/starter/generator.html">express-generator</a>. </p>
<p>On the client-side, <a href="https://facebook.github.io/react/">React</a> will be used for the View layer. React lets you write your client-side code in clean javascript components, rather than mucking around with multiple blocks of html and scripts.</p>
<h2 id="toc_1">Set up the Express server</h2>
<ul>
<li>Install <a href="https://nodejs.org/en/">node</a> on your system. </li>
<li><p>Globally install <a href="http://expressjs.com/en/starter/generator.html">express-generator</a></p>
<div><pre><code class="language-none">npm install express-generator -g</code></pre></div></li>
<li><p>Use express-generator to create a basic app structure. </p>
<div><pre><code class="language-none">$ express demo-react
create : demo-react
create : demo-react/package.json
create : demo-react/app.js
create : demo-react/public
create : demo-react/public/images
create : demo-react/routes
create : demo-react/routes/index.js
create : demo-react/routes/users.js
create : demo-react/public/stylesheets
create : demo-react/public/stylesheets/style.css
create : demo-react/views
create : demo-react/views/index.jade
create : demo-react/views/layout.jade
create : demo-react/views/error.jade
create : demo-react/bin
create : demo-react/bin/www</code></pre></div></li>
</ul>
<p>install dependencies:</p>
<div><pre><code class="language-none"> $ cd demo-react && npm install</code></pre></div>
<p>run the app:</p>
<div><pre><code class="language-none"> $ DEBUG=demo-react:* npm start</code></pre></div>
<p>Then load <a href="http://localhost:3000/">http://localhost:3000/</a> in your browser to access the app.</p>
<h2 id="toc_2">Set up the client-side React app</h2>
<p>For React to work, it has to transpile it's .jsx componets. The easiest way to do this is with <strong>In-browser transformation</strong>. This method is not designed for production use, since it slows down the pages somewhat. But it's perfectly fine for dev and prototyping work. </p>
<p>We will use Bower to gather the React and Babel scripts needed for transformation. </p>
<p>Install Bower</p>
<div><pre><code class="language-none"> $ npm install bower -g</code></pre></div>
<p>Initialize bower, accepting the defaults. </p>
<div><pre><code class="language-none"> $ bower init</code></pre></div>
<p>We will make one customization here. Let's put the bower_components directory into the <code>public</code> dir, for convenience.</p>
<ul>
<li>Create a <code>.bowerrc</code> file in the root</li>
<li>In the <code>.bowerrc</code>, write this one line: <code>{"directory" : "public/bower_components"}</code></li>
<li><p>Then install your bower components </p>
<div><pre><code class="language-none">bower install babel --save
bower install react --save</code></pre></div></li>
</ul>
<h2 id="toc_3">Configure the Jade templates for React</h2>
<p>Here's how you set up your Jade templates to include your React components.</p>
<p>The main <code>views/layout.jade</code> needs to be updated to:</p>
<ul>
<li>source the react script, </li>
<li>source the babel browser transformation script,</li>
<li>and provide a new block called called <code>morejs</code></li>
</ul>
<p>See the new bottom three lines in <code>layout.jade</code></p>
<div><pre><code class="language-none"> doctype html
html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
body
block content
script(src='/bower_components/react/react.min.js')
script(src='/bower_components/babel/browser.min.js')
block morejs</code></pre></div>
<p>In our <code>views/index.jade</code>, </p>
<ul>
<li>Add a <code>#greeter</code> element, which is where React is going to inject our component. </li>
<li><p>Add a reference to that new component in the <code>morejs</code> block. Note the <code>type="text/babel"</code></p>
<div><pre><code class="language-none">extends layout
block content
h1= title
p Welcome to #{title}
#greeter
block morejs
script(src='/javascripts/helloworld.jsx', type="text/babel")</code></pre></div></li>
</ul>
<p>And the greeter component React JSX code itself, at <code>/public/javascripts/helloworld.jsx</code> is: </p>
<div><pre><code class="language-none"> React.render(
<h1>Hello, world from React.js!</h1>,
document.getElementById('greeter')
);</code></pre></div>
<p>That's it. Refresh your browser at <a href="http://localhost:3000/">http://localhost:3000/</a> . You should see</p>
<hr>
<h3 id="toc_4">Express</h3>
<p>Welcome to Express</p>
<p>Hello, world from React.js!</p>
<hr>
Anonymoushttp://www.blogger.com/profile/07264806579798928822noreply@blogger.com0tag:blogger.com,1999:blog-5110058749755320924.post-23968915234835299822014-05-31T22:47:00.000-07:002014-05-31T23:11:18.974-07:00Longest Common Substring Algorithms<p>Given strings "ABAB" and "BABA"...</p>
<p>A dynamic programming style algorithm constructs a matrix of the substring lengths.
<pre class='prettyprint'>
| | | A | B | A | B |
| | O | O | O | O | O |
| B | O | O | 1 | O | 1 |
| A | O | 1 | 0 | 2 | 0 |
| B | O | 0 | 2 | 0 | 3 |
| A | O | 1 | 0 | 3 | 0 |
</pre>
<p>In this matrix, the 5th column tests the substring ABA of the ABAB sequence.
So cell [5, 5] compares ABA to BAB ... the lcs is BA, length 2.</p>
<p>The other approach is to construct a generalized suffix tree for the strings,
then find the deepest internal nodes which have leaf nodes from all the strings in the subtree below it.</p>
<p>
<img src="http://upload.wikimedia.org/wikipedia/commons/thumb/6/64/Suffix_tree_ABAB_BABA.svg/315px-Suffix_tree_ABAB_BABA.svg.png"/>
</p>
<p>A Simple Suffix Tree Implementation:</p>
<script src="https://gist.github.com/hillscottc/f0460657daca55f95b62.js"></script>
<p><a href="http://interactivepython.org/courselib/static/pythonds/Graphs/graphshortpath.html#dijkstras-algorithm">Dijkstras Algorithm</a> for shortest path:</p>
<script src="https://gist.github.com/hillscottc/7d2e17c59d96e26ec855.js"></script>
<p>Or, here's a more complete <a href="https://gist.github.com/hillscottc/e27f7acbc235f6a3e75d">implementation</a>.</p>Anonymoushttp://www.blogger.com/profile/07264806579798928822noreply@blogger.com0tag:blogger.com,1999:blog-5110058749755320924.post-69732557517334233642014-05-29T20:18:00.000-07:002014-05-31T22:49:29.544-07:00Function Caching via Memoization<h2>To explain memoization, see these different versions of Fibonacci:</h2>
<p>
Purely recursive. Highly inefficient. Recalculates every value for every calculation.
<script src="https://gist.github.com/hillscottc/0e95de91f03658c77e5d.js"></script>
</p>
<p>
Iterative. Much faster.
<script src="https://gist.github.com/hillscottc/b086891d57f65509350d.js"></script>
</p>
<p>
Here is the memoization technique. A 'cache' dictionary of { (args) : (return_val), } is created.
This allows us to quickly locate and reuse any value that has already been calculated.
<script src="https://gist.github.com/hillscottc/a2c5dec8512a96ac60b9.js"></script>
</p>
<p>
Here is the same memoization design, implemented as a decorator.
<script src="https://gist.github.com/hillscottc/c68a2b85ec2f1bc145d2.js"></script>
</p>
Anonymoushttp://www.blogger.com/profile/07264806579798928822noreply@blogger.com0tag:blogger.com,1999:blog-5110058749755320924.post-73210310970296690292014-05-05T13:59:00.000-07:002015-02-18T14:08:41.659-08:00Update Evernote in Wine on Ubuntu<a href="https://www.winehq.org/about/">Wine</a> on Ubuntu has problems running the <a href="https://evernote.com">Evernote</a> updates. You get something like: "Evernote was already installed by another user...."
The 'find/remove regedit keys' method, described <a href="http://www.mintywind.com/evernote-on-wine-evernote-was-already-installed-by-another-user/">here, </a> and <a href="http://www.sgvulcan.com/evernote-under-wine-already-installed-by-another-user/">here, </a>
did <i>not</i> work for me. I didn't find the reversed the digits in regedit.
Well, I only use wine for Evernote. So I used this subtle technique to remove all wine installation. (Don't do this if you have other Wine apps you are keeping.)
<pre class='prettyprint'>
sudo apt-get purge wine
rm -rf ~/.wine
sudo apt-get install wine
</pre>
Then ran the Evernote installer as usual (from files, rt-click on installer).
Anonymoushttp://www.blogger.com/profile/07264806579798928822noreply@blogger.com3tag:blogger.com,1999:blog-5110058749755320924.post-32455875103560285812014-04-28T14:18:00.001-07:002014-05-31T23:02:50.737-07:00Fabric is cool.
[Fabric](http://www.fabfile.org/) is cool. More python, less Bash.
For example, I can automate my django db rebuild process, like so:
<script src="https://gist.github.com/hillscottc/8310f5c112c4118bd535.js"></script>Anonymoushttp://www.blogger.com/profile/07264806579798928822noreply@blogger.com0tag:blogger.com,1999:blog-5110058749755320924.post-64656699331863009502014-01-21T15:48:00.002-08:002014-01-23T11:42:11.948-08:00Programming Makey Makey clicks to send strings
<h1>Sending a string</h1>
One way to send a string instead of a keystroke is to modify the Mouse Button Events in the makey.ino file.
To make a left mouse click send 'Hello World':
<ol>
<li>In the Arduino IDE, open the <i>makey-makey.ino file</i>.</li>
<li>In the main code file, <i>*not* the settings.h</i>, find the lines</li>
<pre class="prettyprint">
if (inputs[i].keyCode == MOUSE_LEFT) {
Mouse.press(MOUSE_LEFT);
}
</pre>
<li>Comment out the Mouse.Press line, and replace it with a Keyboard.print</li>
<pre class="prettyprint">
if (inputs[i].keyCode == MOUSE_LEFT) {
//Mouse.press(MOUSE_LEFT);
Keyboard.print("Hello World.");
}
</pre>
<li>Upload the sketch. Pin A1 is the Makey left-mouse click. Touch the Ground and Pin A1 to try it.</li>
</ol>
<h1>Sending a carriage return with button click</h1>
<b>Modify the <i>settings.h</i> file this time,</b> since only one key is being modified. For example, pin A0 defaults to a right-mouse-click...change it to send KEY_RETURN.
<pre class="prettyprint">
int keyCodes[NUM_INPUTS] = {
// top side of the makey makey board
KEY_UP_ARROW, // up arrow pad
KEY_DOWN_ARROW, // down arrow pad
KEY_LEFT_ARROW, // left arrow pad
KEY_RIGHT_ARROW, // right arrow pad
' ', // space button pad
MOUSE_LEFT, // click button pad
// female header on the back left side
'w', // pin D5
'a', // pin D4
's', // pin D3
'd', // pin D2
'f', // pin D1
'g', // pin D0
// female header on the back right side
MOUSE_MOVE_UP, // pin A5
MOUSE_MOVE_DOWN, // pin A4
MOUSE_MOVE_LEFT, // pin A3
MOUSE_MOVE_RIGHT, // pin A2
MOUSE_LEFT, // pin A1
// COMMENT MOUSE_RIGHT TO REPLACE IT WITH KEY_RETURN
//MOUSE_RIGHT // pin A0
KEY_RETURN // pin A0
};
</pre>
<h1>Sending a carriage in sketch code</h1>
Instead or modifying the inits, you can write it in one of the Mouse.press routines.
Keyboard.write(KEY_RETURN);
Anonymoushttp://www.blogger.com/profile/07264806579798928822noreply@blogger.com0tag:blogger.com,1999:blog-5110058749755320924.post-58819856873607286342014-01-20T14:56:00.003-08:002014-01-21T12:19:55.257-08:00Using a Makey-Makey with Ubuntu<p>I've spent a lot of time working with software, but had never been exposed to the basic principles of electronics. The <a href="http://makeymakey.com/">Makey-Makey</a> is a great introduction to the world of circuitry. Its 'cool trick' is hacking just about anything into a keyboard. There's a lot of video of folks <a href="http://makeymakey.com/gallery/">wiring all kinds of household items</a> into input devices. </p>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjogAodl9JX9wi9dhzmbEey7AZxTxGt0SyG0o6T8fMkm-yc1TPdF0bAzAK6MQ4N-wp5jGb-3GjysF6vby9py2l9Kg-4mBzBiUFK1yKIyyJt9pT-i9JYEZyk4JhnvYGJ_AItc_RWIqJ3Gow/s1600/makey.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjogAodl9JX9wi9dhzmbEey7AZxTxGt0SyG0o6T8fMkm-yc1TPdF0bAzAK6MQ4N-wp5jGb-3GjysF6vby9py2l9Kg-4mBzBiUFK1yKIyyJt9pT-i9JYEZyk4JhnvYGJ_AItc_RWIqJ3Gow/s1600/makey.jpg" height="169" width="320" /></a></div>
<p>But underlying all the fun stuff is real first look at how electronic hardware works. The Sparkfun electronic hobbyist's site has an excellent collection of <a href="https://learn.sparkfun.com/tutorials">tutorials</a> presenting the fundamental science and application of electronic circuitry.</p>
</p>
<p><a href="http://arduino.cc/">Arduino</a> is a very popular open-source electronics prototyping platform...your local RadioShack should offer a variety of Arduino-ready components. The Makey Makey is programmed using the Arduino IDE (Integrated Development Environment). Here's how to install the Arduino IDE in Ubuntu. (I used Arduino IDE version 1.0.5, and Ubuntu version 13.10.)
</p>
First, install the Arduino IDE. The one in the Ubuntu repository worked fine for me.<br />
<pre class="prettyprint lang-sh">sudo apt-get install arduino
</pre>
This will install the IDE software to: /usr/share/arduino/
<br />
<p>To use the Arduino IDE with Makey-Makey, you'll need to install a driver.
Download the zipped driver with:</p>
<pre class="prettyprint lang-sh"> wget https://dlnmh9ip6v2uc.cloudfront.net/tutorialimages/MaKey_MaKey_QuickStart/MaKeyMaKey-13-8-12.zip</pre>
<br />
Then Unzip the driver to the IDE's hardware directory:<br />
<pre class="prettyprint lang-sh">unzip MaKeyMaKey-13-8-12.zip -d /usr/share/arduino/hardware</pre>
<br />
If that worked properly, you should see the Makey-Makey listed in the Board menu.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxlRMI3VGbncZoqurjvCzDGQCYHdUOyxCDa3ikErTvYTAf9B3Z1QaNpHNWemgruOf_sJ1fj3_UtBx5S521k4VvESbgrlBQXYDCeLJig8qYjlHWz31PKiXcqL6WgixEDiF5THa-4it70DE/s1600/Screenshot+from+2014-01-20+08:38:04.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxlRMI3VGbncZoqurjvCzDGQCYHdUOyxCDa3ikErTvYTAf9B3Z1QaNpHNWemgruOf_sJ1fj3_UtBx5S521k4VvESbgrlBQXYDCeLJig8qYjlHWz31PKiXcqL6WgixEDiF5THa-4it70DE/s1600/Screenshot+from+2014-01-20+08:38:04.png" height="320" width="320" /></a></div>
<br />
<br />
To modify basic functionality of the Makey, you'll need to grab the source code.<br />
Get and extract the source:<br />
<pre class="prettyprint lang-sh ">wget https://dlnmh9ip6v2uc.cloudfront.net/tutorialimages/MaKey_MaKey_QuickStart/MaKeyMaKey-13-8-12.zip
</pre>
Move it your home/sketchbook's<br />
<pre class="prettyprint lang-sh">mv hardware/Makey ~/sketchbook/hardware/</pre>
<br />
<h3>Permissions</h3>
To ensure your IDE can communicate with the Makey, add your user to the following three groups, like so:<br />
<pre class="prettyprint lang-sh">sudo usermod -a -G dialout $USER
sudo usermod -a -G tty $USER
sudo usermod -a -G uucp $USER</pre>
<br />
<h3>Resolve Ubuntu ModemManager conflicts</h3>
For the IDE to be able to update the Makey settings, you'll need edit ModemManager blacklist settings. (This fix is taken from discussions <a href="http://forums.adafruit.com/viewtopic.php?f=25&t=41031#p225677">here</a> and <a href="https://bugs.launchpad.net/ubuntu/+source/modemmanager/+bug/910736">here</a>.) Using your favorite text editor, you'll need to create/edit a file at:<br />
<pre class="prettyprint lang-sh">sudo vi /etc/udev/rules.d/77-mm-arduino-blacklist.rules</pre>
In your editor, <i>append the following line</i> to that file:<br />
<pre class="prettyprint lang-sh">ATTRS{idVendor}=="1b4f", ATTRS{idProduct}=="2b74", ENV{ID_MM_DEVICE_IGNORE}="1"</pre>
Save the file.<br />
<br />
Unplug your Makey. Close the IDE, Logout/Login. Plug Makey back in. From there, you'll be ready
to reprogram your Makey, following along with the <a href="https://www.sparkfun.com/tutorials/388">MaKey MaKey Quickstart Guide (Part 2)</a>.
<br />Anonymoushttp://www.blogger.com/profile/07264806579798928822noreply@blogger.com4tag:blogger.com,1999:blog-5110058749755320924.post-90163449953349628652013-03-25T16:08:00.000-07:002014-05-05T14:00:24.981-07:00Using python pymssql to query SQLServer from linux<span style="font-family: inherit;">Getting pyssmql to work was pretty easy. (I had less luck using pyodbc.)</span><br />
<br />
<span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; line-height: 18px;"><span style="font-size: x-small;">sudo apt-get install freetds</span></span><br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">sudo pip install pymssql</span><br />
<br />
<span style="background-color: white; color: #222222; font-family: inherit; line-height: 18px;">Create entries for your sqlservers in </span><span style="background-color: white; color: #222222; line-height: 18px;"><span style="font-family: Courier New, Courier, monospace;">/etc/freetds/freetds.conf</span></span><span style="background-color: white; color: #222222; font-family: inherit; line-height: 18px;"> like so:</span><br />
<pre style="background-color: white; color: #222222; line-height: 18px;"></pre>
<span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 18px;"><br /></span><span style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;"></span><span style="background-color: white;"><span style="color: #222222; font-family: Courier New, Courier, monospace; font-size: x-small;"><span style="line-height: 18px;">[dev01]</span></span><br /><span style="color: #222222; font-family: Courier New, Courier, monospace; font-size: x-small;"><span style="line-height: 18px;">host = YOUR_SQL_SERVER_HOST</span></span><br /><span style="color: #222222; font-family: Courier New, Courier, monospace; font-size: x-small;"><span style="line-height: 18px;">port = 1433</span></span><br /><span style="color: #222222; font-family: Courier New, Courier, monospace; font-size: x-small;"><span style="line-height: 18px;">tds version = 8.0</span></span></span><br />
<br />
<br />
<span style="background-color: white; color: #222222; line-height: 18px;"><span style="font-family: inherit;">Here's a simple script using it:</span></span><br />
<span style="background-color: white; color: #222222; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 18px;"><br /></span>
<span style="background-color: white; line-height: 18px;"><span style="color: #222222; font-family: Courier New, Courier, monospace; font-size: x-small;"></span></span><br />
<span style="color: #222222; font-family: Courier New, Courier, monospace; font-size: x-small;">import pymssql</span><br />
<span style="color: #222222; font-family: Courier New, Courier, monospace; font-size: x-small;">import getpass</span><br />
<span style="color: #222222; font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="color: #222222; font-family: Courier New, Courier, monospace; font-size: x-small;">pwd = getpass.getpass()</span><br />
<span style="color: #222222; font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="color: #222222; font-family: Courier New, Courier, monospace; font-size: x-small;">conn = pymssql.connect(host='YOUR_SQL_SERVER_HOST',</span><br />
<span style="color: #222222; font-family: Courier New, Courier, monospace; font-size: x-small;"> user='YOUR_DOMAIN\\YOUR_USERNAME', password=pwd)</span><br />
<span style="color: #222222; font-family: Courier New, Courier, monospace; font-size: x-small;">cur = conn.cursor()</span><br />
<span style="color: #222222; font-family: Courier New, Courier, monospace; font-size: x-small;">cur.execute('use YOUR_DB')</span><br />
<span style="color: #222222; font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="color: #222222; font-family: Courier New, Courier, monospace; font-size: x-small;">query = "select top 10 id, name, lastmodifieddate from campaign"</span><br />
<span style="color: #222222; font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="color: #222222; font-family: Courier New, Courier, monospace; font-size: x-small;">cur.execute(query)</span><br />
<span style="color: #222222; font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="color: #222222; font-family: Courier New, Courier, monospace; font-size: x-small;">for row in cur:</span><br />
<span style="color: #222222; font-family: Courier New, Courier, monospace; font-size: x-small;"> print "{0}\n{1}\n{2}\n".format(row[0], row[1], row[2])</span><br />
<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/07264806579798928822noreply@blogger.com0tag:blogger.com,1999:blog-5110058749755320924.post-14524883372476469982013-03-08T14:52:00.000-08:002014-05-05T14:02:01.584-07:00sqsh -- install, configure, usageinstall:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">sudo apt-get install freetds</span><br />
<span style="font-family: Courier New, Courier, monospace;">sudo apt-get install sqsh</span><br />
<br />
Create entries for your sqlservers in <span style="font-family: Courier New, Courier, monospace;">/etc/freetds/freetds.conf</span> like so:<br />
<pre></pre>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">[dev01]<br /> host = dev01server<br /> port = 1433<br /> tds version = 8.0</span><br />
<br />
<br />Create settings file in <span style="font-family: Courier New, Courier, monospace;">~/.sqshrc</span><br /><span style="font-family: Courier New, Courier, monospace;">\set username=MYDOMAIN\myusername<br />\set password=<br />\set style=vert</span><br />
<br />
<br />
Usage:<br /><span style="font-family: Courier New, Courier, monospace;">user@box:~$ sqsh -Sdev01<br />
</span><br />
<span style="font-family: Courier New, Courier, monospace;">sqsh-2.1 Copyright (C) 1995-2001 Scott C. Gray<br />This is free software with ABSOLUTELY NO WARRANTY<br />For more information type '\warranty'<br />1> use testdb<br />2> go<br />1> select field1, field2 from table where field1 = 'test';<br />2> go<br />field1: test<br />field2: other data<br />
(1 row affected)<br />1> exit<br />user@box:~$</span><br />
<br />
<pre></pre>
<pre></pre>
<pre></pre>
<pre></pre>
<pre></pre>
<pre></pre>
<pre></pre>
<pre></pre>
<br />Anonymoushttp://www.blogger.com/profile/07264806579798928822noreply@blogger.com0tag:blogger.com,1999:blog-5110058749755320924.post-49226719111780539292013-02-26T15:06:00.001-08:002013-02-26T15:06:35.328-08:00access remote django dev server from local browser<br />
To access a remote Django development server from your local browser....<br />
<br />
On the local host, SSH to the remote host:<br />
$ ssh -v -L 9000:localhost:8000 <the remote address><br />
On the remote host, run the Django dev server:<br />
/path/to/my/django/project$ python manage.py runserver 0.0.0.0:8000<br />
On the local host, go to http://localhost:9000 in the browser<br />
<br />
Or...<br />
<br />
Using LocalForward in your ~/.ssh/config, add entry<br />
<br />
Host myremote<br />
User eliot<br />
HostName my.remotehost.com<br />
LocalForward 9000 localhost:8000<br />
<div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/07264806579798928822noreply@blogger.com0tag:blogger.com,1999:blog-5110058749755320924.post-77208533973475479582013-02-14T14:58:00.003-08:002013-02-14T16:42:25.319-08:00SQuirrel SQL client for Ubuntu<span style="font-family: inherit;">Provides a nice gui for accessing Microsoft SQLServer databases. (Handles MySQL also.)</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">Get it from here: <a href="http://www.squirrelsql.org/">http://www.squirrelsql.org/</a></span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">Configuring it is a little tricky...use the guide here:<br /><a href="http://informatics.malariagen.net/2011/08/15/squirrel-sql-a-nice-database-gui-frontend-for-ubuntu/">http://informatics.malariagen.net/2011/08/15/squirrel-sql-a-nice-database-gui-frontend-for-ubuntu/</a></span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">To configure it for MySQL as well, follow similar steps after installing the mysql-jdbc driver.<br /><span style="background-color: white; color: #222222; line-height: 19px;">sudo apt-get install libmysql-java</span><span style="background-color: white; color: #222222; line-height: 19px;"><br /></span></span><br />
<div>
<span style="background-color: white; color: #222222; font-family: monospace; font-size: 13px; line-height: 19px;"><br /></span></div>
Anonymoushttp://www.blogger.com/profile/07264806579798928822noreply@blogger.com1tag:blogger.com,1999:blog-5110058749755320924.post-5444216143233458482012-12-03T09:22:00.003-08:002014-05-05T14:01:36.987-07:00sshfsI've made some effort to duplicate my work desktop Ubuntu environment on my laptop and home desktop systems. When that becomes tiresome, I use SSH from my remote systems to work on my desktop files. But that restricts me to using only the command line editors available on the Ubuntu system. But then EUREKA, SSHFS! Now I mount the work Ubuntu file system to a local drive. Let's me use Sublime and other local dev apps with the files on the mapped drive. Nice.Anonymoushttp://www.blogger.com/profile/07264806579798928822noreply@blogger.com0tag:blogger.com,1999:blog-5110058749755320924.post-22876974361424783072012-11-12T11:26:00.001-08:002012-11-12T11:26:55.741-08:00mysql + django on the mac is a painIssues with mixing 32 bit python build with 64 bit mysql build.<div>
Switching to PostgreSQL.</div>
Anonymoushttp://www.blogger.com/profile/07264806579798928822noreply@blogger.com0tag:blogger.com,1999:blog-5110058749755320924.post-76518365073106419002012-11-03T14:15:00.001-07:002012-11-03T14:15:38.717-07:00installed ack in cygwin<br />
<br />
<pre class="lang-perl prettyprint prettyprinted" style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; line-height: 18px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto;"><code style="border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">perl </span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">-</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">MCPAN </span><span class="pun" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">-</span><span class="pln" style="background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">e </span><span class="str" style="background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;">"CPAN::Shell->force(qw(install App::Ack));"</span></code></pre>
Anonymoushttp://www.blogger.com/profile/07264806579798928822noreply@blogger.com1tag:blogger.com,1999:blog-5110058749755320924.post-47112449751468229652012-11-03T13:59:00.001-07:002012-11-03T16:06:50.143-07:00built vim from source to enable python support for cygwinuninstalled vim ...apt-cyg remove vim<br />
got source vim-7.3.tar.bz2 from vim.org<br />
2 steps to unzip....install bunzip<br />
bunzip vim-7.3.tar.bz2<br />
tar -xvf vim-7.3.tar<br />
<br />
installed ncurses<br />
installed libncurses-devel .. had to be done via cygwin-setup<br />
installed make<br />
installed view<br />
<br />
cd vim73<br />
./configure --enable-pythoninterp --enable-perlinterp --enable-rubyinterp --enable-gui=no --without-x --enable-multibyte --prefix=/usr<br />
<br />
<br />
unlink /usr/bin/view<br />
unlink /usr/bin/rvim<br />
unlink /usr/bin/rview<br />
unlink /usr/bin/vimdiff<br />
<br />
<br />
make && make install<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/07264806579798928822noreply@blogger.com0tag:blogger.com,1999:blog-5110058749755320924.post-18764634213148533192012-10-22T10:46:00.000-07:002012-10-22T10:46:04.241-07:00I finally got MongoDB running in cygwin! Trying to make it work with Django....Anonymoushttp://www.blogger.com/profile/07264806579798928822noreply@blogger.com0tag:blogger.com,1999:blog-5110058749755320924.post-40676354064370949022012-08-20T09:21:00.003-07:002012-08-21T12:37:58.061-07:00Automated web config transformation for Uhuru AppCloud <span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">I use the Uhuru AppCloud (</span><span style="font-family: Arial, Helvetica, sans-serif;"><a href="http://uhurusoftware.com/">http://uhurusoftware.com/</a>) </span><span style="font-family: Arial, Helvetica, sans-serif;">for hosting some of my applications</span><span style="font-family: Arial, Helvetica, sans-serif;">. It's an excellent resource for serving your apps from the cloud. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">For .NET applications, they provide the Uhuru Cloud Manager plugin for Visual Studio that makes deployment simple. The one piece of configuration that is required by the developer is to change the Web.config's database references to point to their new locations in the cloud. I wanted to automate this bit of configuration using Visual Studio tools. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Visual Studio uses it's</span><span style="font-family: Arial, Helvetica, sans-serif;"> Configuration Manager to implement multiple deployment environments</span> <span style="font-family: Arial, Helvetica, sans-serif;">when deploying, but its intended to be used with the VS One-Click publishing tool, rather than the Cloud Manager plugin. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Here’s a way to use the standalone <i>Web Configuration Transformation Tool</i> to perform the same transform that Visual Studio’s Configuration Manager uses to implement multiple deployment environments. This lets you keep store and your Uhuru configuration in the project for use when needed, while keeping your Default configuration file with its local settings for Debug mode testing. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><b>I. Use Visual Studio to create your transform template.</b></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"> 1. In VS, choose Build > Configuration Manager > <New...> and name it UhuruCloud, for example.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"> 2. In Solution Explorer, right-click on your Web.Config file and choose 'Add Config Transforms'</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"> 3. Edit the resulting Web.UhuruCloud.config for the transform. (See <a href="http://msdn.microsoft.com/en-us/library/dd465326(VS.100).aspx">http://msdn.microsoft.com/en-us/library/dd465326(VS.100).aspx</a> )</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"> 4. For example, my Web.config file contained this:</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> <connectionStrings></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <add name="ApplicationServices" </span><br />
<span style="font-family: Courier New, Courier, monospace;"> connectionString="data source=localhost;Integrated Security=SSPI;"</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> providerName="System.Data.SqlClient" /></span><br />
<span style="font-family: Courier New, Courier, monospace;"> </connectionStrings></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"> and the transform xsl I needed looked like this:</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <connectionStrings></span><br />
<span style="font-family: Courier New, Courier, monospace;"> <add name="ApplicationServices"</span><br />
<span style="font-family: Courier New, Courier, monospace;"> connectionString="{mssql-2008#SQL Server}"</span><br />
<span style="font-family: Courier New, Courier, monospace;"> xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/></span><br />
<span style="font-family: Courier New, Courier, monospace;"> </connectionStrings> </span><br />
<span style="font-family: Courier New, Courier, monospace;"></configuration></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><b>II. Using the standalone Config Transform standalone Tool. </b></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"> 1. Get the tool from <a href="http://ctt.codeplex.com/Wikipage?ProjectName=ctt">http://ctt.codeplex.com/Wikipage?ProjectName=ctt</a></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"> 2. The syntax of the tool is like so:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">ctt.exe s:source.config t:transform.config d:destination.config</span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">That’s just the most basic usage. Other good Examples are provided in the distribution. For me, it was handy to have a quick batch script to make that call easier. Especially while trying to get the paths just right.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> File: ctt_run.bat</span><br />
<span style="font-family: Courier New, Courier, monospace;"> @ECHO off</span><br />
<span style="font-family: Courier New, Courier, monospace;"> rem ...Set (S)ource, (T)emplate, and (D)estination files here</span><br />
<span style="font-family: Courier New, Courier, monospace;"> SET S=C:\Projects\MySolution\MyApp\Web.config</span><br />
<span style="font-family: Courier New, Courier, monospace;"> SET T=C:\</span>
<span style="font-family: 'Courier New', Courier, monospace;">Projects</span> <span style="font-family: Courier New, Courier, monospace;">\</span>
<span style="font-family: 'Courier New', Courier, monospace;">MySolution</span> <span style="font-family: Courier New, Courier, monospace;">\</span>
<span style="font-family: 'Courier New', Courier, monospace;">MyApp</span> <span style="font-family: Courier New, Courier, monospace;">\Web.UhuruCloud.config</span><br />
<span style="font-family: Courier New, Courier, monospace;"> SET D=Web.New.config</span><br />
<span style="font-family: Courier New, Courier, monospace;"> @ECHO on</span><br />
<span style="font-family: Courier New, Courier, monospace;">ctt.exe s:%S% t:%T% d:%D%</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">That’s it. (My example wrote the transformed file 'Web.New.config'.) </span><br />
<br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">I also posted this at StackOverflow<br />
<a href="http://stackoverflow.com/questions/12031254/web-configuration-transformation">http://stackoverflow.com/questions/12031254/web-configuration-transformation</a>
</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br />
And in UhuruCloud's forum</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">
<a href="http://support.uhurusoftware.com/entries/21870063">http://support.uhurusoftware.com/entries/21870063</a>
</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
Anonymoushttp://www.blogger.com/profile/07264806579798928822noreply@blogger.com0tag:blogger.com,1999:blog-5110058749755320924.post-4198738912562062302012-08-20T00:22:00.001-07:002012-08-20T00:22:17.130-07:00Put a git repository into DropBoxNot locked to GitHub anymore. Local repos on laptop and Mac pull from master on filesystem DropBox dir.Anonymoushttp://www.blogger.com/profile/07264806579798928822noreply@blogger.com0tag:blogger.com,1999:blog-5110058749755320924.post-2438798126029472182012-08-17T18:07:00.001-07:002012-08-20T00:23:35.721-07:00New Cygwin installs runningI have a decent install of Cygwin on the new desktop and laptop now. Got the terminal and shell how I like it. Console2.Anonymoushttp://www.blogger.com/profile/07264806579798928822noreply@blogger.com0tag:blogger.com,1999:blog-5110058749755320924.post-87591581457568805742012-07-04T09:29:00.002-07:002012-08-20T00:23:56.925-07:00Put RDx Sql into github.Cleaned it up, recursively removed svn dirs.Anonymoushttp://www.blogger.com/profile/07264806579798928822noreply@blogger.com0