Welcome to jotaki.github.io. Formally
spiryx.net. The purpose of this
website
is to create a place where I can place various bits of
information. It also serves as a place for me to dabble and tinker with
CSS, JavaScript, and HTML.
This page requires a modern Web Browser with JavaScript enabled in order to function and look proper. If you are having issues with this webpage please consider updating your browser to a later version. This webpage is also not considered to be mobile friendly. How it looks, and functions on a mobile device is unknown, and is not expected to be supported any time in the near future. Users with accessibility issues, and of Internet Explorer may also find it difficult to navigate this page.
The intended content of this page is mostly documentation related. With the occassional javascript rich application.
This site is in a state of construction. Sections may be incomplete, and/or broken. Sections may also change, move, or be removed entirely all together.
This page intends to serve as uselessness.
For the same reason anything happens.
Find me on IRC. (ircs://irc.freenode.net/peltkore) webchat.freenode.net
The multiplication triangle is just the multiplication table read diagonally. For example, if we look at this simple 5x5 multiplication table and transpose it, you will quickly see what I mean.
↙ ↙ ↙ ↙ ↙ 1 2 3 4 5 1 1 ↗ 2 4 6 8 10 2 2 2 2 ↗ 3 6 9 12 15 -> 3 4 3 -> 3 4 3 ↗ 4 8 12 16 20 4 6 6 4 4 6 6 4 ↗ 5 10 15 20 25 5 8 9 8 5 5 8 9 8 5 ↗
Click here for a better example.
What's fascinating about reading the multiplication table like this, is it
reveals some very interesting patterns. Before we get into that though, it
would be helpful if we could generate the triangle table. For that, we will
use the following function. Where r is the row, and c is the
column.
g(r, c) -> c * (r - (c - 1))
Not only can we use row and column values to retrieve a value, but we can also use a simple N-lookup. What I mean is, to find say the 30'th table entry, we need only the following formula:
f(n) ->
r = sqrt(2*n)
r += ((r*(r+1))/2+1 <= n)
c = n - (r*(r-1))/2
c * (r - (c - 1)) /* should look familiar */
N in this case is an index retrieved by the following function:
f(r, c) -> r*(r-1)/2 + c
If you are not familiar, you should know that the sum of N odds is the value of N², and that the sum of N evens is the value of N*(N+1). This gives us the resulting formula that the sum of consecutive numbers is: (N*(N+1))/2.
As we read the multiplication table as a triangle we come to see that each row is merely the sum of it's terms less one. For example, we know that 2*5 = 10. This means that we should find 10 on row 6 (2+5-1), and columns 2, and 5. In this way, we could come to see that this table is really a representation of the following sequence:
1.) 1 * 1 2.) 2 * 1, 1 * 2 3.) 3 * 1, 2 * 2, 1 * 3 4.) 4 * 1, 3 * 2, 2 * 3, 1 * 4 5.) 5 * 1, 4 * 2, 3 * 3, 2 * 4, 1 * 5 6.) 6 * 1, 5 * 2, 4 * 3, 3 * 4, 2 * 5, 1 * 6 …
This means that the center value for a given row can be calculated quite easily, since it will always be N² or N(N+1) depending on whether or not the given N is even or odd. The formula for this can be found below.
Knowing the sum of all values, whose factors add up to some N could be useful. Somewhere, maybe. probably not.;; n is row
f(2n) = (n/2)(n/2+1) f(2n+1) = ((n+1)/2)^2 f(n) -> r = (n + (n % 2)) / 2;; r = (n+1)/2 if odd, n/2 if even
r * (r + (1 - (n % 2)));; r^2 if odd, r*(r+1) if even
f(2n+1) ->
m = (n+1)/2
2 * (m^3 - (m*(m-1)*(2*(m-1)+1)/6)) - m^2
f(2n) ->
; eh? haven't bothered to deduce this yet
When we consider A*B, what can we really know?
a*b = c (2n+1)
Q = (a+b)/2
W = (a-b)/2
R = 2*Q-1
C = Q - W
I = R*(R-1)/2 + C
N = C * (R - (C - 1))
B = C ;; (Q - W) -> ((a+b)/2) - ((a-b)/2) -> 2*b/2 -> b
A = (R - (C - 1))
N == A * B == Q² - W² == c
# check ``man 1 ssh-keygen'' for details.
ssh-keygen -f ~/.ssh/mykey -t rsa -b 4096 -C "key for myhost"
# check ``man 1 ssh-keygen'' for details.
ssh-keygen -f myhostca.ca -t rsa -b 4096 -C "CA For my host"
# check ``man 1 ssh-keygen'' for details
ssh-keygen -s myhostca.ca \
\ -I identifier \
\ [-n principles] \
\ [-V validity_interval ] \
\ myusersey.pub
# check ``man 1 ssh-keygen'' for details.
ssh-keygen -Lf myuserkey-cert.pub
\myuserkey-cert.pub:
\ Type: ssh-rsa-cert-v01@openssh.com user certificate
\ Public key: RSA-CERT SHA256:ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef...
\ Signing CA: RSA SHA256:rstuvwxyz0123456789abcdefghijklmnopqr...
\ Key ID: "myuserkey"
\ Serial: 0
\ Valid: forever
\ Principals: (none)
\ Critical Options: (none)
\ Extensions:
\ permit-X11-forwarding
\ permit-agent-forwarding
\ permit-port-forwarding
\ permit-pty
\ permit-user-rc
# check ``man 1 s_client'' for details
openssl s_client -connect www.google.com:443
# see ``man 1 req'' for more details.
openssl req -x509 \
\ -newkey rsa:2048 \
\ -keyout server.pem \
\ -out server.pem \
\ -days 30 \
\ -subj '/C=.../ST=.../L=.../O=.../OU=.../CN=.../emailAddress=.../' \
\ [ -nodes ] # no password.
# see ``man 1 s_server'' for more details.
openssl s_server -accept 4443 \
\ -cert server.pem \
\ -key server.pem
gcd(a,0) = a
gcd(a,b) = gcd(b,a%b)
inverse(a, b) ->
t = 0, tk = 1;
r = b, rk = a;
while rk ≠ 0 ->
q = r/rk;
m = t-q*tk;
t = tk, tk = m;
m = r-q*rk;
r = rk, rk = m;
;;
(r > 1? 0:
t + (t < 0? b: 0))
;;
lcm(a,b) = b * (a/gcd(a,b));
reverse(0, o, b) = o
reverse(i, o, b) ->
reverse(floor(i/b), o*b+(i%b), b);
;;
Example:
reverse(351, 0, 10) ->
reverse(35, 1, 10) ->
reverse(3, 15, 10) ->
reverse(0, 153, 10) = 153
d(n,b) ->
((n-1) % (b-1)) + 1
;;
10! -> 10 * 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1
5! -> 5 * 4 * 3 * 2 * 1
7! -> 7 * 6 * 5 * 4 * 3 * 2 * 1
A self taught and critical thinking individual. I grew up mostly interested in computer programming, networking, and Linux systems administration. At 12 I started to learn HTML and Javascript, followed by various programming languages. I have experience with coding QuickBASIC, VisualBasic, C, some C++, x86 Assembly, Java, Python, Perl, Bash, PHP, SQL, and Ruby. I dabbled a bit with Pascal and Delphi in my younger years, but I forget all that now. If it's not obvious, I also learned to use CSS.
Outside of programming, my interests involve learning new things, but I forget them easily. (Don't use it you
lose it.) This includes things like Math, Chemistry, Classical Mechanics/Physics, some very basic quantum
physics, music theory, psychology, pool; I should study more astrophysics, but I am only one person, and
there is only so much time in a day. I know of Lagrangian mechanics, but have not studied it in-depth. I enjoy
math, but what I really enjoy in math is working on the factoring problem. (See the Multiplication
Triangle
) for an easy to see y² - x² visual. As well as an indexed value of the multiplication table.
My work experience consists of being a Line Cook/Meat Cutter, A shelf stocker, a Ruby application developer, Linux systems administrator, a DevOPS engineer, and a Ruby on Rails developer.
My personal experience within the field of computers consists of Linux system administration, including
firewall configuration. Configuring services like SSH, DHCP, DNS, HTTP and HTTPS, MySQL, etc. Other service
types include Syslog, PAM (Pluggable Authentication Modules), SysV init systems (I dislike systemd's init),
etc. I also program many of my personal projects in C, but sometimes other languages like Ruby or Bash may be
used, or in the case of this website
HTML, CSS, and Javascript. I don't know why, but I really like C a
lot, I'm pretty good at keeping track of dynamically allocated memory, and managing memory within an
application. However, I may make a mistake from time to time. (No ones perfect.)
For personal reasons, my psychological development doesn't allow me to be the most social person in the world; mostly family, and close friends is who I open up to. It is something I know I need to work on, and hope I can get better at. Professionally, I am better at it because I have a project or task to discuss.
Another thing about me, is I'm a pretty quick learner. The only issue I have is I can forget things easily that I don't use frequently. That's probably everybody though.
I've spent time on youtube, wikipedia, and other various sites learning new things. However, as a male, I'm better at hands-on learning, and so I have little experience in certain interests such as chemistry or electronics. I'm not stupid, I know with chemistry I should start with baking soda experiments, and I still don't own an oscilloscope or signal generator, but would love to get them one day. I did one time purchase a starter electronics kit that came with some LEDs and a shift register, an NPN transistor, and a few other components, but I got bored with it quick. It was actually an arduino kit, but I'd rather bypass the Arduino and do DC electronics. I have books on the various subjects, but I'm a terrible book reader. I read a bit, then start critically thinking and over analyzing what I just read.
According to their website
OpenSSH is the premier connectivity tool for remote login with the SSH protocol. It encrypts all traffic to eliminate eavesdropping, connection hijacking, and other attacks. In addition, OpenSSH provides a large suite of secure tunneling capabilities, several authentication methods, and sophisticated configuration options.
OpenSSH consists of several different applications, used for a variety of different purposes. But all, utimately aiming to give you secure remote access to a machine that is listening on a port capable of speaking the SSH Protocol. Here is a quick list of applications you can expect to find when you install OpenSSH.
SSH stands for Secure Shell, and consists of several layers documented over several RFC's. To speak extensively about these would be out of scope for this document. However, for completeness sake they should be mentioned. In short, we will say that the SSH protocol enables a secure transport over an insecure network.
sudo apt-get install openssh-server
sudo yum install openssh-server
sudo emerge net-misc/openssh
If you are running Linux, chances are, you already have OpenSSH installed. However, if for some reason OpenSSH is not installed. You can obtain a copy by checking with your distributions package management resource or by visiting https://www.openssh.com/ and following the correct links which correspond to your operating system.
The file located at /etc/ssh/sshd_config is the main configuration file for the OpenSSH server. This file is configured by key-value pairs that will enable the server to act in specific ways. I will be referencing the sshd_config manpage to aid this documentation. Feel free to check man 5 sshd_config at anytime.
This keyword is in charge of specifying what environment variables are allowed to be set on the server upon connecting to the remote host. By default, TERM is always accepted. My sshd_config file also allows locale environment variables to be set as well. You're sshd_config may differ.
Example Usage
AcceptEnv LANG LC_ALL LC_CTYPE LC_TIME
This keyword is to define what address family to use; the address family is the IP (internet protocol) family. Valid options include inet for IPv4, inet6 for IPv6, and any for both IPv4 and IPv6.
Example Usage
AddressFamily any
This keyword specifies whether SSH keys should be allowed to be forwarded using ssh-agent. What this really means is that, when connecting with a key managed my ssh-agent, you can ssh to another host using the same key from the server that you ssh'd to. According to the manpage, setting no is not adequate security. See man 5 sshd_config for details.
Example usage; the default value is yes.
AllowAgentForwarding yes
Specifies the group names that are allowed to login remotely by using ssh. A user only needs to be part of one of the specified groups in order to login. By default this value is empty, implying it does not matter which group is logged in.
User must be in group wheel, or ssh-users, or in a group beginning with net
AllowGroups wheel ssh-users net*
Specifies whether or not Unix-domain sockets can be forwarded. Available options are yes (default), all, no, local, and remote. Specifying yes enables StreamLocal forwarding both locally and remotely.
Only allow local forwarding
AllowStreamLocalForwarding local
Enables TCP port forwarding using the SSH protocol. Available options are yes (default), all, no, local, and remote. Specifying yes enables TCP forwarding both remotely and locally.
Allow only remote port forwarding.
AllowTcpForwarding. remote
A space delimited list of users allowed to login to the system remotely using ssh. Numerical IDs are not accepted.
Allow only the user jsmith, and users beginning with git
AllowUsers jsmith git*
Defines the authentication methods that should be used when logging in remotely using the ssh client. The available methods are: gssapi-with-mic, hostbased, keyboard-interactive, none, password, and publickey. It is recommended that sshd_config be configured with atleast publickey. This keyword directive takes a space delimited list of different authentication methods. Additionally, you may use a comma (,) to specify that more than one authentication method be used.
Require publickey AND password to login to the system
AuthenticationMethods publickey,keyboard-interactive