Visual Arts Press Blog

The all knowing, ever present VAP knowledge base

Creating a new git branch locally and remotely

Locally

> git  checkout -b <new-branch-name>
> git push origin <new-branch-name>

Remotely

> git fetch
> git checkout --track -b <new-branch-name> remotes/origin/<new-branch-name>

 

 

Written by ecorriel

November 4th, 2013 at 9:29 pm

Posted in git,web

Installing Symfony2

  1. In Terminal, navigate to the location of your current sva.local directory.  Backup one level and create a new directory for the new site (“sva_v2”).
  2. cd sva_v2
  3. git init
  4. git remote add origin https://funnygarbage.unfuddle.com/git/funnygarbage_sva2/
  5. git config remote.unfuddle.push refs/heads/master:refs/heads/master
  6. git pull origin master
  7. Follow Symfony2 Install Instructions
  8. curl -s https://getcomposer.org/installer | php
  9. php ./composer.phar update
  10. Update Apache httpd.conf
  11. <VirtualHost *>
        ServerName sva2.local
    
        DocumentRoot /Users/ec/Sites/sf/sva_v2/web
        <Directory /Users/ec/Sites/sf/sva_v2/web>
            # enable the .htaccess rewrites
            AllowOverride All
            Order allow,deny
            Allow from All
        </Directory>
    
        ErrorLog /opt/local/apache2/logs/sva2.log
        CustomLog /opt/local/apache2/logs/sva2.custom.log combined
    </VirtualHost>
  12. Update /etc/hosts
  13. from http://symfony.com/doc/current/book/installation.html
  14. 1
    2
    3
    4
    5
    6
    $ rm -rf app/cache/*
    $ rm -rf app/logs/*
    
    $ APACHEUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data' | grep -v root | head -1 | cut -d\  -f1`
    $ sudo chmod +a "$APACHEUSER allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
    $ sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
  15. from http://stackoverflow.com/questions/9931127/symfony-2-working-with-assets
  16. app/console assets:install web --symlink
  17. 10.103.0.4  sva2.local
  18. restart apache
  19. http://sva2.local/

Written by ecorriel

September 18th, 2013 at 4:04 pm

Posted in web

Adding Canon Printer C5235

  1. System Preferences > Print & Scan > remove the current Canon printer (IP: 10.1.3.4)
  2. Download the latest drivers and install
  3. Add a new printer with these settings (you can put whatever you want for Name)

Written by ecorriel

August 19th, 2013 at 4:04 pm

Posted in office

Setting up a git repo on svablogserver.sva.edu

> mkdir blog.sva.edu
> sudo chgrp -R vabriefs blog.sva.edu/
> sudo chmod -R g+swX blog.sva.edu/
> cd blog.sva.edu/
> git init
> git remote add origin https://visualartspress.unfuddle.com/git/XXXXXXXXXXXXXX
> git config remote.unfuddle.push refs/heads/master:refs/heads/master
> ssh-keygen -t rsa
> cat ~/.ssh/id_rsa.pub

Copy results and paste into unfuddle > account > SSH keys

>  sudo vi ~/.netrc

machine visualartspress.unfuddle.com
login username
password password

 

> git fetch

 

 

 

Written by ecorriel

June 28th, 2013 at 8:55 pm

Posted in admin,git,web

Things to test when migrating SVA.edu

add poster page w the works
- make sure all images/video work
- add a new download

CMS
- AD login
forms
- make sure emails are being sent out

cron
- make sure all cron jobs running
- ./symfony sva:update-feed-sources
 ./symfony sva:ingest-regbook-import

forms
- test form can write txt file to server and results being written to excel file
- http://166.78.75.182/form/accepted-students-day-am
- signup form adding to nuke db
	- (http://www.sva.edu/events)
	- mysql> select * from subscribe order by signupDate desc limit 1;
- catalog request form
database
- make sure migrated most recent version (calendar entries are up to date; check last modified time of most recent entry in pages table)
php
- ini settings resemble old server

apache
- makes sure apache user owns svamaps folder so can recreate cache folder when necess; also write files to server
- eblasts upload to public

test briefs
- both upload to server and download

homepage
- rotator

Written by ecorriel

May 6th, 2013 at 5:11 pm

Posted in admin,web

Restoring CE course categories manually

If all CE courses should be deleted from RegBook and hence, wiped off the site, then once they are restored into RegBook, reimport them into Symfony:

> ./symfony sva:ingest-regbook-import



While this will reimport all courses, unfortunately it will not reassign courses to their proper categories (course_category_map table will be empty).  These will have to be restored by hand (a db restore will not work because all page_ids and foreign keys will be different after the import).

Restoring Course Categories

  1. Drop sva db on beta and replace with sva db from production
  2. Open up two browser windows side by side: beta.sva.edu/cms.php and sva.edu/cms.php
  3. Navigate to CE > Course Categories on both browsers > select a concentration > select a category > click Show All Courses
  4. Open up a JavaScript console on both browsers
  5. In the beta console, paste the following:
    var str='';
    $('input:checked').each(function(){
    if(typeof $(this).val() != 'undefined') str+=$(this).val()+','});
    str=str.substr(0,str.length-1);
    str;
  6. Copy the output, including the open and closed quotes
  7. In the production window console, paste the following:
    var str=<paste the output from beta here>
    var arr=str.split(',');
    for(var i=0; i<arr.length; i++){$('input[value=' + arr[i] +']').prop('checked',true)}
  8. Save Changes
  9. Repeat for all categories (and UG courses).  Don’t forget to click Show All Courses each time.

Written by ecorriel

April 2nd, 2013 at 10:11 pm

Posted in admin,web

If you totally bork the git repo…

# delete entire directory and recreate git repo
> rm -r svamaps
> git init
> git remote add unfuddle git@visualartspress.unfuddle.com:visualartspress/sva.git
> git config remote.unfuddle.push refs/heads/master:refs/heads/master
> git clone git@visualartspress.unfuddle.com:visualartspress/sva.git

# for some reason, the directory comes down as ‘sva’ but it needs to be ‘svamaps’ on beta and production
> mv sva svamaps

# create and connect local branches to remotes
> git checkout --track -b develop_prime remotes/origin/develop_prime
> git checkout --track -b master_prime remotes/origin/master_prime

# get rid of default master branch; not used
> git branch -D master

# create cache and log dirs
> cd svamaps
> mkdir cache
> mkdir log
> chmod 777 cache
> chmod 777 log

# upload files not in the repo
– web/frontend_dev.php (you may have to alter these to add your IP to the list of allowed IPs)
– web/cms_dev.php
– config/databases.yml (copy from beta/production)

# i think that’s it…

 

2/27/13 : UPDATE : according to (new?) unfuddle requirements, all push/pull requests require unfuddle u/p authentication.  To get around this, create ~/.netrc and add:

machine visualartspress.unfuddle.com
login <unfuddle username>
password <unfuddle password>

Note: you’ll have to do this on local, beta and production.

 

3/5/15: UPDATE: to delete branches in the repo:

> git push origin :master_old

Written by ecorriel

November 30th, 2012 at 12:00 am

Posted in admin,web

Configuring rotating daily MySQL backups

  1. Download the AutoMySQLBackup shell script
  2. sudo mkdir /etc/automysqlbackup
  3. copy and rename the conf file: /etc/automysqlbackup/myserver.conf (rename the default automysqlbackup.conf )
  4. tweak conf file as desired
  5. add to cron: 0 3 * * * /usr/local/bin/automysqlbackup /etc/automysqlbackup/myserver.conf
On the VAP server, backup files are stored on the volume VAPBackup at /Backups/MySQL
On the GDAD server, backup files are stored on the volume GDADBackup at Backups/MySQL

 

Written by ecorriel

November 27th, 2012 at 9:58 pm

Posted in admin,web

Using Symfony components in regular web apps

This is useful if you want to, say, use a YAML config file in your app.

Install PEAR

sudo port install php5 +pear
sudo pear channel-discover pear.symfony.com

test PEAR

Install desired Symfony components

sudo pear install pear.symfony.com/Yaml
sudo pear install pear.symfony.com/ClassLoader

testFile.php

<?php
require_once 'Symfony/Component/ClassLoader/UniversalClassLoader.php';
use Symfony\Component\ClassLoader\UniversalClassLoader;
$loader = new UniversalClassLoader();
$loader->useIncludePath(true);
$loader->registerNamespace('Symfony\Component\Yaml\Yaml','/opt/local/lib/php');
$loader->register();

$yaml = new Symfony\Component\Yaml\Yaml;

If you get no errors, then everything should be working. Can also add the following:

$queries = $yaml->parse(file_get_contents('config/queries.yml'));
print_r($queries);

download config/queries.yml

Written by ecorriel

September 26th, 2012 at 3:31 pm

Posted in admin,web

Adding VAP fonts on the Mac

1) Download and then unzip the fonts

2) Navigate to your Applications folder and open Font Book

3) File > Add Fonts

4) Navigate to where you unzipped the fonts, click on one of them, then hit Command+A to select all of them, then once they’re all selected, click Open.  This will add the fonts to your system.

Written by ecorriel

August 10th, 2012 at 5:03 pm

Posted in print,web