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

Skip to content

Commit ea95580

Browse files
committed
Fix running locally
1 parent c7c382c commit ea95580

20 files changed

+46
-61
lines changed

.vscode/tasks.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@
1919
"command": "source $(dirname ${config:python.pythonPath})/activate && make devserver",
2020
"problemMatcher": []
2121
},
22-
{
23-
"label": "Stop Dev server",
24-
"type": "shell",
25-
"command": "source $(dirname ${config:python.pythonPath})/activate && make stopserver",
26-
"problemMatcher": []
27-
},
2822
{
2923
"label": "Open Site in Browser",
3024
"type": "shell",

Makefile

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,8 @@ publish:
3636
$(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS)
3737
if test -d $(BASEDIR)/extra; then cp $(BASEDIR)/extra/* $(OUTPUTDIR)/; fi
3838

39-
devserver:
40-
ifdef PORT
41-
$(BASEDIR)/develop_server.sh restart $(PORT)
42-
else
43-
# defaults to port 8000
44-
$(BASEDIR)/develop_server.sh restart
45-
endif
46-
47-
stopserver:
48-
$(BASEDIR)/develop_server.sh stop
49-
@echo 'Stopped Pelican and SimpleHTTPServer processes running in background.'
39+
devserver: publish
40+
$(PELICAN) --listen
5041

5142
cleanbranches:
5243
git remote | xargs -n 1 git fetch -v --prune $1

content/atotd-optimizing-cloudfront.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ determines things like how long an item should remain in Cloudfront's cache befo
3939
request again to the origin, or if requests should be auto forwarded from http to https, and
4040
various other settings. The behaviour screen looks something like:
4141

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

4444
By default, all items for your distribution are governed by the settings on this Default
4545
Behaviour. What's really cool/handy is you can define multiple behaviours based upon request

content/building-a-vs-code-ext-without-node.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ Now in VS Code open the command palette and search for
178178
`Remote-Containers: Attach to Running Container...`. Pick this, and then your running
179179
container called `vscodeenv` should appear in the list:
180180
181-
![Attaching to the running image]({filename}/static/imgs/runningContainer.png)
181+
![Attaching to the running image]({static}/static/imgs/runningContainer.png)
182182
183183
Pick it, and VS Code will open a new Window "attached" to the running container. For
184184
more details, consult
@@ -189,7 +189,7 @@ your extension) folder and click OK. You then get a VS Code window "attached" t
189189
the running docker container, with your test extension open and ready to play with.
190190
Here's a screenshot to give an idea:
191191
192-
![Extension open in VS Code]({filename}/static/imgs/attachedToContainer.png)
192+
![Extension open in VS Code]({static}/static/imgs/attachedToContainer.png)
193193
194194
Now you can hit `F5` and VS Code will open up a new Extension Development Host window with
195195
your test extension loaded. In that window you should be able to search for the

content/devopsdaysyyj.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,4 @@ in Victoria.
114114
Tomorrow conference season continues for me as I'll be attending the 7th annual
115115
Polyglot Unconference in Vancouver, a favourite event of mine. I'll likely blog about what
116116
I see there, but you can also read about what I've seen in prior years in my posts from
117-
prior years [here]({filename}/polyglotconf-2012.md) and [here]({filename}/polyglotconf-2017.md).
117+
prior years [here]({static}/polyglotconf-2012.md) and [here]({filename}/polyglotconf-2017.md).

content/django_admin_piechart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class EmailSubscriberAdmin(admin.ModelAdmin):
4444
If you've never done anything with the Django admin before, this might seem like
4545
magic, 1-line to get a nice date filter in place:
4646

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

4949
As you click those filters, the changeset view will adjust to only those records
5050
which meet that criteria. All this for 1-line of code. Yup, Django's pretty

content/docker-and-image-sizes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ RUN apk del python3-dev gcc build-base
5858
Sweet, and this resulted in an image size of *381MB*, a savings of *NEGATIVE 2MB*.
5959
Wait.... WAT?
6060

61-
![WAT]({filename}/static/imgs/wat.jpg)
61+
![WAT]({static}/static/imgs/wat.jpg)
6262

6363
So I *removed* some stuff and ended up with an image that's a few MB's *larger*?
6464
How does that work?

content/failure-bow-1-aws-lambda-goof.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ around how to improve the performance of my site, one of those being to "Leverag
2424
Browser Caching" by setting a particular HTTP header on resources that don't change
2525
often (ex: images). It'll look something like:
2626

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

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

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

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

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

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

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

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

110110
Ouch, that's a pointy point in my pride.

content/git-img-diff-with-iterm.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ version that's inlined into your terminal with iTerm's shell integration.
7373
Now when you change an image in a Git repo and do a `git diff` while in iTerm
7474
you'll see a preview of the original image and the changed image. Example:
7575

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

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

83-
![Image diff in non-iTerm terminal]({filename}/static/imgs/imgcatdiffvscode.png)
83+
![Image diff in non-iTerm terminal]({static}/static/imgs/imgcatdiffvscode.png)

content/iterm2-setup.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ preferences go to Profiles -> Keys, and do the following:
4141

4242
Screenshots showing the settings:
4343

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

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

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

5050
## Shell Integration
5151

@@ -77,11 +77,11 @@ What these lines do is define two user variables that can be displayed in variou
7777
spots in iTerm. My badge setting has the value `\(user.pythonVersion)` as you can
7878
see here:
7979
80-
![Badge Setting]({filename}/static/imgs/itermbadge.png)
80+
![Badge Setting]({static}/static/imgs/itermbadge.png)
8181
8282
And then the version displays in the terminal (it's the 3.9.1 in the corner):
8383
84-
![Python Version]({filename}/static/imgs/pythonVersion.png)
84+
![Python Version]({static}/static/imgs/pythonVersion.png)
8585
8686
As I switch to different Python interpreters this value updates.
8787
@@ -107,15 +107,15 @@ completes you'll get a nice toast notification using OSX's notification system.
107107
Shell integration also gives a few handy shell commands, the one I use fairly
108108
often is `imgcat` which allows you to view an image right in the terminal window
109109
110-
![Viewing an Image in the Terminal]({filename}/static/imgs/imgcat.png)
110+
![Viewing an Image in the Terminal]({static}/static/imgs/imgcat.png)
111111
112112
## Status Bar
113113
114114
The iTerm2 status bar is also fully configurable. You can display various items
115115
like CPU load, or what your current directory is, etc. Mine displays a handful of
116116
things:
117117
118-
![My iTerm2 Status Bar]({filename}/static/imgs/statusbar.png)
118+
![My iTerm2 Status Bar]({static}/static/imgs/statusbar.png)
119119
120120
From a glance this shows me that my current battery is 72% charged, CPU is at
121121
18%, memory utilization is at 22GB, that it's currently January 31st at 10:59AM,
@@ -127,7 +127,7 @@ probably redundant since that's in my badge, but 🤷).
127127
You can configure your status bar by going to Profiles -> Session and clicking
128128
"Configure Status Bar". Here's a screenshot showing my settings:
129129
130-
![My iTerm2 Status Bar Settings]({filename}/static/imgs/statusbarsettings.png)
130+
![My iTerm2 Status Bar Settings]({static}/static/imgs/statusbarsettings.png)
131131
132132
I also configure the status bar to be at the bottom of the window (do this under
133133
Appearance -> General -> Status Bar Location)
@@ -141,18 +141,18 @@ Various other settings I turn on, mostly for minor conveniences or visual appeal
141141
I turn on transparency (Profiles -> Window -> Transparency). This is a setting
142142
I continually fiddle with. 😛
143143
144-
![Transparency settings]({filename}/static/imgs/transparency.png)
144+
![Transparency settings]({static}/static/imgs/transparency.png)
145145
146146
I also set these settings under Appearance -> Windows:
147147
148-
![Transparency settings]({filename}/static/imgs/appearancewindows.png)
148+
![Transparency settings]({static}/static/imgs/appearancewindows.png)
149149
150150
I like the border around the windows, and find the window number in title bar
151151
superfluous.
152152
153153
Under Appearance -> Tabs, I have:
154154
155-
![Transparency settings]({filename}/static/imgs/appearancetabs.png)
155+
![Transparency settings]({static}/static/imgs/appearancetabs.png)
156156
157157
### Oddball Conveniences
158158
@@ -162,7 +162,7 @@ opt out of beta releases.
162162
163163
Under General -> Selection, I have the following:
164164
165-
![Selection settings]({filename}/static/imgs/generalselection.png)
165+
![Selection settings]({static}/static/imgs/generalselection.png)
166166
167167
The big one on there for me is that I find the "Copy to pasteboard on selection"
168168
feature very annoying, so I turn it off.

content/lotd-code-reviews-and-prs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ tags: code review,pull request
66
cover: static/imgs/code_quality_2x.png
77
summary: A couple links related to pull requests and reviewing them, and things to do and/or avoid.
88

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

1212
Today I have a few links related to pull requests and doing code review. I've definitely

content/pages/gear.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ I have a room set up in my house that I work out of.
2424

2525
### Desk
2626

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

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

261-
In any case, there you have it, some of the gear I use. Did I miss anything? [Lemme know]({filename}contact.md)
261+
In any case, there you have it, some of the gear I use. Did I miss anything? [Lemme know]({static}contact.md)

content/polyglotconf-2018.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ tags: polyglotconf,conferences,learning
66
cover: static/imgs/polyglotconflogo.png
77
summary: I got to go back yet again for the 7th Annual Polyglot Unconference in Vancouver. Let's recap.
88

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

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

299299
It really worked quite well, was much more organized than the paper board, and it made it
300300
much easier to figure out which talk to go to.

content/pylint-disabling-messages-and-vscode.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ warnings will get put into the problems view. To turn it on set the following i
9090
Note that these are both on by default (at least in the current version). Once you save
9191
a Python file, Pylint warnings will show up in the problems view:
9292

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

9595
Note that that screenshot also illustrates how you can filter the problems view down to show just Pylint
9696
warnings by entering "pylint" into the search box. Also note that clicking any of those will open up

content/screencap-site-monitoring.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ convert capture.png -crop 1920x1080+0+0 capture.png
188188

189189
This worked, but gave the following image:
190190

191-
![ScreenshotNoText]({filename}/static/imgs/captureNoText.png)
191+
![ScreenshotNoText]({static}/static/imgs/captureNoText.png)
192192

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

213213
With this in place we get:
214214

215-
![ScreenshotWithText]({filename}/static/imgs/captureFullRes.png)
215+
![ScreenshotWithText]({static}/static/imgs/captureFullRes.png)
216216

217217
Ahh, much better.
218218

content/serverless-microservices-with-python-p2.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Date: 2017-07-28 10:20
33
tags: lambda,serverless,microservices,aws,python
44
cover: static/imgs/python-logo-master-v3-TM.png
55

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

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

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

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

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

284284
It's worth noting this can increase your costs with Lambda, as pricing is execution-time related.  With that change in
285285
place (50 seconds is crazy, but just trying to get it to work), I got a new error, this time from API Gateway:

content/starship.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ with it.
2020

2121
To begin with, here was my old bash prompt:
2222

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

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

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

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

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

566566
This gives a prompt like the following:
567567

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

570570
Pretty sweet, lots of dynamicism where needed, but still has all the things I
571571
liked from before. Defintely took some time to get this just the way I liked it,

content/stotd-bash-select-part-deux.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ cover: static/imgs/logos/Gnu-bash-logo-crunch.png
77
summary: Shell Tip Of the Day - Interactively deleting Docker images with Bash's select statement
88

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

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

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

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

9999
<!-- markdownlint-disable MD033 -->

content/stotd-select-untracked-files.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cover: static/imgs/logos/Gnu-bash-logo-crunch.png
77
summary: Shell Tip Of the Day - Selecting untracked files
88

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

1313
At Polyglot I saw an example that looked like this:

publishconf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
RELATIVE_URLS = False
2525

2626
FEED_ALL_ATOM = "feeds/all.atom.xml"
27-
CATEGORY_FEED_ATOM = "feeds/%s.atom.xml"
27+
CATEGORY_FEED_ATOM = "feeds/{slug}.atom.xml"
2828

2929
DELETE_OUTPUT_DIRECTORY = True
3030

0 commit comments

Comments
 (0)