Skip to content

Instantly share code, notes, and snippets.

View jon4syth's full-sized avatar

Jon Forsyth jon4syth

  • Independent
  • Provo, UT
View GitHub Profile
<!DOCTYPE>
<html>
<head>
<link href="styles.css" rel="stylesheet">
<title>Your Web Page</title>
<style>
body {
background-color: black;
}
</style>
Following guide at: https://www.gregbrisebois.com/posts/chromedriver-in-wsl2/
Issue:
I get to the last step of running google-chrome with this output as a non-admin:
```
> google-chrome
[9896:9896:0219/105457.079353:ERROR:browser_main_loop.cc(1438)] Unable to open X display.
```
and as root using the required --no-sandbox
```
@jon4syth
jon4syth / Dockerfile
Created November 25, 2020 20:38
h2load and other installs
FROM centos:centos7
RUN yum install gcc make -y #&& \
RUN echo "hello"
RUN curl -L -o nghttp2-1.42.0.tar.xz https://github.com/nghttp2/nghttp2/releases/download/v1.42.0/nghttp2-1.42.0.tar.xz
RUN tar -xf nghttp2-1.42.0.tar.xz
RUN yum install cython python3 python-setuptools -y
RUN cd nghttp2-1.42.0 && \
./configure --enable-app PYTHON=/usr/bin/python3.6 PYTHON_VERSION=3.6 LDFLAGS=/usr/lib64/python3.6 && \
make && make install
@jon4syth
jon4syth / sublist.exs
Created November 4, 2020 19:02
Sublist Exercise
defmodule Sublist2 do
@doc """
Returns whether the first list is a sublist or a superlist of the second list
and if not whether it is equal or unequal to the second list.
"""
def compare(a, b) when a === b, do: :equal
# Passing the smaller list twice to is_sublist?/3
def compare(a, b) when length(a) < length(b), do: if is_sublist?(a, b, a), do: :sublist, else: :unequal
def compare(a, b) when length(a) > length(b), do: if is_sublist?(b, a, b), do: :superlist, else: :unequal
def compare(_, _), do: :unequal
@jon4syth
jon4syth / setup.sh
Created November 25, 2019 16:06
Bash Script to setup Postgres Docker container
#!/bin/sh
set -e
SQL_SCHEMA='production_schema.sql'
if [ 'postgres' = "$(docker container ps | awk '{print $NF}' | grep postgres)" ]
then
echo 'Stop container named:'
docker stop postgres
@jon4syth
jon4syth / Terminal Output
Created September 5, 2019 22:52
HMAC.SHA256 in Elixir
MY_ENCODED_SIGNATURE:
U0ZNeU5UWS5NVFV5TURrNE16WTBOaTU3Q2lBZ0lDQWljMjF6WDJsa0lqb2lPRE0wWmpOa05UTXRPR0V6WXkwMFlXRXdMV0UzTXpNdE4yWXlaRFk0TW1FM01tUm1JaXdLSUNBZ0lDSm1jbTl0SWpvZ0lpc3hNekV5T1RRMU1EQXdNaUlzQ2lBZ0lDQWlkRzhpT2lBaUt6RXpNVEkxTlRVd01EQXhJaXdLSUNBZ0lDSmthWEpsWTNScGIyNGlPaUFpYVc1aWIzVnVaQ0lzQ2lBZ0lDQWlZbTlrZVNJNklDSklaV3hzYnlFaUNuMEsuTXBuYUVNZzhXS0RCN0U5dS1BM3R6TWVJSkFFc3UtYnoyRWw0a2lWeFA5OA==
TELNYX_ENCODED_SIGNATURE: lAjxaJDT5pwXpdnbhUwIQng8zicKOEw3wa4fvLDHhjI=