Recently, I’ve seen cPanel upgrade throwing errors during upcp such as:

# /scripts/upcp
/scripts/upcp syntax OK
Running Futex Check/Fix……Done
Undefined subroutine &Cpanel::Update::automatic_updates_enabled called at /scripts/upcp line 273.

Fix:

wget -O /root/updatenow.static http://httpupdate.cpanel.net/cpanelsync/RELEASE/scripts/updatenow.static && perl /root/updatenow.static –manual

Then force the upgrade:

/scripts/upcp –force

Ubuntu 10.04.02 LTS released

Posted: 18th February 2011 by kire in ubuntu linux

The second maintenance update of Ubuntu 10.04 LTS has been released.

Ubuntu 10.04 LTS will be supported with routine maintenance updates until April 2013 on desktops and April 2015 on servers,

The release integrates ‘numerous post-release updates’ including security updates and ‘corrections for high-impact bugs, with a focus on maintaining stability and compatibility with Ubuntu 10.04 LTS.’

Changes
A full Change log for Ubuntu 10.04.2 can be viewed on @ http://wiki.ubuntu.com/LucidLynx/ReleaseNotes/ChangeSummary/10.04.2

Download
Ubuntu 10.04.02 can be downloaded @ http://ubuntu.com/desktop/get-ubuntu/download

Ever mistakenly pipe output to a file with special characters that you couldn’t remove?

-rw-r–r– 1 eriks eriks 4 2011-02-10 22:37 –fooface

Good luck. Anytime you pass any sort of command to this file, it’s going to interpret it as a flag. You can’t fool rm, echo, sed, or anything else into actually deeming this a file at this point. You do, however, have a inode for every file.

Traditional methods fail:

[eriks@jaded: ~]$ rm -f –fooface
rm: unrecognized option ‘–fooface’
Try `rm ./–fooface’ to remove the file `–fooface’.
Try `rm –help’ for more information.
[eriks@jaded: ~]$ rm -f ‘–fooface’
rm: unrecognized option ‘–fooface’
Try `rm ./–fooface’ to remove the file `–fooface’.
Try `rm –help’ for more information.

So now what, do you live forever with this annoyance of a file sitting inside your filesystem, never to be removed or touched again? Nah.

We can remove a file, simply by an inode number, but first we must find out the file inode number:

$ ls -il | grep foo

Output:

[eriks@jaded: ~]$ ls -il | grep foo
508160 drwxr-xr-x 3 eriks eriks 4096 2010-10-27 18:13 foo3
500724 -rw-r–r– 1 eriks eriks 4 2011-02-10 22:37 –fooface
589907 drwxr-xr-x 2 eriks eriks 4096 2010-11-22 18:52 tempfoo
589905 drwxr-xr-x 2 eriks eriks 4096 2010-11-22 18:48 tmpfoo

The number you see prior to the file permission set is actually the inode # of the file itself.

Hint: 500724 is inode number we want removed.

Now use find command to delete file by inode:

# find . -inum 500724 -exec rm -i {} \;

There she is.

[eriks@jaded: ~]$ find . -inum 500724 -exec rm -i {} \;
rm: remove regular file `./–fooface’? y

And done.

Recently I’ve had to do extensive work with Dell PowerEdge servers, and specifically Dell’s that use the LSI MegaRAID controllers. Anyone who has ever had to work with the LSI RAID controllers knows that the MegaCLI provided by LSI is the most cryptic command line utility in existence. MegaCli is available for Linux, DOS, Windows, Netware and Solaris.

I’ve compiled a “cheat sheet” if you will, of some common commands that will help you decipher the necessary beast of a utility that is MegaCLI.

Check it out: http://erikimh.com/megacli-cheatsheet

fun with outsourced support: Sprint

Posted: 29th January 2011 by kire in comedy & funny ha ha

Mike: Hello, I’m a Sprint order specialist. I specialize in setting up new
wireless accounts. Are there any questions I may help answer for you
today?
You: will my phone be activated when i get it
Mike: I would be glad to assist you about your new phone details.
Mike: Let’s move this chat and make it a window of its own. It will be out
of the way and I can stay with you in case you have any questions or any
concerns. Just click on the “Yes” button below and we can continue.
Mike: Simply click on the white “Yes” button below and we can continue.
Mike: Thank you for moving the chat. Just to check, are you currently a
Sprint customer?
You: uh yeah
Mike: That’s great to hear!
You: great!
You: are you sprint customer?
Mike: Could you please confirm you are upgrading your phone or purchase a
phone with new plan?
Mike: I am online Sprint Order Specialist.
You: So, you don’t have a sprint cell phone?
Mike: I am sorry, I can not tell you about personnel information.
You: So, you don’t have a sprint cell phone?
Mike: I would be happy to help you to place an order online and happy to
answer your questions.
You: It’s not “personnel” information, it’s “personal” information.
Mike: Okay.
Mike: I don’t have Sprint phone currently.
You: Thank you. Do you prefer Verizon? I’ve recently learned they offer
free upgrades.
Mike: You are welcome.
You: That’s really all I want. My current sprint phone cannot even dial
out, the blackberry’s have soured.
Mike: Sprint also offer you free upgrades phone if you are eligible for
full upgrade saving.
You: I should be eligible for “full upgrade saving”
Mike: I you upgrade your phone online today, you should receive your phone
inactive mode.
You: Why would I want a phone in inactive mode?
Mike: You can activate your phone online or contacting with our Customer
Care.
You: You do not care?
Mike: The phone would be inactive mode because if you would get your new
phone in active mode your current phone services would be stopped for the
time.
Mike: Your 1 phone can be active at one time.
You: That’s perfectly fine. My “1 phone” is useless.
You: When I press send, it says no.
Mike: You can activate a device by visiting Sprint.com/Activate and
following the on screen prompts.
You: It vibrates when I receive messages, but hell if I know what they
are.
Mike: I can understand your concern.
Mike: Please let me check your phone upgrade eligibility.
You: is that why you do not use sprint phones?
You: I’m not impressed, either.
Mike: In the future, you can visit www.sprint.com/upgrades to check your
upgrade eligibility but I would be happy to check it for you right now.
Can you please provide me with your billing ZIP code and phone number to
confirm your eligibility?
You: 234** 757-***-****
You: Can you please provide me with your billing ZIP code and phone number
to confirm your eligibility?
Mike: Thank you for your patience.
You: No, thank you.
Mike: Congratulations! You are eligible to receive a savings of $150 with
an instant rebate and with a two-year contract extension, or receive a $75
instant rebate with a one-year contract extension. By upgrading online
today, we will waive your shipping and handling charges and the $18
activation fee.
You: Did you just type all of that???
Mike: Yes,
You: surrreee
You: Well thanks!
You: Thanks Mike!
You: Where are you located?
Mike: I am located in India.
You: SPRINT HAS MIKES IN INDIA?
Mike: Yes, You are right.
You: What’s your real name… Seriously.
You: Maybe we can be penpals.
Mike: My name is Mahesh
You: That’s a beautiful name. Why do they make call yourself Mike?
Mike: I am sorry, I don’t have information about that.
You: :(
You: Okay Mahesh
You: What do you do for fun over there?
Mike: I am sorry, I can not tell you anything from here about me at this
time.
You: I’m sorry Mahesh, I didn’t mean to pry
You: so lets get down to business.
Mike: Alright.
You: So this upgrade… I can get any phone I WANT?
Mike: Yes, You can upgrade your phone with available phones on the Sprint
website.
Mike: Are there any particular features you will like your phone to have?
You: Well, I was looking at them before your sexy ass popped up on my
screen
You: and I want the EVO
You: The shift one
Mike: Excellent Choice!
You: So I can get that upgrade for free?
Mike: Unfortunately, we don’t have offers on the HTC Evo Shift for free
upgrades currently.
Mike: But we have other great phones available online.
You: Oh Mahesh you are breaking my heart
You: You said it was excellent, we have good taste
You: why can’t I upgrade ?
Mike: We offer you 3G best phones for free upgrades with 2 years contract.
Mike: Please have a look Samsung Seek phone.
Mike: We also offer you free activation and shipping.
You: Seek sheet
You: I know you wouldn’t settle for a seek Maheesh
You: I’ll pay for activation and shipping on the EVO shift
You: and I’ll pay to ship you here
You: Over here, beautiful fair skinned women dance atop tables and slide
up and down polls for nothing less than a dollar!
Mike: I can understand your concern.
You: Do you?
Mike: Would you like to place an order online today?
You: OK
Mike: The Checkout page will ask you to provide additional information.
Please take your time and let me know if you have any questions.
You: What are you wearing?
Mike: I am sorry, as I can not tell you anything.
You: mmmmm
You: I love a good mystery.
You: Can you at least tell me what the difference is between 3G and 4G?
Mike: I apologize for your frustration and I do want to help you. I would
like to ask that we approach this issue professionally. I assure you that
I will assist you as much as I possibly can.
You: I agree
Mike: 3G and 4G is a speed of the Internet.
You: I have FIOS
You: Is that 4G?
Mike: It’s also indicate new generation of the Internet.
You: Does G stand for gigabyte or gangsta?
Mike: G stands for the Generation.
You: Damn Facebook
You: They lie.
You: So, 4th generation internet?
You: Is that the same as Al Gore’s internet?
Mike: Fourth Generation (4G) is the next generation of wireless networks
that will complement third Generation (3G).
You: oooo
Mike: 4G gives you an average download speed of 3 to 6 Mbps with peak
download speeds up to 10 Mbps.
You: wow
Mike: 4G has an average upload speed of .5 to 1.0 Mbps with peak upload
speeds up to 5 Mbps.
Mike: Sprint’s 4G network gives you the speed to video conference live
without the lag.
Mike: We’re already set up with 4G coverage in 34 markets. Our 4G speeds
are up to 10 times faster than existing 3G networks.
Mike: You can learn all about 4G speeds, our current devices and coverage
by visiting
Nextel.com/en/solutions/mobile_broadband/mobile_broadband_4G.shtml.
You: So, Sprint invented the fourth generation internet… And that’s
separate from Al Gore’s?
Mike: Additional information about Sprint’s 4G network can be found by
visiting www.Sprint.com/4G.
You: I’ll bookmark that
Mike: Okay.
You: So, can you answer my other question?
You: Is this a separate generation interweb?
Mike: Yes, It’s generation of the Web reception.
You: so it’s not part of Al Gore’s?
Mike: I am sorry, I don’t have information about the AI Gore’s. We have
separate team to help you in this regard.
Mike: I would recommend you please contact our Customer Care Service. They
will be happy to help you. Please give them a call at 1-800-639-6111 for
Nextel and 1-888-211-4727 for Sprint. Timings are Monday to Friday 6 am to
12 am CST and Saturday to Sunday 7 am – 7 pm CST.
You: OMG You have an Al Gore department?
You: Can you transfer me?
Mike: I am sorry, I don’t have access to transfer you from here.
You: But you DO have an Al Gore team?
Mike: Please contact our Customer Care.
You: You don’t care?
Mike: I don’t have information about the AI Gore team and unable to assist
you with this.
Mike: Is there anything else I can help you with today?
You: Okay. I’ll contact Customer care for the Al gore team…
You: What about this upgrade???
You: Stop changing the subject!
Mike: You would no get any free upgrades for the HTC Evo Shift phone.
Mike: not*
You: What if I want to Seek the shit out of the Samsung junk.
Mike: Do you want to upgrade your phone?
You: Do you want to upgrade your phone?
Mike: Okay.
Mike: Thank you for visiting www.sprint.com.
You: Okay.
You: Thank you for visiting www.sprint.com.
You: MAHEESH
Thank you for chatting with us today!

A server’s primary hard drive crashed hard one fine day. Yes, a non-RAIDed “server” (*sigh*). The last thing heard from it was screams of read-only, and it was gone.

We got the drive mounted via a SATA dock to a new machine. At this point, all attempts at mounting and fscking failed, and dmesg was spewing out horribly ugly ext errors that would make any administrator cringe…

sd 2:0:0:0: SCSI error: return code = 0×08000002
sdc: Current: sense key: Medium Error
Add. Sense: Unrecovered read error

end_request: I/O error, dev sdc, sector 214199
JBD: Failed to read block at offset 24684
JBD: recovery failed
EXT3-fs: error loading journal.

It looked pretty hopeless, and we were about to look to not-so-fresh backups and fail over. Then I remembered a magical tool called “ddrescue“. I had used it previously in a crisis-situation and it had proved to save my ass without complaint. Could it work in a server environment dealing with a 1TB drive?

hmmmmmmmmmmmmmmm………

[Disclaimer] Before proceeding, I must again warn all readers that you should always use caution when modifying a file system or disk. If you do not have access to the console (though NOT recommended, but sometimes necessary) be sure you perform any disk operations inside of a screen:

[~]# screen ddrescue -r3 /dev/sdc1 /home2/rescued.image log

Breakdown:

  • -r3 defines # of retries to give a bad block before calling it hopeless, in this case retry 3 times and move on.
  • /dev/sdc1 is the drive/partition I’m trying to recover data from
  • /home2/rescued.image is where the recovered data goes
  • and lastly, “log” simply tells the program where to log (`pwd`/log in this case)
  • And off it goes…

    Initial status (read from logfile)
    rescued: 8416 MB, errsize: 94720 B, current rate: 30146 kB/s
    ipos: 8417 MB, errors: 1, average rate: 14700 kB/s
    opos: 8417 MB, time from last successful read: 0 s
    Copying non-tried blocks…

    After it’s done all of your dirty work, you’re going to want to clean up or “fsck” the image prior to mounting it:

    # e2fsck -y /home2/rescued.image

    The -y flag negates the need to answer “yes” to all that it’s fixing.

    After fsck, simply mount the image:

    # mount -o loop /home2/rescued.image /mnt



    Want to try saving your own data, and save thousands of dollars on data recovery by doing it yourself? Here ya go:



    Obtaining ddrescue:

    Download the RPM’s for any RHEL/CentOS based systems here:
    http://packages.sw.be/ddrescue/

    For all the Debian/Ubuntu Linuxers out there, simply use aptitude:

    [eriks@jaded: ~]$ sudo apt-get install ddrescue



    In a hurry? Want to speed up the process? Learn how to ionice and renice the ddrescue process here: http://erikimh.com/nice

    If rpm / yum command hangs incessantly during operations or you see error messages, it likely means your RPM database has become corrupted.

    /var/lib/rpm/ stores the RPM database information, so to resolve you can just delete and rebuild the database using one of the two methods below like so:

    Method # 1

    rm -f /var/lib/rpm/__db*
    rpm –rebuilddb -v -v

    Method # 2
    If you are still getting errors, then try your luck with following commands:

    # mv Packages Packages-BAKUP
    # db_dump Packages-BAKUP | db_load Packages
    # rpm -qa
    # rpm –rebuilddb

    When setting up Maildir in Debian 5.0 or Ubuntu 10.x, getting the generic mail applications working correctly can be extremely tricky. When you type “mail” in a default/stock installation, it is attempting to read mbox data and will not read your “Maildir”. Annoying, since the stock configuration for mail delivery in most mail servers is now Maildir.

    First, Install the ‘mailutils’ package, not the bsd mailx package.

    apt-get install mailutils

    Do not touch the mailutils /etc/mail.rc file; there are some promising looking variables here like mailbox-type but these do not do what is desired. When the MAIL environment variable is set correctly mailutils will automatically detect the maildir box type.

    Do not touch /etc/login.defs; the promising looking lines in here are deprecated.

    Edit files in /etc/pam.d, changing the pam_mail.so lines as shown (assuming ~/Maildir as the selected location):

    login: default login shells
    session optional pam_mail.so dir=~/Maildir standard

    su: set up for proper MAIL when using su; nopen does not show ‘new mail’ message
    session optional pam_mail.so dir=~/Maildir nopen

    sshd: set up MAIL properly when logging in with ssh; this line probably has a noenv by default which needs removed to set this properly
    session optional pam_mail.so dir=~/Maildir standard

    So you have a drive that’s gone bad, and you cannot mount it. How can you recover a bad superblock from a corrupted ext3 partition to get back your data? Linux ext2/3 filesystem stores superblocks at different locations so it is possible to recover data from a corrupted partition. Your error will likely look similar to this:

    #mount /dev/sda2
    /dev/sda2: Input/output error
    mount: /dev/sda2: can’t read superblock

    or

    # mount /dev/sdb1 /mnt
    mount: special device /dev/sdb1 does not exist

    Note: Your device may be different, I provided two separate examples from an sda partition and sdb partition, but check your server and become familiar with its’ drives before messing with your file system at all.

    Mount partition using alternate superblock

    Find out superblock location for /dev/sda2:

    # dumpe2fs /dev/sda2 | grep superblock

    WARNING! Make sure file system is UNMOUNTED.

    If your system will give you a terminal type the following command, else boot Linux system from rescue disk (boot from 1st CD/DVD. At boot: prompt type command linux rescue)

    Sample output:

    Primary superblock at 0, Group descriptors at 1-6
    Backup superblock at 32768, Group descriptors at 32769-32774
    Backup superblock at 98304, Group descriptors at 98305-98310
    Backup superblock at 163840, Group descriptors at 163841-163846
    Backup superblock at 229376, Group descriptors at 229377-229382
    Backup superblock at 294912, Group descriptors at 294913-294918
    Backup superblock at 819200, Group descriptors at 819201-819206
    Backup superblock at 884736, Group descriptors at 884737-884742
    Backup superblock at 1605632, Group descriptors at 1605633-1605638
    Backup superblock at 2654208, Group descriptors at 2654209-2654214
    Backup superblock at 4096000, Group descriptors at 4096001-4096006
    Backup superblock at 7962624, Group descriptors at 7962625-7962630
    Backup superblock at 11239424, Group descriptors at 11239425-11239430
    Backup superblock at 20480000, Group descriptors at 20480001-20480006
    Backup superblock at 23887872, Group descriptors at 23887873-23887878

    Now check and repair a Linux file system using alternate superblock # 32768 on /dev/sda2:

    # fsck -b 32768 /dev/sda2

    Sample output:

    fsck 1.40.2 (12-Jul-2007)
    e2fsck 1.40.2 (12-Jul-2007)
    /dev/sda2 was not cleanly unmounted, check forced.
    Pass 1: Checking inodes, blocks, and sizes
    Pass 2: Checking directory structure
    Pass 3: Checking directory connectivity
    Pass 4: Checking reference counts
    Pass 5: Checking group summary information
    Free blocks count wrong for group #241 (32254, counted=32253).
    Fix? yes

    Free blocks count wrong for group #362 (32254, counted=32248).
    Fix? yes

    Free blocks count wrong for group #368 (32254, counted=27774).
    Fix? yes
    ……….
    /dev/sda2: ***** FILE SYSTEM WAS MODIFIED *****
    /dev/sda2: 59586/30539776 files (0.6% non-contiguous), 3604682/61059048 blocks

    Now try to mount file system using mount command:

    # mount /dev/sda2 /mnt

    You can also use superblock stored at 32768 to mount partition, enter:

    # mount sb={alternative-superblock} /dev/device /mnt
    # mount sb=32768 /dev/sda2 /mnt

    Now , try to browse and access file system:

    # cd /mnt
    # mkdir test
    # ls -l
    # cp file /path/to/safe/location

    Hopefully, this article will allow you to recover the critical data you need, and that you’ve learned your lesson on THE IMPORTANCE OF BACKUPS.

    ;)

    Ubuntu 10.10 released(Maverick Meerkat)

    Posted: 16th October 2010 by kire in ubuntu linux

    Ubuntu 10.10, aka Maverick Meerkat, has been officially released and while we pause for a moment to think of the poor servers and mirrors getting hammered – as a if a million Ubuntu users cried out (in tears of joy) before being silenced (to the humdrum of download waiting) – you might be wondering what’s new.

    Here’s a quick summary:

    Speed
    Canonical claims a more streamlined boot process (yes, improving on the already superfast Lucid boot speed) and, of course, a sparky new kernel based on 2.6.35 and bringing with it improved hardware support.

    Style
    There’s new themes, icons, and default wallpaper as expected, but there’s also the introduction of a new system font collection designed specifically for Ubuntu, called the The Ubuntu Font Family, that’s easy to read and easy on the eyes. It’s certainly clean, and reminiscent of the Ubuntu logo font introduced in 10.04. For the netbook edition, a new interface design called Unity aims to make using netbooks simpler and more stylish, too.

    Features
    The Software Center gets new sections for Features and What’s New (tones of App Store perhaps?), an improved look that’s more pleasant to browse, a new package installation history which is definitely welcome, and an interesting new trend: the ability to purchase commercial software. A test package is available, ‘Ricks Wallpapers’ which users can buy for $1. Proceeds are re-invested into Ubuntu development.

    Applications
    There’s nothing we love more than the latest version of, well, anything. Meerkat comes with Gnome 2.32, OpenOffice 3.2.1, Transmission 2.04, and the latest Firefox 3.6.10 among other updates. The photo-manager F-Spot is gone now, replaced by Shotwell. Photos can be directly published to Facebook, Flickr and others, and collections made with F-Spot can be imported.

    Cloud
    Canonical is pushing cloud computing hard with both the Desktop and Server editions of Ubuntu. For the desktop the free 2GB online storage on Ubuntu One for all Ubuntu users has been supplemented by a new, cheaper, pricing structure (upgrade to 20GB for $US2.99) and the addition of both a Windows client (for cross-OS syncing) and both iPhone and Android clients, along with a new streaming service to stream music from your cloud collection to your smartphone.

    All up, it sounds like a worthy upgrade. Speaking of which, if you don’t want to do a clean install you can upgrade to 10.10 from within 10.04 itself via the Update Manager – but as 10.04 is an LTS (Long Term Support) release, you’ll first need to tell it you want to: click System –> Administration –> Software Sources, then under the Updates tab set ‘Check for new distribution releases’ to ‘Normal Releases’. See below for detailed instructions.

    NOTE: ALWAYS backup your home directory and personal data first, of course, as when doing any operating system install or upgrade for your machine. I am not responsible for anything stupid that you might do to your machine.

    Network Upgrade for Ubuntu Desktops (Recommended)

    You can easily upgrade over the network with the following procedure.

    Open the Software Sources application from the System -> Administration menu
    Select the sub menu Updates from the Software Sources application
    Change the Release Upgrade drop down to “Normal Releases” and close the application
    Press Alt-F2 and type update-manager
    Click the Check button to check for new updates.
    If there are any updates to install, use the Install Updates button to install them, and press Check again after that is complete.
    A message will appear informing you of the availability of the new release.
    Click Upgrade.
    Follow the on-screen instructions.

    =======================================================

    Now, that was the easy way. Perhaps you’re too cool for the GUI, or you do not run the Desktop edition of Ubuntu. In this case, keep reading.

    First, lets make sure your box is up to date prior to the upgrade (important).

    sudo apt-get update && sudo apt-get upgrade

    Then type ‘Y’ to accept and continue updating your system.

    After that, type the command below to install update-manager-core if you don’t already have it:

    sudo apt-get install update-manager-core

    Then you need to change the upgrade prompt to Normal. To do that, type the commands below:

    sudo nano /etc/update-manager/release-upgrades

    Press I on your keyboard, then change the value of the Prompt to ‘normal’.

    Next, type the commands below to begin the upgrade:

    sudo do-release-upgrade -d

    Type ‘Y’ to continue with the upgrade.

    Wait for all packages to download and upgrade.

    You may have to restart your computer.

    Enjoy.