Compare commits
No commits in common. "main" and "be177af6cd8485edf9741320279bce09fd3697dd" have entirely different histories.
main
...
be177af6cd
24
.gitignore
vendored
|
@ -1,23 +1 @@
|
||||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
.env
|
||||||
|
|
||||||
# dependencies
|
|
||||||
/node_modules
|
|
||||||
/.pnp
|
|
||||||
.pnp.js
|
|
||||||
|
|
||||||
# testing
|
|
||||||
/coverage
|
|
||||||
|
|
||||||
# production
|
|
||||||
/build
|
|
||||||
|
|
||||||
# misc
|
|
||||||
.DS_Store
|
|
||||||
.env.local
|
|
||||||
.env.development.local
|
|
||||||
.env.test.local
|
|
||||||
.env.production.local
|
|
||||||
|
|
||||||
npm-debug.log*
|
|
||||||
yarn-debug.log*
|
|
||||||
yarn-error.log*
|
|
||||||
|
|
5
.idea/.gitignore
generated
vendored
|
@ -1,5 +0,0 @@
|
||||||
# Default ignored files
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
||||||
# Editor-based HTTP Client requests
|
|
||||||
/httpRequests/
|
|
6
.idea/inspectionProfiles/Project_Default.xml
generated
|
@ -1,6 +0,0 @@
|
||||||
<component name="InspectionProjectProfileManager">
|
|
||||||
<profile version="1.0">
|
|
||||||
<option name="myName" value="Project Default" />
|
|
||||||
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
|
|
||||||
</profile>
|
|
||||||
</component>
|
|
8
.idea/modules.xml
generated
|
@ -1,8 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/personal-site.iml" filepath="$PROJECT_DIR$/.idea/personal-site.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
13
.idea/personal-site.iml
generated
|
@ -1,13 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="WEB_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager">
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
6
.idea/vcs.xml
generated
|
@ -1,6 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
21
Dockerfile
|
@ -1,9 +1,16 @@
|
||||||
FROM ubuntu as build-env
|
FROM rust:1.86.0 as build
|
||||||
|
|
||||||
WORKDIR /site
|
ENV PKG_CONFIG_ALLOW_CROSS=1
|
||||||
COPY . .
|
|
||||||
RUN /bin/bash compile.sh
|
|
||||||
|
|
||||||
FROM ghcr.io/nickorlow/anthracite:0.3.0
|
WORKDIR .
|
||||||
COPY --from=build-env /site/out/ /www/
|
COPY ./api ./api
|
||||||
COPY anthracite.cfg ./anthracite.cfg
|
COPY ./libseptastic/ ./libseptastic/
|
||||||
|
|
||||||
|
|
||||||
|
RUN cd api && cargo install --path .
|
||||||
|
|
||||||
|
ENV RUST_LOG=info
|
||||||
|
ENV EXPOSE_PORT=80
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
ENTRYPOINT ["./api/septastic_api"]
|
||||||
|
|
674
LICENSE
|
@ -1,674 +0,0 @@
|
||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
Version 3, 29 June 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The GNU General Public License is a free, copyleft license for
|
|
||||||
software and other kinds of works.
|
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed
|
|
||||||
to take away your freedom to share and change the works. By contrast,
|
|
||||||
the GNU General Public License is intended to guarantee your freedom to
|
|
||||||
share and change all versions of a program--to make sure it remains free
|
|
||||||
software for all its users. We, the Free Software Foundation, use the
|
|
||||||
GNU General Public License for most of our software; it applies also to
|
|
||||||
any other work released this way by its authors. You can apply it to
|
|
||||||
your programs, too.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
them if you wish), that you receive source code or can get it if you
|
|
||||||
want it, that you can change the software or use pieces of it in new
|
|
||||||
free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to prevent others from denying you
|
|
||||||
these rights or asking you to surrender the rights. Therefore, you have
|
|
||||||
certain responsibilities if you distribute copies of the software, or if
|
|
||||||
you modify it: responsibilities to respect the freedom of others.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
|
||||||
gratis or for a fee, you must pass on to the recipients the same
|
|
||||||
freedoms that you received. You must make sure that they, too, receive
|
|
||||||
or can get the source code. And you must show them these terms so they
|
|
||||||
know their rights.
|
|
||||||
|
|
||||||
Developers that use the GNU GPL protect your rights with two steps:
|
|
||||||
(1) assert copyright on the software, and (2) offer you this License
|
|
||||||
giving you legal permission to copy, distribute and/or modify it.
|
|
||||||
|
|
||||||
For the developers' and authors' protection, the GPL clearly explains
|
|
||||||
that there is no warranty for this free software. For both users' and
|
|
||||||
authors' sake, the GPL requires that modified versions be marked as
|
|
||||||
changed, so that their problems will not be attributed erroneously to
|
|
||||||
authors of previous versions.
|
|
||||||
|
|
||||||
Some devices are designed to deny users access to install or run
|
|
||||||
modified versions of the software inside them, although the manufacturer
|
|
||||||
can do so. This is fundamentally incompatible with the aim of
|
|
||||||
protecting users' freedom to change the software. The systematic
|
|
||||||
pattern of such abuse occurs in the area of products for individuals to
|
|
||||||
use, which is precisely where it is most unacceptable. Therefore, we
|
|
||||||
have designed this version of the GPL to prohibit the practice for those
|
|
||||||
products. If such problems arise substantially in other domains, we
|
|
||||||
stand ready to extend this provision to those domains in future versions
|
|
||||||
of the GPL, as needed to protect the freedom of users.
|
|
||||||
|
|
||||||
Finally, every program is threatened constantly by software patents.
|
|
||||||
States should not allow patents to restrict development and use of
|
|
||||||
software on general-purpose computers, but in those that do, we wish to
|
|
||||||
avoid the special danger that patents applied to a free program could
|
|
||||||
make it effectively proprietary. To prevent this, the GPL assures that
|
|
||||||
patents cannot be used to render the program non-free.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU General Public License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
||||||
works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of an
|
|
||||||
exact copy. The resulting work is called a "modified version" of the
|
|
||||||
earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user through
|
|
||||||
a computer network, with no transfer of a copy, is not conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices"
|
|
||||||
to the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work
|
|
||||||
for making modifications to it. "Object code" means any non-source
|
|
||||||
form of a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users
|
|
||||||
can regenerate automatically from other parts of the Corresponding
|
|
||||||
Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that
|
|
||||||
same work.
|
|
||||||
|
|
||||||
2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not
|
|
||||||
convey, without conditions so long as your license otherwise remains
|
|
||||||
in force. You may convey covered works to others for the sole purpose
|
|
||||||
of having them make modifications exclusively for you, or provide you
|
|
||||||
with facilities for running those works, provided that you comply with
|
|
||||||
the terms of this License in conveying all material for which you do
|
|
||||||
not control copyright. Those thus making or running the covered works
|
|
||||||
for you must do so exclusively on your behalf, under your direction
|
|
||||||
and control, on terms that prohibit them from making any copies of
|
|
||||||
your copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under
|
|
||||||
the conditions stated below. Sublicensing is not allowed; section 10
|
|
||||||
makes it unnecessary.
|
|
||||||
|
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such circumvention
|
|
||||||
is effected by exercising rights under this License with respect to
|
|
||||||
the covered work, and you disclaim any intention to limit operation or
|
|
||||||
modification of the work as a means of enforcing, against the work's
|
|
||||||
users, your or third parties' legal rights to forbid circumvention of
|
|
||||||
technological measures.
|
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
|
|
||||||
b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under section
|
|
||||||
7. This requirement modifies the requirement in section 4 to
|
|
||||||
"keep intact all notices".
|
|
||||||
|
|
||||||
c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
|
|
||||||
d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms
|
|
||||||
of sections 4 and 5, provided that you also convey the
|
|
||||||
machine-readable Corresponding Source under the terms of this License,
|
|
||||||
in one of these ways:
|
|
||||||
|
|
||||||
a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
|
|
||||||
b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the
|
|
||||||
Corresponding Source from a network server at no charge.
|
|
||||||
|
|
||||||
c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
|
|
||||||
d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
|
|
||||||
e) Convey the object code using peer-to-peer transmission, provided
|
|
||||||
you inform other peers where the object code and Corresponding
|
|
||||||
Source of the work are being offered to the general public at no
|
|
||||||
charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal, family,
|
|
||||||
or household purposes, or (2) anything designed or sold for incorporation
|
|
||||||
into a dwelling. In determining whether a product is a consumer product,
|
|
||||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
||||||
product received by a particular user, "normally used" refers to a
|
|
||||||
typical or common use of that class of product, regardless of the status
|
|
||||||
of the particular user or of the way in which the particular user
|
|
||||||
actually uses, or expects or is expected to use, the product. A product
|
|
||||||
is a consumer product regardless of whether the product has substantial
|
|
||||||
commercial, industrial or non-consumer uses, unless such uses represent
|
|
||||||
the only significant mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to install
|
|
||||||
and execute modified versions of a covered work in that User Product from
|
|
||||||
a modified version of its Corresponding Source. The information must
|
|
||||||
suffice to ensure that the continued functioning of the modified object
|
|
||||||
code is in no case prevented or interfered with solely because
|
|
||||||
modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or updates
|
|
||||||
for a work that has been modified or installed by the recipient, or for
|
|
||||||
the User Product in which it has been modified or installed. Access to a
|
|
||||||
network may be denied when the modification itself materially and
|
|
||||||
adversely affects the operation of the network or violates the rules and
|
|
||||||
protocols for communication across the network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders of
|
|
||||||
that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
|
|
||||||
b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
|
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or
|
|
||||||
requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
|
|
||||||
d) Limiting the use for publicity purposes of names of licensors or
|
|
||||||
authors of the material; or
|
|
||||||
|
|
||||||
e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
|
|
||||||
f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions of
|
|
||||||
it) with contractual assumptions of liability to the recipient, for
|
|
||||||
any liability that these contractual assumptions directly impose on
|
|
||||||
those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions;
|
|
||||||
the above requirements apply either way.
|
|
||||||
|
|
||||||
8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your
|
|
||||||
license from a particular copyright holder is reinstated (a)
|
|
||||||
provisionally, unless and until the copyright holder explicitly and
|
|
||||||
finally terminates your license, and (b) permanently, if the copyright
|
|
||||||
holder fails to notify you of the violation by some reasonable means
|
|
||||||
prior to 60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or
|
|
||||||
run a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims
|
|
||||||
owned or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within
|
|
||||||
the scope of its coverage, prohibits the exercise of, or is
|
|
||||||
conditioned on the non-exercise of one or more of the rights that are
|
|
||||||
specifically granted under this License. You may not convey a covered
|
|
||||||
work if you are a party to an arrangement with a third party that is
|
|
||||||
in the business of distributing software, under which you make payment
|
|
||||||
to the third party based on the extent of your activity of conveying
|
|
||||||
the work, and under which the third party grants, to any of the
|
|
||||||
parties who would receive the covered work from you, a discriminatory
|
|
||||||
patent license (a) in connection with copies of the covered work
|
|
||||||
conveyed by you (or copies made from those copies), or (b) primarily
|
|
||||||
for and in connection with specific products or compilations that
|
|
||||||
contain the covered work, unless you entered into that arrangement,
|
|
||||||
or that patent license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you may
|
|
||||||
not convey it at all. For example, if you agree to terms that obligate you
|
|
||||||
to collect a royalty for further conveying from those to whom you convey
|
|
||||||
the Program, the only way you could satisfy both those terms and this
|
|
||||||
License would be to refrain entirely from conveying the Program.
|
|
||||||
|
|
||||||
13. Use with the GNU Affero General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU Affero General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the special requirements of the GNU Affero General Public License,
|
|
||||||
section 13, concerning interaction through a network will apply to the
|
|
||||||
combination as such.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
|
||||||
the GNU General Public License from time to time. Such new versions will
|
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Program specifies that a certain numbered version of the GNU General
|
|
||||||
Public License "or any later version" applies to it, you have the
|
|
||||||
option of following the terms and conditions either of that numbered
|
|
||||||
version or of any later version published by the Free Software
|
|
||||||
Foundation. If the Program does not specify a version number of the
|
|
||||||
GNU General Public License, you may choose any version ever published
|
|
||||||
by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
|
||||||
versions of the GNU General Public License can be used, that proxy's
|
|
||||||
public statement of acceptance of a version permanently authorizes you
|
|
||||||
to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
|
||||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
||||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
||||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
||||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
|
||||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
|
||||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
|
||||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
|
||||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
||||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
||||||
SUCH DAMAGES.
|
|
||||||
|
|
||||||
17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
state the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If the program does terminal interaction, make it output a short
|
|
||||||
notice like this when it starts in an interactive mode:
|
|
||||||
|
|
||||||
<program> Copyright (C) <year> <name of author>
|
|
||||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
||||||
This is free software, and you are welcome to redistribute it
|
|
||||||
under certain conditions; type `show c' for details.
|
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
||||||
parts of the General Public License. Of course, your program's commands
|
|
||||||
might be different; for a GUI interface, you would use an "about box".
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school,
|
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
||||||
For more information on this, and how to apply and follow the GNU GPL, see
|
|
||||||
<https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
The GNU General Public License does not permit incorporating your program
|
|
||||||
into proprietary programs. If your program is a subroutine library, you
|
|
||||||
may consider it more useful to permit linking proprietary applications with
|
|
||||||
the library. If this is what you want to do, use the GNU Lesser General
|
|
||||||
Public License instead of this License. But first, please read
|
|
||||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
|
|
@ -1,3 +0,0 @@
|
||||||
# personal-site [](https://github.com/nickorlow/personal-site/actions/workflows/main.yml)
|
|
||||||
My personal website!
|
|
||||||
Hosted by NWS
|
|
|
@ -1,6 +0,0 @@
|
||||||
log_level INFO
|
|
||||||
|
|
||||||
http 80 100000 blocking
|
|
||||||
|
|
||||||
event_loop 6 1000000
|
|
||||||
www_dir ./www
|
|
1
api/.envrc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
use nix
|
2
api/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
target/
|
||||||
|
.env
|
3843
api/Cargo.lock
generated
Normal file
21
api/Cargo.toml
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
[package]
|
||||||
|
name = "septastic_api"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2024"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
actix-web = "4"
|
||||||
|
anyhow = "1.0.98"
|
||||||
|
dotenv = "0.15.0"
|
||||||
|
env_logger = "0.11.8"
|
||||||
|
log = "0.4.27"
|
||||||
|
serde_json = "1.0.140"
|
||||||
|
sqlx = { version = "0.8.6", features = [ "runtime-async-std", "postgres" ] }
|
||||||
|
libseptastic = { path = "../libseptastic/" }
|
||||||
|
askama = "0.14.0"
|
||||||
|
actix-files = "0.6.6"
|
||||||
|
serde = "1.0.219"
|
||||||
|
chrono = "0.4.41"
|
||||||
|
chrono-tz = "0.10.4"
|
||||||
|
actix-cors = "0.7.1"
|
||||||
|
reqwest = { version = "0.12.22", features = [ "json" ] }
|
134
api/assets/style.css
Normal file
|
@ -0,0 +1,134 @@
|
||||||
|
* {
|
||||||
|
font-family: mono;
|
||||||
|
}
|
||||||
|
|
||||||
|
th {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
td {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
table, th, td {
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
padding: 0 !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.body {
|
||||||
|
background-color: #ffffff;
|
||||||
|
margin: 10px auto;
|
||||||
|
max-width: 750px;
|
||||||
|
width: 95%;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: #114488;
|
||||||
|
}
|
||||||
|
|
||||||
|
p, h1, h2, h3, h4, h5, h6 {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flag-img {
|
||||||
|
height: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-link {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.metro-container {
|
||||||
|
font-size: 1.5em;
|
||||||
|
padding: 0.3em;
|
||||||
|
font-weight: bold;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: max-content;
|
||||||
|
height: max-content;
|
||||||
|
aspect-ratio: 1 / 1;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rr-container {
|
||||||
|
background-color: #4c748c;
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 1.5em;
|
||||||
|
padding: 0.3em;
|
||||||
|
font-weight: bold;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: max-content;
|
||||||
|
height: max-content;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-B1, .bg-B2, .bg-B3 {
|
||||||
|
background-color: #FF661C;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-L1 {
|
||||||
|
background-color: #009BDE;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-M1 {
|
||||||
|
background-color: #552B9D;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-D1, .bg-D2 {
|
||||||
|
background-color: #EA4379;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-G1 {
|
||||||
|
background-color: #FFD500;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-T1, .bg-T2, .bg-T3, .bg-T4, .bg-T5 {
|
||||||
|
background-color: #6EA516;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bus-container {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0.2em 0.5em; /* scales with font size */
|
||||||
|
font-size: 1em; /* or inherit */
|
||||||
|
font-weight: bold;
|
||||||
|
border-radius: 9999px; /* full pill shape */
|
||||||
|
border: 2px solid #000000;
|
||||||
|
background-color: #ffffff;
|
||||||
|
color: #000000;
|
||||||
|
width: max-content;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
.tscroll {
|
||||||
|
width: 100%;
|
||||||
|
overflow: scroll;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tscroll table td:first-child, .tscroll table th:first-child {
|
||||||
|
position: sticky;
|
||||||
|
left: 0;
|
||||||
|
background-color: #ddd;
|
||||||
|
box-shadow: inset 0 0.5px 0 #000000,inset 0 -0.5px 0 #000000,inset 1px 0 0 #000000,inset -1px 0 0 #000000;
|
||||||
|
border-width:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tscroll td, .tscroll th {
|
||||||
|
}
|
65
api/assets/test.html
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Canvas Curve Full Width</title>
|
||||||
|
<style>
|
||||||
|
body { margin: 0; }
|
||||||
|
canvas { display: block; background: white; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<canvas id="curveCanvas" height="180"></canvas>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const canvas = document.getElementById('curveCanvas');
|
||||||
|
const ctx = canvas.getContext('2d');
|
||||||
|
|
||||||
|
// Set canvas width to window width
|
||||||
|
function resizeCanvas() {
|
||||||
|
canvas.width = window.innerWidth;
|
||||||
|
|
||||||
|
const rightEnd = canvas.width;
|
||||||
|
const flatStart = 0;
|
||||||
|
const flatEnd = 450;
|
||||||
|
const curveStart = flatEnd;
|
||||||
|
const curveControl1 = 475;
|
||||||
|
const curveControl2 = 525;
|
||||||
|
const curvePeak = 550;
|
||||||
|
|
||||||
|
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||||
|
|
||||||
|
// Blue stripe (top)
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.moveTo(flatStart, 90);
|
||||||
|
ctx.lineTo(flatEnd, 90);
|
||||||
|
ctx.bezierCurveTo(curveControl1, 90, curveControl2, 30, curvePeak, 30);
|
||||||
|
ctx.lineTo(rightEnd, 30);
|
||||||
|
ctx.lineTo(rightEnd, 60);
|
||||||
|
ctx.lineTo(curvePeak, 60);
|
||||||
|
ctx.bezierCurveTo(curveControl2, 60, curveControl1, 120, flatEnd, 120);
|
||||||
|
ctx.lineTo(flatStart, 120);
|
||||||
|
ctx.closePath();
|
||||||
|
ctx.fillStyle = '#007ac2';
|
||||||
|
ctx.fill();
|
||||||
|
|
||||||
|
// Orange stripe (bottom)
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.moveTo(flatStart, 120);
|
||||||
|
ctx.lineTo(flatEnd, 120);
|
||||||
|
ctx.bezierCurveTo(curveControl1, 120, curveControl2, 60, curvePeak, 60);
|
||||||
|
ctx.lineTo(rightEnd, 60);
|
||||||
|
ctx.lineTo(rightEnd, 90);
|
||||||
|
ctx.lineTo(curvePeak, 90);
|
||||||
|
ctx.bezierCurveTo(curveControl2, 90, curveControl1, 150, flatEnd, 150);
|
||||||
|
ctx.lineTo(flatStart, 150);
|
||||||
|
ctx.closePath();
|
||||||
|
ctx.fillStyle = '#f15a22';
|
||||||
|
ctx.fill();
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener('resize', resizeCanvas);
|
||||||
|
resizeCanvas();
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
8
api/shell.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
with import <nixpkgs> {};
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
name = "env";
|
||||||
|
nativeBuildInputs = [ pkg-config ];
|
||||||
|
buildInputs = [
|
||||||
|
cryptsetup
|
||||||
|
];
|
||||||
|
}
|
298
api/src/database.rs
Normal file
|
@ -0,0 +1,298 @@
|
||||||
|
use std::{collections::HashMap, hash::Hash};
|
||||||
|
|
||||||
|
use actix_web::Route;
|
||||||
|
use libseptastic::{direction::CardinalDirection, route::RouteType};
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
use sqlx::{Postgres, Transaction};
|
||||||
|
|
||||||
|
pub async fn get_route_by_id(
|
||||||
|
id: String,
|
||||||
|
transaction: &mut Transaction<'_, Postgres>,
|
||||||
|
) -> ::anyhow::Result<libseptastic::route::Route> {
|
||||||
|
|
||||||
|
let row = sqlx::query!(
|
||||||
|
r#"SELECT
|
||||||
|
id,
|
||||||
|
name,
|
||||||
|
short_name,
|
||||||
|
color_hex,
|
||||||
|
route_type as "route_type: libseptastic::route::RouteType"
|
||||||
|
FROM
|
||||||
|
septa_routes
|
||||||
|
WHERE
|
||||||
|
id = $1
|
||||||
|
;"#,
|
||||||
|
id
|
||||||
|
)
|
||||||
|
.fetch_one(&mut **transaction)
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
return Ok(libseptastic::route::Route {
|
||||||
|
name: row.name,
|
||||||
|
short_name: row.short_name,
|
||||||
|
color_hex: row.color_hex,
|
||||||
|
route_type: row.route_type,
|
||||||
|
id: row.id,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn get_direction_by_route_id(
|
||||||
|
id: String,
|
||||||
|
transaction: &mut Transaction<'_, Postgres>,
|
||||||
|
) -> ::anyhow::Result<Vec<libseptastic::direction::Direction>> {
|
||||||
|
|
||||||
|
let rows = sqlx::query!(
|
||||||
|
r#"SELECT
|
||||||
|
route_id,
|
||||||
|
direction_id,
|
||||||
|
direction as "direction: libseptastic::direction::CardinalDirection",
|
||||||
|
direction_destination
|
||||||
|
FROM
|
||||||
|
septa_directions
|
||||||
|
WHERE
|
||||||
|
route_id = $1
|
||||||
|
;"#,
|
||||||
|
id
|
||||||
|
)
|
||||||
|
.fetch_all(&mut **transaction)
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
let mut res = Vec::new();
|
||||||
|
|
||||||
|
for row in rows {
|
||||||
|
res.push(libseptastic::direction::Direction{
|
||||||
|
route_id: row.route_id,
|
||||||
|
direction_id: row.direction_id,
|
||||||
|
direction: row.direction,
|
||||||
|
direction_destination: row.direction_destination
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return Ok(res);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
pub struct StopSchedule {
|
||||||
|
pub route_id: String,
|
||||||
|
pub stop_name: String,
|
||||||
|
pub trip_id: String,
|
||||||
|
pub service_id: String,
|
||||||
|
pub direction_id: i64,
|
||||||
|
pub arrival_time: i64,
|
||||||
|
pub stop_id: i64,
|
||||||
|
pub stop_sequence: i64
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
pub struct Trip {
|
||||||
|
pub route_id: String,
|
||||||
|
pub trip_id: String,
|
||||||
|
pub direction_id: i64,
|
||||||
|
pub schedule: Vec<StopSchedule>
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn get_schedule_by_route_id(
|
||||||
|
id: String,
|
||||||
|
transaction: &mut Transaction<'_, Postgres>,
|
||||||
|
) -> ::anyhow::Result<Vec<Trip>> {
|
||||||
|
|
||||||
|
let rows = sqlx::query!(
|
||||||
|
r#"SELECT
|
||||||
|
septa_stop_schedules.route_id,
|
||||||
|
septa_stops.name as stop_name,
|
||||||
|
trip_id,
|
||||||
|
service_id,
|
||||||
|
septa_stop_schedules.direction_id,
|
||||||
|
septa_directions.direction as "direction: libseptastic::direction::CardinalDirection",
|
||||||
|
arrival_time,
|
||||||
|
stop_id,
|
||||||
|
stop_sequence
|
||||||
|
FROM
|
||||||
|
septa_stop_schedules
|
||||||
|
INNER JOIN septa_directions
|
||||||
|
ON
|
||||||
|
septa_directions.direction_id = septa_stop_schedules.direction_id
|
||||||
|
AND
|
||||||
|
septa_directions.route_id = septa_stop_schedules.route_id
|
||||||
|
INNER JOIN septa_stops
|
||||||
|
ON septa_stops.id = septa_stop_schedules.stop_id
|
||||||
|
WHERE
|
||||||
|
septa_stop_schedules.route_id = $1
|
||||||
|
AND
|
||||||
|
service_id IN (SELECT service_id FROM septa_schedule_days WHERE date = '20250707')
|
||||||
|
;"#,
|
||||||
|
id
|
||||||
|
)
|
||||||
|
.fetch_all(&mut **transaction)
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
let mut sched_groups: HashMap<String, Vec<StopSchedule>> = HashMap::new();
|
||||||
|
for row in rows {
|
||||||
|
let mut arr = match sched_groups.get_mut(&row.trip_id) {
|
||||||
|
Some(x) => x,
|
||||||
|
None => {
|
||||||
|
sched_groups.insert(row.trip_id.clone(), Vec::new());
|
||||||
|
sched_groups.get_mut(&row.trip_id).unwrap()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
arr.push(StopSchedule {
|
||||||
|
route_id: row.route_id,
|
||||||
|
stop_name: row.stop_name,
|
||||||
|
trip_id: row.trip_id,
|
||||||
|
service_id: row.service_id,
|
||||||
|
direction_id: row.direction_id,
|
||||||
|
arrival_time: row.arrival_time,
|
||||||
|
stop_id: row.stop_id,
|
||||||
|
stop_sequence: row.stop_sequence
|
||||||
|
});
|
||||||
|
}
|
||||||
|
let mut res = Vec::new();
|
||||||
|
|
||||||
|
for group in sched_groups {
|
||||||
|
res.push(Trip{
|
||||||
|
trip_id: group.0,
|
||||||
|
route_id: group.1[0].route_id.clone(),
|
||||||
|
schedule: group.1.clone(),
|
||||||
|
direction_id: group.1[0].direction_id.clone()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return Ok(res);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize,Deserialize,Clone)]
|
||||||
|
pub struct NTALive {
|
||||||
|
delay: i64,
|
||||||
|
cancelled: bool,
|
||||||
|
next_stop: Option<String>
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize,Deserialize)]
|
||||||
|
pub struct LiveData {
|
||||||
|
route_id: String,
|
||||||
|
service_id: String,
|
||||||
|
trip_id: String,
|
||||||
|
trip_headsign: String,
|
||||||
|
direction_id: i64,
|
||||||
|
block_id: String,
|
||||||
|
start_time: String,
|
||||||
|
end_time: String,
|
||||||
|
delay: i64,
|
||||||
|
status: String,
|
||||||
|
lat: Option<String>,
|
||||||
|
lon: Option<String>,
|
||||||
|
heading: Option<String>,
|
||||||
|
next_stop_id: Option<i64>,
|
||||||
|
next_stop_name: Option<String>,
|
||||||
|
next_stop_sequence: Option<i64>,
|
||||||
|
seat_availability: String,
|
||||||
|
vehicle_id: String,
|
||||||
|
timestamp: i64
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize,Deserialize)]
|
||||||
|
pub struct NTAEntry {
|
||||||
|
route_id: String,
|
||||||
|
route_type: RouteType,
|
||||||
|
route_name: String,
|
||||||
|
color_hex: String,
|
||||||
|
trip_id: String,
|
||||||
|
arrival_time: i64,
|
||||||
|
direction: CardinalDirection,
|
||||||
|
direction_destination: String,
|
||||||
|
live: Option<NTALive>
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize,Deserialize)]
|
||||||
|
pub struct NTAResult {
|
||||||
|
station_name: String,
|
||||||
|
arrivals: Vec<NTAEntry>
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn get_nta_by_stop_id(
|
||||||
|
ids: Vec<i64>,
|
||||||
|
start_time: chrono::DateTime<chrono::Utc>,
|
||||||
|
end_time: chrono::DateTime<chrono::Utc>,
|
||||||
|
transaction: &mut Transaction<'_, Postgres>,
|
||||||
|
) -> ::anyhow::Result<NTAResult> {
|
||||||
|
let local_start = start_time.with_timezone(&chrono_tz::America::New_York);
|
||||||
|
let local_end = end_time.with_timezone(&chrono_tz::America::New_York);
|
||||||
|
let local_midnight = chrono::Utc::now().with_timezone(&chrono_tz::America::New_York).date().and_hms(0,0,0);
|
||||||
|
let start_secs = local_start.signed_duration_since(local_midnight).num_seconds();
|
||||||
|
let end_secs = local_end.signed_duration_since(local_midnight).num_seconds();
|
||||||
|
|
||||||
|
let name_row = sqlx::query!("SELECT name FROM septa_stops WHERE id = $1", ids[0]).fetch_one(&mut **transaction).await?;
|
||||||
|
|
||||||
|
let stop_name = name_row.name;
|
||||||
|
|
||||||
|
let rows: Vec<(String, RouteType, String, String, i64, CardinalDirection, String, String,)> = sqlx::query_as(
|
||||||
|
r#"SELECT
|
||||||
|
septa_stop_schedules.route_id,
|
||||||
|
route_type as "route_type: libseptastic::route::RouteType",
|
||||||
|
septa_routes.color_hex,
|
||||||
|
trip_id,
|
||||||
|
arrival_time,
|
||||||
|
septa_directions.direction as "direction: libseptastic::direction::CardinalDirection",
|
||||||
|
septa_directions.direction_destination,
|
||||||
|
septa_routes.name
|
||||||
|
FROM
|
||||||
|
septa_stop_schedules
|
||||||
|
INNER JOIN septa_directions
|
||||||
|
ON
|
||||||
|
septa_directions.direction_id = septa_stop_schedules.direction_id
|
||||||
|
AND
|
||||||
|
septa_directions.route_id = septa_stop_schedules.route_id
|
||||||
|
INNER JOIN septa_stops
|
||||||
|
ON septa_stops.id = septa_stop_schedules.stop_id
|
||||||
|
INNER JOIN septa_routes
|
||||||
|
ON septa_routes.id = septa_stop_schedules.route_id
|
||||||
|
WHERE
|
||||||
|
(septa_stops.id = $1 OR septa_stops.id = $2)
|
||||||
|
AND
|
||||||
|
service_id IN (SELECT service_id FROM septa_schedule_days WHERE date = '20250707')
|
||||||
|
AND
|
||||||
|
septa_stop_schedules.arrival_time > $3
|
||||||
|
AND
|
||||||
|
septa_stop_schedules.arrival_time < $4
|
||||||
|
ORDER BY arrival_time
|
||||||
|
;"#)
|
||||||
|
.bind(&ids[0])
|
||||||
|
.bind(&ids.get(1).unwrap_or(&0))
|
||||||
|
.bind(&start_secs)
|
||||||
|
.bind(&end_secs)
|
||||||
|
.fetch_all(&mut **transaction)
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
let mut ntas: Vec<NTAEntry> = Vec::new();
|
||||||
|
let mut live_map: HashMap<String, NTALive> = HashMap::new();
|
||||||
|
|
||||||
|
let lives: Vec<LiveData> = reqwest::get("https://www3.septa.org/api/v2/trips/?route_id=AIR,CHW,LAN,NOR,TRE,WIL,WAR,MED,PAO,FOX,WTR,CYN").await?.json().await?;
|
||||||
|
|
||||||
|
for live in lives {
|
||||||
|
live_map.insert(live.route_id, NTALive { delay: live.delay, cancelled: live.status == "CANCELLED", next_stop: live.next_stop_name });
|
||||||
|
}
|
||||||
|
|
||||||
|
for row in rows {
|
||||||
|
ntas.push(NTAEntry {
|
||||||
|
route_id: row.0.clone(),
|
||||||
|
route_type: row.1,
|
||||||
|
color_hex: row.2,
|
||||||
|
trip_id: row.3,
|
||||||
|
arrival_time: row.4,
|
||||||
|
direction: row.5,
|
||||||
|
direction_destination: row.6,
|
||||||
|
route_name: row.7,
|
||||||
|
live: match live_map.get(&row.0) {
|
||||||
|
Some(x) => Some(x.clone()),
|
||||||
|
None => None
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return Ok(NTAResult{
|
||||||
|
station_name: stop_name,
|
||||||
|
arrivals: ntas
|
||||||
|
});
|
||||||
|
}
|
268
api/src/main.rs
Normal file
|
@ -0,0 +1,268 @@
|
||||||
|
use actix_web::{get, web::{self, Data}, App, HttpResponse, HttpServer, Responder};
|
||||||
|
use chrono::TimeDelta;
|
||||||
|
use database::{get_direction_by_route_id, get_nta_by_stop_id, get_schedule_by_route_id};
|
||||||
|
use env_logger::Env;
|
||||||
|
use libseptastic::{direction::Direction};
|
||||||
|
use database::{Trip, StopSchedule};
|
||||||
|
use log::*;
|
||||||
|
use dotenv::dotenv;
|
||||||
|
use std::{cmp::Ordering, collections::BTreeMap, sync::Arc};
|
||||||
|
use askama::Template;
|
||||||
|
use serde::{Serialize};
|
||||||
|
|
||||||
|
mod database;
|
||||||
|
|
||||||
|
struct AppState {
|
||||||
|
database: ::sqlx::postgres::PgPool
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async fn get_route_by_id(id: String, state: Data<Arc<AppState>>) -> ::anyhow::Result<libseptastic::route::Route> {
|
||||||
|
Ok(database::get_route_by_id(id, &mut state.database.begin().await?).await?)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#[derive(Debug, Serialize)]
|
||||||
|
pub struct TimetableStopRow {
|
||||||
|
pub stop_id: i64,
|
||||||
|
pub stop_name: String,
|
||||||
|
pub stop_sequence: i64,
|
||||||
|
pub times: Vec<Option<i64>>, // one per trip, None if trip doesn't stop
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Serialize)]
|
||||||
|
pub struct TimetableDirection {
|
||||||
|
pub direction: Direction,
|
||||||
|
pub trip_ids: Vec<String>, // column headers
|
||||||
|
pub rows: Vec<TimetableStopRow>, // one per unique stop
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn build_timetables(
|
||||||
|
directions: &[Direction],
|
||||||
|
trips: &[Trip],
|
||||||
|
) -> Vec<TimetableDirection> {
|
||||||
|
let mut results = Vec::new();
|
||||||
|
|
||||||
|
for direction in directions {
|
||||||
|
let mut direction_trips: Vec<&Trip> = trips
|
||||||
|
.iter()
|
||||||
|
.filter(|trip| trip.direction_id == direction.direction_id)
|
||||||
|
.collect();
|
||||||
|
direction_trips.sort_by_key(|trip| {
|
||||||
|
trip.schedule
|
||||||
|
.iter()
|
||||||
|
.filter_map(|s| Some(s.arrival_time))
|
||||||
|
.min()
|
||||||
|
.unwrap_or(i64::MAX)
|
||||||
|
});
|
||||||
|
|
||||||
|
let trip_ids: Vec<String> = direction_trips
|
||||||
|
.iter()
|
||||||
|
.map(|t| t.trip_id.clone())
|
||||||
|
.collect();
|
||||||
|
|
||||||
|
// Map of stop_id -> (stop_sequence, Vec<Option<arrival_time>>)
|
||||||
|
let mut stop_map: BTreeMap<i64, (i64, String, Vec<Option<i64>>)> = BTreeMap::new();
|
||||||
|
|
||||||
|
for (trip_index, trip) in direction_trips.iter().enumerate() {
|
||||||
|
for stop in &trip.schedule {
|
||||||
|
let entry = stop_map
|
||||||
|
.entry(stop.stop_id)
|
||||||
|
.or_insert((stop.stop_sequence, stop.stop_name.clone(), vec![None; direction_trips.len()]));
|
||||||
|
|
||||||
|
// If this stop_id appears in multiple trips with different sequences, keep the lowest
|
||||||
|
entry.0 = entry.0.max(stop.stop_sequence);
|
||||||
|
entry.1 = stop.stop_name.clone();
|
||||||
|
entry.2[trip_index] = Some(stop.arrival_time);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut rows: Vec<TimetableStopRow> = stop_map
|
||||||
|
.into_iter()
|
||||||
|
.map(|(stop_id, (stop_sequence, stop_name, times))| TimetableStopRow {
|
||||||
|
stop_id,
|
||||||
|
stop_sequence,
|
||||||
|
stop_name,
|
||||||
|
times,
|
||||||
|
})
|
||||||
|
.collect();
|
||||||
|
|
||||||
|
rows.sort_by(| a, b| {
|
||||||
|
if a.stop_sequence < b.stop_sequence {
|
||||||
|
Ordering::Less
|
||||||
|
} else {
|
||||||
|
Ordering::Greater
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
results.push(TimetableDirection {
|
||||||
|
direction: direction.clone(),
|
||||||
|
trip_ids,
|
||||||
|
rows,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
results
|
||||||
|
}
|
||||||
|
|
||||||
|
mod filters {
|
||||||
|
pub fn format_time(
|
||||||
|
seconds: &i64,
|
||||||
|
_: &dyn askama::Values,
|
||||||
|
) -> askama::Result<String> {
|
||||||
|
let total_minutes = seconds / 60;
|
||||||
|
let (hours, ampm) = {
|
||||||
|
let hrs = total_minutes / 60;
|
||||||
|
if hrs > 12 {
|
||||||
|
(hrs - 12, "PM")
|
||||||
|
} else {
|
||||||
|
(hrs, "AM")
|
||||||
|
}
|
||||||
|
};
|
||||||
|
let minutes = total_minutes % 60;
|
||||||
|
Ok(format!("{}:{:02} {}", hours, minutes, ampm))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(askama::Template)]
|
||||||
|
#[template(path = "layout.html")]
|
||||||
|
struct ContentTemplate<T: askama::Template> {
|
||||||
|
content: T,
|
||||||
|
page_title: Option<String>,
|
||||||
|
page_desc: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(askama::Template)]
|
||||||
|
#[template(path = "route.html")]
|
||||||
|
struct RouteTemplate {
|
||||||
|
route: libseptastic::route::Route,
|
||||||
|
directions: Vec<libseptastic::direction::Direction>,
|
||||||
|
timetables: Vec<TimetableDirection>
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(askama::Template)]
|
||||||
|
#[template(path = "routes.html")]
|
||||||
|
struct RoutesTemplate {
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(askama::Template)]
|
||||||
|
#[template(path = "index.html")]
|
||||||
|
struct IndexTemplate {
|
||||||
|
}
|
||||||
|
|
||||||
|
#[get("/routes")]
|
||||||
|
async fn get_routes() -> impl Responder {
|
||||||
|
|
||||||
|
HttpResponse::Ok().body(ContentTemplate {
|
||||||
|
page_title: None,
|
||||||
|
page_desc: None,
|
||||||
|
content: RoutesTemplate {}
|
||||||
|
}.render().unwrap())
|
||||||
|
}
|
||||||
|
|
||||||
|
#[get("/")]
|
||||||
|
async fn get_index() -> impl Responder {
|
||||||
|
|
||||||
|
HttpResponse::Ok().body(ContentTemplate {
|
||||||
|
page_title: None,
|
||||||
|
page_desc: None,
|
||||||
|
content: IndexTemplate {}
|
||||||
|
}.render().unwrap())
|
||||||
|
}
|
||||||
|
|
||||||
|
#[get("/route/{route_id}")]
|
||||||
|
async fn get_route(state: Data<Arc<AppState>>, path: web::Path<(String)>) -> impl Responder {
|
||||||
|
let route_id = path.into_inner();
|
||||||
|
let route_r = get_route_by_id(route_id.clone(), state.clone()).await;
|
||||||
|
let directions = get_direction_by_route_id(route_id.clone(), &mut state.database.begin().await.unwrap()).await.unwrap();
|
||||||
|
let trips = get_schedule_by_route_id(route_id, &mut state.database.begin().await.unwrap()).await.unwrap();
|
||||||
|
if let Ok(route) = route_r {
|
||||||
|
HttpResponse::Ok().body(ContentTemplate {
|
||||||
|
page_title: None,
|
||||||
|
page_desc: None,
|
||||||
|
content: RouteTemplate {
|
||||||
|
route,
|
||||||
|
directions: directions.clone(),
|
||||||
|
timetables: build_timetables(directions.as_slice(), trips.as_slice())
|
||||||
|
}
|
||||||
|
}.render().unwrap())
|
||||||
|
} else {
|
||||||
|
HttpResponse::InternalServerError().body("Error")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[get("/api/route/{route_id}")]
|
||||||
|
async fn api_get_route(state: Data<Arc<AppState>>, path: web::Path<(String)>) -> impl Responder {
|
||||||
|
let route_id = path.into_inner();
|
||||||
|
let route_r = get_route_by_id(route_id, state).await;
|
||||||
|
if let Ok(route) = route_r {
|
||||||
|
HttpResponse::Ok().json(route)
|
||||||
|
} else {
|
||||||
|
HttpResponse::InternalServerError().body("Error")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[get("/api/route/{route_id}/schedule")]
|
||||||
|
async fn api_get_schedule(state: Data<Arc<AppState>>, path: web::Path<(String)>) -> impl Responder {
|
||||||
|
let route_id = path.into_inner();
|
||||||
|
let route_r = get_schedule_by_route_id(route_id, &mut state.database.begin().await.unwrap()).await;
|
||||||
|
if let Ok(route) = route_r {
|
||||||
|
HttpResponse::Ok().json(route)
|
||||||
|
} else {
|
||||||
|
HttpResponse::InternalServerError().body("Error")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[get("/api/stop/{stop_id}/nta")]
|
||||||
|
async fn api_get_nta(state: Data<Arc<AppState>>, path: web::Path<(String)>) -> impl Responder {
|
||||||
|
let route_id = path.into_inner().split(',') .map(|s| s.parse::<i64>())
|
||||||
|
.collect::<Result<Vec<i64>, _>>().unwrap();
|
||||||
|
let route_r = get_nta_by_stop_id(route_id, chrono::Utc::now(), chrono::Utc::now() + TimeDelta::minutes(30), &mut state.database.begin().await.unwrap()).await;
|
||||||
|
if let Ok(route) = route_r {
|
||||||
|
HttpResponse::Ok().json(route)
|
||||||
|
} else {
|
||||||
|
HttpResponse::InternalServerError().body(format!("Error {:?}", route_r.err()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[actix_web::main]
|
||||||
|
async fn main() -> ::anyhow::Result<()> {
|
||||||
|
env_logger::init_from_env(Env::default().default_filter_or("septastic_api=info"));
|
||||||
|
dotenv().ok();
|
||||||
|
|
||||||
|
let version: &str = option_env!("CARGO_PKG_VERSION").expect("Expected package version");
|
||||||
|
info!("Starting SEPTASTIC Server v{} (commit: {})", version, "NONE");
|
||||||
|
|
||||||
|
info!("Connecting to postgres database");
|
||||||
|
|
||||||
|
let connection_string =
|
||||||
|
std::env::var("DB_CONNSTR").expect("Expected database connection string");
|
||||||
|
|
||||||
|
let pool = ::sqlx::postgres::PgPoolOptions::new()
|
||||||
|
.max_connections(5)
|
||||||
|
.connect(&connection_string)
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
let state = Arc::new(AppState {
|
||||||
|
database: pool
|
||||||
|
});
|
||||||
|
|
||||||
|
HttpServer::new(move || {
|
||||||
|
App::new()
|
||||||
|
.wrap(actix_cors::Cors::permissive())
|
||||||
|
.app_data(Data::new(state.clone()))
|
||||||
|
.service(api_get_route)
|
||||||
|
.service(api_get_schedule)
|
||||||
|
.service(api_get_nta)
|
||||||
|
.service(get_route)
|
||||||
|
.service(get_routes)
|
||||||
|
.service(get_index)
|
||||||
|
.service(actix_files::Files::new("/assets", "./assets"))
|
||||||
|
})
|
||||||
|
.bind(("0.0.0.0", 8080))?
|
||||||
|
.run()
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
13
api/templates/index.html
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<h1>SEPTASTIC!</h1>
|
||||||
|
<p><i>A fantastic way to ride SEPTA</i></p>
|
||||||
|
|
||||||
|
<p style="margin-top: 25px;">
|
||||||
|
SEPTASTIC is a website and (a soon to be) mobile app. Its purpose is to provide
|
||||||
|
information about how to ride SEPTA (and connecting transit authorities) in a
|
||||||
|
quick and information-rich manner.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p style="margin-top: 25px; margin-bottom: 25px;">
|
||||||
|
Currently, all this website has is <a href="/routes">timetables for every
|
||||||
|
SEPTA route</a>. More to come soon!
|
||||||
|
</p>
|
58
api/templates/layout.html
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
|
||||||
|
{% if let Some(title) = page_title %}
|
||||||
|
<title>{{ title }}</title>
|
||||||
|
{% else %}
|
||||||
|
<title>SEPTASTIC</title>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if let Some(desc) = page_desc %}
|
||||||
|
<meta name="{{ desc }}" />
|
||||||
|
{% else %}
|
||||||
|
<meta name="SEPTASTIC" />
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="/assets/style.css">
|
||||||
|
<link rel="icon" type="image/x-icon" href="/assets/favicon.ico">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
</head>
|
||||||
|
<style>
|
||||||
|
.silverliner-svg {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
height: 200px; /* Fixed height matching the viewBox */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<body>
|
||||||
|
<div class="body">
|
||||||
|
<nav>
|
||||||
|
<div style="display: flex; justify-content: space-between;">
|
||||||
|
<div>
|
||||||
|
<a class="nav-link" href="/">[ Home ]</a>
|
||||||
|
<a class="nav-link" href="/routes">[ Routes ]</a>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
<hr/>
|
||||||
|
|
||||||
|
{{ content|safe }}
|
||||||
|
|
||||||
|
<footer>
|
||||||
|
<hr />
|
||||||
|
<div style="display: flex; justify-content: space-between;">
|
||||||
|
<div>
|
||||||
|
<p style="margin-bottom: 0px; margin-top:0px;"><b>SEPTASTIC!</b></p>
|
||||||
|
<p style="margin-bottom: 0px;margin-top: 0px;">
|
||||||
|
<small>Copyright © <a href="https://nickorlow.com">Nicholas Orlowsky</a> 2025</small>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</footer>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
111
api/templates/route.html
Normal file
|
@ -0,0 +1,111 @@
|
||||||
|
{%- import "route_symbol.html" as scope -%}
|
||||||
|
<style>
|
||||||
|
.train-direction-table {
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
|
font-family: sans-serif;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.train-direction-table th,
|
||||||
|
.train-direction-table td {
|
||||||
|
border: 1px solid #000;
|
||||||
|
padding: 4px 8px;
|
||||||
|
text-align: left;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.train-direction-table th {
|
||||||
|
background-color: #f0f0f0;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.highlight-row td,
|
||||||
|
.highlight-row th {
|
||||||
|
background-color: #d0ebff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.highlight-col {
|
||||||
|
background-color: #d0ebff !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
|
document.querySelectorAll(".train-direction-table").forEach((table) => {
|
||||||
|
table.addEventListener("click", (e) => {
|
||||||
|
const cell = e.target.closest("td, th");
|
||||||
|
if (!cell) return;
|
||||||
|
|
||||||
|
// Clear previous highlights
|
||||||
|
table.querySelectorAll("tr").forEach(row => row.classList.remove("highlight-row"));
|
||||||
|
table.querySelectorAll("td, th").forEach(c => c.classList.remove("highlight-col"));
|
||||||
|
|
||||||
|
const row = cell.parentNode;
|
||||||
|
const colIndex = Array.from(cell.parentNode.children).indexOf(cell);
|
||||||
|
|
||||||
|
// If it's the first column (row header)
|
||||||
|
if (cell.cellIndex === 0 && cell.tagName === "TD") {
|
||||||
|
row.classList.add("highlight-row");
|
||||||
|
}
|
||||||
|
// If it's a column header
|
||||||
|
else if (row.parentNode.tagName === "THEAD") {
|
||||||
|
table.querySelectorAll("tr").forEach(r => {
|
||||||
|
const cell = r.children[colIndex];
|
||||||
|
if (cell) cell.classList.add("highlight-col");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// If it's a center cell
|
||||||
|
else {
|
||||||
|
row.classList.add("highlight-row");
|
||||||
|
table.querySelectorAll("tr").forEach(r => {
|
||||||
|
const cell = r.children[colIndex];
|
||||||
|
if (cell) cell.classList.add("highlight-col");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div style="background-color: #ff0000; color: #ffffff; padding: 15px; margin-bottom: 15px; margin-top: 15px;">
|
||||||
|
This website is not run by SEPTA. As such, schedules may not be
|
||||||
|
completely accurate.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="display: flex; align-items: center;">
|
||||||
|
{% call scope::route_symbol(route) %}
|
||||||
|
<h1 style="margin-left: 15px;">{{ route.name }}</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% for timetable in timetables %}
|
||||||
|
<h2>{{ timetable.direction.direction | capitalize }} to {{ timetable.direction.direction_destination }}</h2>
|
||||||
|
<div class="tscroll">
|
||||||
|
<table class="train-direction-table" style="margin-top: 5px;">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Stop</th>
|
||||||
|
{% for trip_id in timetable.trip_ids %}
|
||||||
|
<th>{{ trip_id }}</th>
|
||||||
|
{% endfor %}
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for row in timetable.rows %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ row.stop_name }}</td>
|
||||||
|
{% for time in row.times %}
|
||||||
|
<td>
|
||||||
|
{% if let Some(t) = time %}
|
||||||
|
{{ t | format_time }}
|
||||||
|
{% else %}
|
||||||
|
--
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
{% endfor %}
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
19
api/templates/route_symbol.html
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{% macro route_symbol(route) %}
|
||||||
|
{% match route.route_type %}
|
||||||
|
{% when libseptastic::route::RouteType::Trolley | libseptastic::route::RouteType::SubwayElevated %}
|
||||||
|
<div class="metro-container bg-{{ route.id }}">
|
||||||
|
{{ route.id }}
|
||||||
|
</div>
|
||||||
|
{% endwhen %}
|
||||||
|
{% when libseptastic::route::RouteType::RegionalRail %}
|
||||||
|
<div class="rr-container">
|
||||||
|
{{ route.id }}
|
||||||
|
</div>
|
||||||
|
{% endwhen %}
|
||||||
|
{% when libseptastic::route::RouteType::Bus | libseptastic::route::RouteType::TracklessTrolley %}
|
||||||
|
<div class="bus-container">
|
||||||
|
{{ route.id }}
|
||||||
|
</div>
|
||||||
|
{% endwhen %}
|
||||||
|
{% endmatch %}
|
||||||
|
{% endmacro %}
|
83
api/templates/routes.html
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
<h1>Routes</h1>
|
||||||
|
|
||||||
|
<p>Click on a route to see details and a schedule. Schedules in prevailing local time.</p>
|
||||||
|
|
||||||
|
<fieldset>
|
||||||
|
<legend><h2>Regional Rail</h2></legend>
|
||||||
|
<p style="margin-top: 10px; margin-bottom: 10px;">For infrequent rail service to suburban locations</p>
|
||||||
|
<!--<h3 class="line-link">[ Pennsy ]</h3>-->
|
||||||
|
<p class="line-link"><a href="/route/TRE">[ <b>TRE:</b> Trenton (NJT to New York) ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/PAO">[ <b>PAO:</b> Paoli/Thorndale ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/CYN">[ <b>CYN:</b> Cynwyd ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/AIR">[ <b>AIR:</b> Airport ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/WIL">[ <b>WIL:</b> Wilmington/Newark ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/CHW">[ <b>CHW:</b> Chestnut Hill West ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/WAW">[ <b>WAW:</b> Media/Wawa ]</a></p>
|
||||||
|
|
||||||
|
<!--<h3 class="line-link">[ Reading ]</h3>-->
|
||||||
|
<p class="line-link"><a href="/route/LAN">[ <b>LAN:</b> Lansdale/Doylestown ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/NOR">[ <b>NOR:</b> Manayunk/Norristown ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/CHE">[ <b>CHE:</b> Chestnut Hill East ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/FOX">[ <b>FOX:</b> Fox Chase ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/WTF">[ <b>WTR:</b> West Trenton ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/WAR">[ <b>WAR:</b> Warminster ]</a></p>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset>
|
||||||
|
<legend><h2>Metro</h2></legend>
|
||||||
|
<p style="margin-top: 10px; margin-bottom: 10px;">For frequent rail service within Philadelphia and suburban locations</p>
|
||||||
|
<p class="lines-label" style="font-weight: bold;">[ Subway/Elevated ]</p>
|
||||||
|
<p class="line-link"><a href="/route/B1">[ <b>B1:</b> Broad Street Line Local ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/B2">[ <b>B2:</b> Broad Street Line Express ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/B3">[ <b>B3:</b> Broad Ridge Spur ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/L1">[ <b>L1:</b> Market-Frankford Line ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/S1">[ <b>S1:</b> Norristown-Airport Line ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/S2">[ <b>S2:</b> Media-Chestnut Hill Line ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/S3">[ <b>S3:</b> Paoli-Fox Chase Line ]</a></p>
|
||||||
|
<p class="lines-label" style="font-weight: bold;">[ Urban Trolley ]</p>
|
||||||
|
<p class="line-link"><a href="/route/T1">[ <b>T1:</b> Lancaster Avenue Trolley ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/T2">[ <b>T2:</b> Baltimore Avenue Trolley ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/T3">[ <b>T3:</b> Chester Avenue Trolley ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/T4">[ <b>T4:</b> Woodland Avenue Trolley ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/T5">[ <b>T5:</b> Elmwood Avenue Trolley ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/G1">[ <b>G1:</b> Girard Avenue Trolley ]</a></p>
|
||||||
|
<p class="lines-label" style="font-weight: bold;">[ Suburban Trolley ]</p>
|
||||||
|
<p class="line-link"><a href="/route/D1">[ <b>D1:</b> Media Line ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/D2">[ <b>D2:</b> Sharon Hill Line ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/M1">[ <b>M1:</b> Norristown High Speed Line ]</a></p>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset>
|
||||||
|
<legend><h2>Bus</h2></legend>
|
||||||
|
<p style="margin-top: 10px; margin-bottom: 10px;">For service of varying frequency within SEPTA's entire service area</p>
|
||||||
|
<p class="lines-label" style="font-weight: bold;">[ Subway/Elevated ]</p>
|
||||||
|
<p class="line-link"><a href="/route/B1">[ <b>B1:</b> Broad Street Line Local ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/B2">[ <b>B2:</b> Broad Street Line Express ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/B3">[ <b>B3:</b> Broad Ridge Spur ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/L1">[ <b>L1:</b> Market-Frankford Line ]</a></p>
|
||||||
|
<p class="lines-label" style="font-weight: bold;">[ Urban Trolley ]</p>
|
||||||
|
<p class="line-link"><a href="/route/T1">[ <b>T1:</b> Lancaster Avenue Trolley ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/T2">[ <b>T2:</b> Baltimore Avenue Trolley ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/T3">[ <b>T3:</b> Chester Avenue Trolley ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/T4">[ <b>T4:</b> Woodland Avenue Trolley ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/T5">[ <b>T5:</b> Elmwood Avenue Trolley ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/G1">[ <b>G1:</b> Girard Avenue Trolley ]</a></p>
|
||||||
|
<p class="lines-label" style="font-weight: bold;">[ Suburban Trolley ]</p>
|
||||||
|
<p class="line-link"><a href="/route/D1">[ <b>D1:</b> Media Line ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/D2">[ <b>D2:</b> Sharon Hill Line ]</a></p>
|
||||||
|
<p class="line-link"><a href="/route/M1">[ <b>M1:</b> Norristown High Speed Line ]</a></p>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.line-link, .lines-label {
|
||||||
|
white-space: pre;
|
||||||
|
margin-top: 3px;
|
||||||
|
margin-bottom: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lines-label {
|
||||||
|
color: #ffffff;
|
||||||
|
background-color: #000000;
|
||||||
|
width: max-content;
|
||||||
|
}
|
||||||
|
</style>
|
57
compile.sh
|
@ -1,57 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Check if the src directory exists
|
|
||||||
if [ ! -d "src" ]; then
|
|
||||||
echo "Error: 'src' directory not found."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create the out directory if it doesn't exist
|
|
||||||
mkdir -p "out"
|
|
||||||
|
|
||||||
# Define the template file and search pattern
|
|
||||||
template_file="src/structure.template.html"
|
|
||||||
filler_pattern="src/**/*.filler.html"
|
|
||||||
|
|
||||||
# Function to process the filler file and insert its content into the structure file
|
|
||||||
process_filler_file() {
|
|
||||||
local filler_file="$1"
|
|
||||||
local output_file="$2"
|
|
||||||
|
|
||||||
# Read the contents of the template file
|
|
||||||
template_content=$(<"$template_file")
|
|
||||||
|
|
||||||
# Read the contents of the filler file
|
|
||||||
filler_content=$(<"$filler_file")
|
|
||||||
filler_content=$(echo "$filler_content" | sed "s/\&/\\\&/g")
|
|
||||||
|
|
||||||
# Replace "{{ body_area }}" in the template with filler content
|
|
||||||
modified_content="${template_content/\{\{ body_area \}\}/$filler_content}"
|
|
||||||
|
|
||||||
# Write the modified content to the output file in the 'out' directory
|
|
||||||
echo "$modified_content" > "out/$output_file"
|
|
||||||
|
|
||||||
echo "Created: out/$output_file"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Loop through each filler file in the src directory and its subdirectories
|
|
||||||
shopt -s globstar
|
|
||||||
for filler_file in $filler_pattern; do
|
|
||||||
# Check if the filler file exists
|
|
||||||
if [ ! -e "$filler_file" ]; then
|
|
||||||
echo "Error: $filler_file not found."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Get the relative path of the filler file (removing the "src/" prefix)
|
|
||||||
relative_path="${filler_file#src/}"
|
|
||||||
|
|
||||||
# Extract the filename (excluding the extension)
|
|
||||||
filename="${relative_path%.filler.html}"
|
|
||||||
|
|
||||||
# Create the output file name in the 'out' directory
|
|
||||||
output_file="${filename}.html"
|
|
||||||
|
|
||||||
# Process the filler file and insert its content into the structure file
|
|
||||||
process_filler_file "$filler_file" "$output_file"
|
|
||||||
done
|
|
1
data_loader
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit f7e9e7903b55ed5353b0ea3946dcb4b131557468
|
14
docker-compose.yml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
services:
|
||||||
|
pgsql:
|
||||||
|
image: postgres:14.1-alpine
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
- POSTGRES_USER=adminis
|
||||||
|
- POSTGRES_PASSWORD=password
|
||||||
|
ports:
|
||||||
|
- '5432:5432'
|
||||||
|
volumes:
|
||||||
|
- db:/var/lib/postgresql/data
|
||||||
|
volumes:
|
||||||
|
db:
|
||||||
|
driver: local
|
1
example.env
Normal file
|
@ -0,0 +1 @@
|
||||||
|
DB_CONNSTR=
|
1
libseptastic/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
target/
|
1585
libseptastic/Cargo.lock
generated
Normal file
9
libseptastic/Cargo.toml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
[package]
|
||||||
|
name = "libseptastic"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2024"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
serde = "1.0.219"
|
||||||
|
serde_json = "1.0.140"
|
||||||
|
sqlx = "0.8.6"
|
37
libseptastic/src/direction.rs
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
#[derive(sqlx::Type, Serialize, Deserialize, PartialEq, Debug, Clone)]
|
||||||
|
#[sqlx(type_name = "septa_direction_type", rename_all = "snake_case")]
|
||||||
|
pub enum CardinalDirection {
|
||||||
|
Northbound,
|
||||||
|
Southbound,
|
||||||
|
Eastbound,
|
||||||
|
Westbound,
|
||||||
|
Inbound,
|
||||||
|
Outbound,
|
||||||
|
Loop
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(::sqlx::Decode, Serialize, Deserialize, Debug, Clone)]
|
||||||
|
pub struct Direction {
|
||||||
|
pub route_id: String,
|
||||||
|
pub direction_id: i64,
|
||||||
|
pub direction: CardinalDirection,
|
||||||
|
pub direction_destination: String
|
||||||
|
}
|
||||||
|
|
||||||
|
impl std::fmt::Display for CardinalDirection {
|
||||||
|
fn fmt (&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
let output = match self {
|
||||||
|
CardinalDirection::Northbound => "Northbound",
|
||||||
|
CardinalDirection::Southbound => "Southbound",
|
||||||
|
CardinalDirection::Eastbound => "Eastbound",
|
||||||
|
CardinalDirection::Westbound => "Westbound",
|
||||||
|
CardinalDirection::Inbound => "Inbound",
|
||||||
|
CardinalDirection::Outbound => "Outbound",
|
||||||
|
CardinalDirection::Loop => "Loop"
|
||||||
|
};
|
||||||
|
std::write!(f, "{}", output)
|
||||||
|
}
|
||||||
|
}
|
7
libseptastic/src/lib.rs
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
pub mod route;
|
||||||
|
pub mod stop;
|
||||||
|
pub mod route_stop;
|
||||||
|
pub mod stop_schedule;
|
||||||
|
pub mod schedule_day;
|
||||||
|
pub mod direction;
|
||||||
|
pub mod ridership;
|
21
libseptastic/src/ridership.rs
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
use crate::direction::CardinalDirection;
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
pub struct Ridership {
|
||||||
|
pub route_id: String,
|
||||||
|
pub stop_id: i64,
|
||||||
|
pub direction: CardinalDirection,
|
||||||
|
pub exp_ons: i64,
|
||||||
|
pub exp_offs: i64,
|
||||||
|
pub ons: i64,
|
||||||
|
pub offs: i64,
|
||||||
|
pub year: i64,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
pub struct LineRidership {
|
||||||
|
pub route_id: String,
|
||||||
|
pub unlinked_trips: i64
|
||||||
|
}
|
20
libseptastic/src/route.rs
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
#[derive(sqlx::Type, Serialize, Deserialize, PartialEq, Debug, Clone)]
|
||||||
|
#[sqlx(type_name = "septa_route_type", rename_all = "snake_case")]
|
||||||
|
pub enum RouteType {
|
||||||
|
Trolley,
|
||||||
|
SubwayElevated,
|
||||||
|
RegionalRail,
|
||||||
|
Bus,
|
||||||
|
TracklessTrolley
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(::sqlx::FromRow, Serialize, Deserialize, Debug, Clone)]
|
||||||
|
pub struct Route {
|
||||||
|
pub name: String,
|
||||||
|
pub short_name: String,
|
||||||
|
pub color_hex: String,
|
||||||
|
pub route_type: RouteType,
|
||||||
|
pub id: String
|
||||||
|
}
|
7
libseptastic/src/route_stop.rs
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
|
pub struct RouteStop {
|
||||||
|
pub route_id: String,
|
||||||
|
pub stop_id: i64,
|
||||||
|
pub direction_id: i64,
|
||||||
|
pub stop_sequence: i64
|
||||||
|
}
|
5
libseptastic/src/schedule_day.rs
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
|
pub struct ScheduleDay {
|
||||||
|
pub date: String,
|
||||||
|
pub service_id: String
|
||||||
|
}
|
16
libseptastic/src/stop.rs
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
#[derive(sqlx::Type, PartialEq, Debug, Clone)]
|
||||||
|
#[sqlx(type_name = "septa_stop_type", rename_all = "snake_case")]
|
||||||
|
pub enum StopType {
|
||||||
|
FarSide,
|
||||||
|
MiddleBlockNearSide,
|
||||||
|
Normal
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
|
pub struct Stop {
|
||||||
|
pub id: i64,
|
||||||
|
pub name: String,
|
||||||
|
pub lat: f64,
|
||||||
|
pub lng: f64,
|
||||||
|
pub stop_type: StopType
|
||||||
|
}
|
20
libseptastic/src/stop_schedule.rs
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
pub struct StopSchedule {
|
||||||
|
pub route_id: String,
|
||||||
|
pub trip_id: String,
|
||||||
|
pub service_id: String,
|
||||||
|
pub direction_id: i64,
|
||||||
|
pub arrival_time: i64,
|
||||||
|
pub stop_id: i64,
|
||||||
|
pub stop_sequence: i64
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
pub struct Trip {
|
||||||
|
pub route_id: String,
|
||||||
|
pub trip_id: String,
|
||||||
|
pub direction_id: i64,
|
||||||
|
pub schedule: Vec<StopSchedule>
|
||||||
|
}
|
Before Width: | Height: | Size: 197 KiB |
Before Width: | Height: | Size: 438 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 194 KiB |
|
@ -1,25 +0,0 @@
|
||||||
<body style="width: 100%; height: 100%; background-color: #FF2222">
|
|
||||||
<div style="width: 100%; height: 100%; display: flex; justify-content: center; align-items: center;">
|
|
||||||
<div style="padding: 20px; min-height: 500px; max-width: 500px; background-color: white;">
|
|
||||||
<center>
|
|
||||||
<div>
|
|
||||||
<img src="./april-fools-images/nypd.png" width=200/>
|
|
||||||
<img src="./april-fools-images/amtrak.png" width=200/>
|
|
||||||
<img src="./april-fools-images/septa.png" width=200/>
|
|
||||||
<img src="./april-fools-images/uspis.png" width=200/>
|
|
||||||
</div>
|
|
||||||
<h1>THIS WEBSITE HAS BEEN SEIZED</h1>
|
|
||||||
<p>
|
|
||||||
This domain name has been seized by the <b>Southeastern Pennsylvania Transportation Authority (SEPTA)
|
|
||||||
Police Department</b> pursuant to a seizure warrant issued by the United States Supreme Court
|
|
||||||
under the authority of 18 U.S.C. § 918 and 2323.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<i>
|
|
||||||
(April fools! <a href="./index.html?af=false">Continue to my website</a>)
|
|
||||||
</i>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
Before Width: | Height: | Size: 252 KiB |
Before Width: | Height: | Size: 249 KiB |
Before Width: | Height: | Size: 1.2 MiB |
Before Width: | Height: | Size: 622 KiB |
Before Width: | Height: | Size: 3.4 MiB |
Before Width: | Height: | Size: 21 MiB |
|
@ -1,37 +0,0 @@
|
||||||
<head>
|
|
||||||
<title>Nicholas Orlowsky</title>
|
|
||||||
<link rel="stylesheet" href="/style.css">
|
|
||||||
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<nav>
|
|
||||||
<a href="/">[ Home ]</a>
|
|
||||||
<a href="/blog.html">[ Blog ]</a>
|
|
||||||
<a href="/projects.html">[ Projects ]</a>
|
|
||||||
<a href="/extra.html">[ Extra ]</a>
|
|
||||||
<hr/>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h1 style="margin-bottom: 0px;">Blog</h1>
|
|
||||||
<p style="margin-top: 0px;">A collection of my thoughts, some of them may be interesting</p>
|
|
||||||
<p><a href="./blogs/fpga-fun.html">[ FPGA Fun (CHIP-8 in hardware) ]</a> - April 20th, 2024</p>
|
|
||||||
<p><a href="./blogs/nws-postmortem-11-8-23.html">[ NWS Postmortem 11/08/23 ]</a> - November 16th, 2023</p>
|
|
||||||
<p><a href="./blogs/side-project-10-20-23.html">[ Side Project Log 10/20/23 ]</a> - October 20th, 2023</p>
|
|
||||||
<p><a href="./blogs/side-project-8-15-23.html">[ Side Project Log 8/15/23 ]</a> - August 15th, 2023</p>
|
|
||||||
<p><a href="./blogs/side-project-8-8-23.html">[ Side Project Log 8/08/23 ]</a> - August 8th, 2023</p>
|
|
||||||
<p><a href="./blogs/side-project-7-12-23.html">[ Side Project Log 7/12/23 ]</a> - July 12th, 2023</p>
|
|
||||||
<p><a href="./blogs/side-project-4-29-23.html">[ Side Project Log 4/29/23 ]</a> - April 29th, 2023</p>
|
|
||||||
<p><a href="./blogs/side-project-3-27-23.html">[ Side Project Log 3/27/23 ]</a> - March 27th, 2023</p>
|
|
||||||
<p><a href="./blogs/side-project-3-20-23.html">[ Side Project Log 3/20/23 ]</a> - March 20th, 2023</p>
|
|
||||||
<p><a href="./blogs/spring-break-2023.html">[ Spring Break 2023 ]</a> - January 20th, 2023</p>
|
|
||||||
<p><a href="./blogs/doing-c-assignments-in-csharp.html">[ Doing C assignments in C# ]</a> - March 18th, 2022</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<footer>
|
|
||||||
<hr />
|
|
||||||
<p style="margin-bottom: 0px;">Copyright © Nicholas Orlowsky 2025</p>
|
|
||||||
<p style="margin-top: 0px; margin-bottom: 0px;">Hosting provided by <a href="https://nws.nickorlow.com">NWS</a></p>
|
|
||||||
<p style="margin-top: 0px;">Powered by <a href="https://github.com/nickorlow/anthracite">Anthracite Web Server</a></p>
|
|
||||||
</footer>
|
|
||||||
</body>
|
|
|
@ -1,79 +0,0 @@
|
||||||
<head>
|
|
||||||
<title>Nicholas Orlowsky</title>
|
|
||||||
<link rel="stylesheet" href="/style.css">
|
|
||||||
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<nav>
|
|
||||||
<a href="/">[ Home ]</a>
|
|
||||||
<a href="/blog.html">[ Blog ]</a>
|
|
||||||
<a href="/projects.html">[ Projects ]</a>
|
|
||||||
<a href="/extra.html">[ Extra ]</a>
|
|
||||||
<hr/>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<h1>Doing C assignments in C#</h1>
|
|
||||||
<p>Thanks to Arpan Dhatt for doing most of the work on this (his blog here: <a href="https://arpan.one/posts/messing-with-gradescope/">https://arpan.one/posts/messing-with-gradescope/</a>)</p>
|
|
||||||
<p>At the end, he made this comment:</p>
|
|
||||||
<blockquote>
|
|
||||||
<p>And so, that's the end of this post. To whom it may concern, don't try doing your C assignment in C# (you know who you are).</p>
|
|
||||||
</blockquote>
|
|
||||||
<p>The reason for this comment (besides the fact that I talk about C# a lot) is due to the fact that C# requires a runtime to be installed for it to work. This is because C# does not compile to native bytecode but rather compiles to an intermediary language (dubbed CIL by Microsoft) and is then translated 'Just In Time' by the runtime. </p>
|
|
||||||
<p>This makes running assignments in a docker container where the runtime is not already installed considerably hard. One option we have is that we could just include the runtime in our submission. Sounds easy, right? Well it would be non-trivial to do but due to the fact that the .NET runtime is very large, I wouldn't consider this a good idea (Not to mention it's super boring). </p>
|
|
||||||
<p>The better solution is to use .NET's (experimental) AOT compilation feature (formerly called CoreRT). C# has had a number of attempts at an AOT compiler such as :</p>
|
|
||||||
<ul>
|
|
||||||
<li><a href="https://www.mono-project.com/docs/advanced/aot/">AOT</a> by Mono</li>
|
|
||||||
<li>LLD2CPP built by Unity</li>
|
|
||||||
<li><a href="https://docs.microsoft.com/en-us/dotnet/core/deploying/ready-to-run">Ready2Run</a> by Microsoft</li>
|
|
||||||
</ul>
|
|
||||||
<p>We'll be using the official Ready2Run AOT compilation built by Microsoft. In order to use it, all you have to do is add the following to your <code>nuget.config</code>:</p>
|
|
||||||
<pre><code class="lang-xml"><<span class="hljs-keyword">add</span> key=<span class="hljs-string">"nuget.org"</span> <span class="hljs-keyword">value</span>=<span class="hljs-string">"https://api.nuget.org/v3/index.json"</span> protocolVersion=<span class="hljs-string">"3"</span> />
|
|
||||||
</code></pre>
|
|
||||||
<p>and then install the package: <code>Microsoft.DotNet.ILCompiler</code>. After doing that if you run the command: <code>dotnet publish -r [Runtime] -c [Config]</code> and after waiting a considerable amount of time, you'll have a full-fledged C# application compiled directly to your target runtime's bytecode!</p>
|
|
||||||
<p>Compiling my simple Hello, Wold test to linux-x64 (<code>dotnet publish -r linux-x64 -c Release</code>) and adding it to my project files should let me run it using the same method Arpan used in his blog.</p>
|
|
||||||
<p>After doing that, we can follow the instructions followed by Arpan and viola! C# runs on Gradescope!</p>
|
|
||||||
<p>I don't recommend this but it was fun to do and I needed stuff to write in a blog. </p>
|
|
||||||
<h2 id="other-interesting-low-level-c-net-features">Other Interesting (Low Level) C#/.NET Features</h2>
|
|
||||||
<p>C# actually has many lower level features people don't expect it to have. Some of these include pointers and direct memory management. Pointers can be enabled by encasing your code in an unsafe code block.</p>
|
|
||||||
<p>Example (Written by <a href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/unsafe-code">Microsoft</a>)</p>
|
|
||||||
<pre><code class="lang-csharp">
|
|
||||||
<span class="hljs-comment">// Normal pointer to an object.</span>
|
|
||||||
<span class="hljs-keyword">int</span>[] a = <span class="hljs-keyword">new</span> <span class="hljs-keyword">int</span>[<span class="hljs-number">5</span>] { <span class="hljs-number">10</span>, <span class="hljs-number">20</span>, <span class="hljs-number">30</span>, <span class="hljs-number">40</span>, <span class="hljs-number">50</span> };
|
|
||||||
<span class="hljs-comment">// Must be in unsafe code to use interior pointers.</span>
|
|
||||||
unsafe
|
|
||||||
{
|
|
||||||
<span class="hljs-comment">// Must pin object on heap so that it doesn't move while using interior pointers.</span>
|
|
||||||
fixed (<span class="hljs-keyword">int</span>* p = &a[<span class="hljs-number">0</span>])
|
|
||||||
{
|
|
||||||
<span class="hljs-comment">// p is pinned as well as object, so create another pointer to show incrementing it.</span>
|
|
||||||
<span class="hljs-keyword">int</span>* p2 = p;
|
|
||||||
<span class="hljs-built_in">Console</span>.WriteLine(*p2);
|
|
||||||
<span class="hljs-comment">// Incrementing p2 bumps the pointer by four bytes due to its type ...</span>
|
|
||||||
p2 += <span class="hljs-number">1</span>;
|
|
||||||
<span class="hljs-built_in">Console</span>.WriteLine(*p2);
|
|
||||||
p2 += <span class="hljs-number">1</span>;
|
|
||||||
<span class="hljs-built_in">Console</span>.WriteLine(*p2);
|
|
||||||
<span class="hljs-built_in">Console</span>.WriteLine(<span class="hljs-string">"--------"</span>);
|
|
||||||
<span class="hljs-built_in">Console</span>.WriteLine(*p);
|
|
||||||
<span class="hljs-comment">// Dereferencing p and incrementing changes the value of a[0] ...</span>
|
|
||||||
*p += <span class="hljs-number">1</span>;
|
|
||||||
<span class="hljs-built_in">Console</span>.WriteLine(*p);
|
|
||||||
*p += <span class="hljs-number">1</span>;
|
|
||||||
<span class="hljs-built_in">Console</span>.WriteLine(*p);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</code></pre>
|
|
||||||
<p>In .NET 6, the <code>NativeMemory</code> class was introduced which you can read about <a href="https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.nativememory.alloc?view=net-6.0">here</a>. It allows for malloc-like memory allocation and freeing which can be important for high-performance workloads.</p>
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/dark.min.css">
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
|
|
||||||
<script>hljs.highlightAll();</script>
|
|
||||||
|
|
||||||
<footer>
|
|
||||||
<hr />
|
|
||||||
<p style="margin-bottom: 0px;">Copyright © Nicholas Orlowsky 2025</p>
|
|
||||||
<p style="margin-top: 0px; margin-bottom: 0px;">Hosting provided by <a href="https://nws.nickorlow.com">NWS</a></p>
|
|
||||||
<p style="margin-top: 0px;">Powered by <a href="https://github.com/nickorlow/anthracite">Anthracite Web Server</a></p>
|
|
||||||
</footer>
|
|
||||||
</body>
|
|
|
@ -1,111 +0,0 @@
|
||||||
<head>
|
|
||||||
<title>Nicholas Orlowsky</title>
|
|
||||||
<link rel="stylesheet" href="/style.css">
|
|
||||||
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<nav>
|
|
||||||
<a href="/">[ Home ]</a>
|
|
||||||
<a href="/blog.html">[ Blog ]</a>
|
|
||||||
<a href="/projects.html">[ Projects ]</a>
|
|
||||||
<a href="/extra.html">[ Extra ]</a>
|
|
||||||
<hr/>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<h1>NWS Incident Postmortem 11/08/2023</h1>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
On November 8th, 2023 at approximately 09:47 UTC, NWS suffered
|
|
||||||
a complete outage. This outage resulted in the downtime of all
|
|
||||||
services hosted on NWS and the downtime of the NWS Management
|
|
||||||
Engine and the NWS dashboard.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
The incident lasted 38 minutes after which it was automatically
|
|
||||||
resolved and all services were restored. This is NWS' first
|
|
||||||
outage event of 2023.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2>Cause</h2>
|
|
||||||
<p>
|
|
||||||
NWS utilizes several tactics to ensure uptime. A component of
|
|
||||||
this is load balancing and failover. This service is currently
|
|
||||||
provided by Cloudflare at the DNS level. Cloudflare sends
|
|
||||||
health check requests to NWS servers at specified intervals. If
|
|
||||||
it detects that one of the servers is down, it will remove the
|
|
||||||
A record from entry.nws.nickorlow.com for that server (this domain
|
|
||||||
is where all services on NWS direct their traffic via a
|
|
||||||
CNAME).
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
At around 09:47 UTC, Cloudflare detected that our servers in
|
|
||||||
Texas (Austin and Hill Country) were down. It did not detect an
|
|
||||||
error, but rather an HTTP timeout. This is an indication that the
|
|
||||||
server may have lost network connectivity. When Cloudflare detected that the
|
|
||||||
servers were down, it removed their A records from the
|
|
||||||
entry.nws.nickorlow.com domain. Since NWS Pennsylvania servers
|
|
||||||
have been undergoing maintenance since August 2023, this left no
|
|
||||||
servers able to serve requests routed to entry.nws.nickorlow.com,
|
|
||||||
resulting in the outage.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
NWS utilizes UptimeRobot for monitoring the uptime statistics of
|
|
||||||
services on NWS and NWS servers. This is the source of the
|
|
||||||
statistics shown on the NWS status page.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
UptimeRobot did not detect either of the Texas NWS servers as being
|
|
||||||
offline for the duration of the outage. This is odd, as UptimeRobot
|
|
||||||
and Cloudflare did not agree on the status of NWS servers. Logs
|
|
||||||
on NWS servers showed that requests from UptimeRobot were being
|
|
||||||
served while no requests from Cloudflare were shown in the logs.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
No firewall rules existed that could have blocked the healthcheck traffic from Cloudflare
|
|
||||||
for either of the NWS servers. There was no other configuration
|
|
||||||
found that would have blocked these requests. As these servers
|
|
||||||
are on different networks inside different buildings in different
|
|
||||||
parts of Texas, their networking equipment is entirely separate.
|
|
||||||
This rules out any failure of networking equipment owned
|
|
||||||
by NWS. This leads us to believe that the issue may have been
|
|
||||||
caused due to an internet traffic anomaly, although we are currently
|
|
||||||
unable to confirm that this is the cause of the issue.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
This is being actively investigated to find a more concrete root
|
|
||||||
cause. This postmortem will be updated if any new information is
|
|
||||||
found.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
A similar event occurred on November 12th, 2023 lasting for 2 seconds.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2>Fix</h2>
|
|
||||||
<p>
|
|
||||||
The common factor between both of these servers is that they both use
|
|
||||||
Spectrum for their ISP and that they are located near Austin, Texas.
|
|
||||||
The Pennsylvania server maintenance will be expedited so that we have
|
|
||||||
servers online that operate with no commonalities.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
NWS will also investigate other methods of failover and load
|
|
||||||
balancing.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>Last updated on November 16th, 2023</p>
|
|
||||||
|
|
||||||
<footer>
|
|
||||||
<hr />
|
|
||||||
<p style="margin-bottom: 0px;">Copyright © Nicholas Orlowsky 2025</p>
|
|
||||||
<p style="margin-top: 0px; margin-bottom: 0px;">Hosting provided by <a href="https://nws.nickorlow.com">NWS</a></p>
|
|
||||||
<p style="margin-top: 0px;">Powered by <a href="https://github.com/nickorlow/anthracite">Anthracite Web Server</a></p>
|
|
||||||
</footer>
|
|
||||||
</body>
|
|
|
@ -1,121 +0,0 @@
|
||||||
<head>
|
|
||||||
<title>Nicholas Orlowsky</title>
|
|
||||||
<link rel="stylesheet" href="/style.css">
|
|
||||||
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<nav>
|
|
||||||
<a href="/">[ Home ]</a>
|
|
||||||
<a href="/blog.html">[ Blog ]</a>
|
|
||||||
<a href="/projects.html">[ Projects ]</a>
|
|
||||||
<a href="/extra.html">[ Extra ]</a>
|
|
||||||
<hr/>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<h1>Side Project Log 10/20/2023</h1>
|
|
||||||
<p>This side project log covers work done from 8/15/2023 - 10/20/2023</p>
|
|
||||||
|
|
||||||
<h2 id="anthracite">Anthracite</h2>
|
|
||||||
<a href="https://github.com/nickorlow/anthracite">[ GitHub Repo ]</a>
|
|
||||||
<p>
|
|
||||||
Anthracite is a web server written in C++. The site you're reading this on
|
|
||||||
right now is hosted on Anthracite. I wrote it to deepen my knowledge of C++ and networking protocols. My
|
|
||||||
main focus of Anthracite is performance. While developing anthracite,
|
|
||||||
I have been exploring different optimization techniques and benchmarking
|
|
||||||
Anthracite against popular web servers such as NGINX and Apache.
|
|
||||||
Anthracite supports HTTP/1.1 and only supports GET requests to request
|
|
||||||
files stored on a server.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Anthracite currently performs on par with NGINX and Apache when making
|
|
||||||
1000 requests for a 50MB file using 100 threads in a Docker container.
|
|
||||||
To achieve this performance, I used memory profilers to find
|
|
||||||
out what caused large or repeated memory copies to occur. I then updated
|
|
||||||
those sections of code to remove or minimize these copies. I also
|
|
||||||
made it so that Anthracite caches all files it can serve in memory. This
|
|
||||||
avoids unnecessary and costly disk reads. The implementation of this is
|
|
||||||
subpar, as it requires that the server be restarted whenever the files
|
|
||||||
it is serving are changed for the updates to be detected by Anthracite.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
I intend to make further performance improvements, specifically in the request
|
|
||||||
parser. I also plan to implement HTTP/2.0.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2 id="yacemu">Yet Another Chip Eight Emulator (yacemu)</h2>
|
|
||||||
<a href="https://github.com/nickorlow/yacemu">[ GitHub Repo ]</a>
|
|
||||||
<p>
|
|
||||||
YACEMU is an interpreter for the CHIP-8 instruction set written in C. My main
|
|
||||||
goal when writing it was to gain more insight into how emulation works. I had
|
|
||||||
previous experience with this from when I worked on an emulator for a slimmed-down
|
|
||||||
version of X86 called <a href="https://web.cse.ohio-state.edu/~reeves.92/CSE2421sp13/PracticeProblemsY86.pdf">Y86</a>.
|
|
||||||
So far, I've been able to get most instructions working. I need to work on adding
|
|
||||||
input support so that users can interact with programs running in yacemu. It has
|
|
||||||
been fairly uncomplicated and easy to write thus far. After I complete it, I would
|
|
||||||
like to work on an emulator for a real device such as the GameBoy (This might be
|
|
||||||
biting off more than I can chew).
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2 id="nick-vim">Nick VIM</h2>
|
|
||||||
<p>
|
|
||||||
Over the summer while I was interning, I began using VIM as my primary
|
|
||||||
text editor. I used a preconfigured version of it (<a href="https://nvchad.com/">NvChad</a>) to save time, as
|
|
||||||
setting everything up can take a while. After using it for a few months, I began
|
|
||||||
making my own configuration for VIM, taking what I liked from NvChad and leaving
|
|
||||||
behind the parts that I didn't like as much.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<img src="/blog-images/NickVIM_Screenshot.png" alt="Screenshot of an HTML file open for editing in NickVIM"/>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
One important part of Nick VIM was ensuring that it was portable between different
|
|
||||||
machines. I wanted the machine to have as few dependencies as possible so that I
|
|
||||||
could get NickVIM set up on any computer in a couple of minutes. This will be especially
|
|
||||||
useful when working on my School's lab machines and when switching to new computers
|
|
||||||
in the future. I achieved this by dockerizing Nick VIM. This is based on what one of
|
|
||||||
my co-workers does with their VIM setup. The Docker container contains
|
|
||||||
all the dependencies for each language server. Whenever you edit a file with Nick Vim,
|
|
||||||
the following script runs:
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<code lang="bash">
|
|
||||||
echo Starting container...
|
|
||||||
cur_dir=`pwd`
|
|
||||||
container_name=${cur_dir////$'_'}
|
|
||||||
container_name="${container_name:1}_$RANDOM"
|
|
||||||
docker run --name $container_name --network host -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --mount type=bind,source="$(pwd)",target=/work -d nick-vim &> /dev/null
|
|
||||||
|
|
||||||
echo Execing into container...
|
|
||||||
docker exec -w /work -it $container_name bash
|
|
||||||
|
|
||||||
echo Stopping container in background...
|
|
||||||
docker stop $container_name &> /dev/null &
|
|
||||||
</code>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
This code creates a new container, forwards the host's clipboard to the container, and
|
|
||||||
mounts the current directory inside the container for editing.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2 id="secane">Secane</h2>
|
|
||||||
<p><a href="https://www.youtube.com/watch?v=tKRehO7FH_s">[ Video Demo ]</a></p>
|
|
||||||
<p>
|
|
||||||
Secane was a simple ChatGPT wrapper that I wrote to practice for the behavioral part of
|
|
||||||
job interviews. It takes your resume, information about the company, and information about
|
|
||||||
the role you're interviewing for. It also integrates with OpenAI's whisper, allowing you
|
|
||||||
to simulate talking out your answers. I made it with Next.JS.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
<p><strong>These projects had minimal/no work done on them:</strong> NWS, RingGold, SQUIRREL</p>
|
|
||||||
<p><strong>These projects I will no longer be working on:</strong> Olney</p>
|
|
||||||
|
|
||||||
<footer>
|
|
||||||
<hr />
|
|
||||||
<p style="margin-bottom: 0px;">Copyright © Nicholas Orlowsky 2025</p>
|
|
||||||
<p style="margin-top: 0px; margin-bottom: 0px;">Hosting provided by <a href="https://nws.nickorlow.com">NWS</a></p>
|
|
||||||
<p style="margin-top: 0px;">Powered by <a href="https://github.com/nickorlow/anthracite">Anthracite Web Server</a></p>
|
|
||||||
</footer>
|
|
||||||
</body>
|
|
|
@ -1,39 +0,0 @@
|
||||||
<head>
|
|
||||||
<title>Nicholas Orlowsky</title>
|
|
||||||
<link rel="stylesheet" href="/style.css">
|
|
||||||
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<nav>
|
|
||||||
<a href="/">[ Home ]</a>
|
|
||||||
<a href="/blog.html">[ Blog ]</a>
|
|
||||||
<a href="/projects.html">[ Projects ]</a>
|
|
||||||
<a href="/extra.html">[ Extra ]</a>
|
|
||||||
<hr/>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<h1>Side Project Log 3/20/2023</h1>
|
|
||||||
<p>Spring break just wrapped up. I wrote a <a href="">blog</a> last week about the side projects that I was planning on
|
|
||||||
doing. I wanted to provide an update on what I got done, and figured I'd turn it into a recurring thing.</p>
|
|
||||||
<p>This side project log covers work done from 3/13/2023 - 3/20/2023</p>
|
|
||||||
<h2 id="-personal-website-facelift-https-github-com-nickorlow-personal-site-"><a href="https://github.com/nickorlow/personal-site">Personal Website Facelift</a></h2>
|
|
||||||
<p>I managed to move my website over to tab-based navigation pretty early on in the break. It just involved setting
|
|
||||||
up a navbar component and then using react-navigation to navigate between pages. I also managed to
|
|
||||||
update my projects page to be more compact and readable. </p>
|
|
||||||
<p>There is still work to be done on making it look better, but I mostly believe that
|
|
||||||
it's just going to be somewhat minor tweaks.</p>
|
|
||||||
<h2 id="-mahantongo-https-github-com-nickorlow-mahantongo-"><a href="https://github.com/nickorlow/mahantongo">Mahantongo</a></h2>
|
|
||||||
<p>I managed to finish this one. I learned a lot about Rust and I've gained an appreciation for
|
|
||||||
Rust's enforcement of good programming habits, and I really like how error handling is done.</p>
|
|
||||||
<p>Working with Serenity was pretty easy as it mirrored some of the other Discord SDKs I've used
|
|
||||||
before.</p>
|
|
||||||
<hr>
|
|
||||||
<p><strong>The below projects had minimal/no work done on them:</strong> RingGold, NWS Container Deployment Service, and VerifiedBot </p>
|
|
||||||
|
|
||||||
<footer>
|
|
||||||
<hr />
|
|
||||||
<p style="margin-bottom: 0px;">Copyright © Nicholas Orlowsky 2025</p>
|
|
||||||
<p style="margin-top: 0px; margin-bottom: 0px;">Hosting provided by <a href="https://nws.nickorlow.com">NWS</a></p>
|
|
||||||
<p style="margin-top: 0px;">Powered by <a href="https://github.com/nickorlow/anthracite">Anthracite Web Server</a></p>
|
|
||||||
</footer>
|
|
||||||
</body>
|
|
|
@ -1,39 +0,0 @@
|
||||||
<head>
|
|
||||||
<title>Nicholas Orlowsky</title>
|
|
||||||
<link rel="stylesheet" href="/style.css">
|
|
||||||
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<nav>
|
|
||||||
<a href="/">[ Home ]</a>
|
|
||||||
<a href="/blog.html">[ Blog ]</a>
|
|
||||||
<a href="/projects.html">[ Projects ]</a>
|
|
||||||
<a href="/extra.html">[ Extra ]</a>
|
|
||||||
<hr/>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<h1>Side Project Log 3/27/2023</h1>
|
|
||||||
<p>This side project log covers work done from 3/20/2023 - 3/27/2023</p>
|
|
||||||
<h2 id="septa-site">SEPTA Site</h2>
|
|
||||||
<p>I started a new project that aimed to recreate parts of SEPTA's website with a more elegant UI, and using
|
|
||||||
SEPTA's new "SEPTA Metro" wayfinding. The main goal with this project was to help me learn Svelte. I also had
|
|
||||||
to reverse-engineer the APIs on septakey.org in order to authenticate a user and get their trip history. </p>
|
|
||||||
<p>In terms of Svelte, I really enjoyed working with it and overall I found it much more elegant and easier to work
|
|
||||||
with than React. I didn't like the way it handled client-server interaction with its serverside functions. </p>
|
|
||||||
<p>I have not made this open source yet and do not intend to until it's more polished.</p>
|
|
||||||
<h2 id="-verified-bot-https-github-com-benaubin-verified-bot-"><a href="https://github.com/benaubin/verified-bot">Verified Bot</a></h2>
|
|
||||||
<p>I made all the necessary changes and tests to get VerifiedBot working. It is now waiting on my friend Ben
|
|
||||||
to merge my PR with the changes outlined in my <a href="https://nickorlow.com/blog/spring-break-2023">spring break blog</a>.</p>
|
|
||||||
<h2 id="-mahantongo-https-github-com-nickorlow-mahantongo-"><a href="https://github.com/nickorlow/mahantongo">Mahantongo</a></h2>
|
|
||||||
<p>I created some QoL features, such as using Discord's embeds instead of sending regular text messages, showing which board
|
|
||||||
a post was on, and fixing some bugs.</p>
|
|
||||||
<hr>
|
|
||||||
<p><strong>The below projects had minimal/no work done on them:</strong> RingGold, and NWS Container Deployment Service </p>
|
|
||||||
|
|
||||||
<footer>
|
|
||||||
<hr />
|
|
||||||
<p style="margin-bottom: 0px;">Copyright © Nicholas Orlowsky 2025</p>
|
|
||||||
<p style="margin-top: 0px; margin-bottom: 0px;">Hosting provided by <a href="https://nws.nickorlow.com">NWS</a></p>
|
|
||||||
<p style="margin-top: 0px;">Powered by <a href="https://github.com/nickorlow/anthracite">Anthracite Web Server</a></p>
|
|
||||||
</footer>
|
|
||||||
</body>
|
|
|
@ -1,47 +0,0 @@
|
||||||
<head>
|
|
||||||
<title>Nicholas Orlowsky</title>
|
|
||||||
<link rel="stylesheet" href="/style.css">
|
|
||||||
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<nav>
|
|
||||||
<a href="/">[ Home ]</a>
|
|
||||||
<a href="/blog.html">[ Blog ]</a>
|
|
||||||
<a href="/projects.html">[ Projects ]</a>
|
|
||||||
<a href="/extra.html">[ Extra ]</a>
|
|
||||||
<hr/>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<h1>Side Project Log 4/29/2023</h1>
|
|
||||||
<p>This side project log covers work done from 3/27/2023 - 4/29/2023</p>
|
|
||||||
<p>This side project log is a bit late due to it being a busy month of school, but today is my last day!</p>
|
|
||||||
<h2 id="septa-site">SEPTA Site</h2>
|
|
||||||
<p>This week, I published SEPTA Site on Github, you can find it here: <a href="https://github.com/nickorlow/septa-site">github.com/nickorlow/septa-site</a>.</p>
|
|
||||||
<p>I made a few tweaks to it in terms of styling and also wrote a descriptive README to give people instructions on how to run it as I don't want
|
|
||||||
to host it myself since it handles credentials from another service.</p>
|
|
||||||
<h2 id="squirrel">SQUIRREL</h2>
|
|
||||||
<p>SQUIRREL, short for SQL Query Util-Izing Rust's Reliable and Efficient Logic, is a SQL database that I am writing in Rust. Currently, it can
|
|
||||||
parse CREATE TABLE commands, and works with the data types varchar and int. I plan to implement basic CRUD operations, then add JOINs, and
|
|
||||||
then try to make it wire-compatible with Postgres.</p>
|
|
||||||
<p>This project is currently not open-sourced as I am waiting to add more features and polish it up more.</p>
|
|
||||||
<h2 id="swole-control">Swole Control</h2>
|
|
||||||
<p>This one isn't a <em>personal</em> project, however it is a project that I worked on with a group. We began working on it in February as a part of a
|
|
||||||
club at UT called Texas Convergent. We recently presented it at the club's demo day and won the prize for having the best business.</p>
|
|
||||||
<p>Swole Control is an app that monitors machine usage at a gym on a machine-by-machine level, providing gym goers with information about what machines
|
|
||||||
are free (this is a major pain point as a gym goer myself). It also provides gym owners with statistics on which machines are most popular, providing
|
|
||||||
them valuable insights into their business.</p>
|
|
||||||
<p>To achieve this, we built hardware that consisted of an ESP-32 micro controller and an ultrasonic distance sensor. This hardware is mounted on a gym machine
|
|
||||||
and it measures the distance to the nearest object. It then sends this measurement to a Rust backend which stores it in a Firestore database (although we had
|
|
||||||
a fork of it that worked with Postgres). The backend then uses these measurements and compares them to a baseline to determine if there is a user at a machine.
|
|
||||||
Our mobile app then reads this from the Firestore database (it's planned to have it read this from the API to have a better-defined application boundary). The
|
|
||||||
frontend is written in React Native.</p>
|
|
||||||
<hr>
|
|
||||||
<p><strong>These projects had minimal/no work done on them:</strong> RingGold, and NWS Container Deployment Service</p>
|
|
||||||
|
|
||||||
<footer>
|
|
||||||
<hr />
|
|
||||||
<p style="margin-bottom: 0px;">Copyright © Nicholas Orlowsky 2025</p>
|
|
||||||
<p style="margin-top: 0px; margin-bottom: 0px;">Hosting provided by <a href="https://nws.nickorlow.com">NWS</a></p>
|
|
||||||
<p style="margin-top: 0px;">Powered by <a href="https://github.com/nickorlow/anthracite">Anthracite Web Server</a></p>
|
|
||||||
</footer>
|
|
||||||
</body>
|
|
|
@ -1,92 +0,0 @@
|
||||||
<head>
|
|
||||||
<title>Nicholas Orlowsky</title>
|
|
||||||
<link rel="stylesheet" href="/style.css">
|
|
||||||
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<nav>
|
|
||||||
<a href="/">[ Home ]</a>
|
|
||||||
<a href="/blog.html">[ Blog ]</a>
|
|
||||||
<a href="/projects.html">[ Projects ]</a>
|
|
||||||
<a href="/extra.html">[ Extra ]</a>
|
|
||||||
<hr/>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<h1>Side Project Log 7/12/2023</h1>
|
|
||||||
<p>This side project log covers work done from 4/29/2023 - 7/12/2023</p>
|
|
||||||
<p>This side project log is more than a bit late due to working a busy summer internship at <a href="https://futo.org">FUTO</a>!</p>
|
|
||||||
<h2 id="nws-container-deployment-service">NWS Container Deployment Service</h2>
|
|
||||||
<p>I have finally added SSL to NWS CDS. This was challenging, as it required handling ACME challenges and certificate
|
|
||||||
distribution across a set of geo-distributed Kubernetes clusters. I detail the complexities of this in a <a href="http://nickorlow.com/blog/ssl-in-nws-cds">previous blog
|
|
||||||
I wrote</a>. In order to implement auto-created/auto-renewing SSL, I implemented the below solution:</p>
|
|
||||||
<p><img src="/blog-images/NWS_SSL_Diagram.png" alt="Diagram of NWS SSL Architecture"></p>
|
|
||||||
<p>First, a user creates a request to add SSL to their NWS CDS service through the web UI which calls the NWS API (not pictured)</p>
|
|
||||||
<p>Then, the NWS API calls SSLiaison (in-house written software) which adds the domain to Caddy's list of domains. Caddy will then attempt to create
|
|
||||||
an SSL certificate from an ACME server (not pictured).</p>
|
|
||||||
<p>The ACME server will query NWS for the challenge response by requesting a file at <code>/.well-known/acme-challenge</code> on the
|
|
||||||
domain to be verified (this is the green arrows). </p>
|
|
||||||
<p>HAProxy will re-route these requests to NWS Hill Country, which is where the NWS Management Engine (NWSME) lives (this is
|
|
||||||
the orange arrows). <em>(NWSME controls what's deployed on each k8s cluster on NWS)</em></p>
|
|
||||||
<p>HAProxy in NWS Hill Country will then route this request to Caddy, which will solve the <a href="https://letsencrypt.org/docs/challenge-types/">http-01 challenge</a>, and then get the certificate
|
|
||||||
from the ACME server. Once it does this, it will write the certificate to a directory that is bind-mounted to both Caddy
|
|
||||||
and SSLiaison. </p>
|
|
||||||
<p>SSLiaison will detect this new file, parse it into a k8s manifest file, and then add it to our GitOps repo which is
|
|
||||||
hosted in GitHub.</p>
|
|
||||||
<p>From here, the certificate will be added to all the k8s clusters via Rancher Fleet.</p>
|
|
||||||
<hr>
|
|
||||||
<p>For next steps, I'd like to revise this solution such that it doesn't have a single point of failure.
|
|
||||||
Currently, if NWS Hill Country is down (which it is about 0.025% of the time), then SSL certificates
|
|
||||||
won't be able to be created or renewed. </p>
|
|
||||||
<p>To do this, I will have SSLiaison implement the ACME client specification so that it can create and respond do ACME HTTP challenges.
|
|
||||||
SSLiaison will run on NWS CDS (so that it's running on all of our k8s clusters and is HA) instead of running as a standalone docker container.
|
|
||||||
I'll have SSLiaison use some distributed database (probably CockroachDB) to store the HTTP challenges so that it doesn't matter
|
|
||||||
which k8s cluster the challenge request from the ACME server is routed to.</p>
|
|
||||||
<h2 id="next-steps-for-nws">Next Steps for NWS</h2>
|
|
||||||
<ul>
|
|
||||||
<li><strong>HA NWS Management Engine:</strong> Currently (as somewhat discussed above), the NWSME will go down when NWS Hill Country goes down. I'd like to
|
|
||||||
make it so that this isn't the case. This would likely just require that each NWS cluster runs its own instance of Rancher Fleet instead
|
|
||||||
of one central Rancher Fleet that manages all the clusters. It would also require the HA SSLiaison.</li>
|
|
||||||
</ul>
|
|
||||||
<ul>
|
|
||||||
<li><strong>IaC for Everything:</strong> Currently, all NWS CDS services are defined in yaml files in a git repo, however the underlying infrastructure that
|
|
||||||
it runs on is not. Ideally, I'd like every NWS machine to run Proxmox and then have Terraform & Ansible configs to define how to set up
|
|
||||||
vms on proxmox that will run the k8s clusters that support CDS services. This should eliminate my headaches of sshing into each machine
|
|
||||||
to apply config changes and make sure everything is standardized. It should also make the process of setting up new servers easy.</li>
|
|
||||||
</ul>
|
|
||||||
<ul>
|
|
||||||
<li><strong>Monitoring:</strong> I've been working on setting up monitoring on a lot of our services at my current internship using the TIG stack (Telegraf,
|
|
||||||
InfluxDB, and Grafana). Now that I've been exposed to the usefulness of having a bunch of metrics on hand, I think it would be nice to have
|
|
||||||
some dashboards setup for NWS to monitor speed, resource usage, uptime, and traffic. Doing this would also make it possible to expose resource usage in the
|
|
||||||
NWS dashboard.</li>
|
|
||||||
</ul>
|
|
||||||
<ul>
|
|
||||||
<li><p><strong>Enhanced Infrastructure:</strong> This is kind of a blanket one for things I want to do that don't fit into other categories. It includes making
|
|
||||||
hardware upgrades (mostly adding more storage), make management more accessible (such as Dell IDRAC's WebSerial), some load testing to
|
|
||||||
identify painpoints, run an NWS machine in a cloud VM so I can say it's cross cloud (although my friends have told me this is cheating at creating
|
|
||||||
my own cloud), and trying to figure out how to set up an Anycast network. I don't think I can setup an Anycast network without selling
|
|
||||||
a kidney first. Renting a /24 CIDR alone would be more than I want to spend on a side project. I may look into setting it up with ipv6 only,
|
|
||||||
however I'd still have to jump through hoops to get an Autonomous System number from an RIR. I'll probably write a whole blog about Anycast
|
|
||||||
in the coming weeks.</p>
|
|
||||||
</li>
|
|
||||||
<li><p><strong>Reduced External Dependence:</strong> The main goal of NWS is to have no external dependence. In theory, everything but core internet infrastructure
|
|
||||||
should </p>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<h2 id="olney">Olney</h2>
|
|
||||||
<p><code>Rust, ActixWeb, PostgreSQL</code></p>
|
|
||||||
<p>Olney is a new project I am starting with my friend <a href="https://sridharnandigam.com/">Sridhar Nandigam</a>. It aims to make
|
|
||||||
tracking your job applications easier. Most of my friends either use spreadsheets or Trello to track their job applications, I
|
|
||||||
think that we can make something that's a bit better for the job. Some features I'd like to have are: resume version attached to
|
|
||||||
your application, job posting notifications from job boards such as <a href="github.com/pittcsc/summer2024-internships">pittcsc</a>, and watching
|
|
||||||
your email for emails from recruiters. Currently, I have part of the backend setup with basic CRUD operations. Now that I'm done with
|
|
||||||
the latest batch of NWS work, this is next on my list to work on.</p>
|
|
||||||
<hr>
|
|
||||||
<p><strong>These projects had minimal/no work done on them:</strong> RingGold, SQUIRREL</p>
|
|
||||||
|
|
||||||
<footer>
|
|
||||||
<hr />
|
|
||||||
<p style="margin-bottom: 0px;">Copyright © Nicholas Orlowsky 2025</p>
|
|
||||||
<p style="margin-top: 0px; margin-bottom: 0px;">Hosting provided by <a href="https://nws.nickorlow.com">NWS</a></p>
|
|
||||||
<p style="margin-top: 0px;">Powered by <a href="https://github.com/nickorlow/anthracite">Anthracite Web Server</a></p>
|
|
||||||
</footer>
|
|
||||||
</body>
|
|
|
@ -1,82 +0,0 @@
|
||||||
<head>
|
|
||||||
<title>Nicholas Orlowsky</title>
|
|
||||||
<link rel="stylesheet" href="/style.css">
|
|
||||||
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<nav>
|
|
||||||
<a href="/">[ Home ]</a>
|
|
||||||
<a href="/blog.html">[ Blog ]</a>
|
|
||||||
<a href="/projects.html">[ Projects ]</a>
|
|
||||||
<a href="/extra.html">[ Extra ]</a>
|
|
||||||
<hr/>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<h1>Side Project Log 8/15/2023</h1>
|
|
||||||
<p>This side project log covers work done from 8/8/2023 - 8/15/2023</p>
|
|
||||||
|
|
||||||
<h2 id="olney">Olney</h2>
|
|
||||||
<p>
|
|
||||||
I added a frontend to Olney and added a feature where it can automatically keep track of your job applications
|
|
||||||
by monitoring your email.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h3>Frontend</h3>
|
|
||||||
<p>
|
|
||||||
The frontend was made with Svelte. I chose not to use any UI/CSS libraries as I wanted to keep the number of
|
|
||||||
dependencies low. This was another good opportunity to learn about Svelte.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h3>Automatic Tracking via E-Mail</h3>
|
|
||||||
<p>
|
|
||||||
This is the killer feature that I initially set out to build Olney for. This works by having the user forward their
|
|
||||||
E-Mail to an instance of Olney. To receive E-Mail, Olney uses <a href="https://inbucket.org">Inbucket</a>, a mailserver
|
|
||||||
easily hostable within Docker. It listens on a websocket for incoming mail. Whenever a new mail message is received,
|
|
||||||
Olney uses the OpenAI API to get a summary of the email in the following format:
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<pre><code class="language-json">
|
|
||||||
{
|
|
||||||
isRecruiting: bool, // is the message about recruiting?
|
|
||||||
recruitingInfo: null | {
|
|
||||||
location: string, // Location in City, Providence/State, Country format
|
|
||||||
company: string, // Casual name of company e.g: Google, Cisco, Apple
|
|
||||||
position: string, // Name of job position
|
|
||||||
type: "assessment" | "interview" | "offer" | "rejection" | "applied" // What the message is discussing
|
|
||||||
dateTime: string, // DateTime communication rec'd OR DateTime that is being discussed (i.e. interview date confirmation)
|
|
||||||
name: string // Name of event, giving more detail to type
|
|
||||||
} // null if message is not about recruiting, fill with values if it is
|
|
||||||
}
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Olney then takes some details from this data, namely: company, position, and location and then uses the OpenAI API to generate
|
|
||||||
an <a href="https://www.pinecone.io/learn/vector-embeddings/">embedding</a>. We then query the closest match out of the job applications
|
|
||||||
in the database (with <a href="https://github.com/pgvector/pgvector">pgvector</a>). Once we have the job application, we add
|
|
||||||
the event to the database, using the job application's id as a fkey.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
I chose embedding as the lookup method so that we don't have to worry about the data parsed out of the email being an exact
|
|
||||||
match for what the user inputted. This also allows the lookup to work even when certain things such as location are missing from the
|
|
||||||
email.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Olney should be open-sourced/released within the next week or two.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
<p><strong>These projects had minimal/no work done on them:</strong> NWS, RingGold, SQUIRREL</p>
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/dark.min.css">
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
|
|
||||||
<script>hljs.highlightAll();</script>
|
|
||||||
|
|
||||||
<footer>
|
|
||||||
<hr />
|
|
||||||
<p style="margin-bottom: 0px;">Copyright © Nicholas Orlowsky 2025</p>
|
|
||||||
<p style="margin-top: 0px; margin-bottom: 0px;">Hosting provided by <a href="https://nws.nickorlow.com">NWS</a></p>
|
|
||||||
<p style="margin-top: 0px;">Powered by <a href="https://github.com/nickorlow/anthracite">Anthracite Web Server</a></p>
|
|
||||||
</footer>
|
|
||||||
</body>
|
|
|
@ -1,87 +0,0 @@
|
||||||
<head>
|
|
||||||
<title>Nicholas Orlowsky</title>
|
|
||||||
<link rel="stylesheet" href="/style.css">
|
|
||||||
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<nav>
|
|
||||||
<a href="/">[ Home ]</a>
|
|
||||||
<a href="/blog.html">[ Blog ]</a>
|
|
||||||
<a href="/projects.html">[ Projects ]</a>
|
|
||||||
<a href="/extra.html">[ Extra ]</a>
|
|
||||||
<hr/>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<h1>Side Project Log 8/8/2023</h1>
|
|
||||||
<p>This side project log covers work done from 7/12/2023 - 8/8/2023</p>
|
|
||||||
|
|
||||||
<h2 id="squirrel">SQUIRREL</h2>
|
|
||||||
<p>
|
|
||||||
SQUIRREL has been updated to work with INSERT INTO and SELECT queries. I also refactored much of the codebase to do error handling more elegantly and to make the parser
|
|
||||||
more extensible. Here's a screenshot of table creation, data insertion, and data selection:
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
The biggest challenge of this part was working on the parser which has now been written three times. The approaches to the parsing were:
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<ol>
|
|
||||||
<li>
|
|
||||||
<b>Stepping through whitespace:</b> <p>This was my initial and naive approach to the problem. I split the input string by its whitespace
|
|
||||||
and then queried values by referencing their indexes in the split string. </p>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<b>Regex:</b> <p>This approach was cleaner than the first and led to a small parser, however it required an external dependency (which I'm
|
|
||||||
trying to minimize), and would make it hard to add additional features to commands later down the line.</p>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<b>Finite state machine:</b> <p>This solution was more verbose than the others, however it allows for easier development. This method works
|
|
||||||
by splitting the query string into tokens. Tokens are the smallest piece of data that a parser recognizes. SQUIRREL gets them by splitting
|
|
||||||
the input by delimiters and using the split list as tokens (excluding whitespace) SQUIRREL recognizes the following characters as delimiters:
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<code>
|
|
||||||
' ', ',', ';', '(', ')'
|
|
||||||
</code>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
This means that the string "INSERT INTO test (id) VALUES (12);" would be parsed into the list: "INSERT", "INTO", "test", "(", "id", etc..
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Once we have our list of tokens, we iterate through them starting at a default state and perform a certain task for the given state, which
|
|
||||||
usually includes switching to another state. We do this until we reach the end state.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
For example, with the above insert statement, we would start in the IntoKeyword state which would ensure that "INTO" is the current token.
|
|
||||||
We would then transition to the TableName state which would read the table name and store it in the ParsedCommand struct we're returning. We
|
|
||||||
would then move to the ColumnListBegin state which would look for an opening parenthesis, and switch the state to ColumnName. This process
|
|
||||||
continues with the other parts of the query until the Semicolon state is reached which checks that the statement ends with a semicolon, then
|
|
||||||
returns the ParsedCommand struct.
|
|
||||||
</p>
|
|
||||||
</li>
|
|
||||||
</ol>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Next steps for this are to add column selection to SELECT statements and add WHERE clauses to SELECT statements.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2 id="olney">Olney</h2>
|
|
||||||
<p>
|
|
||||||
I added a feature to the Olney API which scans the <a href="https://github.com/SimplifyJobs/Summer2024-Internships">pittcsc (now Simplify) summer internships Github repo</a>
|
|
||||||
and parses the data into JSON format. I parsed the markdown file they have uisng regex which was relatively simple. There were some issues during development due to the
|
|
||||||
changing structure of the markdown file. These issues are being fixed on a rolling basis. I expect the changes to slowdown now that the transition from pittcsc to Simplify
|
|
||||||
is complete. You can access the JSON at <a href="https://olney.nickorlow.com/jobs">olney.nickorlow.com/jobs</a>.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
<p><strong>These projects had minimal/no work done on them:</strong> NWS, RingGold</p>
|
|
||||||
|
|
||||||
<footer>
|
|
||||||
<hr />
|
|
||||||
<p style="margin-bottom: 0px;">Copyright © Nicholas Orlowsky 2025</p>
|
|
||||||
<p style="margin-top: 0px; margin-bottom: 0px;">Hosting provided by <a href="https://nws.nickorlow.com">NWS</a></p>
|
|
||||||
<p style="margin-top: 0px;">Powered by <a href="https://github.com/nickorlow/anthracite">Anthracite Web Server</a></p>
|
|
||||||
</footer>
|
|
||||||
</body>
|
|
|
@ -1,79 +0,0 @@
|
||||||
<head>
|
|
||||||
<title>Nicholas Orlowsky</title>
|
|
||||||
<link rel="stylesheet" href="/style.css">
|
|
||||||
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<nav>
|
|
||||||
<a href="/">[ Home ]</a>
|
|
||||||
<a href="/blog.html">[ Blog ]</a>
|
|
||||||
<a href="/projects.html">[ Projects ]</a>
|
|
||||||
<a href="/extra.html">[ Extra ]</a>
|
|
||||||
<hr/>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<h1>Spring Break 2023</h1>
|
|
||||||
<p>It's Spring Break, and that means I finally have time to spend all day working on side projects without having to worry about school.</p>
|
|
||||||
<p>I figured I should write out the side projects I plan to work on over the break</p>
|
|
||||||
<h2 id="ringgold">RingGold</h2>
|
|
||||||
<p><code>Rust, Swift, PostgreSQL</code></p>
|
|
||||||
<p>Last week, me and my cousin wanted to try out Apple's fitness competition feature that works with Apple Watch. It works
|
|
||||||
by giving you 1 point for every percent you complete of your move, exercise, and stand goals with a point cap of 600
|
|
||||||
per day. The issue with it was that it didn't work at all, not syncing on time if at all. I want to build a clone of it
|
|
||||||
with some additional features such as:</p>
|
|
||||||
<ul>
|
|
||||||
<li><p><strong>Notifications:</strong> I didn't like how it was possible to workout and gain a bunch of points and just completely blindside your opponent. Hopefully this would encourage users to workout even more.</p>
|
|
||||||
</li>
|
|
||||||
<li><p><strong>Widget/Watch Complication:</strong> Similar to the above, adding a homescreen widget or a watch complication would make it easier to keep up with your competitor's progress. </p>
|
|
||||||
</li>
|
|
||||||
<li><p><strong>Custom Competitions:</strong> I think it'd be nice to have competitions with custom rules and lengths so that you're not stuck with only one setting. Settings could include custom duration and custom caps on points.</p>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p>I'm building the web API for it in Rust and the mobile app in Swift. I chose these languages to gain more exposure to them, also
|
|
||||||
Swift was a good choice since the app is going to be platform specific to iOS due to its need to integrate with Apple Watch.
|
|
||||||
<em>(this is named after New Ringgold, PA)</em></p>
|
|
||||||
<h2 id="nws-container-deployment-service">NWS Container Deployment Service</h2>
|
|
||||||
<p><code>C#, Rancher</code></p>
|
|
||||||
<p>I've created my own hosting/cloud service called <a href="https://nws.nickorlow.com">Nick Web Services</a>. It currently allows people to deploy
|
|
||||||
dockerized applications on my geo-distributed k8s clusters running on Dell Poweredge servers. In order to actually deploy this, I
|
|
||||||
had to manually create the Kubernetes manifest files and then ssh into each individual server and apply them. I've setup
|
|
||||||
Rancher Fleet to automate this process by pulling the manifest from a git repo (this is something called gitops). I also
|
|
||||||
wrote an API to generate the manifest files and then upload them to a git repo. I have a video demo of this working that
|
|
||||||
you can watch <a href="https://youtu.be/WHdXWMFHuqA">here</a>.</p>
|
|
||||||
<p>Currently, the service works for deployment but only if you don't want to use SSL or you use Cloudflare's flexible SSL
|
|
||||||
technology. I wrote a separate blog post <a href="http://nickorlow.com/blog/ssl-in-nws-cds">here</a> about the challenges of doing this and how I plan on implementing it.
|
|
||||||
I'd like to complete part of this implementation during the break.</p>
|
|
||||||
<h2 id="verifiedbot">VerifiedBot</h2>
|
|
||||||
<p><code>JavaScript, Rust</code></p>
|
|
||||||
<p>This project isn't a personal project, as a lot of it was built by my friends <a href="https://arpan.one">Arpan</a> and <a href="https://benaubin.com/">Ben</a>.
|
|
||||||
A little over a year ago, we wanted to make a Discord bot to verify that people on some Discord servers we ran
|
|
||||||
went to the University of Texas. Initially, it worked by verifying you had a utexas.edu email address and then verifying
|
|
||||||
some additional information via LDAP. A few months ago Ben found out that using the SaaS survey software that the university uses
|
|
||||||
(qualtrics), we could have users verify themselves by using the university's SSO system. This works because qualtrics can send
|
|
||||||
data to a webhook when a survey is complete, and it can also require signing in with the university's SSO before filling out a survey.
|
|
||||||
It required that I write a <a href="https://github.com/Verified-Bot/aes-gcm-siv-wasm">wasm wrapper for an encryption library</a>. I wrote almost all the code for this function last year, but
|
|
||||||
due to a bug in qualtrics, it wasn't working properly. It seems that this bug has been fixed and we can start rolling it out.</p>
|
|
||||||
<h2 id="personal-website-facelift">Personal Website Facelift</h2>
|
|
||||||
<p><code>Typescript, React</code></p>
|
|
||||||
<p>My personal website (this one) is a little overdue for some design updates. My main focus will be making it more mobile
|
|
||||||
friendly. Last year, I made some improvements to make it usable on mobile but it still doesn't feel quite right. I also
|
|
||||||
think that it has some information overload in some areas such as the projects section. I think that to mitigate this I
|
|
||||||
might just have a small summary of each project and then you can click into each to learn more about it, similar to my
|
|
||||||
friend <a href="https://raulhigareda.com">Raul's Website</a>. I'm also considering a move to tab-based navigation so that I can have
|
|
||||||
more information in each section. Further down the line, I think I might re-write it using Svelte as I'm seeing it being used more and more
|
|
||||||
and would like to get some exposure to it.</p>
|
|
||||||
<h2 id="mahantongo">Mahantongo</h2>
|
|
||||||
<p><code>Rust, PostgreSQL</code></p>
|
|
||||||
<p>I'm one of the members of the Community Team that runs some UT Computer Science community Discord servers.
|
|
||||||
Currently, a Discord bot called Carlbot provides us a star-board, which is a specific channel where messages that 5 or more people
|
|
||||||
react to with a star emoji get posted. It's supposed to be a collection of the funniest and best messages sent on the server.
|
|
||||||
One of the things our server members have wanted is the addition of more '*-board' channels where you can create multiple star-board
|
|
||||||
like channels but with custom emojis. I'm writing it in Rust and I'm just hoping to use this project to get more acquainted with the language.</p>
|
|
||||||
|
|
||||||
<footer>
|
|
||||||
<hr />
|
|
||||||
<p style="margin-bottom: 0px;">Copyright © Nicholas Orlowsky 2025</p>
|
|
||||||
<p style="margin-top: 0px; margin-bottom: 0px;">Hosting provided by <a href="https://nws.nickorlow.com">NWS</a></p>
|
|
||||||
<p style="margin-top: 0px;">Powered by <a href="https://github.com/nickorlow/anthracite">Anthracite Web Server</a></p>
|
|
||||||
</footer>
|
|
||||||
</body>
|
|
|
@ -1,99 +0,0 @@
|
||||||
<head>
|
|
||||||
<title>Nicholas Orlowsky</title>
|
|
||||||
<link rel="stylesheet" href="/style.css">
|
|
||||||
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<nav>
|
|
||||||
<a href="/">[ Home ]</a>
|
|
||||||
<a href="/blog.html">[ Blog ]</a>
|
|
||||||
<a href="/projects.html">[ Projects ]</a>
|
|
||||||
<a href="/extra.html">[ Extra ]</a>
|
|
||||||
<hr/>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h1 style="margin-bottom: 0px;">Extra</h1>
|
|
||||||
<p style="margin-top: 0px;">Extra bits of information about me</p>
|
|
||||||
|
|
||||||
<h2>Rail Photography</h2>
|
|
||||||
<p>
|
|
||||||
I take photos of trains and train stations fairly often.
|
|
||||||
If you would like to see these pictures, they are avaliable
|
|
||||||
<a href="https://www.instagram.com/nickorlow.on.rails/">here</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2>Bowling</h2>
|
|
||||||
<p>
|
|
||||||
I go bowling with some friends regularly. We track our scores
|
|
||||||
down to the throw in a csv. You can check out a website where
|
|
||||||
that data is compiled into a readable format
|
|
||||||
<a href="https://bart.nickorlow.com">here</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2>Personal Records</h2>
|
|
||||||
<table style="width: 100%;">
|
|
||||||
<tr>
|
|
||||||
<th>Activity</th>
|
|
||||||
<th>Effort</th>
|
|
||||||
<th>Date</th>
|
|
||||||
<th>Location</th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>1600m (1 mile)</td>
|
|
||||||
<td>4:34</td>
|
|
||||||
<td>November 14th, 2020</td>
|
|
||||||
<td>Williamson County Park</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Milk Mile</td>
|
|
||||||
<td>5:41</td>
|
|
||||||
<td>May 20th, 2021</td>
|
|
||||||
<td>Lake Travis High School</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>3200m (2 mile)</td>
|
|
||||||
<td>10:11</td>
|
|
||||||
<td>March 20th, 2021</td>
|
|
||||||
<td>Carroll High School</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>5000m XC</td>
|
|
||||||
<td>16:43</td>
|
|
||||||
<td>September 26th, 2020</td>
|
|
||||||
<td>Old Settler's Park</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Bench Press</td>
|
|
||||||
<td>280.5 Lbs</td>
|
|
||||||
<td>December 31st, 2024</td>
|
|
||||||
<td>Anytime Fitness - Pottsville, PA</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Squat</td>
|
|
||||||
<td>415 Lbs</td>
|
|
||||||
<td>August 10th, 2023</td>
|
|
||||||
<td>FUTO HQ</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Deadlift</td>
|
|
||||||
<td>415 Lbs</td>
|
|
||||||
<td>Augist 10th, 2023</td>
|
|
||||||
<td>FUTO HQ</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Bowling</td>
|
|
||||||
<td>170</td>
|
|
||||||
<td>April 19th, 2024</td>
|
|
||||||
<td>Texas Union Underground</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<footer>
|
|
||||||
<hr />
|
|
||||||
<p style="margin-bottom: 0px;">Copyright © Nicholas Orlowsky 2025</p>
|
|
||||||
<p style="margin-top: 0px; margin-bottom: 0px;">Hosting provided by <a href="https://nws.nickorlow.com">NWS</a></p>
|
|
||||||
<p style="margin-top: 0px;">Powered by <a href="https://github.com/nickorlow/anthracite">Anthracite Web Server</a></p>
|
|
||||||
</footer>
|
|
||||||
</body>
|
|
BIN
out/favicon.ico
Before Width: | Height: | Size: 36 KiB |
|
@ -1,54 +0,0 @@
|
||||||
<head>
|
|
||||||
<title>Nicholas Orlowsky</title>
|
|
||||||
<link rel="stylesheet" href="/style.css">
|
|
||||||
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<nav>
|
|
||||||
<a href="/">[ Home ]</a>
|
|
||||||
<a href="/blog.html">[ Blog ]</a>
|
|
||||||
<a href="/projects.html">[ Projects ]</a>
|
|
||||||
<a href="/extra.html">[ Extra ]</a>
|
|
||||||
<hr/>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h1 style="margin-bottom: 0px;">Nicholas Orlowsky</h1>
|
|
||||||
<p style="margin-top: 0px;">Software Engineer - Austin, TX</p>
|
|
||||||
<p>
|
|
||||||
<a href="https://git.nickorlow.com/nickorlow">[ Forgejo ]</a>
|
|
||||||
<a href="https://github.com/nickorlow">[ GitHub (mirrors) ]</a>
|
|
||||||
<a href="https://www.linkedin.com/in/nickorlow/">[ LinkedIn ]</a>
|
|
||||||
<a href="mailto:nickorlow@nickorlow.com">[ E-Mail ]</a>
|
|
||||||
<a href="https://github.com/nickorlow/resume/releases/download/latest/resume-nickorlow.pdf">[ Resume ]</a>
|
|
||||||
<!--<a href="https://old.nickorlow.com">[ My Old Website ]</a>-->
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<a href="https://azuredevopspodcast.clear-measure.com/nick-orlowsky-deciding-to-major-in-computer-science-episode-197">[ Listen to me on the Azure DevOps podcast! ]</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
I'm a computer science student at the University of Texas at Austin. I'm particularly
|
|
||||||
interested in infrastructure, distributed systems, and systems programming.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
I run <a href="https://nws.nickorlow.com">Nick Web Services (NWS)</a>, a side project
|
|
||||||
that provides geo-distributed container hosting using Kubernetes on bare metal servers.
|
|
||||||
It achieved 100% uptime for over a year.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Outside of computers, I enjoy biking and weightlifting. I'm also a public transit enthusiast
|
|
||||||
and I take pictures of trains that I see, especially rare or special ones.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<footer>
|
|
||||||
<hr />
|
|
||||||
<p style="margin-bottom: 0px;">Copyright © Nicholas Orlowsky 2025</p>
|
|
||||||
<p style="margin-top: 0px; margin-bottom: 0px;">Hosting provided by <a href="https://nws.nickorlow.com">NWS</a></p>
|
|
||||||
<p style="margin-top: 0px;">Powered by <a href="https://github.com/nickorlow/anthracite">Anthracite Web Server</a></p>
|
|
||||||
</footer>
|
|
||||||
</body>
|
|
|
@ -1,24 +0,0 @@
|
||||||
<head>
|
|
||||||
<title>Nicholas Orlowsky</title>
|
|
||||||
<link rel="stylesheet" href="/style.css">
|
|
||||||
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<nav>
|
|
||||||
<a href="/">[ Home ]</a>
|
|
||||||
<a href="/blog.html">[ Blog ]</a>
|
|
||||||
<a href="/projects.html">[ Projects ]</a>
|
|
||||||
<a href="/extra.html">[ Extra ]</a>
|
|
||||||
<hr/>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<h1>Rail Pictures</h1>
|
|
||||||
<p>All photos are Copyright © Nicholas Orlowsky</p>
|
|
||||||
|
|
||||||
<footer>
|
|
||||||
<hr />
|
|
||||||
<p style="margin-bottom: 0px;">Copyright © Nicholas Orlowsky 2025</p>
|
|
||||||
<p style="margin-top: 0px; margin-bottom: 0px;">Hosting provided by <a href="https://nws.nickorlow.com">NWS</a></p>
|
|
||||||
<p style="margin-top: 0px;">Powered by <a href="https://github.com/nickorlow/anthracite">Anthracite Web Server</a></p>
|
|
||||||
</footer>
|
|
||||||
</body>
|
|
|
@ -1,117 +0,0 @@
|
||||||
<head>
|
|
||||||
<title>Nicholas Orlowsky</title>
|
|
||||||
<link rel="stylesheet" href="/style.css">
|
|
||||||
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<nav>
|
|
||||||
<a href="/">[ Home ]</a>
|
|
||||||
<a href="/blog.html">[ Blog ]</a>
|
|
||||||
<a href="/projects.html">[ Projects ]</a>
|
|
||||||
<a href="/extra.html">[ Extra ]</a>
|
|
||||||
<hr/>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h1 style="margin-bottom: 0px;">Projects</h1>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h2>Nick Web Services (NWS)</h2>
|
|
||||||
<p><i>C#, Kubernetes, Rancher, and HAProxy</i></p>
|
|
||||||
<a href="https://nws.nickorlow.com">[ Project Website ]</a>
|
|
||||||
<p>
|
|
||||||
Nick Web Services is a cloud infrastructure provider service that I created and run.
|
|
||||||
It allows people to deploy containerized versions of their web apps across our multiple
|
|
||||||
servers. It provides geo-distributed high availability by default with no extra configuration
|
|
||||||
needed from users hosting their webapp with us.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Hardware-wise we use old Dell PowerEdge servers running Proxmox. We then have VMs running
|
|
||||||
in Proxmox that run Kubernetes clusters. We have 4 clusters currently: Austin, Hill Country,
|
|
||||||
Schuylkill, and Philadelphia. The deployments are managed through GitOps with Rancher Fleet.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h2>Anthracite Web Server</h2>
|
|
||||||
<p><i>C++ & Python</i></p>
|
|
||||||
<a href="https://github.com/nickorlow/anthracite">[ GitHub Repo ]</a>
|
|
||||||
<p>
|
|
||||||
Anthracite is a simple web server written in C++. It currently supports HTTP/1.0 and HTTP/1.1.
|
|
||||||
The benchmarking tools for Anthracite are written in Python. Anthracite is optimized for performance
|
|
||||||
and rivals the performance of NGINX & Apache in our testing. It uses a thread-per-connection
|
|
||||||
architecture, allowing it to process many requests in paralell. Additionally, it caches all
|
|
||||||
files that it serves in memory to ensure that added latency from disk reads do not slow down requests.
|
|
||||||
Through writing Anthracite, I have learned to use different C++ profilers as well as some general
|
|
||||||
optimization techniques for C++.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h2>CavCash</h2>
|
|
||||||
<p><i>C#, Kubernetes, SQL Server, and MongoDB</i></p>
|
|
||||||
<a href="https://cavcash.com">[ Project Website ]</a>
|
|
||||||
<p>
|
|
||||||
CavCash was a company that I founded which built a debit-based payment system similar to
|
|
||||||
PayPal and Venmo. I assembled a 5 person team and took on a technical role in the company,
|
|
||||||
writing most of our backend codebase. Our backend used C#, ASP.NET, Microsoft SQL Server,
|
|
||||||
and MongoDB. Our infrastructure changed throughout the lifetime of the company, initially
|
|
||||||
it was on Microsoft Azure using Azure App Service. We then pivoted to AWS using Elastic
|
|
||||||
Beanstalk. We also ran on Google Cloud Platform using Compute Engine. Finally, we setup our
|
|
||||||
own servers in-house and managed our deployments with Kubernetes.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
We launched in 2021, with the ability to send money between real banks using the ACH network.
|
|
||||||
We ended up processing a few hundred dollars in transaction volume before ultimately shutting
|
|
||||||
down due to a lack of funding. The website is now back up and everything works as it did in
|
|
||||||
2021, except adding funds from a bank account is not supported.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h2>SQUIRREL</h2>
|
|
||||||
<p><i>Rust</i></p>
|
|
||||||
<a href="https://github.com/nickorlow/squirrel">[ GitHub Repo ]</a>
|
|
||||||
<p>
|
|
||||||
SQUIRREL stands for SQL Query Util-Izing Rust's Reliable and Efficient Logic. It is a SQL database
|
|
||||||
that I am writing in Rust. Currently, it can create tables, insert data into tables, and select all
|
|
||||||
data from a given table. The biggest challenge so far has been writing the parser. My next steps are
|
|
||||||
to add WHERE clauses to SELECT statements, allow column filtering in SELECT statements, and add DELETE
|
|
||||||
statements.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h2>Olney</h2>
|
|
||||||
<p><i>Rust, Postgres, Svelte, TypeScript, and OpenAI's API</i></p>
|
|
||||||
<a href="https://github.com/nickorlow/olney">[ GitHub Repo ]</a>
|
|
||||||
<p>
|
|
||||||
Olney is a job application tracker that aims to be better than using a <a href="https://trello.com">Trello</a> board or a spreadsheet.
|
|
||||||
It allows users to create jobs and log custom events such as interviews, assessments, and other communication.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h2>SEPTA Site</h2>
|
|
||||||
<p><i>Svelte, TypeScript</i></p>
|
|
||||||
<a href="https://github.com/nickorlow/septa-site">[ GitHub Repo ]</a>
|
|
||||||
<p>
|
|
||||||
SEPTA Site is a website that I created which can get your trip history, SEPTA Key balance,
|
|
||||||
and ridership statistics for your SEPTA Key. It utilizes SEPTA's new metro wayfinding instead
|
|
||||||
of their current wayfinding. I wrote the project to get a basic introduction to Svelte and
|
|
||||||
so that I could try to improve upon the UX of SEPTA's current website and mobile app.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div style="width: 100%; display: flex; justify-content: center; padding: 5px;">
|
|
||||||
<a href="https://github.com/nickorlow">[ See more projects on GitHub ]</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<footer>
|
|
||||||
<hr />
|
|
||||||
<p style="margin-bottom: 0px;">Copyright © Nicholas Orlowsky 2025</p>
|
|
||||||
<p style="margin-top: 0px; margin-bottom: 0px;">Hosting provided by <a href="https://nws.nickorlow.com">NWS</a></p>
|
|
||||||
<p style="margin-top: 0px;">Powered by <a href="https://github.com/nickorlow/anthracite">Anthracite Web Server</a></p>
|
|
||||||
</footer>
|
|
||||||
</body>
|
|
|
@ -1,22 +0,0 @@
|
||||||
* {
|
|
||||||
font-family: serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
td {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
background-color: #fefeaa;
|
|
||||||
margin: 20px auto;
|
|
||||||
max-width: 750px;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
text-decoration: none;
|
|
||||||
color: #114488;
|
|
||||||
}
|
|
||||||
|
|
||||||
img {
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
8
shell.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
with import <nixpkgs> {};
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
name = "septastic_env";
|
||||||
|
nativeBuildInputs = [ pkg-config ];
|
||||||
|
buildInputs = [
|
||||||
|
cryptsetup
|
||||||
|
];
|
||||||
|
}
|
|
@ -1,28 +0,0 @@
|
||||||
<div>
|
|
||||||
<h1 style="margin-bottom: 0px;">Blog</h1>
|
|
||||||
<p style="margin-top: 0px;">A collection of my thoughts, some of them may be interesting</p>
|
|
||||||
|
|
||||||
<h3 style="margin-bottom: 0px;"><a href="./blogs/fpga-fun.html">[ FPGA Fun (CHIP-8 in hardware) ]</a></h3>
|
|
||||||
<p style="margin-top: 0px;">April 20th, 2024</p>
|
|
||||||
|
|
||||||
<h3 style="margin-bottom: 0px;"><a href="./blogs/nws-postmortem-11-8-23.html">[ NWS Postmortem 11/08/23 ]</a></h3>
|
|
||||||
<p style="margin-top: 0px;">November 16th, 2023</p>
|
|
||||||
<h3 style="margin-bottom: 0px;"><a href="./blogs/side-project-10-20-23.html">[ Side Project Log 10/20/23 ]</a></h3>
|
|
||||||
<p style="margin-top: 0px;">October 20th, 2023</p>
|
|
||||||
<h3 style="margin-bottom: 0px;"><a href="./blogs/side-project-8-15-23.html">[ Side Project Log 8/15/23 ]</a></h3>
|
|
||||||
<p style="margin-top: 0px;">August 15th, 2023</p>
|
|
||||||
<h3 style="margin-bottom: 0px;"><a href="./blogs/side-project-8-8-23.html">[ Side Project Log 8/08/23 ]</a></h3>
|
|
||||||
<p style="margin-top: 0px;">August 8th, 2023</p>
|
|
||||||
<h3 style="margin-bottom: 0px;"><a href="./blogs/side-project-7-12-23.html">[ Side Project Log 7/12/23 ]</a></h3>
|
|
||||||
<p style="margin-top: 0px;">July 12th, 2023</p>
|
|
||||||
<h3 style="margin-bottom: 0px;"><a href="./blogs/side-project-4-29-23.html">[ Side Project Log 4/29/23 ]</a></h3>
|
|
||||||
<p style="margin-top: 0px;">April 29th, 2023</p>
|
|
||||||
<h3 style="margin-bottom: 0px;"><a href="./blogs/side-project-3-27-23.html">[ Side Project Log 3/27/23 ]</a></h3>
|
|
||||||
<p style="margin-top: 0px;">March 27th, 2023</p>
|
|
||||||
<h3 style="margin-bottom: 0px;"><a href="./blogs/side-project-3-20-23.html">[ Side Project Log 3/20/23 ]</a></h3>
|
|
||||||
<p style="margin-top: 0px;">March 20th, 2023</p>
|
|
||||||
<h3 style="margin-bottom: 0px;"><a href="./blogs/spring-break-2023.html">[ Spring Break 2023 ]</a></h3>
|
|
||||||
<p style="margin-top: 0px;">January 20th, 2023</p>
|
|
||||||
<h3 style="margin-bottom: 0px;"><a href="./blogs/doing-c-assignments-in-csharp.html">[ Doing C assignments in C# ]</a></h3>
|
|
||||||
<p style="margin-top: 0px;">March 18th, 2022</p>
|
|
||||||
</div>
|
|
|
@ -1,57 +0,0 @@
|
||||||
<h1>Doing C assignments in C#</h1>
|
|
||||||
<p>Thanks to Arpan Dhatt for doing most of the work on this (his blog here: <a href="https://arpan.one/posts/messing-with-gradescope/">https://arpan.one/posts/messing-with-gradescope/</a>)</p>
|
|
||||||
<p>At the end, he made this comment:</p>
|
|
||||||
<blockquote>
|
|
||||||
<p>And so, that's the end of this post. To whom it may concern, don't try doing your C assignment in C# (you know who you are).</p>
|
|
||||||
</blockquote>
|
|
||||||
<p>The reason for this comment (besides the fact that I talk about C# a lot) is due to the fact that C# requires a runtime to be installed for it to work. This is because C# does not compile to native bytecode but rather compiles to an intermediary language (dubbed CIL by Microsoft) and is then translated 'Just In Time' by the runtime. </p>
|
|
||||||
<p>This makes running assignments in a docker container where the runtime is not already installed considerably hard. One option we have is that we could just include the runtime in our submission. Sounds easy, right? Well it would be non-trivial to do but due to the fact that the .NET runtime is very large, I wouldn't consider this a good idea (Not to mention it's super boring). </p>
|
|
||||||
<p>The better solution is to use .NET's (experimental) AOT compilation feature (formerly called CoreRT). C# has had a number of attempts at an AOT compiler such as :</p>
|
|
||||||
<ul>
|
|
||||||
<li><a href="https://www.mono-project.com/docs/advanced/aot/">AOT</a> by Mono</li>
|
|
||||||
<li>LLD2CPP built by Unity</li>
|
|
||||||
<li><a href="https://docs.microsoft.com/en-us/dotnet/core/deploying/ready-to-run">Ready2Run</a> by Microsoft</li>
|
|
||||||
</ul>
|
|
||||||
<p>We'll be using the official Ready2Run AOT compilation built by Microsoft. In order to use it, all you have to do is add the following to your <code>nuget.config</code>:</p>
|
|
||||||
<pre><code class="lang-xml"><<span class="hljs-keyword">add</span> key=<span class="hljs-string">"nuget.org"</span> <span class="hljs-keyword">value</span>=<span class="hljs-string">"https://api.nuget.org/v3/index.json"</span> protocolVersion=<span class="hljs-string">"3"</span> />
|
|
||||||
</code></pre>
|
|
||||||
<p>and then install the package: <code>Microsoft.DotNet.ILCompiler</code>. After doing that if you run the command: <code>dotnet publish -r [Runtime] -c [Config]</code> and after waiting a considerable amount of time, you'll have a full-fledged C# application compiled directly to your target runtime's bytecode!</p>
|
|
||||||
<p>Compiling my simple Hello, Wold test to linux-x64 (<code>dotnet publish -r linux-x64 -c Release</code>) and adding it to my project files should let me run it using the same method Arpan used in his blog.</p>
|
|
||||||
<p>After doing that, we can follow the instructions followed by Arpan and viola! C# runs on Gradescope!</p>
|
|
||||||
<p>I don't recommend this but it was fun to do and I needed stuff to write in a blog. </p>
|
|
||||||
<h2 id="other-interesting-low-level-c-net-features">Other Interesting (Low Level) C#/.NET Features</h2>
|
|
||||||
<p>C# actually has many lower level features people don't expect it to have. Some of these include pointers and direct memory management. Pointers can be enabled by encasing your code in an unsafe code block.</p>
|
|
||||||
<p>Example (Written by <a href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/unsafe-code">Microsoft</a>)</p>
|
|
||||||
<pre><code class="lang-csharp">
|
|
||||||
<span class="hljs-comment">// Normal pointer to an object.</span>
|
|
||||||
<span class="hljs-keyword">int</span>[] a = <span class="hljs-keyword">new</span> <span class="hljs-keyword">int</span>[<span class="hljs-number">5</span>] { <span class="hljs-number">10</span>, <span class="hljs-number">20</span>, <span class="hljs-number">30</span>, <span class="hljs-number">40</span>, <span class="hljs-number">50</span> };
|
|
||||||
<span class="hljs-comment">// Must be in unsafe code to use interior pointers.</span>
|
|
||||||
unsafe
|
|
||||||
{
|
|
||||||
<span class="hljs-comment">// Must pin object on heap so that it doesn't move while using interior pointers.</span>
|
|
||||||
fixed (<span class="hljs-keyword">int</span>* p = &a[<span class="hljs-number">0</span>])
|
|
||||||
{
|
|
||||||
<span class="hljs-comment">// p is pinned as well as object, so create another pointer to show incrementing it.</span>
|
|
||||||
<span class="hljs-keyword">int</span>* p2 = p;
|
|
||||||
<span class="hljs-built_in">Console</span>.WriteLine(*p2);
|
|
||||||
<span class="hljs-comment">// Incrementing p2 bumps the pointer by four bytes due to its type ...</span>
|
|
||||||
p2 += <span class="hljs-number">1</span>;
|
|
||||||
<span class="hljs-built_in">Console</span>.WriteLine(*p2);
|
|
||||||
p2 += <span class="hljs-number">1</span>;
|
|
||||||
<span class="hljs-built_in">Console</span>.WriteLine(*p2);
|
|
||||||
<span class="hljs-built_in">Console</span>.WriteLine(<span class="hljs-string">"--------"</span>);
|
|
||||||
<span class="hljs-built_in">Console</span>.WriteLine(*p);
|
|
||||||
<span class="hljs-comment">// Dereferencing p and incrementing changes the value of a[0] ...</span>
|
|
||||||
*p += <span class="hljs-number">1</span>;
|
|
||||||
<span class="hljs-built_in">Console</span>.WriteLine(*p);
|
|
||||||
*p += <span class="hljs-number">1</span>;
|
|
||||||
<span class="hljs-built_in">Console</span>.WriteLine(*p);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</code></pre>
|
|
||||||
<p>In .NET 6, the <code>NativeMemory</code> class was introduced which you can read about <a href="https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.nativememory.alloc?view=net-6.0">here</a>. It allows for malloc-like memory allocation and freeing which can be important for high-performance workloads.</p>
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/dark.min.css">
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
|
|
||||||
<script>hljs.highlightAll();</script>
|
|
|
@ -1,183 +0,0 @@
|
||||||
<h1>FPGA Fun</h1>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
This semester at school, I took Advanced Computer Architecture. This has been
|
|
||||||
my favorite class in college so far. The class dives deeper into topics from
|
|
||||||
the regular Computer Architecture course, especially the parts that are
|
|
||||||
hand-waved over as being too complicated.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
The class is project-based (mostly) and had 2 large-sized projects. One was
|
|
||||||
creating an out-of-order CPU in SystemVerilog, which I'll dive into in
|
|
||||||
another blog. The other was anything we wanted to do (so long as the instructor
|
|
||||||
approved it). My project was implementing the CHIP-8 and then GameBoy in
|
|
||||||
SystemVerilog.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
The CHIP-8 part was initially easy, as I had
|
|
||||||
<a href="https://github.com/nickorlow/yacemu">previously written a CHIP-8
|
|
||||||
emulator in C</a>. My first stab at doing it in SV was done early in the
|
|
||||||
semester before I was too familiar with SV and how to write it properly.
|
|
||||||
The code resembled my C code, having one large case statement that would use
|
|
||||||
blocking assignments to complete instructions. I used
|
|
||||||
<a href="https://veripool.org/verilator">Verilator</a> to simulate and test
|
|
||||||
my design. Verilator was very nice as I could do FFI (Verilator calls it DPI)
|
|
||||||
to talk to C++ code from my SV code. This allowed me to use SDL2 to take
|
|
||||||
user input and to display the CHIP-8's screen on my laptop. I managed to get
|
|
||||||
a fully working version of it done in a few days.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
After this, I was able to borrow an FPGA from my instructor and set out to
|
|
||||||
run my CHIP-8 on real hardware. I ordered a ST7920 LCD display, a buzzer, and
|
|
||||||
a 16 key keypad off of Amazon the next day.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2>ST7920 Driver "The Bomb"</h2>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
The most time-consuming part of this project so far was interfacing with the
|
|
||||||
ST7920 LCD I ordered. The display has 2 modes for data transmission: 8/4 pin
|
|
||||||
parallel, and serial. The specification for the parallel interface seemed to
|
|
||||||
be the most straightforward, so I went ahead with implementing my driver
|
|
||||||
with that.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
The ST7920 has a
|
|
||||||
<a href="https://www.waveshare.com/datasheet/LCD_en_PDF/ST7920.pdf">fairly
|
|
||||||
straightforward interface</a> for drawing to the screen. It works by sending
|
|
||||||
8-bit instructions to the display controller. You first send a few
|
|
||||||
initialization instructions to clear the display's memory and reset its state.
|
|
||||||
After that you can select a mode (text or graphics). Both modes work similarly
|
|
||||||
to where you set the position of the cursor on the screen and then send
|
|
||||||
instructions that write pixels or text to that coordinate and then advances
|
|
||||||
the coordinate by one.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
I ran into trouble where I couldn't get anything to show up. Not even a simple
|
|
||||||
"Hello World". To troubleshoot, I borrowed a friend's Arduino Mini which has
|
|
||||||
proper drivers written for it for interfacing with the LCD. After hooking the
|
|
||||||
display up to it, it also couldn't draw anything! It wasn't until I tried
|
|
||||||
running it in serial mode that it worked. As it turns out, some manufacturers
|
|
||||||
solder capacitors on the back that can disable certain features of the display
|
|
||||||
(such as parallel mode), and my display's manufacturer had done just that. For
|
|
||||||
this reason, I'd highly recommend buying from a big-name seller of electronic
|
|
||||||
components such as Adafruit instead of random Amazon sellers.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Now that I knew that only the serial interface worked, I had to rewrite my
|
|
||||||
driver to use it. This meant instead of putting all 8 bits of an instruction
|
|
||||||
onto 8 pins at once, I'd have 2 pins: a clock and a data pin. In order to send
|
|
||||||
an 8 bit instruction, I'd send a clock signal and set the data pin to either
|
|
||||||
1 or 0 based on whether the nth bit in my instruction would be a 1 or 0. There
|
|
||||||
are additional device-specific characteristics of the ST7920's serial interface
|
|
||||||
described in the above linked datasheet, but they're not relevant to getting
|
|
||||||
the general idea of SPI (Serial Parallel Interface).
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div style="width: 100%; display: flex; justify-content: center; flex-flow: column; align-items: center;">
|
|
||||||
<img src="/blog-images/the-bomb-text.png" style="max-width: 500px; margin: 10px;">
|
|
||||||
<img src="/blog-images/the-bomb-graphical.jpg" style="max-width: 500px; margin: 10px;">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
I implemented a serial driver with a little demo screen (see above image), and
|
|
||||||
then modified the code to accept a block of memory of which it would then
|
|
||||||
draw out to the display. This left me with a general-purpose ST7920 serial driver!
|
|
||||||
Implementing a serial driver for this display gave me a good amount of
|
|
||||||
experience in dealing with timing outside of simulations. It also taught
|
|
||||||
me about debouncing and metastability.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
The driver is hosted on GitHub
|
|
||||||
<a href="https://github.com/nickorlow/the-bomb/">here</a>. The name "The Bomb"
|
|
||||||
was coined by my girlfriend who thought all the jumper wires and exposed
|
|
||||||
PCBs made it look like I was building a bomb. (I'd like to be clear that I have
|
|
||||||
never nor never intend to build a bomb)
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2>Rewriting CHIP-8 "yayacemu"</h2>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
With my display driver finally done, I decided to try to hook my CHIP-8 code up
|
|
||||||
to it and run it on the FPGA. I was really excited to actually run something on
|
|
||||||
hardware. Then the build time started climbing and Intel Quartus crashed. I
|
|
||||||
knew that this was a sign that I messed up. Through other projects in the class
|
|
||||||
I learned a bit about Verilog and HDL best practices and knew that my giant
|
|
||||||
blocking assignment switch statement would not run well, even if it would
|
|
||||||
compile.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Rewriting the CHIP-8 to work in a way that's more consistent with how processors
|
|
||||||
actually work and not how emulators work was fairly easy as I had done similar
|
|
||||||
work previously. To do so, I turned the processor into a state machine where
|
|
||||||
there was a state for each of the
|
|
||||||
<a href="https://en.wikipedia.org/wiki/Classic_RISC_pipeline">traditional 5
|
|
||||||
stages of the classic RISC pipeline.</a> Each state would do what it needed
|
|
||||||
to do and then move it into the next state. This design actually made logic
|
|
||||||
very simple as I was able to combine the functionality for a lot of instructions.
|
|
||||||
For example, a register to register load and an immediate to register load could use the
|
|
||||||
same writeback logic, as by that stage they would be loading bits into a register.
|
|
||||||
I didn't make it pipelined or do any fancy optimizations, mostly due to the fact
|
|
||||||
that the CHIP-8 is supposed to run at ~480 Hz. It also wasn't in the scope of
|
|
||||||
this project, as this was more about learning how different parts of a
|
|
||||||
computer interact and how real-world ISA implementations are done.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
At this point, I had a working CHIP-8 implemented in hardware sans a buzzer
|
|
||||||
and user input. These parts I was able to knock out fairly quickly. The buzzer
|
|
||||||
was dead simple, I just set its positive pin to high whenever the sound timer
|
|
||||||
was greater than zero. The keypad was a little more challenging, but much
|
|
||||||
simpler than the display. The keypad has 8 pins that are split between
|
|
||||||
4 column pins and 4 row pins. The FPGA sets 1 column pin to low and the rest
|
|
||||||
to high on every clock cycle and reads the output from the row pins to
|
|
||||||
determine which key is pressed. For instance if the first column pin was the
|
|
||||||
one the FPGA had set to low, and then the FPGA read that the first row pin
|
|
||||||
was outputting high, it would know that the pressed key was at coordinate
|
|
||||||
(1,1) (i.e. the first key).
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<video controls style="max-width: 500px;">
|
|
||||||
<source src="/blog-images/fpga-tetris.mp4" type="video/mp4">
|
|
||||||
Your browser does not support the video tag.
|
|
||||||
</video>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
And after doing all of that, we can play Tetris!
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
The source code for
|
|
||||||
yayacemu is hosted <a href="https://github.com/nickorlow/yayacemu">here</a>.
|
|
||||||
The CHIP-8 emulator I wrote in C was called yacemu (Yet Another Chip-8 Emulator),
|
|
||||||
and the naming for this is yayacemu (Yet Another Yet Another Chip-8 Emulator).
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2>The GameBoy</h2>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
I started writing the GameBoy implementation around the same time as I got the
|
|
||||||
FPGA. As such, it's code structure heavily mirrored that of my first attempt
|
|
||||||
at the CHIP-8's. For the project, I made no commitments to running it on an
|
|
||||||
FPGA, and much of the GameBoy is implemented, so I'm pushing forward with
|
|
||||||
keeping that structure. So far, the GameBoy can successfully run the bootrom,
|
|
||||||
draw the background layer to the display, and run a little bit of the Tetris
|
|
||||||
ROM (not enough to show anything yet).
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<video controls style="max-width: 500px;">
|
|
||||||
<source src="/blog-images/gameboy-boot.mp4" type="video/mp4">
|
|
||||||
Your browser does not support the video tag.
|
|
||||||
</video>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
The emulator booting!
|
|
||||||
</p>
|
|
|
@ -1,89 +0,0 @@
|
||||||
<h1>NWS Incident Postmortem 11/08/2023</h1>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
On November 8th, 2023 at approximately 09:47 UTC, NWS suffered
|
|
||||||
a complete outage. This outage resulted in the downtime of all
|
|
||||||
services hosted on NWS and the downtime of the NWS Management
|
|
||||||
Engine and the NWS dashboard.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
The incident lasted 38 minutes after which it was automatically
|
|
||||||
resolved and all services were restored. This is NWS' first
|
|
||||||
outage event of 2023.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2>Cause</h2>
|
|
||||||
<p>
|
|
||||||
NWS utilizes several tactics to ensure uptime. A component of
|
|
||||||
this is load balancing and failover. This service is currently
|
|
||||||
provided by Cloudflare at the DNS level. Cloudflare sends
|
|
||||||
health check requests to NWS servers at specified intervals. If
|
|
||||||
it detects that one of the servers is down, it will remove the
|
|
||||||
A record from entry.nws.nickorlow.com for that server (this domain
|
|
||||||
is where all services on NWS direct their traffic via a
|
|
||||||
CNAME).
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
At around 09:47 UTC, Cloudflare detected that our servers in
|
|
||||||
Texas (Austin and Hill Country) were down. It did not detect an
|
|
||||||
error, but rather an HTTP timeout. This is an indication that the
|
|
||||||
server may have lost network connectivity. When Cloudflare detected that the
|
|
||||||
servers were down, it removed their A records from the
|
|
||||||
entry.nws.nickorlow.com domain. Since NWS Pennsylvania servers
|
|
||||||
have been undergoing maintenance since August 2023, this left no
|
|
||||||
servers able to serve requests routed to entry.nws.nickorlow.com,
|
|
||||||
resulting in the outage.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
NWS utilizes UptimeRobot for monitoring the uptime statistics of
|
|
||||||
services on NWS and NWS servers. This is the source of the
|
|
||||||
statistics shown on the NWS status page.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
UptimeRobot did not detect either of the Texas NWS servers as being
|
|
||||||
offline for the duration of the outage. This is odd, as UptimeRobot
|
|
||||||
and Cloudflare did not agree on the status of NWS servers. Logs
|
|
||||||
on NWS servers showed that requests from UptimeRobot were being
|
|
||||||
served while no requests from Cloudflare were shown in the logs.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
No firewall rules existed that could have blocked the healthcheck traffic from Cloudflare
|
|
||||||
for either of the NWS servers. There was no other configuration
|
|
||||||
found that would have blocked these requests. As these servers
|
|
||||||
are on different networks inside different buildings in different
|
|
||||||
parts of Texas, their networking equipment is entirely separate.
|
|
||||||
This rules out any failure of networking equipment owned
|
|
||||||
by NWS. This leads us to believe that the issue may have been
|
|
||||||
caused due to an internet traffic anomaly, although we are currently
|
|
||||||
unable to confirm that this is the cause of the issue.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
This is being actively investigated to find a more concrete root
|
|
||||||
cause. This postmortem will be updated if any new information is
|
|
||||||
found.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
A similar event occurred on November 12th, 2023 lasting for 2 seconds.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2>Fix</h2>
|
|
||||||
<p>
|
|
||||||
The common factor between both of these servers is that they both use
|
|
||||||
Spectrum for their ISP and that they are located near Austin, Texas.
|
|
||||||
The Pennsylvania server maintenance will be expedited so that we have
|
|
||||||
servers online that operate with no commonalities.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
NWS will also investigate other methods of failover and load
|
|
||||||
balancing.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>Last updated on November 16th, 2023</p>
|
|
|
@ -1,99 +0,0 @@
|
||||||
<h1>Side Project Log 10/20/2023</h1>
|
|
||||||
<p>This side project log covers work done from 8/15/2023 - 10/20/2023</p>
|
|
||||||
|
|
||||||
<h2 id="anthracite">Anthracite</h2>
|
|
||||||
<a href="https://github.com/nickorlow/anthracite">[ GitHub Repo ]</a>
|
|
||||||
<p>
|
|
||||||
Anthracite is a web server written in C++. The site you're reading this on
|
|
||||||
right now is hosted on Anthracite. I wrote it to deepen my knowledge of C++ and networking protocols. My
|
|
||||||
main focus of Anthracite is performance. While developing anthracite,
|
|
||||||
I have been exploring different optimization techniques and benchmarking
|
|
||||||
Anthracite against popular web servers such as NGINX and Apache.
|
|
||||||
Anthracite supports HTTP/1.1 and only supports GET requests to request
|
|
||||||
files stored on a server.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Anthracite currently performs on par with NGINX and Apache when making
|
|
||||||
1000 requests for a 50MB file using 100 threads in a Docker container.
|
|
||||||
To achieve this performance, I used memory profilers to find
|
|
||||||
out what caused large or repeated memory copies to occur. I then updated
|
|
||||||
those sections of code to remove or minimize these copies. I also
|
|
||||||
made it so that Anthracite caches all files it can serve in memory. This
|
|
||||||
avoids unnecessary and costly disk reads. The implementation of this is
|
|
||||||
subpar, as it requires that the server be restarted whenever the files
|
|
||||||
it is serving are changed for the updates to be detected by Anthracite.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
I intend to make further performance improvements, specifically in the request
|
|
||||||
parser. I also plan to implement HTTP/2.0.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2 id="yacemu">Yet Another Chip Eight Emulator (yacemu)</h2>
|
|
||||||
<a href="https://github.com/nickorlow/yacemu">[ GitHub Repo ]</a>
|
|
||||||
<p>
|
|
||||||
YACEMU is an interpreter for the CHIP-8 instruction set written in C. My main
|
|
||||||
goal when writing it was to gain more insight into how emulation works. I had
|
|
||||||
previous experience with this from when I worked on an emulator for a slimmed-down
|
|
||||||
version of X86 called <a href="https://web.cse.ohio-state.edu/~reeves.92/CSE2421sp13/PracticeProblemsY86.pdf">Y86</a>.
|
|
||||||
So far, I've been able to get most instructions working. I need to work on adding
|
|
||||||
input support so that users can interact with programs running in yacemu. It has
|
|
||||||
been fairly uncomplicated and easy to write thus far. After I complete it, I would
|
|
||||||
like to work on an emulator for a real device such as the GameBoy (This might be
|
|
||||||
biting off more than I can chew).
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2 id="nick-vim">Nick VIM</h2>
|
|
||||||
<p>
|
|
||||||
Over the summer while I was interning, I began using VIM as my primary
|
|
||||||
text editor. I used a preconfigured version of it (<a href="https://nvchad.com/">NvChad</a>) to save time, as
|
|
||||||
setting everything up can take a while. After using it for a few months, I began
|
|
||||||
making my own configuration for VIM, taking what I liked from NvChad and leaving
|
|
||||||
behind the parts that I didn't like as much.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<img src="/blog-images/NickVIM_Screenshot.png" alt="Screenshot of an HTML file open for editing in NickVIM"/>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
One important part of Nick VIM was ensuring that it was portable between different
|
|
||||||
machines. I wanted the machine to have as few dependencies as possible so that I
|
|
||||||
could get NickVIM set up on any computer in a couple of minutes. This will be especially
|
|
||||||
useful when working on my School's lab machines and when switching to new computers
|
|
||||||
in the future. I achieved this by dockerizing Nick VIM. This is based on what one of
|
|
||||||
my co-workers does with their VIM setup. The Docker container contains
|
|
||||||
all the dependencies for each language server. Whenever you edit a file with Nick Vim,
|
|
||||||
the following script runs:
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<code lang="bash">
|
|
||||||
echo Starting container...
|
|
||||||
cur_dir=`pwd`
|
|
||||||
container_name=${cur_dir////$'_'}
|
|
||||||
container_name="${container_name:1}_$RANDOM"
|
|
||||||
docker run --name $container_name --network host -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --mount type=bind,source="$(pwd)",target=/work -d nick-vim &> /dev/null
|
|
||||||
|
|
||||||
echo Execing into container...
|
|
||||||
docker exec -w /work -it $container_name bash
|
|
||||||
|
|
||||||
echo Stopping container in background...
|
|
||||||
docker stop $container_name &> /dev/null &
|
|
||||||
</code>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
This code creates a new container, forwards the host's clipboard to the container, and
|
|
||||||
mounts the current directory inside the container for editing.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2 id="secane">Secane</h2>
|
|
||||||
<p><a href="https://www.youtube.com/watch?v=tKRehO7FH_s">[ Video Demo ]</a></p>
|
|
||||||
<p>
|
|
||||||
Secane was a simple ChatGPT wrapper that I wrote to practice for the behavioral part of
|
|
||||||
job interviews. It takes your resume, information about the company, and information about
|
|
||||||
the role you're interviewing for. It also integrates with OpenAI's whisper, allowing you
|
|
||||||
to simulate talking out your answers. I made it with Next.JS.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
<p><strong>These projects had minimal/no work done on them:</strong> NWS, RingGold, SQUIRREL</p>
|
|
||||||
<p><strong>These projects I will no longer be working on:</strong> Olney</p>
|
|
|
@ -1,17 +0,0 @@
|
||||||
<h1>Side Project Log 3/20/2023</h1>
|
|
||||||
<p>Spring break just wrapped up. I wrote a <a href="">blog</a> last week about the side projects that I was planning on
|
|
||||||
doing. I wanted to provide an update on what I got done, and figured I'd turn it into a recurring thing.</p>
|
|
||||||
<p>This side project log covers work done from 3/13/2023 - 3/20/2023</p>
|
|
||||||
<h2 id="-personal-website-facelift-https-github-com-nickorlow-personal-site-"><a href="https://github.com/nickorlow/personal-site">Personal Website Facelift</a></h2>
|
|
||||||
<p>I managed to move my website over to tab-based navigation pretty early on in the break. It just involved setting
|
|
||||||
up a navbar component and then using react-navigation to navigate between pages. I also managed to
|
|
||||||
update my projects page to be more compact and readable. </p>
|
|
||||||
<p>There is still work to be done on making it look better, but I mostly believe that
|
|
||||||
it's just going to be somewhat minor tweaks.</p>
|
|
||||||
<h2 id="-mahantongo-https-github-com-nickorlow-mahantongo-"><a href="https://github.com/nickorlow/mahantongo">Mahantongo</a></h2>
|
|
||||||
<p>I managed to finish this one. I learned a lot about Rust and I've gained an appreciation for
|
|
||||||
Rust's enforcement of good programming habits, and I really like how error handling is done.</p>
|
|
||||||
<p>Working with Serenity was pretty easy as it mirrored some of the other Discord SDKs I've used
|
|
||||||
before.</p>
|
|
||||||
<hr>
|
|
||||||
<p><strong>The below projects had minimal/no work done on them:</strong> RingGold, NWS Container Deployment Service, and VerifiedBot </p>
|
|
|
@ -1,17 +0,0 @@
|
||||||
<h1>Side Project Log 3/27/2023</h1>
|
|
||||||
<p>This side project log covers work done from 3/20/2023 - 3/27/2023</p>
|
|
||||||
<h2 id="septa-site">SEPTA Site</h2>
|
|
||||||
<p>I started a new project that aimed to recreate parts of SEPTA's website with a more elegant UI, and using
|
|
||||||
SEPTA's new "SEPTA Metro" wayfinding. The main goal with this project was to help me learn Svelte. I also had
|
|
||||||
to reverse-engineer the APIs on septakey.org in order to authenticate a user and get their trip history. </p>
|
|
||||||
<p>In terms of Svelte, I really enjoyed working with it and overall I found it much more elegant and easier to work
|
|
||||||
with than React. I didn't like the way it handled client-server interaction with its serverside functions. </p>
|
|
||||||
<p>I have not made this open source yet and do not intend to until it's more polished.</p>
|
|
||||||
<h2 id="-verified-bot-https-github-com-benaubin-verified-bot-"><a href="https://github.com/benaubin/verified-bot">Verified Bot</a></h2>
|
|
||||||
<p>I made all the necessary changes and tests to get VerifiedBot working. It is now waiting on my friend Ben
|
|
||||||
to merge my PR with the changes outlined in my <a href="https://nickorlow.com/blog/spring-break-2023">spring break blog</a>.</p>
|
|
||||||
<h2 id="-mahantongo-https-github-com-nickorlow-mahantongo-"><a href="https://github.com/nickorlow/mahantongo">Mahantongo</a></h2>
|
|
||||||
<p>I created some QoL features, such as using Discord's embeds instead of sending regular text messages, showing which board
|
|
||||||
a post was on, and fixing some bugs.</p>
|
|
||||||
<hr>
|
|
||||||
<p><strong>The below projects had minimal/no work done on them:</strong> RingGold, and NWS Container Deployment Service </p>
|
|
|
@ -1,25 +0,0 @@
|
||||||
<h1>Side Project Log 4/29/2023</h1>
|
|
||||||
<p>This side project log covers work done from 3/27/2023 - 4/29/2023</p>
|
|
||||||
<p>This side project log is a bit late due to it being a busy month of school, but today is my last day!</p>
|
|
||||||
<h2 id="septa-site">SEPTA Site</h2>
|
|
||||||
<p>This week, I published SEPTA Site on Github, you can find it here: <a href="https://github.com/nickorlow/septa-site">github.com/nickorlow/septa-site</a>.</p>
|
|
||||||
<p>I made a few tweaks to it in terms of styling and also wrote a descriptive README to give people instructions on how to run it as I don't want
|
|
||||||
to host it myself since it handles credentials from another service.</p>
|
|
||||||
<h2 id="squirrel">SQUIRREL</h2>
|
|
||||||
<p>SQUIRREL, short for SQL Query Util-Izing Rust's Reliable and Efficient Logic, is a SQL database that I am writing in Rust. Currently, it can
|
|
||||||
parse CREATE TABLE commands, and works with the data types varchar and int. I plan to implement basic CRUD operations, then add JOINs, and
|
|
||||||
then try to make it wire-compatible with Postgres.</p>
|
|
||||||
<p>This project is currently not open-sourced as I am waiting to add more features and polish it up more.</p>
|
|
||||||
<h2 id="swole-control">Swole Control</h2>
|
|
||||||
<p>This one isn't a <em>personal</em> project, however it is a project that I worked on with a group. We began working on it in February as a part of a
|
|
||||||
club at UT called Texas Convergent. We recently presented it at the club's demo day and won the prize for having the best business.</p>
|
|
||||||
<p>Swole Control is an app that monitors machine usage at a gym on a machine-by-machine level, providing gym goers with information about what machines
|
|
||||||
are free (this is a major pain point as a gym goer myself). It also provides gym owners with statistics on which machines are most popular, providing
|
|
||||||
them valuable insights into their business.</p>
|
|
||||||
<p>To achieve this, we built hardware that consisted of an ESP-32 micro controller and an ultrasonic distance sensor. This hardware is mounted on a gym machine
|
|
||||||
and it measures the distance to the nearest object. It then sends this measurement to a Rust backend which stores it in a Firestore database (although we had
|
|
||||||
a fork of it that worked with Postgres). The backend then uses these measurements and compares them to a baseline to determine if there is a user at a machine.
|
|
||||||
Our mobile app then reads this from the Firestore database (it's planned to have it read this from the API to have a better-defined application boundary). The
|
|
||||||
frontend is written in React Native.</p>
|
|
||||||
<hr>
|
|
||||||
<p><strong>These projects had minimal/no work done on them:</strong> RingGold, and NWS Container Deployment Service</p>
|
|
|
@ -1,70 +0,0 @@
|
||||||
<h1>Side Project Log 7/12/2023</h1>
|
|
||||||
<p>This side project log covers work done from 4/29/2023 - 7/12/2023</p>
|
|
||||||
<p>This side project log is more than a bit late due to working a busy summer internship at <a href="https://futo.org">FUTO</a>!</p>
|
|
||||||
<h2 id="nws-container-deployment-service">NWS Container Deployment Service</h2>
|
|
||||||
<p>I have finally added SSL to NWS CDS. This was challenging, as it required handling ACME challenges and certificate
|
|
||||||
distribution across a set of geo-distributed Kubernetes clusters. I detail the complexities of this in a <a href="http://nickorlow.com/blog/ssl-in-nws-cds">previous blog
|
|
||||||
I wrote</a>. In order to implement auto-created/auto-renewing SSL, I implemented the below solution:</p>
|
|
||||||
<p><img src="/blog-images/NWS_SSL_Diagram.png" alt="Diagram of NWS SSL Architecture"></p>
|
|
||||||
<p>First, a user creates a request to add SSL to their NWS CDS service through the web UI which calls the NWS API (not pictured)</p>
|
|
||||||
<p>Then, the NWS API calls SSLiaison (in-house written software) which adds the domain to Caddy's list of domains. Caddy will then attempt to create
|
|
||||||
an SSL certificate from an ACME server (not pictured).</p>
|
|
||||||
<p>The ACME server will query NWS for the challenge response by requesting a file at <code>/.well-known/acme-challenge</code> on the
|
|
||||||
domain to be verified (this is the green arrows). </p>
|
|
||||||
<p>HAProxy will re-route these requests to NWS Hill Country, which is where the NWS Management Engine (NWSME) lives (this is
|
|
||||||
the orange arrows). <em>(NWSME controls what's deployed on each k8s cluster on NWS)</em></p>
|
|
||||||
<p>HAProxy in NWS Hill Country will then route this request to Caddy, which will solve the <a href="https://letsencrypt.org/docs/challenge-types/">http-01 challenge</a>, and then get the certificate
|
|
||||||
from the ACME server. Once it does this, it will write the certificate to a directory that is bind-mounted to both Caddy
|
|
||||||
and SSLiaison. </p>
|
|
||||||
<p>SSLiaison will detect this new file, parse it into a k8s manifest file, and then add it to our GitOps repo which is
|
|
||||||
hosted in GitHub.</p>
|
|
||||||
<p>From here, the certificate will be added to all the k8s clusters via Rancher Fleet.</p>
|
|
||||||
<hr>
|
|
||||||
<p>For next steps, I'd like to revise this solution such that it doesn't have a single point of failure.
|
|
||||||
Currently, if NWS Hill Country is down (which it is about 0.025% of the time), then SSL certificates
|
|
||||||
won't be able to be created or renewed. </p>
|
|
||||||
<p>To do this, I will have SSLiaison implement the ACME client specification so that it can create and respond do ACME HTTP challenges.
|
|
||||||
SSLiaison will run on NWS CDS (so that it's running on all of our k8s clusters and is HA) instead of running as a standalone docker container.
|
|
||||||
I'll have SSLiaison use some distributed database (probably CockroachDB) to store the HTTP challenges so that it doesn't matter
|
|
||||||
which k8s cluster the challenge request from the ACME server is routed to.</p>
|
|
||||||
<h2 id="next-steps-for-nws">Next Steps for NWS</h2>
|
|
||||||
<ul>
|
|
||||||
<li><strong>HA NWS Management Engine:</strong> Currently (as somewhat discussed above), the NWSME will go down when NWS Hill Country goes down. I'd like to
|
|
||||||
make it so that this isn't the case. This would likely just require that each NWS cluster runs its own instance of Rancher Fleet instead
|
|
||||||
of one central Rancher Fleet that manages all the clusters. It would also require the HA SSLiaison.</li>
|
|
||||||
</ul>
|
|
||||||
<ul>
|
|
||||||
<li><strong>IaC for Everything:</strong> Currently, all NWS CDS services are defined in yaml files in a git repo, however the underlying infrastructure that
|
|
||||||
it runs on is not. Ideally, I'd like every NWS machine to run Proxmox and then have Terraform & Ansible configs to define how to set up
|
|
||||||
vms on proxmox that will run the k8s clusters that support CDS services. This should eliminate my headaches of sshing into each machine
|
|
||||||
to apply config changes and make sure everything is standardized. It should also make the process of setting up new servers easy.</li>
|
|
||||||
</ul>
|
|
||||||
<ul>
|
|
||||||
<li><strong>Monitoring:</strong> I've been working on setting up monitoring on a lot of our services at my current internship using the TIG stack (Telegraf,
|
|
||||||
InfluxDB, and Grafana). Now that I've been exposed to the usefulness of having a bunch of metrics on hand, I think it would be nice to have
|
|
||||||
some dashboards setup for NWS to monitor speed, resource usage, uptime, and traffic. Doing this would also make it possible to expose resource usage in the
|
|
||||||
NWS dashboard.</li>
|
|
||||||
</ul>
|
|
||||||
<ul>
|
|
||||||
<li><p><strong>Enhanced Infrastructure:</strong> This is kind of a blanket one for things I want to do that don't fit into other categories. It includes making
|
|
||||||
hardware upgrades (mostly adding more storage), make management more accessible (such as Dell IDRAC's WebSerial), some load testing to
|
|
||||||
identify painpoints, run an NWS machine in a cloud VM so I can say it's cross cloud (although my friends have told me this is cheating at creating
|
|
||||||
my own cloud), and trying to figure out how to set up an Anycast network. I don't think I can setup an Anycast network without selling
|
|
||||||
a kidney first. Renting a /24 CIDR alone would be more than I want to spend on a side project. I may look into setting it up with ipv6 only,
|
|
||||||
however I'd still have to jump through hoops to get an Autonomous System number from an RIR. I'll probably write a whole blog about Anycast
|
|
||||||
in the coming weeks.</p>
|
|
||||||
</li>
|
|
||||||
<li><p><strong>Reduced External Dependence:</strong> The main goal of NWS is to have no external dependence. In theory, everything but core internet infrastructure
|
|
||||||
should </p>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<h2 id="olney">Olney</h2>
|
|
||||||
<p><code>Rust, ActixWeb, PostgreSQL</code></p>
|
|
||||||
<p>Olney is a new project I am starting with my friend <a href="https://sridharnandigam.com/">Sridhar Nandigam</a>. It aims to make
|
|
||||||
tracking your job applications easier. Most of my friends either use spreadsheets or Trello to track their job applications, I
|
|
||||||
think that we can make something that's a bit better for the job. Some features I'd like to have are: resume version attached to
|
|
||||||
your application, job posting notifications from job boards such as <a href="github.com/pittcsc/summer2024-internships">pittcsc</a>, and watching
|
|
||||||
your email for emails from recruiters. Currently, I have part of the backend setup with basic CRUD operations. Now that I'm done with
|
|
||||||
the latest batch of NWS work, this is next on my list to work on.</p>
|
|
||||||
<hr>
|
|
||||||
<p><strong>These projects had minimal/no work done on them:</strong> RingGold, SQUIRREL</p>
|
|
|
@ -1,60 +0,0 @@
|
||||||
<h1>Side Project Log 8/15/2023</h1>
|
|
||||||
<p>This side project log covers work done from 8/8/2023 - 8/15/2023</p>
|
|
||||||
|
|
||||||
<h2 id="olney">Olney</h2>
|
|
||||||
<p>
|
|
||||||
I added a frontend to Olney and added a feature where it can automatically keep track of your job applications
|
|
||||||
by monitoring your email.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h3>Frontend</h3>
|
|
||||||
<p>
|
|
||||||
The frontend was made with Svelte. I chose not to use any UI/CSS libraries as I wanted to keep the number of
|
|
||||||
dependencies low. This was another good opportunity to learn about Svelte.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h3>Automatic Tracking via E-Mail</h3>
|
|
||||||
<p>
|
|
||||||
This is the killer feature that I initially set out to build Olney for. This works by having the user forward their
|
|
||||||
E-Mail to an instance of Olney. To receive E-Mail, Olney uses <a href="https://inbucket.org">Inbucket</a>, a mailserver
|
|
||||||
easily hostable within Docker. It listens on a websocket for incoming mail. Whenever a new mail message is received,
|
|
||||||
Olney uses the OpenAI API to get a summary of the email in the following format:
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<pre><code class="language-json">
|
|
||||||
{
|
|
||||||
isRecruiting: bool, // is the message about recruiting?
|
|
||||||
recruitingInfo: null | {
|
|
||||||
location: string, // Location in City, Providence/State, Country format
|
|
||||||
company: string, // Casual name of company e.g: Google, Cisco, Apple
|
|
||||||
position: string, // Name of job position
|
|
||||||
type: "assessment" | "interview" | "offer" | "rejection" | "applied" // What the message is discussing
|
|
||||||
dateTime: string, // DateTime communication rec'd OR DateTime that is being discussed (i.e. interview date confirmation)
|
|
||||||
name: string // Name of event, giving more detail to type
|
|
||||||
} // null if message is not about recruiting, fill with values if it is
|
|
||||||
}
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Olney then takes some details from this data, namely: company, position, and location and then uses the OpenAI API to generate
|
|
||||||
an <a href="https://www.pinecone.io/learn/vector-embeddings/">embedding</a>. We then query the closest match out of the job applications
|
|
||||||
in the database (with <a href="https://github.com/pgvector/pgvector">pgvector</a>). Once we have the job application, we add
|
|
||||||
the event to the database, using the job application's id as a fkey.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
I chose embedding as the lookup method so that we don't have to worry about the data parsed out of the email being an exact
|
|
||||||
match for what the user inputted. This also allows the lookup to work even when certain things such as location are missing from the
|
|
||||||
email.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Olney should be open-sourced/released within the next week or two.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
<p><strong>These projects had minimal/no work done on them:</strong> NWS, RingGold, SQUIRREL</p>
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/dark.min.css">
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
|
|
||||||
<script>hljs.highlightAll();</script>
|
|
|
@ -1,65 +0,0 @@
|
||||||
<h1>Side Project Log 8/8/2023</h1>
|
|
||||||
<p>This side project log covers work done from 7/12/2023 - 8/8/2023</p>
|
|
||||||
|
|
||||||
<h2 id="squirrel">SQUIRREL</h2>
|
|
||||||
<p>
|
|
||||||
SQUIRREL has been updated to work with INSERT INTO and SELECT queries. I also refactored much of the codebase to do error handling more elegantly and to make the parser
|
|
||||||
more extensible. Here's a screenshot of table creation, data insertion, and data selection:
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
The biggest challenge of this part was working on the parser which has now been written three times. The approaches to the parsing were:
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<ol>
|
|
||||||
<li>
|
|
||||||
<b>Stepping through whitespace:</b> <p>This was my initial and naive approach to the problem. I split the input string by its whitespace
|
|
||||||
and then queried values by referencing their indexes in the split string. </p>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<b>Regex:</b> <p>This approach was cleaner than the first and led to a small parser, however it required an external dependency (which I'm
|
|
||||||
trying to minimize), and would make it hard to add additional features to commands later down the line.</p>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<b>Finite state machine:</b> <p>This solution was more verbose than the others, however it allows for easier development. This method works
|
|
||||||
by splitting the query string into tokens. Tokens are the smallest piece of data that a parser recognizes. SQUIRREL gets them by splitting
|
|
||||||
the input by delimiters and using the split list as tokens (excluding whitespace) SQUIRREL recognizes the following characters as delimiters:
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<code>
|
|
||||||
' ', ',', ';', '(', ')'
|
|
||||||
</code>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
This means that the string "INSERT INTO test (id) VALUES (12);" would be parsed into the list: "INSERT", "INTO", "test", "(", "id", etc..
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Once we have our list of tokens, we iterate through them starting at a default state and perform a certain task for the given state, which
|
|
||||||
usually includes switching to another state. We do this until we reach the end state.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
For example, with the above insert statement, we would start in the IntoKeyword state which would ensure that "INTO" is the current token.
|
|
||||||
We would then transition to the TableName state which would read the table name and store it in the ParsedCommand struct we're returning. We
|
|
||||||
would then move to the ColumnListBegin state which would look for an opening parenthesis, and switch the state to ColumnName. This process
|
|
||||||
continues with the other parts of the query until the Semicolon state is reached which checks that the statement ends with a semicolon, then
|
|
||||||
returns the ParsedCommand struct.
|
|
||||||
</p>
|
|
||||||
</li>
|
|
||||||
</ol>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Next steps for this are to add column selection to SELECT statements and add WHERE clauses to SELECT statements.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2 id="olney">Olney</h2>
|
|
||||||
<p>
|
|
||||||
I added a feature to the Olney API which scans the <a href="https://github.com/SimplifyJobs/Summer2024-Internships">pittcsc (now Simplify) summer internships Github repo</a>
|
|
||||||
and parses the data into JSON format. I parsed the markdown file they have uisng regex which was relatively simple. There were some issues during development due to the
|
|
||||||
changing structure of the markdown file. These issues are being fixed on a rolling basis. I expect the changes to slowdown now that the transition from pittcsc to Simplify
|
|
||||||
is complete. You can access the JSON at <a href="https://olney.nickorlow.com/jobs">olney.nickorlow.com/jobs</a>.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
<p><strong>These projects had minimal/no work done on them:</strong> NWS, RingGold</p>
|
|
|
@ -1,57 +0,0 @@
|
||||||
<h1>Spring Break 2023</h1>
|
|
||||||
<p>It's Spring Break, and that means I finally have time to spend all day working on side projects without having to worry about school.</p>
|
|
||||||
<p>I figured I should write out the side projects I plan to work on over the break</p>
|
|
||||||
<h2 id="ringgold">RingGold</h2>
|
|
||||||
<p><code>Rust, Swift, PostgreSQL</code></p>
|
|
||||||
<p>Last week, me and my cousin wanted to try out Apple's fitness competition feature that works with Apple Watch. It works
|
|
||||||
by giving you 1 point for every percent you complete of your move, exercise, and stand goals with a point cap of 600
|
|
||||||
per day. The issue with it was that it didn't work at all, not syncing on time if at all. I want to build a clone of it
|
|
||||||
with some additional features such as:</p>
|
|
||||||
<ul>
|
|
||||||
<li><p><strong>Notifications:</strong> I didn't like how it was possible to workout and gain a bunch of points and just completely blindside your opponent. Hopefully this would encourage users to workout even more.</p>
|
|
||||||
</li>
|
|
||||||
<li><p><strong>Widget/Watch Complication:</strong> Similar to the above, adding a homescreen widget or a watch complication would make it easier to keep up with your competitor's progress. </p>
|
|
||||||
</li>
|
|
||||||
<li><p><strong>Custom Competitions:</strong> I think it'd be nice to have competitions with custom rules and lengths so that you're not stuck with only one setting. Settings could include custom duration and custom caps on points.</p>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p>I'm building the web API for it in Rust and the mobile app in Swift. I chose these languages to gain more exposure to them, also
|
|
||||||
Swift was a good choice since the app is going to be platform specific to iOS due to its need to integrate with Apple Watch.
|
|
||||||
<em>(this is named after New Ringgold, PA)</em></p>
|
|
||||||
<h2 id="nws-container-deployment-service">NWS Container Deployment Service</h2>
|
|
||||||
<p><code>C#, Rancher</code></p>
|
|
||||||
<p>I've created my own hosting/cloud service called <a href="https://nws.nickorlow.com">Nick Web Services</a>. It currently allows people to deploy
|
|
||||||
dockerized applications on my geo-distributed k8s clusters running on Dell Poweredge servers. In order to actually deploy this, I
|
|
||||||
had to manually create the Kubernetes manifest files and then ssh into each individual server and apply them. I've setup
|
|
||||||
Rancher Fleet to automate this process by pulling the manifest from a git repo (this is something called gitops). I also
|
|
||||||
wrote an API to generate the manifest files and then upload them to a git repo. I have a video demo of this working that
|
|
||||||
you can watch <a href="https://youtu.be/WHdXWMFHuqA">here</a>.</p>
|
|
||||||
<p>Currently, the service works for deployment but only if you don't want to use SSL or you use Cloudflare's flexible SSL
|
|
||||||
technology. I wrote a separate blog post <a href="http://nickorlow.com/blog/ssl-in-nws-cds">here</a> about the challenges of doing this and how I plan on implementing it.
|
|
||||||
I'd like to complete part of this implementation during the break.</p>
|
|
||||||
<h2 id="verifiedbot">VerifiedBot</h2>
|
|
||||||
<p><code>JavaScript, Rust</code></p>
|
|
||||||
<p>This project isn't a personal project, as a lot of it was built by my friends <a href="https://arpan.one">Arpan</a> and <a href="https://benaubin.com/">Ben</a>.
|
|
||||||
A little over a year ago, we wanted to make a Discord bot to verify that people on some Discord servers we ran
|
|
||||||
went to the University of Texas. Initially, it worked by verifying you had a utexas.edu email address and then verifying
|
|
||||||
some additional information via LDAP. A few months ago Ben found out that using the SaaS survey software that the university uses
|
|
||||||
(qualtrics), we could have users verify themselves by using the university's SSO system. This works because qualtrics can send
|
|
||||||
data to a webhook when a survey is complete, and it can also require signing in with the university's SSO before filling out a survey.
|
|
||||||
It required that I write a <a href="https://github.com/Verified-Bot/aes-gcm-siv-wasm">wasm wrapper for an encryption library</a>. I wrote almost all the code for this function last year, but
|
|
||||||
due to a bug in qualtrics, it wasn't working properly. It seems that this bug has been fixed and we can start rolling it out.</p>
|
|
||||||
<h2 id="personal-website-facelift">Personal Website Facelift</h2>
|
|
||||||
<p><code>Typescript, React</code></p>
|
|
||||||
<p>My personal website (this one) is a little overdue for some design updates. My main focus will be making it more mobile
|
|
||||||
friendly. Last year, I made some improvements to make it usable on mobile but it still doesn't feel quite right. I also
|
|
||||||
think that it has some information overload in some areas such as the projects section. I think that to mitigate this I
|
|
||||||
might just have a small summary of each project and then you can click into each to learn more about it, similar to my
|
|
||||||
friend <a href="https://raulhigareda.com">Raul's Website</a>. I'm also considering a move to tab-based navigation so that I can have
|
|
||||||
more information in each section. Further down the line, I think I might re-write it using Svelte as I'm seeing it being used more and more
|
|
||||||
and would like to get some exposure to it.</p>
|
|
||||||
<h2 id="mahantongo">Mahantongo</h2>
|
|
||||||
<p><code>Rust, PostgreSQL</code></p>
|
|
||||||
<p>I'm one of the members of the Community Team that runs some UT Computer Science community Discord servers.
|
|
||||||
Currently, a Discord bot called Carlbot provides us a star-board, which is a specific channel where messages that 5 or more people
|
|
||||||
react to with a star emoji get posted. It's supposed to be a collection of the funniest and best messages sent on the server.
|
|
||||||
One of the things our server members have wanted is the addition of more '*-board' channels where you can create multiple star-board
|
|
||||||
like channels but with custom emojis. I'm writing it in Rust and I'm just hoping to use this project to get more acquainted with the language.</p>
|
|
|
@ -1,112 +0,0 @@
|
||||||
<div>
|
|
||||||
<h1 style="margin-bottom: 0px;">Extra</h1>
|
|
||||||
<p style="margin-top: 0px;">Extra bits of information about me</p>
|
|
||||||
|
|
||||||
<h2>Rail Photography</h2>
|
|
||||||
<p>
|
|
||||||
I take photos of trains and train stations fairly often.
|
|
||||||
If you would like to see these pictures, they are available
|
|
||||||
<a href="https://www.instagram.com/nickorlow.on.rails/">here</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2>Bowling</h2>
|
|
||||||
<p>
|
|
||||||
I go bowling with some friends regularly. We track our scores
|
|
||||||
down to the throw in a csv. You can check out a website where
|
|
||||||
that data is compiled into a readable format
|
|
||||||
<a href="https://bart.nickorlow.com">here</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2>Personal Records</h2>
|
|
||||||
<table style="width: 100%;">
|
|
||||||
<tr>
|
|
||||||
<th>Activity</th>
|
|
||||||
<th>Effort</th>
|
|
||||||
<th>Date</th>
|
|
||||||
<th>Location</th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>1600m (1 mile)</td>
|
|
||||||
<td>4:34</td>
|
|
||||||
<td>November 14th, 2020</td>
|
|
||||||
<td>Williamson County Park</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Milk Mile</td>
|
|
||||||
<td>5:41</td>
|
|
||||||
<td>May 20th, 2021</td>
|
|
||||||
<td>Lake Travis High School</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>3200m (2 mile)</td>
|
|
||||||
<td>10:11</td>
|
|
||||||
<td>March 20th, 2021</td>
|
|
||||||
<td>Carroll High School</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>5000m XC</td>
|
|
||||||
<td>16:43</td>
|
|
||||||
<td>September 26th, 2020</td>
|
|
||||||
<td>Old Settler's Park</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Bench Press</td>
|
|
||||||
<td>280.5 Lbs</td>
|
|
||||||
<td>December 31st, 2024</td>
|
|
||||||
<td>Anytime Fitness - Pottsville, PA</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Squat</td>
|
|
||||||
<td>415 Lbs</td>
|
|
||||||
<td>August 10th, 2023</td>
|
|
||||||
<td>FUTO HQ</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Deadlift</td>
|
|
||||||
<td>415 Lbs</td>
|
|
||||||
<td>Augist 10th, 2023</td>
|
|
||||||
<td>FUTO HQ</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Bowling</td>
|
|
||||||
<td>170</td>
|
|
||||||
<td>April 19th, 2024</td>
|
|
||||||
<td>Texas Union Underground</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
<h2>In the news</h2>
|
|
||||||
<p>
|
|
||||||
<a href="https://www.kxan.com/video/kxan-viewers-react-to-highland-lanes-closing/9431847/">[ Video of a strike I threw on the news ]</a>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<a href="https://www.kxan.com/video/highland-lanes-will-remain-on-burnet-a-little-longer-than-anticipated/9888905/">[ Same bowling video played again! ]</a>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<a href="https://www.youtube.com/watch?v=v9qSFdAjmFQ">[ Coverage of transit rally I spoke at (the news cut my speaking part) ]</a>
|
|
||||||
</p>
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
<h2>PGP Key</h2>
|
|
||||||
<div style="background-color: #1E1E2E; color: #FFFFFF; padding: 10px; overflow: scroll;">
|
|
||||||
<p>
|
|
||||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
|
||||||
<br>
|
|
||||||
mDMEZ8J/bhYJKwYBBAHaRw8BAQdAGaG9EehhWlKQQXP42W3Uvv6qkyo1NPzYASkR
|
|
||||||
vx4m0Y20K05pY2hvbGFzIE9ybG93c2t5IDxuaWNrb3Jsb3dAbmlja29ybG93LmNv
|
|
||||||
bT6IkwQTFgoAOxYhBPFsfG56tNFpdTscKKnzukwKp6cLBQJnwn9uAhsDBQsJCAcC
|
|
||||||
AiICBhUKCQgLAgQWAgMBAh4HAheAAAoJEKnzukwKp6cLrHYBAOFT953mpAY3yVE9
|
|
||||||
tvcA4sdpkmWw/OIrsd24vW74ykWyAQCvtqwLfsVvZxXRzvWOau3P+IrnYP5UGXJj
|
|
||||||
snieP3vXDLg4BGfCf24SCisGAQQBl1UBBQEBB0BOiEhnLnikOTCENkGfgmIRdswh
|
|
||||||
0qzryW9PMq5BN24BaAMBCAeIeAQYFgoAIBYhBPFsfG56tNFpdTscKKnzukwKp6cL
|
|
||||||
BQJnwn9uAhsMAAoJEKnzukwKp6cLyF8A/i46c9EPhzwlvkgLRJzsuHAoWX9DcCLR
|
|
||||||
JH39kfjZ5ecTAP4kQ+aw/oD3lhaDiIrEo1MobVDzoCM5wV39ci6klBsVCw==
|
|
||||||
=p51G
|
|
||||||
<br>
|
|
||||||
-----END PGP PUBLIC KEY BLOCK-----
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
|
@ -1,28 +0,0 @@
|
||||||
<div>
|
|
||||||
<h1 style="margin-bottom: 0px;">Nicholas Orlowsky</h1>
|
|
||||||
<p style="margin-top: 0px;">Software Engineer - Philadelphia, PA</p>
|
|
||||||
<p>
|
|
||||||
<a href="https://git.nickorlow.com/nickorlow">[ Git Repositories ]</a>
|
|
||||||
<a href="https://github.com/nickorlow">[ GitHub (mirrors) ]</a>
|
|
||||||
<a href="https://www.linkedin.com/in/nickorlow/">[ LinkedIn ]</a>
|
|
||||||
<a href="mailto:nickorlow@nickorlow.com">[ E-Mail ]</a>
|
|
||||||
<a href="https://github.com/nickorlow/resume/releases/download/latest/resume-nickorlow.pdf">[ Resume ]</a>
|
|
||||||
<!--<a href="https://old.nickorlow.com">[ My Old Website ]</a>-->
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<a href="https://azuredevopspodcast.clear-measure.com/nick-orlowsky-deciding-to-major-in-computer-science-episode-197">[ Listen to me on the Azure DevOps podcast! ]</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
I'm a Software Engineer in Philadelphia, Pennsylvania. I'm particularly
|
|
||||||
interested in computer architecture and systems programming, with a focus on
|
|
||||||
performance-critical applications.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
I ran <a href="https://nws.nickorlow.com">Nick Web Services (NWS)</a>, a side project
|
|
||||||
that provided geo-distributed container hosting using Kubernetes on bare metal servers.
|
|
||||||
It achieved 100% uptime for over a year. We had locations in Pottsville, PA, Philadelphia, PA, and Austin, Texas.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
|
@ -1,148 +0,0 @@
|
||||||
<div>
|
|
||||||
<h1 style="margin-bottom: 0px;">Projects</h1>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h2>Project Warminster: yayacemu, yacemu, yagbemu</h2>
|
|
||||||
<p><i>C, C++, and SystemVerilog</i></p>
|
|
||||||
<p>
|
|
||||||
<a href="https://git.nickorlow.com/nickorlow/yacemu">[ Git Repo: yacemu ]</a>
|
|
||||||
<a href="https://git.nickorlow.com/nickorlow/yayacemu">[ Git Repo: yayacemu ]</a>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<a href="https://files.nickorlow.com/videos/warminster/yayacemu_tetris.mp4">[ Tetris Demo: yayacemu ]</a>
|
|
||||||
<a href="https://files.nickorlow.com/videos/warminster/yayacemu_bowling.mp4">[ Bowling Demo: yayacemu ]</a>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Project Warminster is a collection of 3 subprojects:
|
|
||||||
<ul>
|
|
||||||
<li><b>yacemu (Yet Another Chip Eight Emulator):</b> A CHIP-8 emulator written in C</li>
|
|
||||||
<li><b>yayacemu (Yet Another Yet Another Chip Eight Emulator):</b> A CHIP-8 hardware implementation in SystemVerilog (that works on real hardware)</li>
|
|
||||||
<li><b>yagbemu (Yet Another Gameboy Emulator):</b> A Gameboy hardware implementation in SystemVerilog (WIP, not public yet)</li>
|
|
||||||
</ul>
|
|
||||||
This project taught me a lot of practical hands-on things about Computer Architecture. Designing the hardware driver for the ST7920 LED display was
|
|
||||||
the most challenging part. Debugging hardware adds a lot of complications, you don't get breakpoints or a nice debugger like gdb. Additionally,
|
|
||||||
interference, faulty wires, timing, and debouncing all throw wrenches into the mix.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h2>Nick Web Services (NWS)</h2>
|
|
||||||
<p><i>C#, Kubernetes, Rancher, and HAProxy</i></p>
|
|
||||||
<a href="https://nws.nickorlow.com">[ Project Website ]</a>
|
|
||||||
<p>
|
|
||||||
Nick Web Services is a cloud infrastructure provider service that I created and run.
|
|
||||||
It allows people to deploy containerized versions of their web apps across our multiple
|
|
||||||
points of presence. It provides geo-distributed high availability by default with no extra configuration
|
|
||||||
needed from users hosting their webapp with us.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Hardware-wise we use old Dell PowerEdge servers running Proxmox. We then have VMs running
|
|
||||||
in Proxmox that run Kubernetes clusters. At the peak I had 4 points of presence: Austin, Hill Country,
|
|
||||||
Schuylkill, and Philadelphia. The deployments are managed through GitOps with Rancher Fleet. Unfortunately,
|
|
||||||
we only have one point of presence at the moment due to a number of factors, however that should
|
|
||||||
change this fall.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
NWS maintained 100% uptime for the period from 11/8/2023 to 11/28/2024 (over a year!).
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
The website you're reading this on right now is hosted on NWS!
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h2>Anthracite Web Server</h2>
|
|
||||||
<p><i>C++, CMake, and Python</i></p>
|
|
||||||
<a href="https://git.nickorlow.com/nickorlow/anthracite">[ Git Repo ]</a>
|
|
||||||
<p>
|
|
||||||
Anthracite is a web server written for Linux in C++. It currently supports both HTTP/1.0 and HTTP/1.1 and TLS.
|
|
||||||
It heavily uses a dependency injection design pattern to allow for a high degree of customization.
|
|
||||||
It currently uses an event-loop threading model and uses the epoll() system call to efficiently detect
|
|
||||||
events. Previously, it used a connection per thread model.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Anthracite's HTTP request parser is able to parse roughly 27 million requests per second on my laptop, compared
|
|
||||||
to Boost's HTTP parser which parsed roughly 1 million per second. I'd imagine a lot of this is due to missing
|
|
||||||
functionality in Anthracite's HTTP parser, but it's enough to get by! While I haven't run extensive end-to-end
|
|
||||||
tests on the newest version of Anthracite, in the limited tests I've done during development, it's been able to
|
|
||||||
handle ~300k RPS on my laptop, a comparable number to NGINX.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
The website you're reading this on right now is hosted with Anthracite!
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h2>RAZZLE</h2>
|
|
||||||
<p><i>C, ASM, and CMake</i></p>
|
|
||||||
<a href="https://git.nickorlow.com/nickorlow/razzle">[ Git Repo ]</a>
|
|
||||||
<p>
|
|
||||||
RAZZLE is a monolithic kernel. Currently, it's very limited and I haven't made a lot of progress on it.
|
|
||||||
It's currently single-core but supports preemptive timesharing. It has basic I/O interfaces for ps2,
|
|
||||||
serial, and vga. It currently has a very limited in-ram filesystem using a proprietary filesystem.
|
|
||||||
I'm currently working on adding an ATA driver so I can have programs run on RAZZLE without including
|
|
||||||
them at build-time.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h2>Open Source Contributions</h2>
|
|
||||||
<p>
|
|
||||||
I've made various (minor) open source contributions. I'd say the only one worth anything was the cgroups2 support in
|
|
||||||
nginx-ingress.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<a href="https://github.com/kubernetes/ingress-nginx/pull/9816">[ kubernetes nginx-ingress: cgroups2 configuration support ]</a>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<a href="https://github.com/argoproj/argo-cd/pull/13060">[ argo cd: fix styling issue on dashboard ]</a>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<a href="https://github.com/endeavouros-team/endeavouros-i3wm-setup/pull/90">[ endeavouros: update default i3 config to work with numpad keys ]</a>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<a href="https://github.com/trivago/hamara/pull/15">[ trivago hamara: documentation update ]</a>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h2>SQUIRREL</h2>
|
|
||||||
<p><i>Rust</i></p>
|
|
||||||
<a href="https://git.nickorlow.com/nickorlow/squirrel">[ Git Repo ]</a>
|
|
||||||
<p>
|
|
||||||
SQUIRREL stands for SQL Query Util-Izing Rust's Reliable and Efficient Logic. It is a SQL database
|
|
||||||
that I am writing in Rust. Currently, it can create tables, insert data into tables, and select all
|
|
||||||
data from a given table. The biggest challenge so far has been writing the parser. My next steps are
|
|
||||||
to add WHERE clauses to SELECT statements, allow column filtering in SELECT statements, and add DELETE
|
|
||||||
statements.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h2>CavCash</h2>
|
|
||||||
<p><i>C#, Kubernetes, SQL Server, and MongoDB</i></p>
|
|
||||||
<!--<a href="https://cavcash.com">[ Project Website ]</a>-->
|
|
||||||
<p>
|
|
||||||
CavCash was a company that I founded which built a debit-based payment system similar to
|
|
||||||
PayPal and Venmo. I assembled a 5 person team and took on a technical role in the company,
|
|
||||||
writing most of our backend codebase. Our backend used C#, ASP.NET, Microsoft SQL Server,
|
|
||||||
and MongoDB. Our infrastructure changed throughout the lifetime of the company, initially
|
|
||||||
it was on Microsoft Azure using Azure App Service. We then pivoted to AWS using Elastic
|
|
||||||
Beanstalk. We also ran on Google Cloud Platform using Compute Engine. Finally, we setup our
|
|
||||||
own servers in-house and managed our deployments with Kubernetes.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
We launched in 2021, with the ability to send money between real banks using the ACH network.
|
|
||||||
We ended up processing a few hundred dollars in transaction volume before ultimately shutting
|
|
||||||
down due to a lack of funding. <!--The website is now back up and everything works as it did in
|
|
||||||
2021, except adding funds from a bank account is not supported.-->
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div style="width: 100%; display: flex; justify-content: center; padding: 5px;">
|
|
||||||
<a style="margin: 5px" href="https://github.com/nickorlow">[ See more projects on GitHub ]</a>
|
|
||||||
<a style="margin: 5px" href="https://git.nickorlow.com/nickorlow">[ See more projects on Forgejo ]</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
|
@ -1,23 +0,0 @@
|
||||||
<head>
|
|
||||||
<title>Nicholas Orlowsky</title>
|
|
||||||
<link rel="stylesheet" href="/style.css">
|
|
||||||
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
</head>
|
|
||||||
<body style="padding: 10px;">
|
|
||||||
<nav>
|
|
||||||
<a href="/">[ Home ]</a>
|
|
||||||
<a href="/blog.html">[ Blog ]</a>
|
|
||||||
<a href="/projects.html">[ Projects ]</a>
|
|
||||||
<a href="/extra.html">[ Extra ]</a>
|
|
||||||
<hr/>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
{{ body_area }}
|
|
||||||
|
|
||||||
<footer>
|
|
||||||
<hr />
|
|
||||||
<p style="margin-bottom: 0px;">Copyright © Nicholas Orlowsky 2025</p>
|
|
||||||
<p style="margin-top: 0px;">Powered by <a href="https://git.nickorlow.com/nickorlow/anthracite">Anthracite Web Server</a></p>
|
|
||||||
</footer>
|
|
||||||
</body>
|
|