Archive for 'sys admin'

Exporting MediaWiki sites to Google sites

  

In the last post I’ve talked about moving files from SharePoint to Google Site,
what about a Mediawiki site?
how to export it and upload it?
I’ve already covered the uploading files to Google sites via the Google sites API,
you can use java or python to write a script to mass upload all your files and htmls to your new google site,
but first you need to export everything out of the Mediawiki site.

here is a working method to export your site, these are the steps:

  1. install python
  2. download the mw2html script
  3. export the mediawiki site

so lets start :

Installing python

If you are working from a linux distro with yum its as easy as typing:
yum install python

for windows – you will need to download and install from the python site:
the main python download page for windows
or you can just grab the latest version for September 4 2011 Python 3.2.2
Download and install the msi package.

next step is to add the installation to the computer’s path,
in windows 7  open the start panel and type in the search panel:
“view advance system settings”

press the “Environment Variables”

in the System Variables section search for the “Path” line and choose edit:

now to the end of the line add the path of where you have installed the python,
for example I have installed it to  C:\Python27 , and so i will add at the end of the Path line this:
;C:\Python27
notice the “;”  - this separates between the items on the Path line.

Now if you will type “python -V” on your command line it will run the python binary and will show you your version

now that we have the python working lets move to the next step:

Download the mw2html script

you can find it here:

from Connelly Barnes blog

this script will crawl all over your media wiki site and will grab all the html files and all the attachments there.

Exporting the mediawiki site

usage:
url – URL of mediawiki page to convert to static HTML.
outdir – Output directory.

-f, –force – Overwrite existing files in outdir.
–no-flatten – Do not flatten directory structure.
–no-lower – Retain original case for output filenames and dirs.
–no-clean – Do not clean up filenames (clean replaces
non-alphanumeric chars with _, renames math thumbs).
–no-hack-skin – Do not modify skin CSS and HTML for looks.
–no-made-by – Suppress “generated by” comment in HTML source.
–no-move-href – Disable <movehref> tag. [1]
–no-remove-png – Retain external link PNG icons.
–no-remove-history – Retain image history and links to information.
-l, –left=a.html – Paste HTML fragment file into left sidebar.
-t, –top=a.html – Paste HTML fragment file into top horiz bar.
-b, –bottom=a.html – Paste HTML fragment file into footer horiz bar.
-i, –index=filename – Move given filename in outdir to index.html.

Example Usage:
mw2html http://127.0.0.1/mywiki/ out -f -i main_page.html -l sidebar.html

 Important note:

this script will crawl all over your wiki site, but it does ignore all the files that do not have a link to them,
all the  ”orphan” pages, to solve this issue, instead of pointing to the main page, you can run the mw2html script while pointing to the orphans page,
it will get all the regular files from your site and the Orphan pages.
the link looks like:

http://yourwikisite/wiki/index.php?title=Special:Lonelypages&limit=500&offset=0

now that you have a folder with all your wiki page, you can edit the content of the folder,
remove all the files staring with the word “image_”
remove all the un-needed js files,
and do internal changes in the html files like change the links pointing to the original wiki site and point them to the new Google site URL.

now you can use the Google sites API to upload all your html to your new site.

  

Technorati Tags: , , , ,

SharePoint to Google sites – how to move your files

Many organisations now move to use the Google office suite for their day-to-day office needs,
this includes the Google sites service which allows you to easily create internal portals for the different
organisation’s departments.

This move allows for a department to share an internal web site that has easy access from home as well with the regular office google account,
it also allows for better collaboration with other branches of the same company located far away – as it saves the need for an office VPN, or the need to connect to a server that is located in a branch in another country,
instead – everybody just connect to Google.

But what do we do if our files are already on the office internal SharePoint?

apparently – the migration processes from SharePoint to Google sites is not as hard ,
here are two working options.

 

Exporting from SharePoint

Connect to the SharePoint and browse to where you keep the files you wish to move,
choose  ”Actions –>  Open with windows explorer”

 

you will get and explorer folder listing all the shared files there,
at this point you can select all the folders  and copy them locally to your desktop or to a network share – if the size of the files is too large.

The only folder not to copy over is the “forms” folder – as it is a system folder and you do not need to move it too.

 

 

Uploading files to Google Sites

Here we have 2 options:

  1. Use native Google Sites files upload option

    This option works well only if you have a very small number of files and folder to upload

     

  2. Use Google Sites API

     The Google sites API  will allow you to upload multiple files and folders, 
    it support now two languages -

  • Java
  • Pythonand you can read some more about in the Official Google Enterprise Blog .
    The API allows you to:
  • create new sites
  • retrieve , create , change and delete pages
  • upload and download attachments and files
  • change sharing settings
  • and manage templates

 

  

Technorati Tags: , ,

Great Online Stop Watch

This Online tool can be found here:

A very Easy to use online stop watch for all your IT needs, including:

  • limiting meeting sections (lets not talk about this subject more than 10 minutes)
  • counting time to measure a time limited action (how much time it really took the switch to reboot)
  • testing to see if an IT action was able to finish within the time limit set (DB switch should be completed in 5 minutes)

etc …

it has 2 useful modes:

  • Stop Watch
  • counter

both look like this:

but you setup the counter with this preliminary screen:



 

Solaris 10 Service Management

solaris 10

Under the Solaris 10 system – or the open Solaris as well,
the service management have been upgraded, and there are great new tools to handle the sysadmin
work on the services.

The long detailed explanation can be found here:
Solaris Service Management Facility – Quickstart Guide

But for the fast paced sysadmin – here is the short version :)


Read more

xkcd – funny system cartoons

Do you ever get this feeling when you see something and you can’t let go of it?

xkcd sandwich

xkcd cartoons got me at least twice that i can think of,
I’m hearing a lot these days about uptime, and this cartoon just hits the spot:

devotion to duty

devotion to duty

and another one that i went around with for months, couldn’t get it out of my head:

exploits of a mom

exploits of a mom

Technorati Tags: ,