OpenDNS
Friday, August 31st, 2007An interesting find. OpenDNS is a free DNS provider: http://www.opendns.com/
An interesting find. OpenDNS is a free DNS provider: http://www.opendns.com/
Q: What command do I need to run as root to grant access to wget and curl to user x?
A: Curl and wget is locked down on the server. You need to add the user x to both of these groups in order grant them the necessary privileges.
Both the steps below can be followed for this:
1) vi /etc/group and add the user x to the group seperated by comma.( this will look like curl:x:32474:x,y)
2) Use the command gpasswd; syntax: gpasswd -a x curl
note: use gpasswd -d x curl to remove x from curl.
To create a webpage in cake:
Basically, everything you do has to be an action in a controller. An “Action” is a function in a controller.
urls are formed as follows:
http://www.site.com/path_to_cake_installation/action/controller/param1/param2/param3/param4/etc…
so if I visit:
http://www.site.com/sphere/people/view/
you’re saying that there’s a people controller with action called ‘view’. The action is a function within a controller class.
So to define a view action in a People controller, you would place the following code in sphere/app/controllers/people_controller.php:
< ?php
class PeopleController extends AppController
{
var $name = 'People';
function view()
{
// programming logic goes here.
}
}
?>
For this respective controller action to be rendered, you must create a view by placing the following code in sphere/app/views/people/view.thtml:
The above view would be rendered by cake when the people controller is called with the view action.
SPECIAL CASES:
If you visit: http://www.site.com/sphere/people/, with no action defined, then the index() action is called. To define the index html contents, put the following in your controller:
function index()
{
}
and define the contents in index.thtml in app/views/people/
PAGES CONTROLLER:
For static pages that require no backend and that don’t really belong in a controller, there is a “PagesController” defined in cake that is accessed as follows:
http://www.site.com/sphere/pages/display/page1/
where page1 can be defined in
/app/views/pages/page1.thtml
page1.thtml can be called anything (say, poopoo.thtml) and will be accessed by visiting:
http://www.site.com/sphere/pages/display/poopoo/
I don’t know that you’ll be making any static pages though.
Either way, you can then define what’s called “routes” to allow http://www.site.com/sphere/pages/display/PAGE_NAME to be visited simply by accessing http://www.site.com/sphere/PAGE_NAME/
The route should be defined by default. So you should be able to access http://www.site.com/sphere/pages/display/poopoo/ by going to http://www.site.com/sphere/poopoo/
OTHER STUFF
Oh, and be sure to read this for how to name classes and files so that cake finds them:
http://manual.cakephp.org/appendix/conventions
and if you want to render an element in every page (say, a menu), don’t use include(), instead create an element. To see an example, look at the following files:
app/views/auth/index.thtml (and other files in this folder)
app/views/elements/authz/menu.thtml
Also, read http://manual.cakephp.org/chapter/helpers
you HAVE to use the < ?=$html->link()?> and < ?=$html->url()?> functions to do relative linking, and it saves you a bunch of typing when you get used to it (5 min learning curve).
I think that should cover everything… You should be an up and coming cake pro in about 20 mins.
A quick guide written mainly to help me set up the CVS server if ever something happened to my current installation. It’s not complete and might not apply to you, but might help you out if you’re also looking for a relatively secure, internet-accessible CVS setup on an XP Pro box. I opted for using CVSNT with sserver protocol.
cvs passwd -r -a )