Hot answers tagged

36

If i can give you any advice.... Is stop wasting your time cleaning... Make an image of the OS for forensic stuff for later.. And just reinstall the server.. Sorry.. but its the only secure way to resolving yourself from being rootkit'd Later you can check the image, for certain reasons why it happened.. From personal experience, i did this, and later ...


26

aptitude install -y package1 package2 package3


14

I guess this isn't really a script, but you could install puppet and use the package type. Then it will simply be a matter of creating a file with a bunch of package directives. For example: package { zsh: ensure => latest } package { vim-enhanced: ensure => latest, name => $operatingsystem ? { 'centos' =&...


14

You are using the EPEL 5 version of the repo instead of 6, go into your /etc/yum.repos.d/epel.repo file and change: mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch to mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=$basearch Then run yum clean all and then try and install munin again. ...


13

You appear to be having this issue, which is because at some point nvi started opening files O_RDWR instead of O_RDONLY. If your vi is in fact nvi, I'd try using a different vi, say vim.


13

Perl was probably already installed, and who knows what that install script did to your environment to screw it up. Two lessons here: Never install software using the above "pipe to bash" method without first verifying that 1) the install works, 2) it won't mess things up, and 3) it doesn't do anything malicious. Always, always, always check to see if a ...


10

You are seeing an rpmforge dependency problem, not a CentOS dependency problem. rpmforge perl modules are mass rebuilt at the moment. See http://lists.rpmforge.net/pipermail/users/2009-July/002508.html ff.


10

In PowerShell, this is one way you could do it: PS> Get-ChildItem -recurse | ` Where {$_.PSIsContainer -and ` @(Get-ChildItem $_.Fullname | Where {!$_.PSIsContainer}).Length -eq 1} The $_.PSIsContainer returns true for dirs and false for files. The @() syntax ensures the result of the expression is an array. If its length is 1 then ...


10

http://roundcube.net/ looks pretty good and I've heard good things about it. Personally, haven't used it in any huge capacity. The other commonly used one is horde/imp which is used in a lot of various places, relatively simple from an end users point of view not so much so from a sysadmin point of view. Hope that helps.


10

In addition to using the -y flag for yes answers you will also want to set DEBIAN_FRONTEND=noninteractive to prevent debconf setting questions from popping up. DEBIAN_FRONTEND=noninteractive apt-get install PACKAGE -y That being said, it might be a better road in the long run to follow Kyle's suggestion and take a look at a configuration management system ...


9

Short answer: learn both. You are going to encounter both as a sysadmin, so you'll want to know how to read/troubleshoot/debug both. As for writing scripts, I have used mostly Perl over the last 10 years for most of my sysadmin utility and "glue" scripts. Its regex syntax is really simple, and it lends itself quite well to extremely fast script ...


9

It looks like it goes through and makes an HTML table out of all of your environmental variables. Would you consider that nefarious? I'd consider anything that I didn't put on my own server to be nefarious, but that's me.


9

Bottom line: If you have no time for this then you need to revert to your pre-upgrade system snapshot/backup until you do have time to migrate to a webmail system that does not recommend use of deprecated technology. As far as I recall (it's been probably 8 years since I've seen an open webmail install), open webmail reads mail spools directly (hence the ...


9

You have an incompatible repository "rpmforge". This only works on RHEL and clones, and isn't compatible with Amazon Linux (which used to be a RHEL clone, but isn't anymore). You have a couple of options: Remove the rpmforge repository and try again. Note that you might not be able to do this if you actually need packages from this repository. The ...


8

What OS / Distro are you using? It is generally easier to install these modules from a package because that will get the dependencies too. In Ubuntu you would just: sudo apt-get install libdatetime-perl


8

The username will be available in the environment variable REMOTE_USER. This works for nearly every authentication method, should you ever start using digest or maybe even kerberos authentication.


8

You can create a soft link using ln that links /usr/bin/perl to /usr/local/bin/perl ln -s /usr/local/bin/perl /usr/bin/perl


8

I don't think data structures, algorithms or sorting questions apply to me role? Why don't you think that? Mabe not knowing the differences betwen O(n) and O(1) and O(log n) but writing good code - and scripts are code - definatly needs a basic understanding of those three things. When I intervied for my current job I was asked at least the below ...


8

I've just had the same error and fixed it with the below. cpan o conf make '/usr/bin/make' #or path to your make o conf commit


8

Look at the autodie core module. This replaces calls like open and fork with functions that die on failure. To get it to work with system, you need to import :all or :system, since the default does not do so. use strict; #always! use warnings; #always! use autodie qw(:system); system('/bin/false'); #This will die print "This will never be printed\n"; ...


8

The error on login is from the following line being in your bashrc script: ~/perl5/perlbrew/etc/bashrc You can likely fix perl by deleting /usr/bin/perl as the install script didn't put it in /usr/local/bin/perl by default... not sure where the ln command was inspired from. You may have to consult your distro to fix Perl, not sure. The installation ...


8

if ssh is working between the servers, scp seems to be what you're looking for. it's as easy as: scp /dir/source.file user@targethost:dir/target.file


8

Here is already many answers about scp or rsync. For routine "cron based" backup is rsync better. Reasons: rsync copying only files what are not already at the target so, usually a bit faster than scp -r has a bunch of useful parameters (e.g. what to do with symlinks and etc) with some tweaking can act as "OS X" time machine (hardlinking the latest ...


8

Many perl modules will be available within the usual package hierarchy. For Ubuntu, I believe the package you want is called libdbd-pg-perl - so try installing that. For packages not included within the package hierarchy, you can use the perl module CPAN to install them. As root, run perl -MCPAN -eshell and follow the instructions to configure what ...


7

I see that you already solved this with the CPAN shell, but it would be better to install with Debian packages, that way you have only one place to check for upgrades, etc... In fact, I'll bet if you'd used the debian bugzilla package in the first place you wouldn't have run into this problem in the first place. apt-get install libemail-address-perl The ...


7

After you install gitweb (on RHEL $ yum install gitweb), it should create a directory var/www/git and put a file in etc/httpd/conf.d/git.conf. If these don't exist, create them. Put all your git repos in var/www/git and edit git.conf to let it execute cgi scripts and rewrite URLs for gitweb. Here's what I have: <Directory /var/www/git> SetEnv ...


7

Use the modulo operator (bash specific syntax): if [ $(($counter % 600)) -eq 0 ] ; then echo " still in process wait another 10 min .." fi Or more portable: if [ `expr $counter % 600` -eq 0 ] ; then echo " still in process wait another 10 min .." fi


7

see /usr/ports/UPDATING the entry from 20120630 has detailed description how to do it with portmaster or portupgrade


6

CentOS follow RHEL (Red Hat Enterprise Linux). RHEL 6 is on the way, which means that CentOS 6 will also be released in a few weeks (estimate). I took a quick look at RHEL 6 repodata, and it seems that Perl will, in the new version, have version 5.10.1: ftp://ftp.redhat.com/pub/redhat/rhel/beta/6/i386/os/Packages/ perl-5.10.1-106.el6.i686.rpm Answer: Yes, ...



Only top voted, non community-wiki answers of a minimum length are eligible