Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jwarwick/info_parse_phoenix
Directory display code
https://github.com/jwarwick/info_parse_phoenix
Last synced: about 6 hours ago
JSON representation
Directory display code
- Host: GitHub
- URL: https://github.com/jwarwick/info_parse_phoenix
- Owner: jwarwick
- Created: 2014-09-04T18:43:03.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-09-17T20:01:41.000Z (about 9 years ago)
- Last Synced: 2023-04-13T20:27:17.008Z (over 1 year ago)
- Language: Elixir
- Size: 250 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# InfoParse (Phoenix version)
Elixir project built with Phoenix and Ecto. Used to display information captured with `info_gather`.
Requires Erlang R17 and Elixir v1.0.4 (commit e02d7bf)
To create a backup of a heroku postgres database:
`heroku pg:backups --app ` to list backups
`heroku pg:backups delete --app ` to delete an existing backup
`heroku pg:backups capture` to capture the current databaseTo download the capture:
`curl -o latest.dump \`heroku pg:backups public-url\``To import the capture into postgres:
`pg_restore --verbose --clean --no-acl --no-owner -d infogather latest.dump`## Databases
This project uses two databases `infogather` and `infoparse`. `infogather` holds the raw data dumped from Heroku. It
is not modified. The mix task `db.import` parses the data in the `infogather` database and creates the approriate
records in the `infoparse` database. It is not smart about removing old data, so the `infoparse` database should be
dropped first.Use ecto migrations to create the appropriate databases and tables:
```
mix ecto.create InfoGather.Repo
pg_restore --verbose --clean --no-acl --no-owner -d infogather latest.dump
mix ecto.drop InfoParse.Repo
mix ecto.create InfoParse.Repo
mix ecto.migrate InfoParse.Repo
mix db.import
```There is a mix alias `import` which will do all of the `InfoParse` steps:
```
mix import
```To view directory:
```
mix phoenix.start
(also aliased to `mix server`)
```## Dump Email List
To dump a list of parent names and email address, use these commands from `psql`:
```
psql info_parse
\copy (select firstname, lastname, email from parent where email <> '') to '/tmp/emails.csv' with csvsort emails.csv | uniq | awk -F"," '{ print $1 " " $2 "," $3}' > clean_emails.csv
```
Then edit in your favorite editor to fix invalid names and addresses...