Sunday, September 7, 2014

POP3 gets academic / university / office 365 into gmail

I use Gmail.[*] Part of the cost of a night course at the local Uni is agreeing to use their email, which uses Microsoft's Outlook.com  Fortunately, Gmail can be configured to pull email from other systems.

The winning search term is POP3 academic office 365.  If you know what POP3 is, all you need is that  POP3 server info:


Incoming POP3 server: outlook.office365.com, port 995, encryption SSL

If you don't know what POP3 is, proceed as follows. You will need:

  1. Your student email username
  2. Your student email password
  3. Confidence that your university is using Academic Office 365  or Outlook.com
  4. a gmail account. 
Given the above:

Login to Gmail and access settings:


















 

 

Choose accounts


Add POP3 account you own











 

 

Add your email address

Set username (probably your email address) , password, POP3 server (outlook.office365.com) , port (995) and encryption


Finish (no to send outgoing mail as your student account)


Possible Problems / sources of errors

  1. Don't include any invalid letters like a comma  in the POP3 server name 
  2. Do get your username correct. (probably your email address)

Bigger issues

Why do many students have to deal with this multiple account hassle instead of 1 person at the university provide good service in compiling a directory of existing emails  ?

[*] albeit with Icedove

Sunday, August 3, 2014

HOWTO backup mediawiki for easy restore on debian wheezy/squeeze

Creating a useful backup for a a web app like MediaWIki is somewhat more complicated process than backing up somebody's home directory.

While there is no warranty, I have tested this script on the Debian GNU/LINUX Wheezy release. Tonight I used it for reals to move a MedaiWiki on dead Wheezy server to a living Squeeze server.

Assuming you have a working, somewhat standard MediaWiki setup on Debian Wheezy (and probably squeeze), the script below creates a complete tarball backup of your Debian Wheezy MediaWiki install, including:
  1. Database 
  2. MediaWiki configuration
  3. PHP configuration
  4. Apache configuraiton
  5. README.restore , containing complete instructions on restoring your MediaWiki
By default, the script deletes backups older than 90 days, Edit the script and change the variable: delete_after_days if you don't like this. 

  To install / test install:
  1. copy the script below to /etc/cron.daily/backup_media
  2. edit the script to change the config variables (probably just mysqlopt to set mysql root password)
  3. make the script executable
  4. make the script readable only by root
  5. run the script.
  6. untar the tarball in /var/backups/mediawiki/
  7. examine the tarball contents, in particular README.restore

#!/bin/sh

# based on http://www.mediawiki.org/wiki/User:Megam0rf/WikiBackup

########### start configuration variables#########

# You need to change this:
mysqlopt="--user=root --password=your-mysql-db-root-password"     #  user/password to run mysql dump as

# you might want to change this:
delete_after_days=90                                              # how long to keep the backups

# you probably don't need to change these:
now=`date +%Y-%m-%d-%H_%M-%a`                                     # used to give you timestamped backup files, 
backupdir=/var/backups/mediawiki                                  # the directory to write the backup tar file to
dump_dir="$backupdir/mediawiki_backup.d/"                         # directory to hold backed up files
db_dumpfile="$dump_dir/mediawiki-restore.sql"                     # database dump to this file
tarfile="$backupdir/mediawiki-backup-$now.tgz";

########### no more configuration variables below #########

mkdir -p $dump_dir || exit $?

# dump the database
mysqldump  $mysqlopt wikidb  | gzip > "$db_dumpfile.gz" || exit $?

cp -ar /etc/mediawiki $dump_dir/etc-mediawiki                       || exit $? 
cp -ar /var/www/mediawiki_images $dump_dir/var-www-mediawiki_images || exit $?
cp -ar /etc/cron.daily/backup_mediawiki $dump_dir/                  || exit $?


cat << 'EOF' > "$dump_dir/mediawiki-setup.sql"

 -- #################         start HEREDOC for mediawiki-setup.sql" #################

START TRANSACTION;
  CREATE DATABASE wikidb;
  USE wikidb;
  CREATE USER 'wiki'@'localhost';
  GRANT DELETE ON wikidb.* TO wiki;
  GRANT SELECT ON wikidb.* TO wiki;
  GRANT UPDATE ON wikidb.* TO wiki;
  GRANT INSERT ON wikidb.* TO wiki;


  -- CHANGE mysql 'password'  (below) to password you configured 
  --  Mediawiki to connect to database with see: 
  --      grep wgDBpassword  etc-mediawiki/LocalSettings.php

  SET PASSWORD FOR  wiki  = password('password');
COMMIT;

  -- #################         end HEREDOC for mediawiki-setup.sql"  ################# 

EOF
 
cat << 'EOF' > "$dump_dir/README.restore"

#################         start HEREDOC for README.restore  #################

# To restore on Debian wheezy  run commands below

# Assumptions are that you:
 #   use mysql / apache 
 #   will handle Dns on your own.
 #   know what the root mysql password  is on your system

sudo apt-get install php5-mysql mysql-server mediawiki mediawiki-extensions-base  mediawiki-math
sudo apt-get install mediawiki-extensions-confirmedit mediawiki-extensions-openid 

 # follow comment about changing password
 # re-discover password configured mediawiki to connect to mysql with
 
       grep wgDBpassword  etc-mediawiki/LocalSettings.php

 # change script to use that password for the mysql user 'wiki'
 sudo $EDITOR mediawiki-setup.sql

 # unzip the database backup
 gunzip mediawiki-restore.sql.gz

# create the  dataase and database user
 mysql -u root --password=the-password-for-wikiuser       < mediawiki-setup.sql

 # restore the database
 mysql -u root --password=your-mysql-root-password  wikidb < mediawiki-restore.sql

 # copy the files
 sudo mv /etc/mediawiki            /etc/mediawiki.original
 sudo mv etc-mediawiki             /etc/mediawiki
 sudo mv var-www-mediawiki_images  /var/www/mediawiki_images
 sudo mv backup_mediawiki          /etc/cron.daily/

 # replace the default apache conf file  for mediawiki with yours
 sudo rm /etc/apache2/conf.d/mediawiki.conf
 sudo ln -s /etc/mediawiki/apache.conf /etc/apache2/sites-enabled/wiki.conf


 # set the mysql root password  and other parameters you care to change
 sudo $EDITOR /etc/cro.daily/backup_mediawiki

 #################         Stop HEREDOC for README.restore  #################

EOF

cd $backupdir
tar -zcf $tarfile mediawiki_backup.d/ || exit $?
rm  -rf mediawiki_backup.d/ || exit $?

/usr/bin/find $backupdir   -type f -mtime +$delete_after_days -exec rm {} \;

############   END  of  backup script ###############

 

Saturday, February 15, 2014

I am a delegate to the 2014 Massachusetts state convention.

So I, Alex , Marlene Faulkner-Hussein , Patty Coffey and Stacie Ann Hargis are democratic delegates to the state convention representing Lowell Massachusetts second ward. Alicia Page, Fatima (sp?) and Marie-tou (sp?) are alternates.

Our vote decides who represents the Democratic party in the state-wide November elections. My big take aways were:

1. 90% of success is showing up.
2. It is a big advantage to be male.

I arrived late in tatty jeans and a tee-shirt but I still got in. There are (2) spots reserved for each gender and (1) open gender spot. There were only 2 men running.

Alex demonstrated the political acumen to show up on time, shave, wear a shirt with buttons, pants without holes. Probably most important, he was careful to stand next to Stacie. He crushed me 5 to 3 on the ballet for the first spot 5-3. (Thanks to Alicia and my mystery friend for voting for me.)

In the vote for the 2nd male delegate, I ran against nobody and beat him 8 - 0. I doubt I could have beat Marlene, Patty or Stacie, who all demonstrated much more than the minimum commitment.

I guess the gender quota was created some time in the distant past to get women in the game. Now that female political participation exceeds male participation, we might be dealing with un-intended consequences.

The alternative hypothesis is less creditable. I don't think women have more political power than men or that middle aged men need endangered species status.

An interesting bit about the female voting was Patty voted for somebody else the first round. She had only one vote and since it was me, I know she didn't vote for herself.