Google sites liberation: Bad Request Invalid request URI - gdata

I keep getting
Jul 24, 2014 11:53:15 AM com.google.sites.liberation.export.ContinuousContentFeed?$FeedIterator? catchException WARNING: Error retrieving response from query. com.google.gdata.util.InvalidEntryException?: Bad Request Invalid request URI
at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:558) at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:543) at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:536) at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:515)
I used (you can use this test account i provide the password here below :) ).
java -jar google-sites-liberation-1.0.4.jar -w https://sites.google.com/site/hmmtestgsl/ -u hmmtestgsl#gmail.com -p aaabbbcccddd -f ./backup
and I changed the main in MANIFEST.MF to: Main-Class: com.google.sites.liberation.export.Main so that I can run it from command line.

Using
-w hmmtestgsl
instead of
-w https://sites.google.com/site/hmmtestgsl/
fixed it.

Related

Cannot apply count() or collecr() on RDD from textfile(Spark)

I am new at Spark and I have Databricks Community Edition account. Right now I'm doing Lab and encountered with following error:
!rm README.md* -f
!wget https://raw.githubusercontent.com/carloapp2/SparkPOT/master/README.md
textfile_rdd = sc.textFile("README.md")
textfile_rdd.count()
Output:
IllegalArgumentException: Path must be absolute: dbfs:/../dbfs/README.md
By default, wget will download your file to /databricks/driver
You have to store it in the DataBricks File System (dbfs) in order to be able to read it with the -P option. See wget manual for reference.
It also seems that the !wget magic creates a file that is not available with the dbfs:/ path. On Databricks Community, !wget leads to a file not found as you mentionned.
You can do the following in a %sh cell first:
%sh
rm README.md* -f
wget https://raw.githubusercontent.com/carloapp2/SparkPOT/master/README.md -P /dbfs/downloads/
And then in a second python cell, you can access the file throug the Files API (note the path starting with file:/
textfile_rdd = sc.textFile("file:/dbfs/downloads/README.md")
textfile_rdd.count()
--2022-02-11 13:48:19-- https://raw.githubusercontent.com/carloapp2/SparkPOT/master/README.md
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.133, 185.199.110.133, 185.199.109.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3624 (3.5K) [text/plain]
Saving to: ‘/dbfs/FileStore/README.md.1’
README.md.1 100%[===================>] 3.54K --.-KB/s in 0.001s
2022-02-11 13:48:19 (4.10 MB/s) - ‘/dbfs/FileStore/README.md.1’ saved [3624/3624]
Out[25]: 98
The following solution has been tested on a Databricks Community Edition with a 7.1 LTS ML and a 9.1 LTS ML Databricks Runtime.

Proper working with suexec on apache httpd 2.4

I am trying to run 3 separated domains in one machine, each with its user (through virtual host) so I decided to use suExec for my task (it been also installed along with apache):
Global Server configuration running on "apache" user and group.
The conficuration of one of the users (the one I am trying to access with):
listen 9999
<VirtualHost *:9999>
ServerName *:9999
DocumentRoot "/home/efpanel/public_html"
ErrorLog "/home/efpanel/err.log"
<IfModule suexec_module>
# SuexecUserGroup efpanel efpanel
</IfModule>
# Directory settings...
...
<IfModule alias_module>
ScriptAlias /cgi-bin/ "/home/efpanel/public_html/cgi-bin/"
</IfModule>
</VirtualHost>
The issue:
When the line of the SuexecUserGroup is commented, running perl script will be on user "apache" - not what I want, but at least run.
HOWEVER: If I uncomment this line, even simple perl script will fail with error 500 (internal server error). Checking the log file, the error I get there is:
[Sat Dec 21 01:34:56.274872 2019] [cgi:error] [pid 31211] [client 183.28.7.14:7262] End of script output before headers: test.cgi, referer: http://99.99.99.99:9999/
Notes:
1) mod_suexec is installed and enabled (the below is the result of "ls -l /usr/sbin | grep suexec"):
-r-x--x--- 1 root apache 15440 Aug 8 07:42 suexec
2) I am running Apache 2.4 httpd on CentOS 7, CGI written in PERL.
3) I am aware that suEXEC only work on script files, but is enough for me - if I make it somehow to work.
4) Checking the configuration values, I cannot determine where is the suexec log file, and was unable to find it by "find / suexec.log" command. The configuration values are as follows (seems standard):
[root#vps cgi-bin]# suexec -V
-D AP_DOC_ROOT="/var/www"
-D AP_GID_MIN=100
-D AP_HTTPD_USER="apache"
-D AP_LOG_SYSLOG
-D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin"
-D AP_UID_MIN=500
-D AP_USERDIR_SUFFIX="public_html"
My only concern here is the "DOC_ROOT" which is "/var/www" and has anything common with "/home/efpanel" - but: a) I have no idea how to reconfigure suexec after it been compiled, b) I don't think it is that necessary, maybe it is ok "as is"?
5) cgi script, cgi-bin directory, public_html directory and /home/efpanel directory are all belong to the same user and group (efpanel) and has access permit of 0755, except "/home/efpanel" that has 0711 access permit.
6) I have tried to add "-w" in the first line of the script, as suggested here:
#!/usr/bin/perl -w
my $u=(getpwuid $>)[0];
print "ContentType: text/html;\n\n$u";
exit 0;
As it seen, a VERY simple script and fail.

ldapmodify: Invalid parameter ... specified for changetype modify

I'm using a script that is supposed to add an attribute to an LDAP record. It used to work, then we moved the LDAP server from Solaris Unix to Linux.
Now the script doesn't work and throws an error
The LDIF file looks like this :
dn:cn=template-uid,ou=Groups,o=mycompany.com,o=Company
changetype:modify
mgrpRFC822MailMember:new#gmail.com
ldapmodify gets called like this :
ldapmodify -h ldap.mycompany.com -D "cn=LDAPuser" -w *pswd* -v -p 636 -f updateUser.ldif
This is the error that gets thrown :
ldapmodify: Invalid parameter "mgrpRFC822MailMember" specified for changetype modify
If I log into LDAP using an LDAP browser with the same user, I can manually add the attribute without any problem. I just can't do it from command line.
Any ideas ?
Thanks
Assuming it should add a value to mgrpRFC822MailMember, it should be:
dn: cn=template-uid,ou=Groups,o=mycompany.com,o=Company
changetype: modify
add: mgrpRFC822MailMember
mgrpRFC822MailMember: new#gmail.com
A changetype of modify needs an action defined, which would be one of: add, delete, replace. That is then followed by the attribute name to take the action on. I'm surprised it worked at all in the previous form.

How to set resource which is not mapped

The dir structure is:
application
models
Milestones
ObserverBroker.php => Application_Model_Milestone_ObserverBroker
Observers
Milestone.php => Application_Model_Observer_Milestone
at Bootstrap.php
$loader->addResourceType('observer','models/observers','Model_Observer');
$loader->addResourceType('observerbroker','models/milestones','Model_Milestone');
The problem I encountered was:
[f#gail]$ php zfrun.php \
> --environment development -a task.create-milestone -m '%s' \
> -p '%s'
PHP Fatal error: Class 'Application_Model_Milestone_ObserverBroker' not found in /var/www/html/sites/plugin_handler/application/controllers/TaskController.php on line 55
Fatal error: Class 'Application_Model_Milestone_ObserverBroker' not found in /var/www/html/sites/plugin_handler/application/controllers/TaskController.php on line 55
[f#gail]$ php zfrun.php \
> --environment development -a task.update-milestone -m '%s' -o '%s' \
> -p '%s'
PHP Fatal error: Class 'Application_Model_Milestone_ObserverBroker' not found in /var/www/html/sites/plugin_handler/application/controllers/TaskController.php on line 81
You shouldn't have to add a resource type for classes in the Application_Model_ namespace.
The default module autoloader already includes rules for this, provided your configured appnamespace is "Application"
As a test, I just created two models, Application_Model_Test (application/models/Test.php) and Application_Model_Test_Test (application/models/Test/Test.php) and without adding anything further, was able to create an instance of each in my controller.
Edit
On re-reading your question, it looks like you want to store the Application_Model_Milestone_ classes in "Milestone*s*" (plural) and likewise for the Observer classes. Whilst I think you would be better off just storing these under application/models/Milestone and application/models/Observer and letting the default autoloader do its thing, it looks like your problem is due to case sensitivity.
Your $loader->addResourceType() calls are using lowercase folder names whereas your directory structure example uses Milestones and Observers (capital first letters).
This will fail on a case-sensitive filesystem.

Why does my REST request return garbage data?

I am trying to use LWP::Simple to make a GET request to a REST service. Here's the simple code:
use LWP::Simple;
$uri = "http://api.stackoverflow.com/0.8/questions/tagged/php";
$jsonresponse= get $uri;
print $jsonresponse;
On my local machine, running Ubuntu 10.4, and Perl version 5.10.1:
farhan#farhan-lnx:~$ perl --version
This is perl, v5.10.1 (*) built for x86_64-linux-gnu-thread-multi
I can get the correct response and have it printed on the screen. E.g.:
farhan#farhan-lnx:~$ head -10 output.txt
{
"total": 1000,
"page": 1,
"pagesize": 30,
"questions": [
{
"tags": [
"php",
"arrays",
"coding-style"
(... snipped ...)
But on my host's machine to which I SSH into, I get garbage printed on the screen for the same exact code. I am assuming it has something to do with the encoding, but the REST service does not return the character set type in the response, so how do I force LWP::Simple to use the correct encoding? Any ideas what may be going on here?
Here's the version of Perl on my host's machine:
[dredd]$ perl --version
This is perl, v5.8.8 built for x86_64-linux-gnu-thread-multi
I happen to have a 64 bit RHEL 5.4 box which has Perl 5.8.8 on it. I took your code and got the exact same result. I tried using Data::Dumper to dump the data, but that didn't change anything. I then went to the command line and did this:
wget -O jsonfile http://api.stackoverflow.com/0.8/questions/tagged/php
--2010-05-26 11:42:41-- http://api.stackoverflow.com/0.8/questions/tagged/php
Resolving api.stackoverflow.com... 69.59.196.211
Connecting to api.stackoverflow.com|69.59.196.211|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5430 (5.3K) [application/json]
Saving to: `jsonfile'
2010-05-26 11:42:42 (56.9 KB/s) - `jsonfile' saved [5430/5430]
When I did this:
file jsonfile
I got:
jsonfile: gzip compressed data, from FAT filesystem (MS-DOS, OS/2, NT), max speed
So, the JSON data was gzipped by the web server. I tried this:
gzip -dc jsonfile
and lo and behold the results are the JSON data as you would expect.
What you can do now is to either use another module to ungzip the data, or you can check out this other thread which shows how to accept gzip using LWP::UserAgent and handle the request that way
This is bug 44435. Upgrade libwww-perl to version 5.827 or better.