Sponsored Content
Homework and Emergencies Homework & Coursework Questions Remote Access vs Local Access Post 302918347 by Don Cragun on Tuesday 23rd of September 2014 03:09:46 AM
Old 09-23-2014
I repeat: You MUST fill out the Required Template for Homework & Coursework Questions when posting questions in the Homework and Coursework Questions Forum.

Please repost with a completed template. If you continue to refuse to fill out the required template, you will be banned from using this site!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Need help to access/mount so to access folder/files on a Remote System using Linux OS

Hi I need to access files from a specific folder of a Linux system from an another Linux System Remotely. I know how to, Export a folder on One SCO System & can access the same by using Import via., NFS in the Sco Unix SVR4 System using the scoadmin utility. Also, I know to use mount -t ... (2 Replies)
Discussion started by: S.Vishwanath
2 Replies

2. Solaris

Remote Access

Hi We access all our SPARC/x86 servers (Solaris 8,9 & 10) using ssh. I am looking for a open source tool that allows me to get the GUI on to my laptop. I tried with x-org and some other applications like Hummingbird. Encountered problems with license issues and CPU compatability of my laptop. ... (2 Replies)
Discussion started by: chrs0302
2 Replies

3. Shell Programming and Scripting

unable to access a variable not local to a while loop

I have a while loop like this cat ${filename} | while read fileline do ... done I need to access a variable value $newfile inside this while loop How will i do that?? (6 Replies)
Discussion started by: codeman007
6 Replies

4. Shell Programming and Scripting

Can a script runned in local server access remote server?

Hi, Im creating a script that is supposed to run commands on remote server using sftp. My script is as below: #!/bin/ksh sftp remote_server mypassword cd /u08/mydir/allfiles mget * .. But this is what I got when I runned the script: Connecting to remote server...... (3 Replies)
Discussion started by: luna_soleil
3 Replies

5. Red Hat

Restrict local users to access ftp

Hi, I had installed vsftp in rhel5 and i want to restrict all the local users from accessing the ftp. i want to allow specific users to access the ftp server. Request you to please help. Thanks & regards Arun (1 Reply)
Discussion started by: Arun.Kakarla
1 Replies

6. Red Hat

Understanding local access to NFS export

Hello, I've inherited an NFS setup that allows external servers to write to an NFS share on a Centos box. Here is an example line from /etc/exports (there are four entries that only are different based on server IP adress). /exports/foobar... (4 Replies)
Discussion started by: KickstartUF
4 Replies

7. Red Hat

How to check local accounts have root and user access rights ?

Hi, I have three servers,For 3 servers how i can take output,all the local accounts and details of whether the access is Root or User access. cheers (1 Reply)
Discussion started by: ranjithm
1 Replies

8. Red Hat

NFS share full access for local user

Hi All, Is it possible to give full access for a normal user in a NFS share? If its not possible is there a trick with which I can make it work? Thanks in advance Shyam (1 Reply)
Discussion started by: shyam2j
1 Replies

9. Solaris

Solaris local access restriction other than sshd_config?

Hi All, As part of LDAP implementation we need to restrict users/groups locally on solaris machine: Options tried: sshd_config: as far as my testing it is restricting either user or group, as per the first preference. pam_access.so by default I am unable to find(need some help if this is... (0 Replies)
Discussion started by: Sridaran
0 Replies

10. Shell Programming and Scripting

Except script to run a local shell script on remote server using root access

local script: cat > first.sh cd /tmp echo $PWD echo `whoami` cd /tmp/123 tar -cvf 789.tar 456 sleep 10 except script: cat > first #!/usr/bin/expect set ip 10.5.15.20 set user "xyz123" set password "123456" set script first.sh spawn sh -c "ssh $user@$ip bash < $script" (1 Reply)
Discussion started by: Aditya Avanth
1 Replies
Template::FAQ(3pm)					User Contributed Perl Documentation					Template::FAQ(3pm)

NAME
Template::FAQ - Frequently Asked Questions about the Template Toolkit Template Toolkit Language Why doesn't [% a = b IF c %] work as expected? There's a limitation in the TT2 parser which means that the following code doesn't work as you might expect: [% a = b IF c %] The parser interprets it as an attempt to set "a" to the result of "b IF c", like this: [% a = (b IF c) %] If you want to set "a = b" only if "c" is true, then do this instead: [% SET a = b IF c %] The explicit "SET" keyword gives the parser the clue it needs to do the right thing. NOTE: this will be fixed in TT3 If I'm using TT to write out a TT template, is there a good way to escape [% and %]? You can do something like this: [% stag = "[\%" etag = "%]" %] and then: [% stag; 'hello'; etag %] Or you can use the "TAGS" directive, like so: [% TAGS [- -] %] [- INCLUDE foo -] # is a directive [% INCLUDE foo %] # not a directive How do I iterate over a hash? This is covered in the Template::Manual::VMethods section of the manual. A list of all the keys that are in the hash can be obtained with the "keys" virtual method. You can then iterate over that list and by looking up each key in turn get the value. [% FOREACH key = product.keys %] [% key %] => [% product.$key %] [% END %] Plugins How do I get the Table plugin to order data across rather than down? Order the data into rows: Steve Karen Jeff Brooklyn Nantucket Fairfax NY MA VA [% USE table(data, rows=3) %] Then ask for each column [% FOREACH column = table.cols %] And then print each item in the column going across the output rows [% FOREACH item = column %] <td>[% item %]</td> [% END %] Accessing Cookies Jeff Boes <jboes@nexcerpt.com> asks: Does anyone have a quick-n-dirty approach to accessing cookies from templates? Jonas Liljegren answers: [% USE CGI %] <p>The value is [% CGI.cookie('cookie_name') | html %] Extending the Template Toolkit Can I serve templates from a database? Short answer: yes, Chris Nandor has done this for Slash. You need to subclass Template::Provider. See the mailing list archives for further info. Can I fetch templates via http? To do the job properly, you should subclass Template::Provider to "Template::Provider::HTTP" and use a "PREFIX_MAP" option to bind the "http" template prefix to that particular provider (you may want to go digging around in the Changes file around version 2.01 for more info on "PREFIX_MAP" - it may not be properly documented anywhere else...yet!). e.g. use Template::Provider::HTTP; my $file = Template::Provider( INCLUDE_PATH => [...] ); my $http = Template::Provider::HTTP->new(...); my $tt2 = Template->new({ LOAD_TEMPLATES => [ $file, $http ], PREFIX_MAP => { file => '0', # file:foo.html http => '1', # http:foo.html default => '0', # foo.html => file:foo.html } }); Now a template specified as: [% INCLUDE foo %] will be served by the 'file' provider (the default). Otherwise you can explicitly add a prefix: [% INCLUDE file:foo.html %] [% INCLUDE http:foo.html %] [% INCLUDE http://www.xyz.com/tt2/header.tt2 %] This same principal can be used to create a DBI template provider. e.g. [% INCLUDE dbi:foo.html %] Alas, we don't yet have a DBI provider as part of the Template Toolkit. There has been some talk on the mailing list about efforts to develop DBI and/or HTTP providers but as yet no-one has stepped forward to take up the challenge... In the mean time, Craig Barrat's post from the mailing list has some useful pointers on how to achieve this using existing modules. See http://tt2.org/pipermail/templates/2001-May/000954.html <http://tt2.org/pipermail/templates/2001-May/000954.html> Miscellaneous How can I find out the name of the main template being processed? The "template" variable contains a reference to the Template::Document object for the main template you're processing (i.e. the one provided as the first argument to the Template process() method). The "name" method returns its name. [% template.name %] # e.g. index.html How can I find out the name of the current template being processed? The "template" variable always references the main template being processed. So even if you call [% INCLUDE header %], and that calls [% INCLUDE menu %], the "template" variable will be unchanged. index.html: [% template.name %] # index.html [% INCLUDE header %] header: [% template.name %] # index.html [% INCLUDE menu %] menu: [% template.name %] # index.html In constrast, the "component" variable always references the current template being processed. index.html [% component.name %] # index.html [% INCLUDE header %] header: [% component.name %] # header [% INCLUDE menu %] menu: [% component.name %] # menu How do I print the modification time of the template or component? The "template" and "component" variables reference the main template and the current template being processed (see previous questions). The "modtime" method returns the modification time of the corresponding template file as a number of seconds since the Unix epoch (00:00:00 GMT 1st January 1970). This number doesn't mean much to anyone (except perhaps serious Unix geeks) so you'll probably want to use the Date plugin to format it for human consumption. [% USE Date %] [% template.name %] last modified [% Date.format(template.modtime) %] How can I configure variables on a per-request basis? One easy way to achieve this is to define a single "PRE_PROCESS" template which loads in other configuration files based on variables defined or other conditions. For example, my setup usually looks something like this: PRE_PROCESS => 'config/main' config/main: [% DEFAULT style = 'text' section = template.section or 'home'; PROCESS config/site + config/urls + config/macros + "config/style/$style" + "config/section/$section" + ... %] This allows me to set a single 'style' variable to control which config file gets pre-processed to set my various style options (colours, img paths, etc). For example: config/style/basic: [% style = { name = style # save existing 'style' var as 'style.name' # define various other style variables.... col = { back => '#ffffff' text => '#000000' # ...etc... } logo = { # ...etc... } # ...etc... } %] Each source template can declare which section it's in via a META directive: [% META title = 'General Information' section = 'info' %] ... This controls which section configuration file gets loaded to set various other variables for defining the section title, menu, etc. config/section/info: [% section = { name = section # save 'section' var as 'section.name' title = 'Information' menu = [ ... ] # ...etc... } %] This illustrates the basic principal but you can extend it to perform pretty much any kind of per-document initialisation that you require. Why do I get rubbish for my utf-8 templates? First of all, make sure that your template files define a Byte Order Mark <http://en.wikipedia.org/wiki/Byte_Order_Mark> If you for some reason don't want to add BOM to your templates, you can force Template to use a particular encoding (e.g. "utf8") for your templates with the "ENCODING" option. my $template = Template->new({ ENCODING => 'utf8' }); Questions About This FAQ Why is this FAQ so short? Because we don't have anyone maintaining it. Can I help? Yes please :-) perl v5.14.2 2011-12-20 Template::FAQ(3pm)
All times are GMT -4. The time now is 01:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy