liferay page layout thumbnails not showing up - url

The issue is that I am not able to see thumbnails of the Page layouts. I am working on Liferay Portal EE 6.1.20.
When I go to Manage -> Page Layout, I cannot see the thumbnails.
Few things
I am not using OOB Liferay, it is a custom solution where Liferay is bundled as a custom portal solution
This thing works fine in Liferay OOB, so there must be some configuration issue
I tried to debug with Firebug and it is able to fetch the image from the URL specified.
The context path is changed from / to /portal
The generated image URL is like this /portal/layouttpl/custom/1_2_columns_ii.png. This is also not accessible from the browser itself.
The other URLS like /portal/html or /portal/wap/ working fine. Only from /portal/layouttpl does not allow to access static resources.
Any Idea?

It might be worth checking the file permissions of the images. In my Liferay development enviroment, I have all of my images set to 777:
user#ubuntu:/usr/liferay/tomcat/webapps/ROOT/layouttpl/custom$ ll *.png
-rwxrwxrwx 1 root root 1801 Apr 2 2012 1_2_1_columns.png*
-rwxrwxrwx 1 root root 1798 Apr 2 2012 1_2_columns_ii.png*
-rwxrwxrwx 1 root root 1793 Apr 2 2012 1_2_columns_i.png*
-rwxrwxrwx 1 root root 1425 Apr 2 2012 1_column.png*
-rwxrwxrwx 1 root root 1923 Apr 2 2012 2_2_columns.png*
-rwxrwxrwx 1 root root 1718 Apr 2 2012 2_columns_iii.png*
-rwxrwxrwx 1 root root 1735 Apr 2 2012 2_columns_ii.png*
-rwxrwxrwx 1 root root 1618 Apr 2 2012 2_columns_i.png*
-rwxrwxrwx 1 root root 1852 Apr 2 2012 3_columns.png*
-rwxrwxrwx 1 root root 1740 Apr 2 2012 freeform.png*

Related

Lua can't import a module and says file not found but the file exists

i'm trying to run a lua script from inside haproxy that imports the "pgmoon" library. i can import pgmoon and get as far as opening a socket, but then i run into this:
[ALERT] 082/234313 (8) : Lua function 'queue-request': runtime error: /usr/local/share/lua/5.3/pgmoon/init.lua:269: module 'pgmoon.crypto' not found:
no field package.preload['pgmoon.crypto']
no file '/usr/local/share/lua/5.3/pgmoon/crypto.lua'
no file '/usr/local/share/lua/5.3/pgmoon/crypto/init.lua'
no file '/usr/local/lib/lua/5.3/pgmoon/crypto.lua'
no file '/usr/local/lib/lua/5.3/pgmoon/crypto/init.lua'
no file '/usr/share/lua/5.3/pgmoon/crypto.lua'
no file '/usr/share/lua/5.3/pgmoon/crypto/init.lua'
no file './pgmoon/crypto.lua'
no file './pgmoon/crypto/init.lua'
no file '/usr/local/lib/lua/5.3/pgmoon/crypto.so'
no file '/usr/lib/x86_64-linux-gnu/lua/5.3/pgmoon/crypto.so'
no file '/usr/lib/lua/5.3/pgmoon/crypto.so'
no file '/usr/local/lib/lua/5.3/loadall.so'
no file './pgmoon/crypto.so'
no file '/usr/local/lib/lua/5.3/pgmoon.so'
no file '/usr/lib/x86_64-linux-gnu/lua/5.3/pgmoon.so'
no file '/usr/lib/lua/5.3/pgmoon.so'
no file '/usr/local/lib/lua/5.3/loadall.so'
no file './pgmoon.so' from [C] global 'require', /usr/local/share/lua/5.3/pgmoon/init.lua:269 C function line 267 ..., /usr/local/share/lua/5.3/pgmoon/init.lua:211 method 'connect', /usr/local/haproxy/queue-request.lua:38 C function line 25.
however, there is a file at /usr/local/share/lua/5.3/pgmoon/crypto.lua, this is what ls shows:
# ls -la /usr/local/share/lua/5.3/pgmoon/
total 60
drwxr-xr-x 1 root root 4096 Mar 24 23:42 .
drwxr-xr-x 1 root root 4096 Mar 24 23:00 ..
-rw-r--r-- 1 root root 2880 Mar 24 23:00 arrays.lua
-rw-r--r-- 1 root root 1130 Mar 24 23:00 bit.lua
-rw-r--r-- 1 root root 1587 Mar 24 23:00 cqueues.lua
-rw-r--r-- 1 root root 654 Mar 24 23:00 crypto.lua
-rw-r--r-- 1 root root 2084 Mar 24 23:00 hstore.lua
-rw-r--r-- 1 root root 20127 Mar 24 23:00 init.lua
-rw-r--r-- 1 root root 665 Mar 24 23:00 json.lua
-rw-r--r-- 1 root root 2728 Mar 24 23:42 socket.lua
-rw-r--r-- 1 root root 457 Mar 24 23:00 util.lua
i could see it being permissions-related, if the haproxy user couldn't access a root owned file, but by the time it gets here it's already executed init.lua which has imported socket.lua and they've all got the same permissions...
Anybody know why lua thinks there is no file at crypto.lua?
I guess that you have haproxy configured with chroot and there actually isn't a file at /usr/local/share/lua/5.3/pgmoon/crypto.lua - in the chroot you haproxy runs in.
The require('pgmoon.crypto') in init.lua is within a function and probably tries to run long after Haproxy and lua initialization - and the root change.
And somewhat (un)relatedly - you can probably expect other problems with the pgmoon not being aware of haproxy, eg. its use of luasocket and not the haproxy-provided replacement: https://www.haproxy.com/blog/5-ways-to-extend-haproxy-with-lua/
The Socket class is a replacement for the standard Lua Socket class and is compatible with HAProxy’s non-blocking nature. When you want to use socket functions in your actions, you must use this class.

Xcode Unit Tests returns the NSURL of temp folder without 'private keyword'

I am writing Unit Tests in Objective C.
The following is my code:
NSString *testTempDirectory = [NSString stringWithFormat:#"%#%#", NSTemporaryDirectory(), #"DC_Tests"];
NSURL *parentDirURL = [NSURL fileURLWithPath:testTempDirectory];
NSURL *testFolderURL = [NSURL fileURLWithPath:testFolderPath];
Now the path in testFolderURL is returned as
/var/folders/31/2dpztnmx4fzfxb87qtn5_n0wc49pvz/T/DC_Tests/testFolder/
But the original path is
/private/var/folders/31/2dpztnmx4fzfxb87qtn5_n0wc49pvz/T/DC_Tests/testFolder/
The original path is my expected path and since it is different, my assertion is failing.
Any idea as to how do I get the complete path.
Note: I tried absolute string, doesn't help.
Note that in Mac OS, the var folder is actually a linked folder to /private/var
$ ls -l /
total 45
drwxrwxr-x+ 61 root admin 2074 Jun 11 08:58 Applications
drwxr-xr-x+ 63 root wheel 2142 Jul 6 2016 Library
drwxr-xr-x# 2 root wheel 68 Aug 24 2015 Network
drwxr-xr-x# 4 root wheel 136 Jun 9 18:56 System
drwxr-xr-x 6 root admin 204 Apr 22 2016 Users
drwxrwxrwt# 4 root admin 136 Jun 15 09:53 Volumes
drwxr-xr-x# 39 root wheel 1326 Jun 9 18:56 bin
drwxrwxr-t# 2 root admin 68 Aug 24 2015 cores
dr-xr-xr-x 3 root wheel 4312 Jun 9 18:57 dev
lrwxr-xr-x# 1 root wheel 11 Oct 18 2015 etc -> private/etc
dr-xr-xr-x 2 root wheel 1 Jun 9 18:58 home
-rw-r--r--# 1 root wheel 313 Aug 23 2015 installer.failurerequests
dr-xr-xr-x 2 root wheel 1 Jun 9 18:58 net
drwxr-xr-x# 6 root wheel 204 Oct 18 2015 private
drwxr-xr-x# 59 root wheel 2006 Jun 9 18:56 sbin
lrwxr-xr-x# 1 root wheel 11 Oct 18 2015 tmp -> private/tmp
drwxr-xr-x# 13 root wheel 442 Apr 19 2016 usr
lrwxr-xr-x# 1 root wheel 11 Oct 18 2015 var -> private/var
So the simplest way to fix your test is to ignore the /private part from the path. (We had a similar issue with paths that contain the tmp folder on Mac OS as well)

Jenkins can't find artifacts

I have a jenkins running a job, after which I want it to "archive artifact", which is basically just get some files.
The Job clones a github and when ran, it generates some log files which I need.
The patter is:
logfiles/*
I added a command to list the directory to make sure the files are there, and indeed they are.
+ ls -la logfiles
total 24
drwxr-xr-x 2 root root 4096 Apr 22 23:23 .
drwxr-xr-x 8 root root 4096 Apr 22 23:23 ..
-rw-r--r-- 1 root root 0 Apr 22 23:23 1461367410777_testuuid_61746144-3A3A-5555-4944-3D5343414C41.log
-rw-r--r-- 1 root root 1248 Apr 22 23:23 1461367410777_testuuid_61746144-3A3A-5555-4944-3D5343414C41_shortmsg.csv
-rw-r--r-- 1 root root 2521 Apr 22 23:23 1461367410777_testuuid_61746144-3A3A-5555-4944-3D5343414C41_stats.log
-rw-r--r-- 1 root root 8035 Apr 22 23:23 1461367410777_testuuid_61746144-3A3A-5555-4944-3D5343414C41_trace_msg.log
Archiving artifacts
ERROR: No artifacts found that match the file pattern "logfiles/*". Configuration error?
ERROR: ‘logfiles/*’ doesn’t match anything, but ‘*’ does. Perhaps that’s what you mean?
Build step 'Archive the artifacts' changed build result to FAILURE
I don't really understand why they are not found.
Hope someone can help!
Thanks!
I finally found my problem. I had configured the job to do the git clone. But for some reason I also added the cloning on the build steps... once i removed that jenkins started getting the files properly.
I would still like to understand why this would happen...
Thanks to all

Once jailbroken, will iOS apps run with root privilege?

Once an iOS device is jailbroken, we can build jailbreak apps (with theos) and it gets installed in the /Applications directory where the preloaded apps run with root privileges. If an app is built with Xcode, once it is installed, it gets into the /private/var/mobile/Applications/ folder, which is supposed to have Apple sandbox enforced (before jailbreak).
So, the questions I have are:
For a jailbroken device, will the apps in /private/var/mobile/Applications/ execute with root privileges or with mobile user privileges?
In case of Android, once rooted, the apps will have to gain root privileges by executing the su command. Is it the case when it comes to iOS as well?
I would like to understand the difference between these two development options (Theos / Xcode) and how it affects what operations my app can perform.
Not disagreeing with anything H2CO3 said, but to add some further clarification ...
Apps installed in /private/var/mobile/Applications/(†) with Xcode will run with user mobile privileges, even on jailbroken phones.
Even on a jailbroken phone, apps installed to /private/var/mobile/Applications/(†) will be sandboxed almost (‡) like apps on a jailed phone. So, no reading other (normal) apps' data, even if those files are owned by user mobile.
For a good description of the process that apps like Cydia use to run as root, see this answer. Or, just ssh into your phone, and take a look inside /Applications/Cydia.app/ yourself.
If you simply copy/install an app (without doing what H2CO3 suggested) to /Applications/, it won't be sandboxed, but it will still run with mobile (UID=501) privileges:
iPhone5:~ root# cd /Applications
iPhone5:/Applications root# ls -altr ./HelloJB.app/
total 220
-rw-r--r-- 1 root wheel 711 Apr 3 20:36 entitlements.xml
-rw-r--r-- 1 root wheel 297 Apr 3 20:36 entitlements-daemon.xml
-rw-r--r-- 1 root wheel 7972 Apr 3 20:36 embedded.mobileprovision
-rw-r--r-- 1 root wheel 58755 Apr 3 20:36 date.zip
-rw-r--r-- 1 root wheel 485 Apr 3 20:36 ResourceRules.plist
-rw-r--r-- 1 root wheel 8 Apr 3 20:36 PkgInfo
-rw-r--r-- 1 root wheel 1226 Apr 3 20:36 Info.plist
-rw-r--r-- 1 root wheel 10960 Apr 3 20:36 Icon\#2x.png
-rw-r--r-- 1 root wheel 8328 Apr 3 20:36 Icon.png
-rw-r--r-- 1 root wheel 451 Apr 3 20:36 HelloJB.plist
-rwxr-xr-x 1 root wheel 61088 Apr 3 20:36 HelloJB*
-rwxr-xr-x 1 root wheel 42688 Apr 3 20:36 HelloDaemon*
drwxr-xr-x 2 root wheel 136 Apr 3 20:36 en.lproj/
drwxr-xr-x 2 root wheel 102 Apr 3 20:36 _CodeSignature/
drwxr-xr-x 4 root wheel 544 Apr 3 20:36 ./
drwxrwxr-x 54 root admin 1904 Apr 5 02:14 ../
iPhone5:/Applications root# ps -Aef | grep HelloJB
501 9412 1 0 0:00.00 ?? 0:00.33 /Applications/HelloJB.app/HelloJB
iPhone5:/Applications root# grep mobile /etc/passwd
mobile:*:501:501:Mobile User:/var/mobile:/bin/sh
(‡) Here's a good discussion, with input from Saurik, about how different jailbreaks may affect the sandbox. Long story short: it depends.
(†) Update: in recent versions of iOS, the location of 3rd-party apps has been moved to /var/mobile/Containers, and later to /var/containers/, but the same basic sandbox issues remain.
Long story short: no.
Jailbreaking is a necessary but not sufficient condition for gaining root. Apps will still be sandboxed by default.
What you can do for making your app run with root privileges is creating a startup shell script that has root:wheel ownership and 755 permissions, then create your actual executable with the same ownership, 7555 as permissions (i. e. set its "setuid" bit), then call setuid(0); from within main(), before calling UIApplicationMain().

JQuery-UI and Bootstrap Conflicts

I have a Rails 3.2.5 app that is using Twitter Bootstrap. I am trying to use the JQuery UI datepicker. I have Googled this for days looking for a solution and can't find anything. I have a text field in a Rails view that I am trying to use with the JQuery datepicker. However, when I click in the text field, nothing happens.
In my Rails view, I have a simple text_field_tag like so:
<%= text_field_tag 'andrew' %>
In my associated CoffeeScript file:
$ ->
$('#andrew').datepicker
In the Chrome Developer Tools JavaScript Console, I see this error:
Uncaught TypeError: Object [object Object] has no method 'datepicker'
Now I have determined there is a conflict between JQuery-UI and Bootstrap. In that same JavaScript console, I can do this:
jQuery.noConflict();
and I get
function (a,b){return new e.fn.init(a,b,h)}
Then I can type:
$('andrew'.datepicker();
And I get:
[<input id="andrew" name="andrew" type="text" class="hasDatepicker">]
After this, when I go over to the browser window, clicking in the text field brings up the datepicker calendar just like I want it to.
So how do I get this to work in my code? That is, I am manually resolving the conflict in the JavaScript Console but I can't get it to work just through my code.
It looks like I have this one solved after much pain. I created a new project and slowly, methodically moved over pieces of my application to the new app. I finally uncovered a directory that was only in my project with the problem described above.
There was a 'public/assets' directory with the contents below. I don't recall creating this directory or putting these files in that directory. Renaming the directory to something different caused my JQuery-UI datepicker to work properly in conjunction with Twitter Bootstrap.
Here are the contents of public/assets:
-rw-r--r-- 1 andrunix staff 83360 Sep 3 18:01 application 6fc1172d858485077bbecdb82b96399a.css
-rw-r--r-- 1 andrunix staff 13546 Sep 3 18:01 application-6fc1172d858485077bbecdb82b96399a.css.gz
-rw-r--r-- 1 andrunix staff 100616 Sep 3 18:01 application-990a4cf0df42934fcc4c14aaf88b7ced.js
-rw-r--r-- 1 andrunix staff 35448 Sep 3 18:01 application-990a4cf0df42934fcc4c14aaf88b7ced.js.gz
-rw-r--r-- 1 andrunix staff 83294 Sep 3 18:01 application.css
-rw-r--r-- 1 andrunix staff 13484 Sep 3 18:01 application.css.gz
-rw-r--r-- 1 andrunix staff 100618 Sep 6 20:26 application.js
-rw-r--r-- 1 andrunix staff 35448 Sep 3 18:01 application.js.gz
-rw-r--r-- 1 andrunix staff 13826 Aug 30 17:42 glyphicons-halflings-f6675c325532ec11a984d58e172b8e2a.png
-rw-r--r-- 1 andrunix staff 8777 Aug 30 17:42 glyphicons-halflings-white-13553a5bf21ae3cc374006592488ec64.png
-rw-r--r-- 1 andrunix staff 8777 Aug 30 17:42 glyphicons-halflings-white.png
-rw-r--r-- 1 andrunix staff 13826 Aug 30 17:42 glyphicons-halflings.png
-rw-r--r-- 1 andrunix staff 368 Sep 5 15:00 manifest.yml
-rw-r--r-- 1 andrunix staff 6646 Aug 10 19:57 rails-be8732dac73d845ac5b142c8fb5f9fb0.png
-rw-r--r-- 1 andrunix staff 6646 Aug 10 19:57 rails.png
If anyone knows how this got created, that would put my mind at ease. Thanks!
Andrew

Resources