Skip to content

Instantly share code, notes, and snippets.

@karenc
karenc / cnxarchive_dump.sh
Last active August 29, 2015 19:42
Replaced by cnxarchive_db.sh
#!/bin/bash
if [ "$#" -ne 2 ]
then
echo "Usage: $0 db_user db_name"
exit 1
fi
DB_USER=$1
DB_NAME=$2
@karenc
karenc / cnxarchive_load.sh
Last active August 29, 2015 19:42
Replaced by cnxarchive_db.sh
#!/bin/bash
if [ "$#" -ne 2 ]
then
echo "Usage: $0 db_user db_name"
exit 1
fi
DB_USER=$1
DB_NAME=$2
@karenc
karenc / cnxarchive_db.sh
Last active December 20, 2015 16:25
For dumping and loading cnxarchive database (See https://github.com/Connexions/cnx-archive/issues/197)
#!/bin/bash
DUMP_NAME=cnxarchive_dump
DUMP_TGZ=''
DUMP_SQL=cnxarchive_dump_without_files.sql
DUMP_INDEX_FILES=cnxarchive_index_files.txt
DUMP_INDEX_MFILES=cnxarchive_index_module_files.txt
PRIORITY=19
function nice_this {
COPY (SELECT ROW_NUMBER() OVER (ORDER BY id),
username,
'{SSHA}RmBlDXdkdJaQkDsr790+eKaY9xHQdPVNwD/B' AS password_digest, -- ssha hash for "password"
SUBSTR(title, 0, 255) AS title, -- accounts db uses varchar(255)
SUBSTR(first_name, 0, 255) AS first_name,
SUBSTR(last_name, 0, 255) AS last_name,
SUBSTR(full_name, 0, 255) AS full_name,
username || '@e-mail-tester.appspotmail.com' AS email_address FROM users) TO STDOUT DELIMITER ',' CSV HEADER;
@karenc
karenc / cnxarchive-users-to-accounts.md
Created December 11, 2015 14:17
Creating users in accounts using the users table from cnx-archive database

To create users in accounts using the users table in the cnx-archive database:

This assumes that you have accounts running and have created a oauth application for cnx (e.g. "OpenStax CNX").

  1. Download the sql file for exporting the cnx-archive users table to a csv file:

Redirects for cnx-archive contents API

master

--2016-01-21 20:11:33--  http://trusty.local:6543/contents/55_943-0:IJ3rHxpG
Resolving trusty.local (trusty.local)... 192.168.122.251
Connecting to trusty.local (trusty.local)|192.168.122.251|:6543... connected.
keystone installed:
alabaster==0.7.9
alembic==0.8.8
amqp==1.4.9
anyjson==0.3.3
appdirs==1.4.0
astroid==1.4.8
Babel==2.3.4
backports.functools-lru-cache==1.3
boto==2.43.0

CNX Pipeline

Broadly speaking, there are 2 parts to generate pdfs:

  1. cnxml -> single html

    1. module cnxml files -> module html files
    2. module html files -> epub -> one single html file
  2. single html -> pdf

press/errors.py:
- Undo collection.xml change restriction
press/legacy_publishing/collection.py:
- Detect major/minor rev
- Undo collection.xml change restriction
- collxml parser
press/legacy_publishing/litezip.py:
- Undo collection.xml change restriction

The following are commands in neb in PRs right now. This is not how the textbook developers will create a pdf. The textbook developers will use scripts in cnx-recipes as they have been doing before. We will change the scripts to use neb under the hood.


  1. Download the "Introduction to Business" book from production using neb get:

    neb get prod col25734 1.8.5