ssh .netrc

The file .netrc in linux is used to specify passwords. The file is located under the home directory.

The format is as follows:

machine <host name or IP>
login <username>
password <user_password>

Note that if the .netrc file's permissions must be set to 600 (read and write by owner only). This is to ensure the information is hidden to all but the user (and root).

chmod 600 ~/.netrc

See Also

Text Processing with python

Ascii Text:
https://www.rapidtables.com/code/text/ascii-table.html

remove of escape chars
https://stackoverflow.com/questions/92438/stripping-non-printable-characters-from-a-string-in-python

win encoding
https://stackoverflow.com/questions/42070668/python-3-default-encoding-cp1252

https://wiki.python.org/moin/EscapingHtml
a.encode('ascii', 'xmlcharrefreplace')

https://docs.python.org/3/library/cgi.html#cgi.escape

HTTP GET

The GET method requests a representation of the specified resource. Requests using GET should only retrieve data and should have no other effect. (This is also true of some other HTTP methods.) The W3C has published guidance principles on this distinction, saying, "Web application design should be informed by the above principles, but also by the relevant limitations."

HTTP PUT

The PUT method requests that the enclosed entity be stored under the supplied URI. If the URI refers to an already existing resource, it is modified; if the URI does not point to an existing resource, then the server can create the resource with that URI.

http POST

In computing, POST is a request method supported by HTTP used by the World Wide Web. By design, the POST request method requests that a web server accepts the data enclosed in the body of the request message, most likely for storing it. It is often used when uploading a file or when submitting a completed web form.

git clone

Clone to directory "foler-name" like this:

git clone git@github.com:whatever folder-name

git branching

Create branch called section-A

git branch section-A
git checkout section-A
git ls-files --stage
git push --set-upstream origin section-A

Switch back to master

git checkout master

git change user check-in name

Setting account information

To set a repo to use a different account (other than the default name) do the following:

git config user.email "<your_github_account_email>"

This will cause commits to use the user as the name of the committer.

mysql reset table data

mysql table reset

TRUNCATE TABLE <tablename>;
ALTER TABLE <tablename> AUTO_INCREMENT = 1;

Alternate to truncate is

DELETE FROM <tablename>;

git-windows - make bash script executable

To create foo.sh as executable script do the following:

touch foo.sh
git add foo.sh
git update-index --chmod=+x foo.sh

Check using the following command:

git ls-files --stage

tmux keys

Window commands

c           new window
,           name window
w           list windows
f           find window
&           kill window
.           move window - prompted for a new number
:movew<CR>  move window to the next unused number

Pane commands

%  horizontal split
"  vertical split

o  swap panes
q  show pane numbers
x  kill pane
⍽  space - toggle between layouts

pynq arduino digital pins

From arduino:

Input pins make extremely small demands on the circuit that they are sampling, equivalent to a series resistor of 100 megohm in front of the pin. This means that it takes very little current to move the input pin from one state to another, and can make the pins useful for such tasks as implementing a capacitive touch sensor, reading an LED as a photodiode, or reading an analog sensor with a scheme such as RCTime.

Often it is useful to steer an input pin to a known state if no input is present. This can be done by adding a ...

pynq hostname

To show the host name do the following on the serial terminal

hostname -I

You can also do the following to get more detail

ifconfig

pynq z1 schematic

Digilent Pynq

Expansion Connectors

Two standard Pmod ports

  • 16 Total FPGA I/O

Arduino/chipKIT Shield connector

  • 49 Total FPGA I/O
  • 6 Single-ended 0-3.3V Analog inputs to XADC
  • Differential 0-1.0V Analog inputs to XADC

Schematic Names to pins/pynq io

ck_IO<#> = ck=>chipKit / Arduino

tmux tips and shortcuts

reload temux

:source-file ~/.tmux.conf

conf settings

Disable rename of tmux window

set -g allow-rename off

htop install on centos 7

Install htop using:

# yum install htop