Commit 8a38c866 authored by Diman Maharjan's avatar Diman Maharjan
Browse files

init

parents
Pipeline #641 canceled with stages
version: '3.1'
services:
kiwix:
image: becram/olen-elib-kiwix:offline-20190509
restart: 'always'
ports:
- "83:81"
volumes:
- ./data:/zims
tty: true
This diff is collapsed.
This diff is collapsed.
<?php
/*
* This controls the maps section
* Author: Abhishek Singh <abhishek.singh@olenepal.org>
*/
include_once("config.inc.php");
include_once(APP_INC_PATH . "class.template.php");
$tpl = new Template_API();
$tpl->setTemplate("maps.tpl.html");
$map="world";
$lang="ne";
if (isset($_GET['map'])) {
$map = trim(strtolower($_GET['map']));
}
if (isset($_GET['lang'])) {
$lang = trim(strtolower($_GET['lang']));
}
$mapTitle = "";
$mapImg = array();
$caption = array();
switch($map) {
case "world":
$mapImg = array("world_topo.jpg","world_poli.png","world_pac.png");
if ($lang=="ne") {
$caption = array("सेटलाईटबाट खिचिएको विश्वको नक्सा","विश्वको भौगोलिक नक्सा","विश्वको प्यासिफिक केन्द्रित नक्सा");
$mapTitle = "विश्वको नक्सा";
}
else {
$caption = array("Satellite Image of the world","Political map of the world","Pacific centric map of the world");
$mapTitle = "Map of the world";
}
break;
case "nepal":
$mapImg = array("nepal_topo.jpg","province_nepal.jpg","admin_nepal.png");
if ($lang=="ne") {
$caption = array("नेपालको भौगोलिक नक्सा","संघीय नेपालको नक्सा","संघीय नेपालको प्रशासनिक नक्सा");
$mapTitle = "नेपालको नक्सा";
}
else {
$caption = array("Topographical map of Nepal","Provincial Map of Nepal","Administrative map of Nepal");
$mapTitle = "Map of Nepal";
}
break;
case "africa":
$mapImg = array("africa_ortho.png","africa_poli.png","africa_population.png","africa_topo.jpg");
if ($lang=="ne") {
$caption = array("सेटलाइटबाट खिचिएका तस्बिरहरु संयोजन गरि बनाएको अफ्रिका","अफ्रिकाको राजनैतिक नक्सा","अफ्रिकाको जनसंख्या घनत्वको नक्सा","अफ्रिकाको भौगोलिक नक्सा");
$mapTitle = "अफ्रिकाको नक्सा";
}
else {
$caption = array("Composed satellite image of Africa","Political map of Africa","Population density map of Africa","Topographical map of Africa");
$mapTitle = "Map of Africa";
}
break;
case "antarctica":
$mapImg = array("antarctica_bedrock.jpg","antarctica_blue_marble.jpg","antarctica_surface.jpg");
if ($lang=="ne") {
$caption = array("एन्टार्कटिकाको समुद्रि गहिराई र भौगोलिक नक्सा","सेटलाइटबाट खिचिएका तस्बिरहरु संयोजन गरि बनाएको एन्टार्कटिकाको अर्थोग्राफिक नक्सा","एन्टार्कटिकाको ऊचाई अनुसारको रङ्गिन नक्सा");
$mapTitle = "एन्टार्कटिकाको नक्सा";
}
else {
$caption = array("Subglacial topography and bathymetry of bedrock underlying Antarctica ice sheet","Orthographic projection of Antartica using composite satellite images","Elevation map of Antarctica coloured by relief height");
$mapTitle = "Map of Nepal";
}
break;
case "asia":
$mapImg = array("asia_equi.jpg","asia_poli.png","asia_un.png");
if ($lang=="ne") {
$caption = array("समदूरीमा रहेको एसियाको नक्सा","अरब बिनाको एसियाको भौतिक नक्सा","यु.एन. द्वारा बिभाजित एसियाको छेत्रहरु");
$mapTitle = "एसियाको नक्सा";
}
else {
$caption = array("Two-point equidistant projection of Asia","Physical map of Asia, excluding Southwest Asia","United Nations geoscheme sub-regions of Asia");
$mapTitle = "Map of Asia";
}
break;
case "europe":
$mapImg = array("europe_bigeo_regions.png","europe_countries.png","europe_demographics.png","europe_topo.png");
if ($lang=="ne") {
$caption = array("युरोपको जैँविक-भौगोलिक छेत्रहरुको नक्सा","युरोपको राजनैतिक नक्सा","युरोपको जनसाङ्खिक नक्सा","युरोपको भौगोलिक नक्सा");
$mapTitle = "युरोपको नक्सा";
}
else {
$caption = array("Map of the biogeographic regions of Europe","Modern political map of Europe and the surrounding region","Population growth/decline of European countries","Relief map of Europe and surrounding regions");
$mapTitle = "Map of Europe";
}
break;
case "northamerica":
$mapImg = array("na_location.png","na_topo.jpg");
if ($lang=="ne") {
$caption = array("उत्तर अमेरिकाको अर्थोग्राफिक नक्सा","सेटलाइटबाट खिचिएका तस्बिरहरु संयोजन गरि बनाएको उत्तर अमेरिका");
$mapTitle = "उत्तर अमेरिकाको नक्सा";
}
else {
$caption = array("Orthographic projection of North America","Composite satellite photograph of North America");
$mapTitle = "Map of North America";
}
break;
case "southamerica":
$mapImg = array("sa_location.png","sa_population.png","sa_topo.png");
if ($lang=="ne") {
$caption = array("दक्षिण अमेरिकाको अर्थोग्राफिक नक्सा","ल्याटिन अमेरिकामा बिभिन्न रोमान्स भाषाहरुको नक्सा","सेटलाइटबाट खिचिएका तस्बिरहरु संयोजन गरि बनाएको दक्षिण अमेरिकाको अर्थोग्राफिक नक्सा");
$mapTitle = "दक्षिण अमेरिकाको नक्सा";
}
else {
$caption = array("Orthographic projection of South America","Map of spoken romance language in Latin America","Orthographic projection of South America using composite satellite images");
$mapTitle = "Map of South America";
}
break;
case "australia":
$mapImg = array("australia_poli.png","australia_topo.png");
if ($lang=="ne") {
$caption = array("अस्ट्रेलियाको राजनैतिक नक्सा","अस्ट्रेलियाको सेटलाइटबाट खिचिएका तस्बिर");
$mapTitle = "अष्ट्रेलियाको नक्सा";
}
else {
$caption = array("Political map of Australia","Satellite image of Mainland Australia");
$mapTitle = "Map of Australia";
}
break;
default:
$mapImg = array("world_topo.jpg","world_poli.png","world_pac.png");
if ($lang=="ne") {
$caption = array("सेटलाईटबाट खिचिएको विश्वको नक्सा","विश्वको भौगोलिक नक्सा","विश्वको प्यासिफिक केन्द्रित नक्सा");
$mapTitle = "विश्वको नक्सा";
}
else {
$caption = array("Satellite Image of the world","Political map of the world","Pacific centric map of the world");
$mapTitle = "Map of the world";
}
break;
}
$tpl->assign("mapimg",$mapImg);
$tpl->assign("caption",$caption);
$tpl->assign("maptitle",$mapTitle);
$tpl->displayTemplate();
?>
#!/bin/bash
if [ $EUID -ne 0 ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
apt-get update -y && sudo apt-get install -y apt-transport-https ca-certificates
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
mkdir /etc/apt/sources.list.d/docker.list
echo "deb https://apt.dockerproject.org/repo ubuntu-precise main" >> /etc/apt/sources.list.d/docker.list
apt-get update -y
apt-cache policy docker-engine
apt-get install docker-engine -y
service docker start
docker run hello-world
groupadd docker && sudo usermod -aG docker sysadmin
echo -e "\nDocker has been installed "
#!/bin/bash
if [ $EUID -ne 0 ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
apt-get update -y
apt-get install -y linux-image-generic-lts-trusty linux-headers-generic-lts-trusty
reboot
#!/bin/bash
docker run --name kiwix -p 83:81 -v /home/diman/projects/kiwix/data:/zims --restart always becram/olen-elib-kiwix:offline-20190509
#!/bin/bash
if [ $EUID -ne 0 ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
update_map()
{
echo -e "\n----------------Updating the maps of Nepal----------------"
cp ./edits/new-maps/* /var/www/fez/images/maps/
cp /var/www/fez/maps.php /var/www/fez/maps.php.old
cp ./edits/maps.php /var/www/fez/
echo "Done updating maps--------------"
}
update_frontpages()
{
echo -e "\n----------------Updating the frontpages links----------------"
cp /var/www/fez/templates/ne/front_page.tpl.html /var/www/fez/templates/ne/front_page.tpl.html.old
cp /var/www/fez/templates/en/front_page.tpl.html /var/www/fez/templates/en/front_page.tpl.html.old
cp ./frontpage-ne/* /var/www/fez/templates/ne/
cp ./frontpage-en/* /var/www/fez/templates/en/
echo "Done updating frontpages-------------"
}
update_wiki()
{
echo -e "\n----------------Updating the Wiki----------------"
if [ ! -d /library/kiwix ]
then
mkdir /library/kiwix
rsync -a ./* /library/kiwix/
fi
if [ ! -f /library/kiwix/becram-olen-elib-kiwix-offline-20190509.tar.gz ]
then
echo " The required docker image is not present.Please re-copy it "
fi
#check if docker is installed or not
if [ -x "$(command -v docker)" ];
then
echo "Docker is installed...... Moving onwards."
else
echo "Please install docker first."
fi
docker load -i /library/kiwix/becram-olen-elib-kiwix-offline-20190509.tar.gz
docker run -d --name kiwix -p 83:81 -v /library/kiwix/data:/zims --restart always becram/olen-elib-kiwix:offline-20190509
echo -e "\nDone Updating Wiki......................"
}
update_map
update_wiki
update_frontpages
echo -e "\nDone Updating the pustakalaya.\nPlease go to the pustakalaya and test the update reflection.\nThankyou!"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment