I recently spun up my Dreamhost account from a few years ago to do play around PHP and couldnt get php running! After installing PHP 5.4 using the Dreamhost provided script I still had the problem until I added the following to .htaccess
<FilesMatch "\.(htm|html)$">
SetHandler application/x-httpd-php5
</FilesMatch>
Friday, 18 July 2014
Thursday, 29 May 2014
HighCharts - Graph sizes in Tabs not resizing to Tab
<style type="text/css"> /* bootstrap hack: fix content width inside hidden tabs */ .tab-stats-content > .tab-stats-pane { display: block; /* undo display:none */ height: 0; /* height:0 is also invisible */ overflow: hidden; /* no-overflow */ padding: 0px; } .tab-stats-content > .active, .tab-stats-pane > .active { /* let the content decide it */ height: 100%; } /* bootstrap hack end */ </style> <ul class="nav nav-tabs" id="myTab"> <li class="tab-pane active"><a href="#active" data-toggle="tab">Teams And Users By Week</a></li> <li><a href="#teamsbysport" data-toggle="tab">Teams By Sport</a></li> <li><a href="#teamsthismonth" data-toggle="tab">Teams Created This Month</a></li> </ul> <div class="tab-stats-content"> <div class="tab-stats-pane active" id="active"> {{ render(controller('RosterbotAnalyticBundle:Graph:Draw', {'graph':'TeamsAndUsersByWeek', 'div' : 'active'} ))}} </div> <div class="tab-stats-pane" id="teamsbysport"> {{ render(controller('RosterbotAnalyticBundle:Graph:Draw', {'graph':'TeamsBySport', 'div' : 'teamsbysport'} ))}} </div> <div class="tab-stats-pane" id="teamsthismonth"> {{ render(controller('RosterbotAnalyticBundle:Graph:Draw', {'graph':'TeamsThisMonth', 'div' : 'teamsthismonth'} ))}} </div> </div>
Thursday, 3 April 2014
Oracle OHS 2 VirtualHost domains on the same port with different RewriteRules
#Ensure the listening port
Listen 80
#Name the virtualhost
NameVirtualHost *:80
<VirtualHost *:80>
ServerName domaindns1
ServerAlias domaindns1
RewriteEngine On
RewriteOptions inherit
RewriteRule ^/$ /webcenter/spaces/Space1Name[PT,L]
RewriteRule ^/webcenter$ /webcenter/spaces [PT,L]
RewriteLog /home/oracle/rewrite.log
<Location />
SetHandler weblogic-handler
WebLogicCluster WCSSERVER:8888
</Location>
</VirtualHost>
<VirtualHost *:80>
ServerName domaindns2
ServerAlias domaindns2
RewriteEngine On
RewriteOptions inherit
RewriteRule ^/$ /webcenter/spaces/Space2Name[PT,L]
RewriteRule ^/webcenter$ /webcenter/spaces [PT,L]
RewriteLog /home/oracle/rewrite.log
<Location />
SetHandler weblogic-handler
WebLogicCluster WCSSERVER:8888
</Location>
</VirtualHost>
Then
If you do not "super user do" stop and then start opmnctl you will receive the following error
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
Listen 80
#Name the virtualhost
NameVirtualHost *:80
<VirtualHost *:80>
ServerName domaindns1
ServerAlias domaindns1
RewriteEngine On
RewriteOptions inherit
RewriteRule ^/$ /webcenter/spaces/Space1Name[PT,L]
RewriteRule ^/webcenter$ /webcenter/spaces [PT,L]
RewriteLog /home/oracle/rewrite.log
<Location />
SetHandler weblogic-handler
WebLogicCluster WCSSERVER:8888
</Location>
</VirtualHost>
<VirtualHost *:80>
ServerName domaindns2
ServerAlias domaindns2
RewriteEngine On
RewriteOptions inherit
RewriteRule ^/$ /webcenter/spaces/Space2Name[PT,L]
RewriteRule ^/webcenter$ /webcenter/spaces [PT,L]
RewriteLog /home/oracle/rewrite.log
<Location />
SetHandler weblogic-handler
WebLogicCluster WCSSERVER:8888
</Location>
</VirtualHost>
Add the DNS to the /etc/hosts
sudo nano /etc/hosts
Then add the following two lines
127.0.0.1 domaindns1 domaindns1
127.0.0.1 domaindns2 domaindns2
Then
Sudo ./opmnctl
stopall
Sudo
./opmnctl startall
If you do not "super user do" stop and then start opmnctl you will receive the following error
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
Wednesday, 12 March 2014
Iframing a UCM(WCC) form/page and CORs
To iframe in a UCM page and stop it from constantly busting into fullscreen apply the following variable to the config.cfg
- AllowContentServerInAnyDomains=1
Complete list of config.cfg Configuration variables can be found here
Sunday, 23 February 2014
LDAP Users in owc_discussions (Forums)
Posting this here so I don't lose it!
Source: https://community.oracle.com/message/4085237
1. Open a terminal;
2. cd /u01/Middleware/user_projects/domains/wc_domain/config/fmwconfig/servers/WLS_Services/owc_discussions_11.1.1.1.0. Where /u01/MIddleware is my Oracle_HOME
3. backup archive: cp jive_startup.xml jive_startup.xml.bkp ;
4 . gedit jive_startup.xml
5. Find the text: "<setup>true</setup"
6. Change to: "<setup>false</setup>"
7. Open a Browser with: http://wc11g.br.oracle.com:8890/owc_discussions . <host>:<port_discussion>/owc_discussions
8. You'll see a setup screen, like this http://www.jivesoftware.com/builds/docs/latest/documentation/images/screen_setup_checklist.png
9. Click continue;
10. In Database Setings screen, select JNDI Datasource and click next;
11. In JNDI Datasource Name put: jdbc/OWC_DiscussionsDS
12. Click next;
13. In Group and Authentication Systems screen select LDAP and next;
14. Fill the fields, like a example above:
LDAP Host: wc11g.br.oracle.com
LDAP Port: 3060
Base DN: cn=Users, dc=br,dc=oracle,dc=com
Admin DN: cn=orcladmin
Admin Password: welcome1
User Search Filter: (&(cn={0})(objectclass=person))
Group Search Filter: (&(cn={0})(objectclass=groupofUniqueNames))
15. Leave other fields default
16. In Other Settings screen, fill your email server or leave blank and click next;
17. Define administration user(e.g. orcladmin) and click next;
18. A message will appear: Jive Forums Setup Complete!
19. Restart WLS Services;
20. Login with your LDAP's user
Source: https://community.oracle.com/message/4085237
1. Open a terminal;
2. cd /u01/Middleware/user_projects/domains/wc_domain/config/fmwconfig/servers/WLS_Services/owc_discussions_11.1.1.1.0. Where /u01/MIddleware is my Oracle_HOME
3. backup archive: cp jive_startup.xml jive_startup.xml.bkp ;
4 . gedit jive_startup.xml
5. Find the text: "<setup>true</setup"
6. Change to: "<setup>false</setup>"
7. Open a Browser with: http://wc11g.br.oracle.com:8890/owc_discussions . <host>:<port_discussion>/owc_discussions
8. You'll see a setup screen, like this http://www.jivesoftware.com/builds/docs/latest/documentation/images/screen_setup_checklist.png
9. Click continue;
10. In Database Setings screen, select JNDI Datasource and click next;
11. In JNDI Datasource Name put: jdbc/OWC_DiscussionsDS
12. Click next;
13. In Group and Authentication Systems screen select LDAP and next;
14. Fill the fields, like a example above:
LDAP Host: wc11g.br.oracle.com
LDAP Port: 3060
Base DN: cn=Users, dc=br,dc=oracle,dc=com
Admin DN: cn=orcladmin
Admin Password: welcome1
User Search Filter: (&(cn={0})(objectclass=person))
Group Search Filter: (&(cn={0})(objectclass=groupofUniqueNames))
15. Leave other fields default
16. In Other Settings screen, fill your email server or leave blank and click next;
17. Define administration user(e.g. orcladmin) and click next;
18. A message will appear: Jive Forums Setup Complete!
19. Restart WLS Services;
20. Login with your LDAP's user
owc_discussions: "The service was not provisioned for this space." error
When enabling discussion on a space in WebCenter Spaces/Portals. If the current user does not have contributor level access or higher they will be thrown this error when they attempt to create or post threads.
In order to solve this elevate their level to Contributor under "Members" section of space settings.
In order to solve this elevate their level to Contributor under "Members" section of space settings.
Sunday, 12 January 2014
Python: Minimum absolute sum of two integers in an Array
So I was given this problem and figured I would share my solution for others. I believe the Time Complexity to be O(n log n) due to Quicksort being O(n log n). I could be wrong though!
'''Created on 10/01/2014# My first foray in python# min_abs_sum_of_two takes an Integer Array and returns the lowest absolute sum of two integers# I did not include checking for the following: array length, non integer characters.@author: BeauR'''import timeimport sysdef min_abs_sum_of_two(listOfNums):#init y as last array placey = len(listOfNums)-1#init x as first array placex = 0#set current min to arbitrary max possible integercurrentMin = sys.maxsize#quicksort array into ascending orderquicksort(listOfNums, x, y)#while x is less than y to ensure they never overlap array placeswhile (x < y):#if the current calculation is less than currentMinif abs(listOfNums[x]+listOfNums[y]) < currentMin:#store new minimumcurrentMin = abs(listOfNums[x]+listOfNums[y])#if the sum of arr[x] & arr[y] is greater than zero#x no longer need to be increased as its at optimum minimum valueif listOfNums[x]+listOfNums[y] < 0:#increment search pointer xx = x + 1else:#decrement search pointer yy = y -1return(currentMin)def quicksort(list, start, end):if start < end: # If there are two or more elements...split = partition(list, start, end) # ... partition the sublist...quicksort(list, start, split-1) # ... and sort both halves.quicksort(list, split+1, end)else:returndef partition(myList, start, end):pivot = myList[start]left = start+1right = enddone = Falsewhile not done:while left <= right and myList[left] <= pivot:left = left + 1while myList[right] >= pivot and right >=left:
right = right -1if right < left:done= Trueelse:# swap placestemp=myList[left]myList[left]=myList[right]myList[right]=temp# swap start with myList[right]temp=myList[start]myList[start]=myList[right]myList[right]=tempreturn rightstart_time = time.clock()print(min_abs_sum_of_two(listOfNums = [-6, -5, -4, -3, 1]))print(time.clock() - start_time, "seconds")
Subscribe to:
Posts (Atom)