Sinatra is one really amazing, light, and productive framework.
Among its many features, Sinatra allows one to define routes dinamically. See a scope binding example in the request scope section of Sinatra’s introduction page.
Sinatra is one really amazing, light, and productive framework.
Among its many features, Sinatra allows one to define routes dinamically. See a scope binding example in the request scope section of Sinatra’s introduction page.
crypto(3) is a function that provides basic criptography. It is at a so basic level that for serious work other than that of generating a shadowed password on the system, it is not recommended (as per a statement in its own man page).
The function is declared in the crypt.h file:
extern char *crypt (__const char *__key, __const char *__salt)
The input is a raw password string and a salt string, which is an additional value that provides a certain level of randomness to crypto’s hash generation process, so that there is not a single hash that may be produced for the same password, but several instead. If one provides a salt A, the output for the password X is Y whereas another salt B is passed, the output hash cannot be Y anymore, it will be some other hash Z.
I made a program in C which uses it, whose source code file I named cryptifier.c that has the following content:
#include <crypt.h> #include <stdio.h> #define _XOPEN_SOURCE #include <unistd.h> int main(int argc, char **argv) { const char *k = (const char *) argv[1]; const char *s = (const char *) argv[2]; char* r; printf("'%s' with salt '%s' generates '%s'\n", k, s, crypt(k, s)); return 0; }
The output of this function can be served as an input argument for useradd command’s -p option as described in a previous post.
IMPORTANT remark: when compiling a program that uses crypt.h now and having libc-6 it is necessary to specify -lcrypt (for libcrypt) on the gcc command line as libc-5 used to have crypt() in libc, whereas libc-6 has it in libcrypt (this is very old change, dated at least of 1998: source post).
I saw code saying “I have spaces”.to_sym to convert a String object to a symbol, but one can also use the form :’I am a symbol with spaces’.
See:
1.9.3-p0 :005 > :’this is a test’
=> :”this is a test”
1.9.3-p0 :006 > :’this is a test’.class
=> Symbol
1.9.3-p0 :007 > :’this is a test’.to_s
=> “this is a test”
This was also tested in ruby-1.8.7-p357.
The useradd command is a tool that provides sysadmins with the capability of adding new users (a.k.a. logins) to the system. The generic form of the command is this:
useradd -c 'COMMENT' -d 'HOME' -m -p 'CRYPT_STRING' -s 'SHELL' LOGIN
The -m option creates the user’s home directory if it does not exist.
Example:
useradd -c 'John Doe' -d /home/johndoe -m -p 'ABiELdbxGY2fY' -s '/bin/ksh' johndoe
John Doe just got himself a new account with the /home/johndoe home/login directory, created (-m) if not present, with CRYPT_STRING ‘ABiELdbxGY2fY’ generated by the crypt(3) function for the (simplest and unbelievably most commonly used) password ’123456′ with salt ‘AB’. The default login shell for this account is ksh (-s ‘/bin/ksh’). And last, the username, johndoe.
Go on and create some users on your grid.
Red Hat generally provides a stable Linux distribution in its currently supported releases. And one might want to only use the packages that came along with the distribution media i.e. a cdrom or an .iso file containing that cd’s image.
To be able to use a CD’s or .iso file’s packages in RHEL (Red Hat Enterprise Linux) 5.7, create this file in /etc/yum.repos.d/:
[user@localhost yum.repos.d]$ cat redhat_cdrom.repo [redhat_cdrom] name=Red Hat Enterprise Linux $releasever - CD-ROM baseurl=file:///media/rhel/Server enabled=1 gpgcheck=1 gpgkey=file:///media/rhel/RPM-GPG-KEY-redhat-release
This is assuming you had mounted the cdrom or the distribution’s .iso file to the /media/rhel directory.
Then do:
# yum update
And then pick up the desired software and install it:
# yum install <packages>
That is all.