Archive for the 'Linux Support' Category

SBDavid

Using Variables in Perl

Using Variables in Perl

$_, the default variable. Creating containers for variables in Perl is easy. Give the container a name (which is made up of a combination of the letters A-Z, a-z, the digits 0-9 and the underscore character), then precede the name with one of Perl’s special variable naming characters, depending on what the variable will be used for:

$ – a scalar variable (one of something);
@ – an array variable (a collection of somethings, a list);

% – a hash variable (a collection of name/value pairs); and
\ – a referenced variable (a ‘pointer’ to something else, usually another variable).

SBDavid

Overview Kexec & Kdump

Overview Kexec & Kdump

Kexec is a fastboot mechanism which allows booting a Linux kernel from the context of already running kernel without going through BIOS. BIOS can be very time consuming especially on the big servers with lots of peripherals. This can save a lot of time for developers who end up booting a machine numerous times.

Kdump
Kdump is a new kernel crash dumping mechanism and is very reliable because the crash dump is captured from the context of a freshly booted kernel and not from the context of the crashed kernel. Kdump uses kexec to boot into
a second kernel whenever system crashes. This second kernel, often called a capture kernel, boots with very little memory and captures the dump image.

The first kernel reserves a section of memory that the second kernel uses to boot. Kexec enables booting the capture kernel without going through BIOS hence contents of first kernel’s memory are preserved, which is essentially
the kernel crash dump.

systemctl - Control the systemd system and service manager

systemctl may be used to introspect and control the state of the systemd(1) system and service manager.

systemd is a system and service manager for Linux operating systems. When run as first process on boot (as PID 1), it acts as init system that brings up and maintains userspace services.

Getting Help

systemctl -h
systemctl [OPTIONS...] {COMMAND} …

Query or send control commands to the systemd manager.

-h –help Show this help
–version Show package version
-t –type=TYPE List only units of a particular type
-p –property=NAME Show only properties by this name
-a –all Show all units/properties, including dead/empty ones
–failed Show only failed units
–full Don’t ellipsize unit names on output
–fail When queueing a new job, fail if conflicting jobs are
pendin

SBDavid

Comprehensive Perl Archive Network

The CPAN is the Comprehensive Perl Archive Network and can be accessed at http://www.cpan.org/ , and searched at http://search.cpan.org/ .

# perl -MCPAN -e shell

First, are you sure that the module isn’t already on your system? Try “perl -MFoo -e 1″. (Replace “Foo” with the name of the module; for instance.

“perl -MCGI::Carp -e 1″

If you don’t see an error message, you have the module. (If you do see an error message, it’s still possible you have the module, but that it’s not in your path, which you can display with “perl -e “print qq(@INC)”".)

SBDavid

How to verify user defaults

How to verify user defaults.

If you want to view the defaults, type the useradd command with the -D option as follows:

# useradd -D
GROUP=100
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel
CREAT_MAIL_SPOOL=yes

You can also use the -D option to change defaults. When run with this flag, useradd refrains from actually creating a new user account; instead, it saves any additionally supplied options as the new default values in /etc/login.defs. Not all useradd options can be used.

To set any of the defaults, give the -D option first; then add any of the defaults you want to set. For example, to set the default home directory location to /home/everyone and the default shell to /bin/tcsh, type the following:

# useradd -D -b /home/everyone -s /bin/tcsh

« Prev - Next »