Skip to content

Instantly share code, notes, and snippets.

View bmvakili's full-sized avatar

Bijan Vakili bmvakili

View GitHub Profile
@bmvakili
bmvakili / liferay-script-check-perms-1
Created October 10, 2012 19:54
Liferay scripts - check every page permission in a group to see which roles have VIEW access
// ## CHANGE THESE ##
var largestLayoutId = 99999;
var groupName = "[group name]";
var showPublic = false;
var companyId = 10153;
var siteMemberRoleId= 10169;
var className = "com.liferay.portal.model.Layout";
//var groupId = Packages.com.liferay.portal.service.GroupLocalServiceUtil.getGroup(companyId, groupName).getGroupId();
var groupId = 10179;
// ## CHANGE THESE ##
var mainPath = "http://localdev.aha.org:8080";
var largestLayoutId = 99999;
// ## get all layouts containing custom portlets (that is, ones whose ID is not numeric) and print their URLs
var layouts = Packages.com.liferay.portal.service.LayoutLocalServiceUtil.getLayouts(0,largestLayoutId);
number = layouts.size();
var friendlyUrlArray = new Packages.java.util.ArrayList();
var names = "";
var output = "";
@bmvakili
bmvakili / 20120914p1g1.gist
Created September 14, 2012 12:49
20120914p1g1
export JAVA_HOME=/usr/java/jdk1.6.0_21
export LIFERAY_HOME=/usr/liferay/liferay-portal-6.0.5/tomcat-6.0.26
export PATH=$JAVA_HOME/bin:$LIFERAY_HOME/bin:$PATH
@bmvakili
bmvakili / gist:1819230
Created February 13, 2012 19:14
"Fast Forward" the fork! Merges any changes from orginal repository into forked repository .
git checkout -b upstream/master
git remote add upstream git://github.com/documentcloud/underscore.git
git pull upstream master
git checkout master // [my master branch]
git merge upstream/master
git push origin master
## Source : https://github.com/blog/266-fast-forward-your-fork
@bmvakili
bmvakili / proxy.php
Created January 31, 2012 02:54
this PHP script lets your apache server act as a proxy
<?
// limitation is that this script only works for http right now; also, login forms may/not work
// this PHP script lets your apache server act as a proxy
// 1. simply add a .htaccess directive as follows
// ErrorDocument 404 /proxy.php
// 2. set the proxy_url and actual_url parameters belom
// proxy_url is the address to your PHP server, e.g. www.example.com
// actual_url is the address to your other server, e.g. 10.10.10.10
error_reporting(E_ALL);