The following will work with Ubuntu Linux, use appropriate commands for other distros.
One way of accessing log files and other files from server, is to setup an FTP server so that it can serve log files and other files. The user should be able to access the server’s log files using a browser by accessing a url [eg: ftp://abcd.com]
NOTE: make sure the port 20 is opened or setup Apache to do appropriate proxying.
1. download and setup an ftp server, in this example we use vsftpd
2. after the setup is complete modify its configuration file in /etc/vsftpd.conf
1. Add the following config settings:
1. to give anonymous access:
1. anonymous_enable=YES
no_anon_password=YES
2. to enable browser to be used as an ftp client, the ftp should support passive mode
1. pasv_enable=YES
pasv_max_port=51000
pasv_min_port=50000
port_enable=YES
3. to change the default directory, and enable custom directory to be served by ftp server
1. local_root=/home/[user]/tools/tomcat7/logs
anon_root=/home/[user]/tools/tomcat7/logs
Restart the server to make the changes affected:
sudo service vsftpd restart
Google Doc Scripting!
If you want to add additional functionality for google docs you can simply write scripts.
Google provides various API to accomplish this, eg Google Spreadsheet API, Google DocList API etc.
Here is an example script that copies a "template file" and adds collaborators that are specified in another spread sheet (list)
function myFunction() {
var templateFile = DocsList.getFileById("tvkH8axayF4-GSXWpzZ7oSQ"); //id of the template
var listFile = DocsList.getFileById("tyAQs1cGxA1MhLj462e9d2A"); //id of collaborators
var listSpreadSheet = SpreadsheetApp.open(listFile);
var listSheet = listSpreadSheet.getSheets()[0];
var listRange = listSheet.getDataRange();
var values = listSheet.getSheetValues(1, 1, listRange.getLastRow(),listRange.getLastColumn());
for(row=1; row < listRange.getLastRow(); row++){
var name = values[row][0];
if(name == ""){
continue;
}
//create new file
var newFile = DocsList.copy(templateFile, name+" Feedback");
var spreadSheet = SpreadsheetApp.open(newFile);
//get the url of the attached form of the copied spreadsheet
var formURL = spreadSheet.getFormUrl();
var collaborator = values[row][1];
if(collaborator != "" || collaborator!= undefined|| collaborator!=null){
spreadSheet.addCollaborators(collaborator,{editorAccess:false, emailInvitations:false}); /*you can set emailInvitatins:true if you want to send emails to collaborators */
}
listSheet.getRange(row+1,3).getCell(1,1).setValue(formURL);
}
SpreadsheetApp.flush(); //this is important for changes to take effect
}
Google provides various API to accomplish this, eg Google Spreadsheet API, Google DocList API etc.
Here is an example script that copies a "template file" and adds collaborators that are specified in another spread sheet (list)
function myFunction() {
var templateFile = DocsList.getFileById("tvkH8axayF4-GSXWpzZ7oSQ"); //id of the template
var listFile = DocsList.getFileById("tyAQs1cGxA1MhLj462e9d2A"); //id of collaborators
var listSpreadSheet = SpreadsheetApp.open(listFile);
var listSheet = listSpreadSheet.getSheets()[0];
var listRange = listSheet.getDataRange();
var values = listSheet.getSheetValues(1, 1, listRange.getLastRow(),listRange.getLastColumn());
for(row=1; row < listRange.getLastRow(); row++){
var name = values[row][0];
if(name == ""){
continue;
}
//create new file
var newFile = DocsList.copy(templateFile, name+" Feedback");
var spreadSheet = SpreadsheetApp.open(newFile);
//get the url of the attached form of the copied spreadsheet
var formURL = spreadSheet.getFormUrl();
var collaborator = values[row][1];
if(collaborator != "" || collaborator!= undefined|| collaborator!=null){
spreadSheet.addCollaborators(collaborator,{editorAccess:false, emailInvitations:false}); /*you can set emailInvitatins:true if you want to send emails to collaborators */
}
listSheet.getRange(row+1,3).getCell(1,1).setValue(formURL);
}
SpreadsheetApp.flush(); //this is important for changes to take effect
}
My SQL not starting up?
Simple follow these steps!
http://imknight.net/web-apps/cant-start-mysql-error-1067/
http://imknight.net/web-apps/cant-start-mysql-error-1067/
Subscribe to:
Posts (Atom)