Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix running locally #196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@
"command": "source $(dirname ${config:python.pythonPath})/activate && make devserver",
"problemMatcher": []
},
{
"label": "Stop Dev server",
"type": "shell",
"command": "source $(dirname ${config:python.pythonPath})/activate && make stopserver",
"problemMatcher": []
},
{
"label": "Open Site in Browser",
"type": "shell",
Expand Down
13 changes: 2 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,8 @@ publish:
$(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS)
if test -d $(BASEDIR)/extra; then cp $(BASEDIR)/extra/* $(OUTPUTDIR)/; fi

devserver:
ifdef PORT
$(BASEDIR)/develop_server.sh restart $(PORT)
else
# defaults to port 8000
$(BASEDIR)/develop_server.sh restart
endif

stopserver:
$(BASEDIR)/develop_server.sh stop
@echo 'Stopped Pelican and SimpleHTTPServer processes running in background.'
devserver: publish
$(PELICAN) --listen

cleanbranches:
git remote | xargs -n 1 git fetch -v --prune $1
Expand Down
2 changes: 1 addition & 1 deletion content/atotd-optimizing-cloudfront.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ determines things like how long an item should remain in Cloudfront's cache befo
request again to the origin, or if requests should be auto forwarded from http to https, and
various other settings. The behaviour screen looks something like:

![Cloudfront Behavior]({filename}/static/imgs/cloudfront-behaviour-1.png)
![Cloudfront Behavior]({static}/static/imgs/cloudfront-behaviour-1.png)

By default, all items for your distribution are governed by the settings on this Default
Behaviour. What's really cool/handy is you can define multiple behaviours based upon request
Expand Down
4 changes: 2 additions & 2 deletions content/building-a-vs-code-ext-without-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Now in VS Code open the command palette and search for
`Remote-Containers: Attach to Running Container...`. Pick this, and then your running
container called `vscodeenv` should appear in the list:

![Attaching to the running image]({filename}/static/imgs/runningContainer.png)
![Attaching to the running image]({static}/static/imgs/runningContainer.png)

Pick it, and VS Code will open a new Window "attached" to the running container. For
more details, consult
Expand All @@ -189,7 +189,7 @@ your extension) folder and click OK. You then get a VS Code window "attached" t
the running docker container, with your test extension open and ready to play with.
Here's a screenshot to give an idea:

![Extension open in VS Code]({filename}/static/imgs/attachedToContainer.png)
![Extension open in VS Code]({static}/static/imgs/attachedToContainer.png)

Now you can hit `F5` and VS Code will open up a new Extension Development Host window with
your test extension loaded. In that window you should be able to search for the
Expand Down
2 changes: 1 addition & 1 deletion content/devopsdaysyyj.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ in Victoria.
Tomorrow conference season continues for me as I'll be attending the 7th annual
Polyglot Unconference in Vancouver, a favourite event of mine. I'll likely blog about what
I see there, but you can also read about what I've seen in prior years in my posts from
prior years [here]({filename}/polyglotconf-2012.md) and [here]({filename}/polyglotconf-2017.md).
prior years [here]({static}/polyglotconf-2012.md) and [here]({filename}/polyglotconf-2017.md).
2 changes: 1 addition & 1 deletion content/django_admin_piechart.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class EmailSubscriberAdmin(admin.ModelAdmin):
If you've never done anything with the Django admin before, this might seem like
magic, 1-line to get a nice date filter in place:

![Date Filters in the Django Admin]({filename}/static/imgs/date_heir_filter.png)
![Date Filters in the Django Admin]({static}/static/imgs/date_heir_filter.png)

As you click those filters, the changeset view will adjust to only those records
which meet that criteria. All this for 1-line of code. Yup, Django's pretty
Expand Down
2 changes: 1 addition & 1 deletion content/docker-and-image-sizes.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ RUN apk del python3-dev gcc build-base
Sweet, and this resulted in an image size of *381MB*, a savings of *NEGATIVE 2MB*.
Wait.... WAT?

![WAT]({filename}/static/imgs/wat.jpg)
![WAT]({static}/static/imgs/wat.jpg)

So I *removed* some stuff and ended up with an image that's a few MB's *larger*?
How does that work?
Expand Down
8 changes: 4 additions & 4 deletions content/failure-bow-1-aws-lambda-goof.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ around how to improve the performance of my site, one of those being to "Leverag
Browser Caching" by setting a particular HTTP header on resources that don't change
often (ex: images). It'll look something like:

![Leverage Browser Caching]({filename}/static/imgs/pingdomcachewarning-fs8.png)
![Leverage Browser Caching]({static}/static/imgs/pingdomcachewarning-fs8.png)

Specifically you set the
[`Cache-Control` header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control)
Expand Down Expand Up @@ -80,15 +80,15 @@ thinking "ah, that's weird, I'll look into it later".
By the time that "later" happened and I turned off the Lambda, I had accrued around 1.1
million Lambda requests:

![The Lambda call count & costs]({filename}/static/imgs/lambda_costs-fs8.png)
![The Lambda call count & costs]({static}/static/imgs/lambda_costs-fs8.png)

But that's nothing:the real problem was that each one of those lambda calls represented
a PUT to a S3 bucket.
PUT's with S3 are actually one of the more expensive operations. For the `ca-central-1`
region where I host my stuff, it's currently $0.0055 per 1,000 of them. This sounds crazy
cheap, and it is, but when you're doing about 1.1 million of them, well, that adds up:

![The S3 PUT count & costs]({filename}/static/imgs/s3_costs-fs8.png)
![The S3 PUT count & costs]({static}/static/imgs/s3_costs-fs8.png)

Queue the Iron Maiden -- 6, 6, 6, THE NUMBER OF THE BEAST!

Expand All @@ -105,6 +105,6 @@ bill into likely well over $100.
But in the end I got a funny picture, this is the graph of my S3 bill for the month of
April:

![Graph of S3 costs]({filename}/static/imgs/s3costgraph-fs8.png)
![Graph of S3 costs]({static}/static/imgs/s3costgraph-fs8.png)

Ouch, that's a pointy point in my pride.
4 changes: 2 additions & 2 deletions content/git-img-diff-with-iterm.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ version that's inlined into your terminal with iTerm's shell integration.
Now when you change an image in a Git repo and do a `git diff` while in iTerm
you'll see a preview of the original image and the changed image. Example:

![Showing the image diffing]({filename}/static/imgs/imgcatDiff.png)
![Showing the image diffing]({static}/static/imgs/imgcatDiff.png)

The above image is the original, the 2nd image is what I changed it to. Note
that because imgcat is iTerm specific, it won't work in other terminals. If
you do a `git diff` in a different terminal (ex: the integrated terminal in
VS Code) you'll see just the ordinary blank output:

![Image diff in non-iTerm terminal]({filename}/static/imgs/imgcatdiffvscode.png)
![Image diff in non-iTerm terminal]({static}/static/imgs/imgcatdiffvscode.png)
24 changes: 12 additions & 12 deletions content/iterm2-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ preferences go to Profiles -> Keys, and do the following:

Screenshots showing the settings:

![Keyboard Option Key Settings]({filename}/static/imgs/keymapping1.png)
![Keyboard Option Key Settings]({static}/static/imgs/keymapping1.png)

![Keyboard Shortcut dialog for moving by word]({filename}/static/imgs/keymapping.png)
![Keyboard Shortcut dialog for moving by word]({static}/static/imgs/keymapping.png)

![Keyboard Shortcut dialog for moving to start/end of line]({filename}/static/imgs/keymapping2.png)
![Keyboard Shortcut dialog for moving to start/end of line]({static}/static/imgs/keymapping2.png)

## Shell Integration

Expand Down Expand Up @@ -77,11 +77,11 @@ What these lines do is define two user variables that can be displayed in variou
spots in iTerm. My badge setting has the value `\(user.pythonVersion)` as you can
see here:

![Badge Setting]({filename}/static/imgs/itermbadge.png)
![Badge Setting]({static}/static/imgs/itermbadge.png)

And then the version displays in the terminal (it's the 3.9.1 in the corner):

![Python Version]({filename}/static/imgs/pythonVersion.png)
![Python Version]({static}/static/imgs/pythonVersion.png)

As I switch to different Python interpreters this value updates.

Expand All @@ -107,15 +107,15 @@ completes you'll get a nice toast notification using OSX's notification system.
Shell integration also gives a few handy shell commands, the one I use fairly
often is `imgcat` which allows you to view an image right in the terminal window

![Viewing an Image in the Terminal]({filename}/static/imgs/imgcat.png)
![Viewing an Image in the Terminal]({static}/static/imgs/imgcat.png)

## Status Bar

The iTerm2 status bar is also fully configurable. You can display various items
like CPU load, or what your current directory is, etc. Mine displays a handful of
things:

![My iTerm2 Status Bar]({filename}/static/imgs/statusbar.png)
![My iTerm2 Status Bar]({static}/static/imgs/statusbar.png)

From a glance this shows me that my current battery is 72% charged, CPU is at
18%, memory utilization is at 22GB, that it's currently January 31st at 10:59AM,
Expand All @@ -127,7 +127,7 @@ probably redundant since that's in my badge, but 🤷).
You can configure your status bar by going to Profiles -> Session and clicking
"Configure Status Bar". Here's a screenshot showing my settings:

![My iTerm2 Status Bar Settings]({filename}/static/imgs/statusbarsettings.png)
![My iTerm2 Status Bar Settings]({static}/static/imgs/statusbarsettings.png)

I also configure the status bar to be at the bottom of the window (do this under
Appearance -> General -> Status Bar Location)
Expand All @@ -141,18 +141,18 @@ Various other settings I turn on, mostly for minor conveniences or visual appeal
I turn on transparency (Profiles -> Window -> Transparency). This is a setting
I continually fiddle with. 😛

![Transparency settings]({filename}/static/imgs/transparency.png)
![Transparency settings]({static}/static/imgs/transparency.png)

I also set these settings under Appearance -> Windows:

![Transparency settings]({filename}/static/imgs/appearancewindows.png)
![Transparency settings]({static}/static/imgs/appearancewindows.png)

I like the border around the windows, and find the window number in title bar
superfluous.

Under Appearance -> Tabs, I have:

![Transparency settings]({filename}/static/imgs/appearancetabs.png)
![Transparency settings]({static}/static/imgs/appearancetabs.png)

### Oddball Conveniences

Expand All @@ -162,7 +162,7 @@ opt out of beta releases.

Under General -> Selection, I have the following:

![Selection settings]({filename}/static/imgs/generalselection.png)
![Selection settings]({static}/static/imgs/generalselection.png)

The big one on there for me is that I find the "Copy to pasteboard on selection"
feature very annoying, so I turn it off.
Expand Down
2 changes: 1 addition & 1 deletion content/lotd-code-reviews-and-prs.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ tags: code review,pull request
cover: static/imgs/code_quality_2x.png
summary: A couple links related to pull requests and reviewing them, and things to do and/or avoid.

[![XKCD ‘Code Quality’, copied under CC BY-NC 2.5]({filename}/static/imgs/code_quality_2x.png)
[![XKCD ‘Code Quality’, copied under CC BY-NC 2.5]({static}/static/imgs/code_quality_2x.png)
XKCD ‘Code Quality’, copied under CC BY-NC 2.5](https://xkcd.com/1513/)

Today I have a few links related to pull requests and doing code review. I've definitely
Expand Down
4 changes: 2 additions & 2 deletions content/pages/gear.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ I have a room set up in my house that I work out of.

### Desk

![My Desk]({filename}/static/imgs/mydesk.jpg)
![My Desk]({static}/static/imgs/mydesk.jpg)

I currently use the "broken-ass giant desk that was a hand-me-down from someone
in my building when I was a teenager" desk. It weighs a metric ton, is ugly, the
Expand Down Expand Up @@ -258,4 +258,4 @@ Ok, so this was a bit playful, but honestly, I take a bit of pride in not spendi
gear I use. Often people in tech can be caught up with the latest & greatest (and most expensive),
but you can do a lot with not a ton of money.

In any case, there you have it, some of the gear I use. Did I miss anything? [Lemme know]({filename}contact.md)
In any case, there you have it, some of the gear I use. Did I miss anything? [Lemme know]({static}contact.md)
6 changes: 3 additions & 3 deletions content/polyglotconf-2018.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ tags: polyglotconf,conferences,learning
cover: static/imgs/polyglotconflogo.png
summary: I got to go back yet again for the 7th Annual Polyglot Unconference in Vancouver. Let's recap.

This year, like many past years (see [here]({filename}/polyglotconf-2012.md) and
[here]({filename}/polyglotconf-2017.md)), I was fortunate enough to be able to make the trip to
This year, like many past years (see [here]({static}/polyglotconf-2012.md) and
[here]({static}/polyglotconf-2017.md)), I was fortunate enough to be able to make the trip to
YVR for the annual [Polyglot Unconference](https://www.polyglotconf.com). This event, now
in it's 7th year, has been a favourite of mine for some time as it's a great (and very
affordable) opportunity to network with a bunch of other technologists, hear about new
Expand Down Expand Up @@ -294,7 +294,7 @@ This year rather than just papers on a wall & dot voting, there was an app built
organizers to allow the dot voting to happen online rather than the mob around the post board.
A screenshot of how it looked while voting was going on is below:

![Dot voting online!]({filename}/static/imgs/polyglot2018_app_sm-crunch.png)
![Dot voting online!]({static}/static/imgs/polyglot2018_app_sm-crunch.png)

It really worked quite well, was much more organized than the paper board, and it made it
much easier to figure out which talk to go to.
Expand Down
2 changes: 1 addition & 1 deletion content/pylint-disabling-messages-and-vscode.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ warnings will get put into the problems view. To turn it on set the following i
Note that these are both on by default (at least in the current version). Once you save
a Python file, Pylint warnings will show up in the problems view:

![Pylint Warnings in VS Code Problems View]({filename}/static/imgs/pylint_warnings_in_vscode-crunch.png)
![Pylint Warnings in VS Code Problems View]({static}/static/imgs/pylint_warnings_in_vscode-crunch.png)

Note that that screenshot also illustrates how you can filter the problems view down to show just Pylint
warnings by entering "pylint" into the search box. Also note that clicking any of those will open up
Expand Down
4 changes: 2 additions & 2 deletions content/screencap-site-monitoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ convert capture.png -crop 1920x1080+0+0 capture.png

This worked, but gave the following image:

![ScreenshotNoText]({filename}/static/imgs/captureNoText.png)
![ScreenshotNoText]({static}/static/imgs/captureNoText.png)

Wait, what? Where's the text? And why is the image so small? Looking into the original
image before the cropping I found these problems were there. As it turns out, there's two
Expand All @@ -212,7 +212,7 @@ page a chance to load). I gave it 3 seconds which is probably overkill. `--min

With this in place we get:

![ScreenshotWithText]({filename}/static/imgs/captureFullRes.png)
![ScreenshotWithText]({static}/static/imgs/captureFullRes.png)

Ahh, much better.

Expand Down
6 changes: 3 additions & 3 deletions content/serverless-microservices-with-python-p2.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Date: 2017-07-28 10:20
tags: lambda,serverless,microservices,aws,python
cover: static/imgs/python-logo-master-v3-TM.png

Ok, so in [part 1]({filename}/serverless-microservices-with-python-p1.md) of this series, I started off by exploring the
Ok, so in [part 1]({static}/serverless-microservices-with-python-p1.md) of this series, I started off by exploring the
use of [Lambda](https://aws.amazon.com/lambda/) and
[API Gateway](https://aws.amazon.com/api-gateway/) as a tool for building scalable microservices in Python. I largely
focussed on taking an existing tutorial, and building out some unit tests for it, as well as some supplementary scripts
Expand Down Expand Up @@ -266,7 +266,7 @@ and is easy (we'll optimize later), so let's enable that backend. This is done b
`PASSLIB_BUILTIN_BCRYPT="enabled"` where you're running passlib. With Lambda, setting some env variables is easy, you
can do this in the web interface:

![Setting Environment Vars in Lambda]({filename}/static/imgs/screen-shot-2017-07-27-at-2-16-32-pm.png)
![Setting Environment Vars in Lambda]({static}/static/imgs/screen-shot-2017-07-27-at-2-16-32-pm.png)

Doing this, I no longer got a `MissingBackendError`, but now there was a new problem:

Expand All @@ -279,7 +279,7 @@ Doing this, I no longer got a `MissingBackendError`, but now there was a new pro
Yup, apparently that plain Python version is in fact just way too slow. You can extend the timeout value for a Lambda
function on the Configuration tab under advanced items:

![Extending Lambda Timeout]({filename}/static/imgs/screen-shot-2017-07-27-at-2-19-06-pm.png)
![Extending Lambda Timeout]({static}/static/imgs/screen-shot-2017-07-27-at-2-19-06-pm.png)

It's worth noting this can increase your costs with Lambda, as pricing is execution-time related.  With that change in
place (50 seconds is crazy, but just trying to get it to work), I got a new error, this time from API Gateway:
Expand Down
6 changes: 3 additions & 3 deletions content/starship.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ with it.

To begin with, here was my old bash prompt:

![My Old Prompt]({filename}/static/imgs/oldprompt.png)
![My Old Prompt]({static}/static/imgs/oldprompt.png)

That prompt has a bunch of things in it, and shows:

Expand Down Expand Up @@ -116,7 +116,7 @@ touch ~/.config/starship.toml
Now open up a new terminal and you should see the default Starship prompt
which is actually quite sophisticated out of the box:

![Default Starship Prompt]({filename}/static/imgs/defaultstarship.png)
![Default Starship Prompt]({static}/static/imgs/defaultstarship.png)

Your output may vary, as many of the items in a Starship prompt are dynamic
depending on your current context. In this you can see:
Expand Down Expand Up @@ -565,7 +565,7 @@ Note current version (in case I revise in the future) is at:

This gives a prompt like the following:

![New Starship-Powered Prompt]({filename}/static/imgs/newPrompt.png)
![New Starship-Powered Prompt]({static}/static/imgs/newPrompt.png)

Pretty sweet, lots of dynamicism where needed, but still has all the things I
liked from before. Defintely took some time to get this just the way I liked it,
Expand Down
6 changes: 3 additions & 3 deletions content/stotd-bash-select-part-deux.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ cover: static/imgs/logos/Gnu-bash-logo-crunch.png
summary: Shell Tip Of the Day - Interactively deleting Docker images with Bash's select statement

![Sometimes when you learn about a hammer, everything looks like a nail....]
({filename}/static/imgs/hammer_nail.jpg)
({static}/static/imgs/hammer_nail.jpg)

([source](https://devrant.com/rants/752222/if-all-you-have-is-a-hammer-everything-looks-like-a-nail-this-was-something-whic))

Sometimes when you learn about a hammer, everything looks like a nail.... In
[a previous tip]({filename}/stotd-select-untracked-files.md) I showed off using
[a previous tip]({static}/stotd-select-untracked-files.md) I showed off using
Bash's `select` statement to interactively select untracked files in a Git repo.

Today I found another use for the `select` statement -- deleting local Docker
Expand Down Expand Up @@ -93,7 +93,7 @@ Dissecting the clunky argument to `docker rmi`: `awk -F'--' '{print $1}'` splits
the input string on a double dash and then prints just the first column (the ID
in our case). We then just echo it back to `docker rmi`. This works, and I
tweeted it at Eric Promislow who was the person who demoed
[the select statement at Polyglot this year]({filename}/polyglotconf-2018.md)
[the select statement at Polyglot this year]({static}/polyglotconf-2018.md)
which was where I first saw the trick:

<!-- markdownlint-disable MD033 -->
Expand Down
2 changes: 1 addition & 1 deletion content/stotd-select-untracked-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cover: static/imgs/logos/Gnu-bash-logo-crunch.png
summary: Shell Tip Of the Day - Selecting untracked files

Today's tip of the day is a follow up from something I learned at
[this year's Polyglot UnConference]({filename}/polyglotconf-2018.md) -- how
[this year's Polyglot UnConference]({static}/polyglotconf-2018.md) -- how
to use ```select``` with the Bash shell for interactive goodness.

At Polyglot I saw an example that looked like this:
Expand Down
2 changes: 1 addition & 1 deletion publishconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
RELATIVE_URLS = False

FEED_ALL_ATOM = "feeds/all.atom.xml"
CATEGORY_FEED_ATOM = "feeds/%s.atom.xml"
CATEGORY_FEED_ATOM = "feeds/{slug}.atom.xml"

DELETE_OUTPUT_DIRECTORY = True

Expand Down