Just like last week, where we wanted to replace a string, we can use sed
for this task:
sed '/pouet/d' file.txt
This will output file.txt
on stdout without the lines containing pouet
.
# Fetch latest configuration: | |
*/5 * * * * cd /home/ubuntu/dogsheep-config && python3 git_pull_and_run_scripts.py . && sudo python3 ensure_symlinks.py files-to-symlink | |
# Goodreads | |
46 * * * * cd /home/ubuntu && /home/ubuntu/datasette-venv/bin/goodreads-to-sqlite books goodreads.db -a auth.json | |
1,11,21,31,41,51 * * * * /home/ubuntu/datasette-venv/bin/twitter-to-sqlite user-timeline /home/ubuntu/twitter.db -a /home/ubuntu/auth.json --since | |
2,7,12,17,22,27,32,37,42,47,52,57 * * * * run-one /home/ubuntu/datasette-venv/bin/twitter-to-sqlite home-timeline /home/ubuntu/timeline.db -a /home/ubuntu/auth.json --since | |
4,14,24,34,44,54 * * * * run-one /home/ubuntu/datasette-venv/bin/twitter-to-sqlite mentions-timeline /home/ubuntu/twitter.db -a /home/ubuntu/auth.json --since |
import pandas as pd | |
import numpy as np | |
import fastparquet | |
from sqlalchemy import create_engine, schema, Table | |
# Copied from pandas with modifications | |
def __get_dtype(column, sqltype): | |
import sqlalchemy.dialects as sqld |
Progressive JPG images, as opposed to baseline JPG, will display right away in the browser, and will load bits of it in cycle, rendering it from blur to clear.
Progressive is known to provide a better user experience, preventing the ”fax loading” effect. Where the image is displayed in full, but sequentially from top to bottom.
The imagemagick
package will install the convert
command that you can run to convert JPG to progressive:
convert -strip -interlace Plane -quality 80 input-file.jpg output-file.jpg
The exception handling block except Exception as ex: print(ex)
will only print the exception message and not its traceback.
That’s good to know, but we need more info than this to debug properly. Namely the line that raised the exception, together with its stack trace.
The traceback
module, part of the stdlib, will help us with this:
You update your app.js
or styles.css
, but have a caching of 30 days and none of the clients will get the latest version? 😟
While the best would be to use a build mechanism to generate new filenames on the server, here is how to ensure clients get your last updates:
1. Change the name of the files in the HTML, for example styles.css
to styles.123.css
2. Add this cache busting snippet in your nginx conf: