# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY=OhGezuz2021
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG=false
USE_HTTPS=true
DOMAIN="你的域名"
EMAIL=你的站长邮箱
# Used for deciding which editions to prefer
DEFAULT_LANGUAGE="English"
## Leave unset to allow all hosts
# ALLOWED_HOSTS="localhost,127.0.0.1,[::1]"
MEDIA_ROOT=images/
OL_URL=https://openlibrary.org
## Database backend to use.
## Default is postgres, sqlite is for dev quickstart only (NOT production!!!)
BOOKWYRM_DATABASE_BACKEND=postgres
MEDIA_ROOT=images/
POSTGRES_PORT=5432
POSTGRES_PASSWORD="你的Postgres密码"
POSTGRES_USER=fedireads
POSTGRES_DB=fedireads
POSTGRES_HOST=db
# Redis activity stream manager
MAX_STREAM_LENGTH=200
REDIS_ACTIVITY_HOST=redis_activity
REDIS_ACTIVITY_PORT=6380
REDIS_ACTIVITY_PASSWORD="你的redis密码"
# Redis as celery broker
REDIS_BROKER_PORT=6379
REDIS_BROKER_PASSWORD=你的redis密码
#CELERY_BROKER=redis://:${REDIS_BROKER_PASSWORD}@redis_broker:${REDIS_BROKER_PORT}/0
#CELERY_RESULT_BACKEND=redis://:${REDIS_BROKER_PASSWORD}@redis_broker:${REDIS_BROKER_PORT}/0
FLOWER_PORT=8888
FLOWER_USER=你的花花用户名
FLOWER_PASSWORD="你的花花密码"
EMAIL_HOST="smtp.eu.mailgun.org"
EMAIL_PORT=587
EMAIL_HOST_USER=mail@域名.com
EMAIL_HOST_PASSWORD=你的这个mail@域名 的密码
EMAIL_USE_TLS=true
EMAIL_USE_SSL=false
# Set this to true when initializing certbot for domain, false when not
CERTBOT_INIT=false
# Thumbnails Generation
ENABLE_THUMBNAIL_GENERATION=false
# S3 configuration
USE_S3=false
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
# Commented are example values if you use a non-AWS, S3-compatible service
# AWS S3 should work with only AWS_STORAGE_BUCKET_NAME and AWS_S3_REGION_NAME
# non-AWS S3-compatible services will need AWS_STORAGE_BUCKET_NAME,
# along with both AWS_S3_CUSTOM_DOMAIN and AWS_S3_ENDPOINT_URL
# AWS_STORAGE_BUCKET_NAME= # "example-bucket-name"
# AWS_S3_CUSTOM_DOMAIN=None # "example-bucket-name.s3.fr-par.scw.cloud"
# AWS_S3_REGION_NAME=None # "fr-par"
# AWS_S3_ENDPOINT_URL=None # "https://s3.fr-par.scw.cloud"
# Preview image generation can be computing and storage intensive
# ENABLE_PREVIEW_IMAGES=True
# Specify RGB tuple or RGB hex strings,
# or use_dominant_color_light / use_dominant_color_dark
PREVIEW_BG_COLOR=use_dominant_color_light
# Change to #FFF if you use use_dominant_color_dark
PREVIEW_TEXT_COLOR="#363636"
PREVIEW_IMG_WIDTH=1200
PREVIEW_IMG_HEIGHT=630
PREVIEW_DEFAULT_COVER_COLOR="#002549"
git pull
docker-compose build
docker-compose exec web python manage.py migrate
docker-compose exec web python manage.py collectstatic --no-input
docker-compose up -d
docker system prune -a
cd /home/
mkdir bookwyrm && cd bookwyrm
git clone https://github.com/bookwyrm-social/bookwyrm.git
git checkout production
cp .env.prod.example .env
用nano 或者 vi 编辑.env文件。(nano .env 或者 vi .env)。
.env设置如下:
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY="你的密码"
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG=false
USE_HTTPS=true
DOMAIN=你的域名
EMAIL=你的站长邮箱
# Used for deciding which editions to prefer
DEFAULT_LANGUAGE="English"
## Leave unset to allow all hosts
# ALLOWED_HOSTS="localhost,127.0.0.1,[::1]"
MEDIA_ROOT=images/
PGPORT=5432
POSTGRES_PASSWORD=你的数据库密码
POSTGRES_USER=fedireads
POSTGRES_DB=fedireads
POSTGRES_HOST=db
# Redis activity stream manager
MAX_STREAM_LENGTH=200
REDIS_ACTIVITY_HOST=redis_activity
REDIS_ACTIVITY_PORT=6379
REDIS_ACTIVITY_PASSWORD=你的redis密码
# Redis as celery broker
REDIS_BROKER_PORT=6379
REDIS_BROKER_PASSWORD=你的redis密码
FLOWER_PORT=8888
FLOWER_USER=你的flower用户名
FLOWER_PASSWORD=你的flower密码
EMAIL_HOST=smtp.mailgun.org
EMAIL_PORT=587
EMAIL_HOST_USER=你的bookwyrm服务的邮箱地址
EMAIL_HOST_PASSWORD=你的服务邮箱密码
EMAIL_USE_TLS=true
EMAIL_USE_SSL=false
# Thumbnails Generation
ENABLE_THUMBNAIL_GENERATION=false
# S3 configuration
USE_S3=false
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
# Commented are example values if you use a non-AWS, S3-compatible service
# AWS S3 should work with only AWS_STORAGE_BUCKET_NAME and AWS_S3_REGION_NAME
# non-AWS S3-compatible services will need AWS_STORAGE_BUCKET_NAME,
# along with both AWS_S3_CUSTOM_DOMAIN and AWS_S3_ENDPOINT_URL
# AWS_STORAGE_BUCKET_NAME= # "example-bucket-name"
# AWS_S3_CUSTOM_DOMAIN=None # "example-bucket-name.s3.fr-par.scw.cloud"
# AWS_S3_REGION_NAME=None # "fr-par"
# AWS_S3_ENDPOINT_URL=None # "https://s3.fr-par.scw.cloud"
# Preview image generation can be computing and storage intensive
# ENABLE_PREVIEW_IMAGES=True
# Specify RGB tuple or RGB hex strings,
# or use_dominant_color_light / use_dominant_color_dark
PREVIEW_BG_COLOR=use_dominant_color_light
# Change to #FFF if you use use_dominant_color_dark
PREVIEW_TEXT_COLOR=#363636
PREVIEW_IMG_WIDTH=1200
PREVIEW_IMG_HEIGHT=630
PREVIEW_DEFAULT_COVER_COLOR=#002549
var Bucky = {
favFood: "bacon",
favMovie: "Chappie"
};
var Person = Bucky;
Person.favFood = "salad";
console.log(Bucky.favFood); //the print result would be "salad"
nodejs “this”
var Bucky = {
printFirstName: function() {
console.log("My Name is Bucky");
console.log(this === Bucky);
}
};
Bucky.printFirstName(); //prints "True"
//The default calling context is global
function doSomethingWorthless(){
console.log("\nI am a worthless piece of shit");
console.log(this === global);
}
doSomethingWorthless(); //prints "I am ... shit" and "true"
nodejs Prototyping
function User(){
this.name = "";
this.life = 100;
this.giveLife = function giveLife(targetPlayer) {
targetPlayer.life +=1;
console.log(this.name + "give 1 life to " + targetPlayer.name);
}
}
var Bucky = new User();
var Wendy = new User();
Bucky.name = "Bucky";
Wendy.name = "Wendy";
Bucky.giveLife(Wendy); //now Wendy 101, Bucky 100 lives.
//you can add functions to all objects
User.prototype.uppercut = function uppercut (targetPlayer){
targetPlayer.life -=3;
};
Wendy.uppercut(Bucky); //now Wendy 101, Bucky 97
//You can add properties to all objects
User.prototype.magic = 60;//now both Wendy and Bucky have 60 magics.
var movies = require('./movies');
var emilysMovies = movies();
emilysMovies.favMovie = "The Notebook";
console.log("blablabla" + emilysMovies.favMovie);
in bucky.js
var movies = require('./movies');
var buckysMovies = movies();
console.log("blablabla" + buckysMovies.favMovie);
in app.js
require('./emily');
require('./bucky');
The terminal will print:
blablabla The Notebook
blablabla
Creating a Basic Server
var http = require('http');
function onRequest(request, response){
console.log("A user made a request" + request.url);
response.writeHead(200, {"Contect-Type": "text/plain"}; //string basically
response.write("Here is some data");
response.end();
}
http.createServer(onRequest).listen(8888);
console.log("Server is now running...");
Connect
var connect = require('connect');
var http = require('http');
var app = connect();
function doFirst(request, response, next){
console.log("Bacon");
next();
}
function doSecond(request, response, next){
console.log("Tuna");
next();
}
app.use(doFirst);
app.use(doSecond);
http.createServer(app).listen(8888);
console.log("Server is running.");
Optional paging:
var connect = require('connect');
var http = require('http');
var app = connect();
function profile(request, response){
console.log('User requested profile');
}
function forum(request, response){
console.log('User requested forum');
}
app.use('/profile', profile);
app.use('/forum', forum);
http.createServer(app).listen(8888);
console.log("Server is running.");
Darts are most often used to shape the back of the skirt. A fitted, darted front shows every bump and curve of the body. If you don’t have a flat tummy, front darts may not be flattering and can be eliminated with a stitching technique called staystitch plus.
When making darts, careful marking and stitching go hand in hand. Position pins all along the stitching line, with one horizontal pin marking the tip of the dart.
Make sure that pins are in straight lines along both legs of the dart.
Stitch from the wide end of the dart, backstitching as you begin in order to secure the stitches (1).
Remove the pins as you come to them.
When you're ½ in. from the tip of the dart, change to a short stitch length (1.5mm) and stitch the last few stitches along the edge of the fabric. Shorter stitches increase stitching accuracy and make tying knots or backstitching unnecessary.
Stitch evenly off the edge to prevent a bubble from forming at the tip of the dart (2).
Sew a smooth and true dart every time by mentally drawing a line from the first stitches to the tip, pointing the machine in that direction. This visualization is helpful even if you’ve marked the stitching line with chalk.
Press the dart on a ham. A perfectly pressed dart is nearly invisible on the right side of the fabric.
I tried to set up a sort of soundcloud service today, built using Ruby on Rails for backend with PostgreSQL for the database and ReactJS for the front end.
While I was connected to the vps, “rails server”-ed the server, I had to left my desk for a few minutes, and by the time I was back, the ssh connection was already “reset by peer”.
Then when I was back connected again and tried to relauch the rails server, it gave a warning of “Server is already running in Rails”.
The following is a copy of the content linked above..
Root Cause:
Because PID is locked in a file and web server thinks that if that file exists then it means it is already running. Normally when a web server is closed that file is deleted, but in some cases, proper deletion doesn't happen so you have to remove the file manually New Solutions
A Hong Kong seam finish, made with China silk, rayon, or silk bias strips, is a flat and elegant binding for hems and waistbands.
Stitching seams is one of the basic components of sewing.
With a little practice, you'll be able to sew perfect straight or curved seams and a variety of professional finishes.
Before you begin sewing, always test for the best stitch length, needle size, and type of thread for your fabric. Test the stitch length for appearance and strength as well as for ease in ripping. A too-long stitch length uses less thread, but creates a puckered seam.
Keep a supply of different needles on hand and use only the best quality—this is not a place to skimp. Change the needle before you begin each new garment and any time the needle hits a pin (listen for the sound of a blunt or bent needle piercing the cloth).
If you notice skipped stitches, or if the thread keeps breaking or fraying, try a different-size needle.
If that doesn’t help, try another brand of needle.
Sewing Perfect Seams
For smooth seams, always cut, stitch, and press seams in the same direction. For skirts, this usually means working along the length of the garment, from hem to waistline.
To sew long side seams, place pins vertically on the stitching line, positioned so that you can pull them out as you sew. This saves time and—because you're not sewing over pins—it also saves wear and tear on the machine.
Pin the top and bottom of the seam first. Next match the notches, then match or ease the fabric in between. A fabric with “tooth” grabs or sticks to itself and thus requires fewer pins than a slippery fabric that moves and slides. You may need to hand-baste some hard-to-handle fabrics, such as velvet, before stitching.
Most seams are sewn with right sides together, using a 5/8-in. seam allowance. Some machines have this 5/8-in. width marked on the throat plate. A magnetic seam guide, which acts as a “fence” along which you can guide the fabric, is also a very helpful tool.
Always press a seam after stitching and before crossing it with another seam or detail.
Remember, stitching and pressing go hand in hand.
Ripping out Seams
Break stitches along one side of the seam with the narrow point of the seam ripper.
Ripping out seams is an essential part of sewing. Use the narrow point of the seam ripper to break a few stitches on one side of the seam. This frees the thread on the other side so that it can be pulled. Working from one end of the seam to the other, rip just a few stitches, grasp the thread with your fingers, and give it a good pull, disposing of the loose threads as you go.
Another way to rip stitches is to use the point of the ripper to break threads on one side of the fabric every 1 in. to 1 in. along the seam and then pull the long freed-up thread on the other side. (The disadvantage is that on the first side you're left with broken threads all along the seam that need to be removed.)
Never work the curved portion of the seam ripper between the two layers of the seam unless the fabric is heavy and very firmly woven.
Otherwise, you’re liable to rip the fabric as well as the threads.
Finishes for Side Seams
Aim for simple, light, unobtrusive seam finishes. Test fabric scraps to see which seam finish is most compatible with your fabric. The seam finish should keep the seam edges from fraying and shouldn't show from the right side. If your fabric doesn’t ravel, the best seam finish is none at all.
Pinked Seams
One easy way to finish a seam is with pinking shears. Pink the edges, trimming a small slice of fabric away from the seam allowance.
Trimming with pinking shears is a classic, honest way to finish a seam (see photo). The ultimate in simplicity, it adds no bulk and won't show
from the right side. After you sew the seam, trim away the smallest amount of fabric possible.
Test the pinking shears on fabric scraps first. On some fabrics, you can trim both layers of the seam allowance at one time. With other fabrics, to get a clean edge, you must open the seam allowance and trim single layers. Test both methods and compare the results.
Some pinking shears have a notched tip that will cut all the way to the end of the cut. Other brands work best if you don’t fully open the shears and if you don’t cut all the way to the points. Test to see how deep a cut you need to make to work smoothly.
There’s also a rotary cutter with a wavy blade that works well as a pinking tool.
A pinked-and-stitched edge is especially flat and ravel-resistant: Sew a line of stitching ¼ in. from the edge before the seam is sewn.
Pink the edges after seaming, without cutting the line of stitching.
Seams For Bias-Cut Skirts
Cut, making 11-in. seams to allow the fabric to relax. Mark the seamline with basting.
Press the pieces.
Pin along the marked seamline and try on the garment. Adjust where necessary.
You may need to make smaller seam allowances to compensate for the pieces’ having stretched slightly in length and contracted in width.
Sew with a slightly shorter stitch length than usual, stretching the fabric as you sew. Because bias does not ravel, you won't need to finish the seams.
Zigzag Seams
Zigzag edges are quick and simple finishes. Both are made after the seam is sewn and pressed.
Both finishes have two disadvantages, however. First, the extra stitching and thread can add bulk to thin fabrics, which will keep them from lying flat. Second, these finishes, which aren’t found in ready-to-wear, shout “homemade.” I generally don’t use them, but you might want to experiment with them yourself.
For a zigzag finish, use a stitch of medium width and length. Stitch near the edge, but not along it, and trim close to the stitching. If your machine has this option, try a machine-overcast stitch. Stitch close to the edge so the points of the stitches fall almost at the edge of the fabric.
Serged Seams
A serger cuts and overcasts the edges of the seam allowance in one quick and easy operation.
The serger, or overlock machine, has transformed home sewing.
Although it doesn’t replace a conventional machine, a serger is very useful for quickly cutting and finishing seam edges in one fast and easy operation (above right).
Fuse interfacings to pockets and zipper areas before serging. If your fabric frays easily, serge all around the skirt, but on more stable fabrics, serge only the seams that will be pressed open. Serge the hem after you mark the length and trim to desired width.
When using a serger, it’s not necessary to cut wider seams than you normally would. The cutting edge of the serger trims just the ravelly edges before overcasting.
Use fine, soft thread, machine-embroidery thread, or texturized nylon to minimize the amount of thread impression “striking through” on the right side of the fabric. A 3-thread edge, using long staple polyester or coned “serger” thread, is the most versatile of the serged finishes. Or, if your machine has a 2-thread finish, try that for a flatter edge.
Serge a wide edge on fabrics that are heavy or bulky, and a narrow edge on flat fabrics that are lightweight to midweight.
Finishes for Hems and Waistband Seams
For a flat and professional-looking finish, you can bind hems and waistband seams with a Hong Kong finish or with a rayon seam binding.
Hong Kong Finish The Hong Kong finish is a simple and elegant touch for medium to heavy fabrics. This flat, narrow binding makes a fine finish for
hems or an inside waistband seam ona skirt (see photo on p. 52), but it’s too bulky for most side seams.
A Hong Kong finish has two lines of stitching and adds three layers of fabric to the edge. The seam edge is bound in bias strips of a lightweight fabric, such as China silk, rayon lining, silk, or polyester crepe de chine.
For the binding, cut ¼-in. wide bias strips, piecing the lengths as necessary. Press the bias strips to remove excess stretchability and to prevent them from rippling.
Before you stitch the waistband to the skirt, sew the binding to the seam edge, with right sides together, /s in. from the edges. (Bind the hem in the same way after marking and trimming it.)
Trim the seam edge to an even 1/8 in. using sharp long-blade shears, or a rotary cutter (1).
Wrap the binding around the seam edge and press. On the right side of the fabric, stitch in the “ditch” of the seam of the waistband and the binding—that is, where the two fabrics are sewn together (2). For accuracy, use an edgestitching foot with the needle in the center position.
On the wrong side of the fabric, trim the excess binding 1/8 in. from the stitching line (3). Bias doesn’t fray, so the binding won't ravel.
Rayon Seam Binding A flat woven-tape seam binding creates a dressmaker’s touch for bulky and flat fabrics that ravel. Use rayon rather than polyester—it’s softer, flatter, and more fluid. With just a bit of practice, you'll find this technique fast and simple.
Rayon seam binding adds less bulk than the Hong Kong finish. It has only one line of stitching and adds only two layers of fabric to the edge. This seam binding can also be used to finish the inside waistband edge and the hem edge.
Press the binding in half lengthwise, making one half slightly wider than the other. Hold the end in place with a straight pin as you work.
Position the narrow half of the binding on top of the right side of
the fabric and stitch along this half (4). This way, you'll be sure that
your stitches will catch the wider half of the binding on the other side of the fabric.
As you stitch along the edge of the binding, pull it slightly toward the fabric with your finger so that it wraps around and encases the raw edge. Press to eliminate puckers.
1. To apply Hong Kong finish, trim the binding to an even 1/8 in. with shears or a rotary cutter.
2. Wrap the binding around the edges, press and stitch in the ditch of the seam on the right side of the fabric.
3. Trim excess binding on the wrong side of the fabric. Here, an appliqué scissors is used to get as close as possible to the seam.
4. To apply rayon seam binding, stitch the press binding with the narrower half on top of the right side of the fabric.