SynMaxis.Com

November 27, 2008

keywords

Filed under: Uncategorized — Tags: — Dr.Z @ 7:48 pm

Otolaryngology

October 29, 2008

How do I change the menu in Geeklog?

Filed under: computer — Tags: , — Dr.Z @ 11:15 am

Most themes use the variable {menu_elements} in their header.thtml file. This variable is replaced with a set of menu entries.

In Geeklog 1.3.9 and earlier versions, those menu entries were hard-coded into Geeklog, so if you want to change these entries, you will have to remove the {menu_elements} variable and replace it with the actual links to the items you want.

Starting with Geeklog 1.3.10, there is a configuration variable in your config.php that lets you choose which menu entries will be used for {menu_elements} and in which order they will be displayed. The variable is $_CONF['menu_elements'] and consists of a comma-separated list of keywords, each of which represents a menu entry (see the comments in config.php for details).

Custom entries

It is also possible to add your own entries to that list through the use of the ‘custom’ keyword and a function called CUSTOM_menuEntries that you’ll have to implement in your lib-custom.php. It should return an array of (menu text, link) entries (see lib-custom.php for details).

A much simpler method of adding your own entries would be to simply hard-code them in the header.thtml file of your theme, near {menu_elements}.

Plugin entries

The ‘plugins’ keyword will let plugins add their entries to the menu (e.g. Static Pages where the “Add To Menu” checkbox is activated).

Additionally, the variable {plg_menu_elements} (in header.thtml) can be used to have the plugin menu entries in a separate place than the standard menu entries.

Please note that the use of the ‘plugins’ keyword in $_CONF['menu_elements'] will add all plugin entries to {menu_elements}, so you may up end with duplicate plugin entries if your theme uses both the {menu_elements} and the {plg_menu_elements} variable.

To remove a plugin’s entry from the menu, check with the plugin’s documentation to see if it has an option to switch off the menu entry (typically in its config.php file). If it doesn’t, find the plugin’s functions.inc file and in that file the function that’s named plugin_getmenuitems_plugin-name and either remove that function or comment it out.

Misc. notes

Please note that not all themes use these variables. For example, the XSilver theme uses {plg_menu_elements} but not {menu_elements}.

If all you’re trying to do is changing the actual text of the menu entries, please see Where can I change the text …?

FAQ Manager » Usage » How do I change the menu?

October 21, 2008

The importance of making milestones

Filed under: computer — Tags: — Dr.Z @ 6:55 am

Mile stones can be used to effectively measure the progress of your projects.

  • Milestones should be obvious—anyone on your project team should be able to easily recognize when a milestone has been reached.
  • Milestones should be demonstrable—anyone on your project team should be able to demonstrate to an outsider that a milestone has been reached.
  • And Milestones should be progressive—each milestone reached should indicate additional progress towards completing the entire project.

The Correct Approach? Assign Milestones for Small Deliverables and Large Deliverables.

Milestones are not supposed to be redundant follow-ups for tasks.

The correct way to utilize milestones is to use them to indicate when tangible deliverables are complete. You should use a combination of milestones: small milestones that are internal to your team to indicate progress on small deliverables and large milestones that are used to communicate your overall progress to outsiders.

October 14, 2008

A good starting point for wget and ssh

Filed under: computer — Tags: — Dr.Z @ 12:21 pm
The following message is from: http://mail.pm.org/pipermail/melbourne-pm/2002-May/000162.html.
it is a good question and useful to be worked on.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hey Dudes,

I often find a need to have a single URL that is used to download files.
Think like wget you can type things like
	wget http://user:password@host/directory/file.ext
	wget ftp://user:password@host/directory/file.ext

Now add to that the ability to do things like
	wget ssh://user:password@host/directory/file.ext

and I am sure there are more...
eg:
	wget dbi://user:password@dsn/query
or something inventive

The thing is that parsing the URL and then turning it into either a get
with LWP or an ftp query with Net::FTP or even Net::SSH::Perl is fine,
but I don't want to have to re-implement it every time. Does anyone know
of a product available for any of these generically ?

I would prefer to separate out the url from login and password

Something like...

	use MyGet;
	use IO::File;
	my $f = new IO::File '> /tmp/outfile.$$';

	my $g = MyGet->new();
	$g->user($user);
	$g->passwd($passwd);
	$g->url($url)
	$g->get($f);

Is LWP the right place to start?

Many years ago now I wrote 'fcp'. Literally it is equiv to 'rcp' and
'scp' but for FTP files. Meaning I can basically do:

	fcp *.html scottp at linux.dd.com.au:/tmp/

and it uploads the file. Thus I could download and upload, and do things
like:

	fcp scottp at linux.dd.com.au:/tmp/*.html scottp at melbourne.pm.org:/tmp/

Things like that - but it was REALLY hard to not only parse the URL
correctly but also work out exactly the things like recursive
directories etc. wget is great, but it is download only and only ftp and
http.

Any ideas? Do you find that you do this alot yourself ?

Scott
- ---
Scott Penrose
Open source and Linux Developer
http://linux.dd.com.au/
scottp at dd.com.au
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (Darwin)
Comment: For info see http://www.gnupg.org

iD8DBQE85cvtDCFCcmAm26YRAgfJAJ9+378oFO1stRlvjQmqyNTSXiHG/ACbBQXU
anEIII43qfIY7igVdFPOO6s=
=s09t
-----END PGP SIGNATURE-----

October 10, 2008

List of recent Nobel Prize in chemistry winners

Filed under: people, science — Tags: — Dr.Z @ 10:11 am

_ 2008: Osamu Shimomura, Japan, and Martin Chalfie and Roger Y. Tsien, United States, for the discovery and development of the green fluorescent protein, GFP.

_ 2007: Gerhard Ertl, Germany, for studies of chemical processes on solid surfaces, research that has advanced the understanding of why the ozone layer is thinning, how fuel cells work and even why iron rusts.

_ 2006: Roger D. Kornberg, United States, for work on how information stored within a gene is copied and transferred to the parts of cells that produce proteins.

_ 2005: Yves Chauvin, France, and Robert H. Grubbs and Richard R. Schrock, United States, for their work and exploration of metathesis.

_ 2004: Aaron Ciechanover and Avram Hershko, Israel, and Irwin Rose, United States, for their work in how cells break down.

_ 2003: Peter Agre and Roderick MacKinnon, United States, for their research on how key materials enter or leave cells in the body and their discoveries concerning tiny pores called “channels” on the surface of cells.

_ 2002: John B. Fenn, United States, Koichi Tanaka, Japan, and Kurt Wuethrich, Switzerland, for developing methods used in identifying and analyzing large biological molecules.

_ 2001: William S. Knowles and K. Barry Sharpless, United States, and Ryoji Noyori, Japan, for showing how to better control chemical reactions, paving the way for drugs to treat heart ailments and Parkinson’s disease.

_ 2000: Alan J. Heeger and Alan G. MacDiarmid, United States, and Hideki Shirakawa, Japan, for the discovery that plastic conducts electricity and for the development of conductive polymers.

_ 1999: Ahmed H. Zewail, United States, for pioneering the investigation of fundamental chemical reactions, using ultra-short laser flashes, on the time scale on which the reactions actually occur.

_ 1998: Walter Kohn, United States, for the development of density-functional theory in the 1960s that simplifies the mathematical description of the bonding between atoms that make up molecules, and John Pople, Britain, for developing computer techniques to test the chemical structure and details of matter.

October 9, 2008

What is SCP, TFTP, FTP, HTTP, HTTPS

Filed under: computer — Tags: , , , — Dr.Z @ 12:46 pm

Secure Copy or SCP is a means of securely transferring computer files between a local and a remote host or between two remote hosts, using the Secure Shell (SSH) protocol.

The SCP protocol, which runs on port 22, is similar to the BSD rcp protocol, however unlike rcp, data is encrypted during transfer, to avoid potential packet sniffers extracting usable information from the data packets. The protocol itself does not provide authentication and security; it relies on the underlying protocol, SSH, to provide these features.

SCP can interactively request any passwords or passphrases required to make a connection to a remote host, unlike rcp which fails in this situation.

The SCP protocol implements file transfers only. It does so by connecting to the host using SSH and there executes an SCP server (scp). The SCP server program is typically the same program as the SCP client.

For upload, the client feeds the server with files to be uploaded, optionally including their basic attributes (permissions, timestamps). This is an advantage over the common FTP protocol, which does not have provision for uploads to include the original date/timestamp attribute.

For downloads, the client sends a request for files or directories to be downloaded. When downloading a directory, the server feeds the client with its subdirectories and files. Thus the download is server-driven, which imposes a security risk when connected to a malicious server.

For most applications, the SCP protocol is superseded by the more comprehensive SFTP protocol, which is also based on SSH.

SCP program

The SCP program is a client implementing the SCP protocol, i.e. it is a program to perform secure copying.

The most widely used SCP client is the command line scp program, that is provided in most SSH implementations. The scp program is the secure analog of the rcp command. The scp program must be part of all SSH servers that want to provide SCP service, as scp functions as SCP server too.

Some SSH implementations provide the scp2 program, which uses the SFTP protocol instead of SCP, but provides the very same command line interface as scp. scp is then typically a symbolic link to scp2.

Typically, a syntax of scp program is like the syntax of cp:

Copying file to host:

scp SourceFile user@host:directory/TargetFile

Copying file from host:

scp user@host:directory/SourceFile TargetFile

As the SCP protocol implements file transfers only, GUI SCP clients are rare, as implementing it requires additional functionality (directory listing at least). For example, WinSCP defaults to the SFTP protocol. Even when operating in SCP mode, clients like WinSCP are typically not pure SCP clients, as they must use other means to implement the additional functionality (like the ls command). This in turn brings platform-dependency problems. Thus it may not be possible to work with a particular SCP server using a GUI SCP client, even if you are able to work with the same server using a traditional command line client.

More comprehensive tools for managing files over SSH are SFTP clients.

October 6, 2008

PHP implementation for Visotors, users, and Web masters

Filed under: computer — Tags: , , — Dr.Z @ 5:19 am

1. users and visitors:

if (isset($_COOKIE["cUSER"]) ) {

//user is logged in code

}else{

//visitor is notlogged in code

}

2. web masters

User based Policy Roles

Configuration

.htaccess file:

php_value includepath

“.:/user/lib/php/:/var/www/html/_lib/_base:/var/www/html/_lib/_classes:/var/www/html/site:/var/www/html/code:/var/www/html/pear”

php_value register_globals “Off”

Note That the value for include_path should all be on line in the file

web server root dir is: /var/www/html here

config.php file

this file defines globale values that are useed throughout this site. Secifically, the line that reads:

define(”DSN”,”mysql://root:@localhost/xxxx”);

has to be changed to work with your database

With register_globals turned off (for security), use Superglobal Array:

$_GET, $_POST, $_COOKIE, $_SESSION, $_FILES, $_SERVER, $_ENV

October 5, 2008

The worst things that a development team can do

Filed under: computer — Dr.Z @ 11:31 pm

function fooFuction ($s) {

if $($s==”){

return 0;

}

else { return stripspashes ($s);

}

}

function bar_function($sVariable){

if (strcmp($sVariable,”)) {

return FALSE;

}

else {return stripslashes($sVariable);

}

}

what is wrong with that? –inconsistency!

note also: NULL and 0 is different.

September 28, 2008

My Shadow

Filed under: Uncategorized — Tags: — Dr.Z @ 1:13 pm

My Shadow

Robert Louis Stevenson

From Child’s Garden of Verses

I have a little shadow that goes in and out with me,
And what can be the use of him is more than I can see.
He is very, very like me from the heels up to the head;
And I see him jump before me, when I jump into my bed.

The funniest thing about him is the way he likes to grow–
Not at all like proper children, which is always very slow;
For he sometimes shoots up taller like an india-rubber ball,
And he sometimes goes so little that there’s none of him at all.

He hasn’t got a notion of how children ought to play,
And can only make a fool of me in every sort of way.
He stays so close behind me, he’s a coward you can see;
I’d think shame to stick to nursie as that shadow sticks to me!

One morning, very early, before the sun was up,
I rose and found the shining dew on every buttercup;
But my lazy little shadow, like an arrant sleepy-head,
Had stayed at home behind me and was fast asleep in bed.

September 26, 2008

examples for xargs command

Filed under: computer — Tags: — Dr.Z @ 10:22 am

% find [dir] -name [finename] -print | xargs rm -rf

Examples

  1. To use a command on files whose names are listed in a file, enter:
    xargs lint -a <cfiles

    If the cfiles file contains the following text:

    main.c readit.c
    gettoken.c
    putobj.c

    the xargs command constructs and runs the following command:

    lint -a main.c readit.c gettoken.c putobj.c

    If the cfiles file contains more file names than fit on a single shell command line (up to LINE_MAX), the xargs command runs the lint command with the file names that fit. It then constructs and runs another lint command using the remaining file names. Depending on the names listed in the cfiles file, the commands might look like the following:

    lint -a main.c readit.c gettoken.c . . .
    lint -a getisx.c getprp.c getpid.c . . .
    lint -a fltadd.c fltmult.c fltdiv.c . . .

    This command sequence is not quite the same as running the lint command once with all the file names. The lint command checks cross-references between files. However, in this example, it cannot check between the main.c and the fltadd.c files, or between any two files listed on separate command lines.

    For this reason you may want to run the command only if all the file names fit on one line. To specify this to the xargs command use the -x flag by entering:
    xargs -x lint -a <cfiles
    If all the file names in the cfiles file do not fit on one command line, the xargs command displays an error message.

  2. To construct commands that contain a certain number of file names, enter:
    xargs -t -n 2 diff <<EOF
    starting chap1 concepts chap2 writing
    chap3
    EOF

    This command sequence constructs and runs diff commands that contain two file names each (-n 2):

    diff starting chap1
    diff concepts chap2
    diff writing chap3

    The -t flag causes the xargs command to display each command before running it, so you can see what is happening. The <<EOF and EOF pattern-matching characters define a here document, which uses the text entered before the end line as standard input for the xargs command.

  3. To insert file names into the middle of command lines, enter:
    ls | xargs -t -I {} mv {} {}.old
    This command sequence renames all files in the current directory by adding .old to the end of each name. The -I flag tells the xargs command to insert each line of the ls directory listing where {} (braces) appear. If the current directory contains the files chap1, chap2, and chap3, this constructs the following commands:

    mv chap1 chap1.old
    mv chap2 chap2.old
    mv chap3 chap3.old
  4. To run a command on files that you select individually, enter:
    ls | xargs -p -n 1 ar r lib.a
    This command sequence allows you to select files to add to the lib.a library. The -p flag tells the xargs command to display each ar command it constructs and to ask if you want to run it. Enter y to run the command. Press the any other key if you do not want to run the command.Something similar to the following displays:

    ar r lib.a chap1 ?...
    ar r lib.a chap2 ?...
    ar r lib.a chap3 ?...
  5. To construct a command that contains a specific number of arguments and to insert those arguments into the middle of a command line, enter:
    ls | xargs -n6 | xargs -I{} echo {} - some files in the directory

    If the current directory contains files chap1 through chap10, the output constructed will be the following:

    chap1 chap2 chap3 chap4 chap5 chap6 - some files in the directory
    chap7 chap8 chap9 chap10 - some file in the directory

File

/usr/bin/xargs Contains the xargs command.
Older Posts »

Powered by WordPress