RealTechTalk (RTT) - Linux/Server Administration/Related

We have years of knowledge with technology, especially in the IT (Information Technology) industry. 

realtechtalk.com will always have fresh and useful information on a variety of subjects from Graphic Design, Server Administration, Web  Hosting Industry and much more.

This site will specialize in unique topics and problems faced by web hosts, Unix/Linux administrators, web developers, computer technicians, hardware, networking, scripting, web design and much more. The aim of this site is to explain common problems and solutions in a simple way. Forums are ineffective because they have a lot of talk, but it's hard to find the answer you're looking for, and as we know, the answer is usually not there. No one has time to scour the net for forums and read pages of irrelevant information on different forums/threads. RTT just gives you what you're looking for.

  • 2CO/2Checkout Howto Enable IPN/Notification Setup & Script Info


    https://www.2checkout.com/documentation/notifications/order-created

    It shows all the parameters that get passed so you can make a simple script to process it.

    To enable 2CO Notifications you need to do the following:

    1. Login
    2. Browse to the top right to an icon that looks like a "circle with horizontal lines inside" - Notifications.
    3. Enter the appropriate URL for your IPN/Notification processing script (you can have a custom script/location for each event but most just use a single script that intercepts the message type/notification).

    The above is quite similar to how PayPal does it and works quite well once you get it going.  The only drawback is that it doens't appear you can repost notifications or track them like you can with PayPal.


  • 2CO/2Checkout how to create recurring payment subscription button dynamically


    It was hard to find this as I find most online payment processors don't just put the basic information in plain view.

    Remember to set your sid (your seller id).  The below can easily be turned into a scripted PHP template to integrate into your own custom or existing payment solution.

    http://help.2checkout.com/articles/How_to/How-to-Sell-Recurring-Products-with-2Checkout/


    <form action="https://www.2checkout.com/2co/buyer/purchase" method="POST">
    <input type="hidden" name="sid" value="XXXXXXX">
    <input type="hidden" name="mode" value="2CO">
    <input type="hidden" name="li_1_price" value="10.00">
    <input type="hidden" name="li_1_name" value="This is my Product">
    <input type="hidden" name="li_1_tangible" value="N">
    <input type="hidden" name="li_1_quanity" value="1">
    <input type="hidden" name="li_1_startup_fee" value="-2.00">
    <input type="hidden" name="li_1_type" value="product">
    <input type="hidden" name="li_1_recurrence" value="2 Week">
    <input type="hidden" name="li_1_duration" value="1 Year">
    <input type="submit" class="submit" name="purchase" value="Buy from 2CO" />
    </form>


  • Thunderbird Error An error occurred while loading or saving configuration information for thunderbird. Some of your configuration settings may not work properly.


    This error seems to happen randomly and especially when trying to send e-mails.  Apparently it's a long-standing GNome bug but is also partially the default of Thunderbird depending on who you ask.  There is no known fix that I'm aware of except to upgrade gnome and the gvfs package but this is not an option for older versions/distributions.

    An error occurred while loading or saving configuration information for thunderbird. Some of your configuration settings may not work properly.

    Bad key or directory name: "/desktop/gnome/url-handlers/GMT+02/command": `+' is an invalid character in key/directory names
    Bad key or directory name: "/desktop/gnome/url-handlers/GMT+02/command": `+' is an invalid character in key/directory names
    Bad key or directory name: "/desktop/gnome/url-handlers/GMT+02/command": `+' is an invalid character in key/directory names
    Bad key or directory name: "/desktop/gnome/url-handlers/GMT+02/command": `+' is an invalid character in key/directory names
    Bad key or directory name: "/desktop/gnome/url-handlers/GMT+02/command": `+' is an invalid character in key/directory names
    Bad key or directory name: "/desktop/gnome/url-handlers/GMT+02/command": `+' is an invalid character in key/directory names


  • CPanel Link to all of the command line options


    <p>CPanel says you can access 98% of the functions through CLI which experienced Unix/Linux admins prefer for simplicity and for scripting.&nbsp; I've never found CPanel easy to use from the admin panel, it seems everything is hard to find and a simple task becomes a series of hunts.</p> <p>So for people like me here's the list: <a href="http://cpanel.net/system-administrators/command-line-scripts/">http://cpanel.net/system-administrators/command-line-scripts/</a></p> <p>Remember to invoke all scripts like this:</p> <p>&nbsp;</p> <p><strong>/scripts/scriptname</strong></p> <p>&nbsp;</p> <dl class="cl-scripts"><dt>easyapache</dt><dd>This powerful script allows you to compile, upgrade, and re-install Apache, PHP, and various modules. EasyApache makes it simple to compile Apache and PHP modules.</dd><dt>check_cpanel_rpms</dt><dd>The check_cpanel_rpms script validates cPanel-managed RPMs and provides a way to reinstall these RPMs if they have been altered.</dd><dt>*up</dt><dd> The *up script is used to manually update the various services on your cPanel &amp; WHM server using various forms such as mysqlup, phpup and eximup. Although you can configure your services to update with cPanel, *up can be used for finer control.</dd><dt>restartsrv_*</dt><dd>The restartsrv_* script can be used to manually restart the various services on your cPanel server. This is the recommended method for restarting services through SSH.</dd><dt>addpop</dt><dd>The addpop script can be used to add email addresses through SSH. Through interactive prompts, addpop will create the new address and set the email address password under the proper user account.</dd><dt>delpop</dt><dd>The delpop scripts can be used to remove email accounts through SSH. Similar to the addpop script, delpop will remove the email address from the proper account.</dd><dt>wwwacct</dt><dd>The wwwacct script can be used to create accounts for your cPanel &amp; WHM server. We&rsquo;ve designed this script to allow you define common parameters used for account creation.</dd><dt>killacct</dt><dd>The killacct script can be used in similar fashion as the wwwacct script to automate removal of accounts.</dd><dt>restorepkg</dt><dd>The restorepkg script can be used to manually restore an account from backup.</dd><dt>cpbackup</dt><dd>When using cPanel &amp; WHM&rsquo;s legacy backup system the cpbackup script can be used to manually trigger system wide backups.</dd><dt>pkgacct</dt><dd>The pkgacct script is used within the cpbackup script and can be manually executed to create account specific backups.</dd><dt>upcp</dt><dd>The upcp script can be used to trigger the update process on your server. You can also configure whether you want server software and the OS updated by the upcp script.</dd><dt>setupmailserver</dt><dd>The setupmailserver script allows you to switch between courier and dovecot, or disable POP3 and IMAP functionality altogether.</dd><dt>setupftpserver</dt><dd>The setupftpserver script allows you to switch between pure-ftpd and proftpd, or disable ftp functionality altogether.</dd><dt>setupnameserver</dt><dd>The setupnameserver script allows you to switch between bind, mydns, and nsd, or disable nameserver functions altogether.</dd><dt>suspendacct</dt><dd>The suspendacct script can be used to automate suspension of accounts on your cPanel &amp; WHM server.</dd><dt>unsuspendacct</dt><dd>The unsuspendacct script can be used to automate unsuspension of accounts on your cPanel &amp; WHM server.</dd><dt>restartsrv_*</dt><dd>The restartsrv family of scripts can be used to restart various services on your cPanel &amp; WHM server, such as Apache, Exim and Dovecot. For administration using the command line, this is the preferred method for restarting services. For a complete list please consult our <a href="http://docs.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/RestartServices#Restart" target="_blank">documentation</a>. Included are: </dd></dl> <p>&nbsp;</p> <p>&nbsp;</p>
  • PayPal Convert BuyNow Button to Plain HTML Link


    Say if you have a form/button like this:

             <form method="post" action="https://www.paypal.com/cgi-bin/webscr">
                    <input type="hidden" value="_s-xclick" name="cmd" /> <input type="hidden" value="THEBUTTONID" name="hosted_button_id" />
    <input width="75%" height="75%" type="image" border="0" alt="PayPal - The safer, easier way to pay
                    online!" name="submit" src="/images/buynow.gif" />
                </form>

    To use it as a plain HTML link just use:

    https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=THEBUTTONID


  • OpenVZ Unable to stop container


    vzctl stop ctid
    Killing container ...
    Child 1033348 exited with status 7
    Unable to stop container

    vzctl enter ctid
    enter into CT 29831 failed

    Some have suggested using vzctl stop ctid --fast which does not work.
    The only thing that seems to work is restarting the vz service.


  • Sipura/Linksys VOIP Adapter How to Check your IP Address


    Dial * * * *

    Then 110#

    It will then say what your current IP address is.


  • Ubuntu Linux Slow/Delayed SSH ping response Solution


    I've only ever seen this in Ubuntu for some reason and it is because of the /etc/nsswitch.conf settings.

    So the issue is that if the hostname's reverse DNS cannot be found that you need to go back to DNS which was not the default in this nsswitch.conf file for some strange reason.

    Edit /etc/nsswitch.conf and replace your "hosts" line with this:

    #hosts:          files dns mdns4_minimal [NOTFOUND=return] mdns4
    hosts: files mdns4_minimal [NOTFOUND=return] dns [NOTFOUND=return] mdns4

    I kept the original hosts line commented out in case I need to return to the original although I doubt it.

    After editing like above then ping responds right away without a several second delay.


  • Webalizer Error "Error: Unable to restore run data (10)" no longer updating


    Error: Unable to restore run data (10)

    I keep getting this error but so far there is no obvious solution.  Sometimes I've had to remove the *.hist files so I'll try that again.


  • phpBB guests unable to view forums without logging in Anonymous account solution


    This is still a weird quirk about phpBB, you can allow everyone+guests to see a forum.

    What also controls the first layer is this weird built-in "Anonymous" account.  You have to actually give that account specific rights to view all the forums or otherwise the above will happen and you'll wonder why your group permissions don't seem to apply. 


  • phpBB create new email hash manually when modifying or adding user manually directly through MySQL


    Many may ask why would you need to do this?  When upgrading from phpBB 2 to 3 the conversion does not keep the admin user you create.  If your old admin user has an email address associated that no longer works or is accessible this makes it impossible to reset the admin password.

    Some may just say "I'll just manually edit the e-mail address" but it won't work and phpBB will fail to find that user if you don't update the "user_email_hash" field but how do you do that?

    Use this PHP code:

    <?
    $email='yournewemailaddress';

    echo sprintf('%u', crc32(strtolower($email))) . strlen($email);
    ?>

    It will output the corresponding hash you need to use.


  • cp ignore symlink and copy the actual file


    This can be very tricky, say you are doing development on a file that is symlinked.  Doing a "cp dev.file dev.file-bk" won't do what you expect, it just links back to the same file so you haven't copied or backed anything up.

    You need the "-H" switch to copy the actual file that is referenced by the symlink:

    cp -H dev.file dev.file-bk


  • iptables how to forward port to another IP address with DNAT


    -A PREROUTING -d 98.98.98.5/32 -p tcp -m tcp --dport 1050 -j DNAT --to-destination 192.168.1.50:3389

    The above forwards port 1050 on IP 98.98.98.5 to 192.168.1.50 port 3389 (you can obviously edit things to meet your needs).


  • SolusVM error error: Failed to create domain from /home/kvm/kvm101/kvm101.xml error: cannot open file '/dev//dev/kvmcontainer/kvm101_img': No such file or directory


    error: Failed to create domain from /home/kvm/kvm101/kvm101.xml
    error: cannot open file '/dev//dev/kvmcontainer/kvm101_img': No such file or directory

    This is caused by what we consider a quark in SolusVM that I helped a client with.

    SolusVM has as config for the "LVM volume name" and does not enforce any convention.

    Naturally most technical people would use the actual path eg "/dev/kvmcontainer".

    However this causes the error above where it ends up using the path like "/dev//dev/kvmcontainer" so it never works.

    Just enter the actual name of the LV in SolusVM and not the actual path to fix it.

    Really SolusVM should catch this and fix it transparently or force the user to enter the input as it should be.


  • drbd 8.3 hard drive failure recovery example


    drbd 8.3 hard drive failure recovery

    drbdadm attach r0
    DRBD module version: 8.3.10
       userland version: 8.3.8
    you should upgrade your drbd tools!
    0: Failure: (119) No valid meta-data signature found.

        ==> Use 'drbdadm create-md res' to initialize meta-data area. <==

    Command 'drbdsetup 0 disk /dev/sda3 /dev/sda3 internal --set-defaults --create-device --on-io-error=call-local-io-error' terminated with exit code 10

     drbdadm create-md r0
    DRBD module version: 8.3.10
       userland version: 8.3.8
    you should upgrade your drbd tools!
    Writing meta data...
    initializing activity log
    NOT initialized bitmap
    New drbd meta data block successfully created.
     

    drbdadm attach r0


  • mytop install errors


    mytop-1.4-2.el5.rf.noarch from rpmforge has depsolving problems
      --> Missing Dependency: perl(DBI) is needed by package mytop-1.4-2.el5.rf.noarch (rpmforge)

    solution:

    #disabling excludes is required on CPanel type boxes which exclude most updates including perl-DBI
     yum --disableexcludes=main install perl-DBI


    mytop-1.4-2.el5.rf.noarch from rpmforge has depsolving problems
      --> Missing Dependency: perl(Term::ReadKey) is needed by package mytop-1.4-2.el5.rf.noarch (rpmforge)

    # solution

    yum --disableexcludes=main install perl-Term-ReadKey

    mytop Error in option spec: "long|!"
    vi /usr/bin/mytop

    comment the following:

     "long|!"              => $config{long_nums},
     


  • Argument list too long solution - rm -rf new/* -bash: /bin/rm: Argument list too long


    Have you ever tried to run a command like rm to delete several hundred thousand files?  I am not sure what the limit is but any time it is exceeded you need to use a work around like below (which will delete any number of files).

    Solution

     find . -maxdepth 1 -name "*.*" -print0 | xargs -0 rm


  • Windows 2008 Server Trial How To Activate & Extend the Trial


    To activate your Windows 2008 server trial which gives you 180 days:

    1. Start -> Right Click (My Computer).
    2. Click "Activate Windows now"

    To renew your license for 6 days (can be done 3 times):

    1. Start -> Type this command:
    2. slmgr.vbs -rearm
    3. Wait a few minutes until it says it is successful (unless you get that message it has not worked or been done)
    4. Restart

    Note that if you don't activate your Windows on time each hour it will log you off and physically power itself down (a big pain for servers in a datacenter or remote location of any sort).


  • The Best NoSQL Solution


    To first start off, there are many misconceptions about NoSQL and especially its strengths and weaknesses.

    Even the popular NoSQL solution MongoDB is fraught with issues that no one seems to be concerned about aside from a few but there are serious issues with database integrity and verified writes.  MySQL was considered dangerous or incomplete at one point without having the transactional safety features of Oracle for example.

    However the NoSQL implementations seem to take this a vast step further.  NoSQL is distributed and fast, but data integrity and fault tolerance are highly questionable and many question that the way the data is stored without having any relation is crazy.

    This is where many are taking advantage of the current issues with PostreSQL and MySQL now branching out into the NoSQL forray and it looks like they will likely do it better where they retain the SQL features but also have a NoSQL interface and datastore.


  • mysql how to kill individual process/query


    Enter the console as root

    mysql -u root -p

    Then kill the process (where 1234 = the thread ID)

    kill 1234

    It's also a good idea to use a tool like "mtop" to monitor which processes and queries are slow, killing them is a temporary fix while you try to isolate the actual problem.


  • CPanel mysql root password location how to find


    It is located in /root/.my.cnf

    This is truly a horrible idea and a security flaw and on top of that MySQL port 3306 is wide open by default with CPanel.


  • WHMCS Sending Blank E-mails Solution


    After the "latest" update one of our clients asked us to figure out the issue and it turns out it is related to the mail settings.

    Basically all e-mails were being sent with blank text/no body.

    The solution

    Go to "Setup -> General Settings -> Mail" and just click on "Save" and it will work again.

    Note that this assumes you didn't break things yourself by changing any settings.  WHMCS may tell you to use "8bit encoding" but you probably already have that as the default.  It seems that something in the database gets fixed when saving the settings again even if they're already correct/unchanged.


  • Acer Aspire E1-522-5603 Howto Enter BIOS - Press F2


    Press F2, you wouldn't know this because like most new computers, it doesn't announce the required key unless you enable it from the BIOS.

     


  • How to update Open Office in Ubuntu/Debian if your repository is outdated or no longer supported


    http://sourceforge.net/projects/apacheoo-deb/files/debian/dists/wheezy/main/binary-i386/

    To install AOO on your computer, you need to add the following entry to the /etc/apt/sources.list file:

    deb http://downloads.sourceforge.net/project/apacheoo-deb/debian wheezy main

    sudo apt-get update && sudo apt-get install openoffice-en* openoffice-brand-writer openoffice-brand-calc openoffice-brand-impress openoffice-brand-base openoffice-brand-draw openoffice-brand-math openoffice-pyuno openoffice-ooofonts openoffice-ooolinguistic openoffice-debian-menus


  • error: Legacy syntax is unsupported: copyright error: line 10: Unknown tag: Copyright: distributable


    Usually just modify the .spec file to resolve this:

    vi specfile.spec

    Change "Copyright: GPL" to "License: GPL" and try again.


  • drbd won't create device if previous partition is on it Command 'drbdmeta 0 v08 /dev/md160 internal create-md' terminated with exit code 40


    This is what fixed it:

    [root@box13 ~]# dd if=/dev/zero of=/dev/md160 bs=512 count=500

    Basically you need to wipe out more than just the 512 byte partition table so 512 bytes * 500 is more than enough to make DRBD happy and think the partition is now empty.

    The reason this happens is because it gets confused when there is a previous partition with data on the device you are using.


     

    root@box13 ~]# dd if=/dev/zero of=/dev/md160 bs=512 count=1
    1+0 records in
    1+0 records out
    512 bytes (512 B) copied, 0.241883 s, 2.1 kB/s
    [root@box13 ~]# drbdadm create-md r0
    DRBD module version: 8.3.13
       userland version: 8.3.16
    preferably kernel and userland versions should match.
    md_offset 1395733229568
    al_offset 1395733196800
    bm_offset 1395690598400

    Found ext3 filesystem
      1363020736 kB data area apparently used
      1362979100 kB left usable by current configuration

    Device size would be truncated, which
    would corrupt data and result in
    'access beyond end of device' errors.
    You need to either
       * use external meta data (recommended)
       * shrink that filesystem first
       * zero out the device (destroy the filesystem)
    Operation refused.

    Command 'drbdmeta 0 v08 /dev/md160 internal create-md' terminated with exit code 40
    drbdadm create-md r0: exited with code 40
    [root@box13 ~]# mount^C
    [root@box13 ~]# ^C
    [root@box13 ~]# mount
    /dev/md0 on / type ext4 (rw)
    proc on /proc type proc (rw)
    sysfs on /sys type sysfs (rw)
    devpts on /dev/pts type devpts (rw,gid=5,mode=620)
    tmpfs on /dev/shm type tmpfs (rw)
    none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
    sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
    [root@box13 ~]# dd if=/dev/zero of=/dev/md160 bs=512 count=500
     


  • heatbeat ERROR: NV failure (msgfromsteam): [>>> ] ha_msg_add_nv_depth: line doesn't contain '='


    Apr 17 11:55:47 Cluster01 heartbeat: [1426]: WARN: ha_msg_add_nv_depth: line doesn't contain '='
    Apr 17 11:55:47 Cluster01 heartbeat: [1426]: info: >>>

    Apr 17 11:55:47 Cluster01 heartbeat: [1426]: ERROR: NV failure (msgfromsteam): [>>>
    ]

    I have never been able to reproduce the above but it happened on heartbeat-3.04-2 when I took a node down for testing.

    One thing I believe caused it was by configuring ha.cf to do bcast br0 (which means all other heartbeat nodes on the network will communicate when they shouldn't).  I verified this by fluke when I was shocked to see communication from the bad heartbeat node with other unrelated nodes.

    I believe that is what introduced the above errors so I switched to ucast and specific IPs only rather than bcast.


  • drbd won't sync 8.3.13 on OpenVZ kernel


    <p>I used the matching 8.3.13 utilities and it didn't work but strangely the newer 8.3.16 which makes DRBD complain works just fine.</p> <p>GIT-hash: 83ca112086600faacab2f157bc5a9324f7bd7f77 build by root@sighted, 2012-10-09 12:47:51<br /> &nbsp;0: cs:SyncSource ro:Secondary/Primary ds:UpToDate/Inconsistent A r-----<br /> &nbsp;&nbsp;&nbsp; ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:5236960<br /> &nbsp;&nbsp;&nbsp; [&gt;....................] sync'ed:&nbsp; 0.1% (5112/5112)M<br /> &nbsp;&nbsp;&nbsp; finish: 26977:37:03 speed: 0 (0) K/sec</p> <p>You would think the errors in the logs below indicate a kernel module error but I don't think that's the case as the newer utilities resolve the sync issue and don't produce messages like below:</p> <p><code>No response from the DRBD driver! Is the module loaded? </code></p> <p><q>Apr 15 20:31:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1200.695070] INFO: task drbd0_receiver:1301 blocked for more than 120 seconds.<br /> Apr 15 20:31:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1200.695893]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Not tainted 2.6.32-042stab085.20 #1<br /> Apr 15 20:31:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1200.696479] &quot;echo 0 &gt; /proc/sys/kernel/hung_task_timeout_secs&quot; disables this message.<br /> Apr 15 20:31:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1200.698359] drbd0_receive D ffff88001f166140&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp; 1301&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp; 0 0x00000080<br /> Apr 15 20:31:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1200.698371]&nbsp; ffff88001b4fbcb0 0000000000000046 0000000000000000 0000000000000000<br /> Apr 15 20:31:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1200.698377]&nbsp; ffff88001c615638 0000000000000246 0000000000000000 ffff88001c615630<br /> Apr 15 20:31:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1200.698382]&nbsp; 0000000000000246 0000000100032bc1 ffff88001f166708 000000000001ec80<br /> Apr 15 20:31:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1200.698387] Call Trace:<br /> Apr 15 20:31:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1200.698404]&nbsp; [<ffffffff810a15ee>] ? prepare_to_wait+0x4e/0x80<br /> Apr 15 20:31:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1200.698421]&nbsp; [<ffffffffa0268029>] receive_sync_uuid+0x189/0x320 [drbd]<br /> Apr 15 20:31:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1200.698427]&nbsp; [<ffffffff810a12c0>] ? autoremove_wake_function+0x0/0x40<br /> Apr 15 20:31:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1200.698438]&nbsp; [<ffffffffa025f915>] drbdd+0xe5/0x380 [drbd]<br /> Apr 15 20:31:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1200.698454]&nbsp; [<ffffffff8152bf27>] ? printk+0x41/0x4a<br /> Apr 15 20:31:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1200.698459]&nbsp; [<ffffffff8152bf27>] ? printk+0x41/0x4a<br /> Apr 15 20:31:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1200.698470]&nbsp; [<ffffffffa0265194>] drbdd_init+0xa4/0x1d0 [drbd]<br /> Apr 15 20:31:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1200.698475]&nbsp; [<ffffffff8152da7a>] ? schedule_timeout+0x19a/0x2e0<br /> Apr 15 20:31:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1200.698482]&nbsp; [<ffffffff810881e0>] ? process_timeout+0x0/0x10<br /> Apr 15 20:31:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1200.698494]&nbsp; [<ffffffffa0275b3c>] drbd_thread_setup+0xdc/0x260 [drbd]<br /> Apr 15 20:31:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1200.698500]&nbsp; [<ffffffff8100c34a>] child_rip+0xa/0x20<br /> Apr 15 20:31:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1200.698511]&nbsp; [<ffffffffa0275a60>] ? drbd_thread_setup+0x0/0x260 [drbd]<br /> Apr 15 20:31:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1200.698515]&nbsp; [<ffffffff8100c340>] ? child_rip+0x0/0x20<br /> Apr 15 20:33:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1320.698098] INFO: task drbd0_receiver:1301 blocked for more than 120 seconds.<br /> Apr 15 20:33:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1320.699942]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Not tainted 2.6.32-042stab085.20 #1<br /> Apr 15 20:33:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1320.701509] &quot;echo 0 &gt; /proc/sys/kernel/hung_task_timeout_secs&quot; disables this message.<br /> Apr 15 20:33:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1320.704374] drbd0_receive D ffff88001f166140&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp; 1301&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp; 0 0x00000080<br /> Apr 15 20:33:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1320.704382]&nbsp; ffff88001b4fbcb0 0000000000000046 0000000000000000 0000000000000000<br /> Apr 15 20:33:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1320.704389]&nbsp; ffff88001c615638 0000000000000246 0000000000000000 ffff88001c615630<br /> Apr 15 20:33:02 src=&quot;/style-2014-l1b/Cluster01 kernel: [ 1320.704394]&nbsp; 0000000000000246 0000000100032bc1 ffff88001f166708 000000000001ec80<br /> <br /> [ 1800.722067] INFO: task drbd0_receiver:1301 blocked for more than 120 seconds.<br /> [ 1800.723910]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Not tainted 2.6.32-042stab085.20 #1<br /> [ 1800.725484] &quot;echo 0 &gt; /proc/sys/kernel/hung_task_timeout_secs&quot; disables this message.<br /> [ 1800.728368] drbd0_receive D ffff88001f166140&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp; 1301&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp; 0 0x00000080<br /> [ 1800.728377]&nbsp; ffff88001b4fbcb0 0000000000000046 0000000000000000 0000000000000000<br /> [ 1800.728383]&nbsp; ffff88001c615638 0000000000000246 0000000000000000 ffff88001c615630<br /> [ 1800.728388]&nbsp; 0000000000000246 0000000100032bc1 ffff88001f166708 000000000001ec80<br /> [ 1800.728393] Call Trace:<br /> [ 1800.728405]&nbsp; [<ffffffff810a15ee>] ? prepare_to_wait+0x4e/0x80<br /> [ 1800.728422]&nbsp; [<ffffffffa0268029>] receive_sync_uuid+0x189/0x320 [drbd]<br /> [ 1800.728428]&nbsp; [<ffffffff810a12c0>] ? autoremove_wake_function+0x0/0x40<br /> [ 1800.728439]&nbsp; [<ffffffffa025f915>] drbdd+0xe5/0x380 [drbd]<br /> [ 1800.728446]&nbsp; [<ffffffff8152bf27>] ? printk+0x41/0x4a<br /> [ 1800.728450]&nbsp; [<ffffffff8152bf27>] ? printk+0x41/0x4a<br /> [ 1800.728465]&nbsp; [<ffffffffa0265194>] drbdd_init+0xa4/0x1d0 [drbd]<br /> [ 1800.728470]&nbsp; [<ffffffff8152da7a>] ? schedule_timeout+0x19a/0x2e0<br /> [ 1800.728477]&nbsp; [<ffffffff810881e0>] ? process_timeout+0x0/0x10<br /> [ 1800.728488]&nbsp; [<ffffffffa0275b3c>] drbd_thread_setup+0xdc/0x260 [drbd]<br /> [ 1800.728495]&nbsp; [<ffffffff8100c34a>] child_rip+0xa/0x20<br /> [ 1800.728505]&nbsp; [<ffffffffa0275a60>] ? drbd_thread_setup+0x0/0x260 [drbd]<br /> [ 1800.728510]&nbsp; [<ffffffff8100c340>] ? child_rip+0x0/0x20<br /> </ffffffff8100c340></ffffffffa0275a60></ffffffff8100c34a></ffffffffa0275b3c></ffffffff810881e0></ffffffff8152da7a></ffffffffa0265194></ffffffff8152bf27></ffffffff8152bf27></ffffffffa025f915></ffffffff810a12c0></ffffffffa0268029></ffffffff810a15ee></ffffffff8100c340></ffffffffa0275a60></ffffffff8100c34a></ffffffffa0275b3c></ffffffff810881e0></ffffffff8152da7a></ffffffffa0265194></ffffffff8152bf27></ffffffff8152bf27></ffffffffa025f915></ffffffff810a12c0></ffffffffa0268029></ffffffff810a15ee></q></p>
  • heartbeat ERROR: make_io_childpair: cannot open ucast br0


    ERROR: make_io_childpair: cannot open ucast br0

    You cannot specify ucast br0 without an IP address associated with it.


  • Openvz Can't load ploop library: libploop.so: cannot open shared object file: No such file or directory


    Can't load ploop library: libploop.so: cannot open shared object file: No such file or directory

    The above happens when you haven't installed the ploop tools:

    yum -y install ploop


  • How to script fdisk in Linux bash


    (echo n; echo p; echo 1; echo 1; echo; echo wq) | fdisk /dev/sdb

    The above would make a new partition 1 on /dev/sdb and save the changes to disk, you can of course make changes to do almost anything in fdisk.


  • heartbeat compile errors with rpmbuild


    c1: warnings being treated as errors
    stonith_signal.h:34: error: 'stonith_signal_set_simple_handler' defined but not used
    gmake[3]: *** [apcmaster.lo] Error 1
    gmake[3]: Leaving directory `/root/rpmbuild/BUILD/heartbeat-1.2.4/lib/plugins/stonith'
    gmake[2]: *** [all-recursive] Error 1
    gmake[2]: Leaving directory `/root/rpmbuild/BUILD/heartbeat-1.2.4/lib/plugins'
    gmake[1]: *** [all-recursive] Error 1
    gmake[1]: Leaving directory `/root/rpmbuild/BUILD/heartbeat-1.2.4/lib'
    make: *** [all-recursive] Error 1
    error: Bad exit status from /var/tmp/rpm-tmp.vHLZRh (%build)

     


  • OpenVZ avoid vzctl 4.7 and ploop


    <p>OpenVZ has made vzctl version 4.7 default to using ploop which is a big annoyance.&nbsp; No one wants it otherwise we'd use Xen or KVM.</p> <p>Make sure to manually specify vzctl 4.6.1 or you will have issues with old scripts breaking since it defaults to using ploop (a single image like Xen/KVM).</p> <p><a href="https://openvz.org/Download/vzctl/Archives">Here's a list to old versions of vzctl.</a></p>
  • Wordpress Security Hole, Plug it by manually installing themes and plugins


    It's always bothered me how Wordpress basically forces the user to provide their hosting credentials to install themes and plugins.  How do know for sure the data is not being saved, intercepted and being provided backdoor access to the NSA or other agencies or even just being misused by others with access?

    Here's how to close the security hole above and if you're already given Wordpress your credentials make sure you change everything associated it with it.  Eg. change your ftp username and password, database password and if the same login gives you access to your hosting account/control panel you'll need to change all of your e-mail passwords too.

    1. Search for themes from their website directly.
    2. Download it to your computer, extract the zip file.
    3. FTP/Upload the extracted directory to your hosting account to the "wp-content/themes" directory for your domain.
    4. Activate it from your Wordpress

    Yes the above takes a few extra steps but is well worth the peace of mind.

     


  • LVM Tutorial how to create a Physical Volume (PV), Volume Group (vg), and a Logical Volume (LV) within it


    # first we need a physical volume which we use the pvcreate tool to create

    # I create mine on /dev/sdb3
    pvcreate /dev/sdb3
      dev_is_mpath: failed to get device for 8:19
      Physical volume "/dev/sdb3" successfully created

    # pvdisplay shows the newly created volume
    pvdisplay
      "/dev/sdb3" is a new physical volume of "1.35 TiB"
      --- NEW Physical volume ---
      PV Name               /dev/sdb3
      VG Name              
      PV Size               1.35 TiB
      Allocatable           NO
      PE Size               0  
      Total PE              0
      Free PE               0
      Allocated PE          0
      PV UUID               gpMwTX-JNA7-oTXT-YoCJ-RsKF-ceJd-3hin8w

    # we need to create a new volume group within the physical volume of /dev/sdb3
    # below I call it "kvmvm" on /dev/sdb3
    vgcreate kvmvm /dev/sdb3
      Volume group "kvmvm" successfully created

    # we can see below with vgdisplay that it has been created
    vgdisplay
      --- Volume group ---
      VG Name               kvmvm
      System ID            
      Format                lvm2
      Metadata Areas        1
      Metadata Sequence No  1
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                0
      Open LV               0
      Max PV                0
      Cur PV                1
      Act PV                1
      VG Size               1.35 TiB
      PE Size               4.00 MiB
      Total PE              352925
      Alloc PE / Size       0 / 0  
      Free  PE / Size       352925 / 1.35 TiB
      VG UUID               2d42cr-3f92-wF25-l288-JThZ-GGGQ-ttYvI6

    # now that I have a volume group I need to create a logical volume (basically a mini-usable/resizeable partition within LVM's PV /dev/sdb3 on the VG kvmvm

    # create a 60GB partition on the VG kvmvm and call it "kvmuserrdp"  
    lvcreate -L 60G kvmvm -n kvmuserrdp
      Logical volume "kvmuserrdp" created

    # shows the newly created lv (logical volume) which is accessible like a normal drive under /dev/kvmvm/kvmuserrdp

    lvdisplay
      --- Logical volume ---
      LV Path                /dev/kvmvm/kvmuserrdp
      LV Name                kvmuserrdp
      VG Name                kvmvm
      LV UUID                HQhCr0-S2WS-DJEn-eHcc-axYn-uA8M-6bnYro
      LV Write Access        read/write
      LV Creation host, time testbox, 2014-03-26 16:52:56 +0800
      LV Status              available
      # open                 0
      LV Size                60.00 GiB
      Current LE             15360
      Segments               1
      Allocation             inherit
      Read ahead sectors     auto
      - currently set to     256
      Block device           253:0
     


  • Howto Convert Xen Image to KVM


    #count=10000 makes an image of 10000MB make sure your image is at least the same as your existing
    dd if=/dev/zero of=yourimage.img bs=1M count=10000


    # losetup -fv newimage.raw
    # fdisk -cu /dev/loop0


    # kpartx -a /dev/loop0

    # dd if=<xenimage> of=/dev/mapper/loop0p1
    # e2fsck -f /dev/mapper/loop0p1
    # resize2fs /dev/mapper/loop0p1



    # a lot of guides tell you to edit /etc/fstab and /boot/grub/menu.conf and make everything vda or vda1 but I have no idea why
    # You need to make it /sda1 or whatever the root partition is

    for i in dev sys proc; do mount -o bind /$i mnt/$i; done
    mount -o bind <directory which contains raw image> mnt/mnt
    chroot mnt

    yum -y install grub

    [root@testbox /]# echo "(hd0) /dev/vda" > /boot/grub/devices.map
    [root@testbox /]# grub --no-floppy
    Probing devices to guess BIOS drives. This may take a long time.


        GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

     [ Minimal BASH-like line editing is supported.  For the first word, TAB
       lists possible command completions.  Anywhere else TAB lists the possible
       completions of a device/filename.]
    grub> device (hd0) /mnt/kvmuser5900.img
    device (hd0) /mnt/kvmuser5900.img
    grub> root (hd0,0)
    root (hd0,0)
     Filesystem type is ext2fs, partition type 0x83
    grub> setup (hd0)
    setup (hd0)
     Checking if "/boot/grub/stage1" exists... no
     Checking if "/grub/stage1" exists... no

    Error 15t: File not found
    grub>

    grub
    Probing devices to guess BIOS drives. This may take a long time.


        GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

     [ Minimal BASH-like line editing is supported.  For the first word, TAB
       lists possible command completions.  Anywhere else TAB lists the possible
       completions of a device/filename.]
    grub> device (hd0) /mnt/kvmuser5900.img
    device (hd0) /mnt/kvmuser5900.img
    grub> root (hd0,0)
    root (hd0,0)
     Filesystem type is ext2fs, partition type 0x83
    grub> setup (hd0)
    setup (hd0)
     Checking if "/boot/grub/stage1" exists... yes
     Checking if "/boot/grub/stage2" exists... yes
     Checking if "/boot/grub/e2fs_stage1_5" exists... yes
     Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  27 sectors are embedded.
    succeeded
     Running "install /boot/grub/stage1 (hd0) (hd0)1+27 p (hd0,0)/boot/grub/stage2 /boot/grub/grub.conf"... succeeded
    Done.
    grub> quit
    quit



    #edit grub.conf with the right options obviously dev=xvda is wrong you'll likely want /dev/sda1 as your root or whatever the partition is
    [root@testbox /]# vi /boot/grub/grub.conf
    #edit fstab to mount the right partition
    [root@testbox /]# vi /etc/fstab
    #setup inittab properly
    #Comment the line containing xvc0.
    [root@testbox /]# vi /etc/inittab
    [root@testbox /]# exit


    [root@testbox kvmuser5900]# umount mnt/*
    umount: mnt/bin: not mounted
    umount: mnt/boot: not mounted
    umount: mnt/etc: not mounted
    umount: mnt/home: not mounted
    umount: mnt/lib: not mounted
    umount: mnt/lost+found: not mounted
    umount: mnt/media: not mounted
    umount: mnt/mnt: not mounted
    umount: mnt/opt: not mounted
    umount: mnt/root: not mounted
    umount: mnt/sbin: not mounted
    umount: mnt/selinux: not mounted
    umount: mnt/srv: not mounted
    umount: mnt/tmp: not mounted
    umount: mnt/usr: not mounted
    umount: mnt/var: not mounted

    [root@testbox kvmuser5900]# umount mnt/
    [root@testbox kvmuser5900]# kpartx -d /dev/loop0
    [root@testbox kvmuser5900]# losetup -d /dev/loop0


  • yum error "Error: database disk image is malformed" solution


    yum -y install mathtools
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: centos.mirror.rafal.ca
     * epel: mirror.steadfast.net
     * extras: mirror.agmn.ca
     * rpmforge: repoforge.mirror.constant.com
     * updates: centosb5.centos.org
    extras                                                                                        | 3.4 kB     00:00    
    rpmforge                                                                                      | 1.9 kB     00:00    
    updates                                                                                       | 3.4 kB     00:00    
    updates/primary_db                                                                            | 1.9 MB     00:00    
    vz-base                                                                                       |  951 B     00:00    
    vz-updates                                                                                    |  951 B     00:00    
    Error: database disk image is malformed

    Solution:
    yum clean all


  • drbd howto solve splitbrain or WFConnection


    On primary node

    drbdadm connect all


    On secondary node
    drbdadm -- --discard-my-data connect all

     


  • How to view GPT/EFI Windows Partition Table


    fdisk unfortunately can't do this and I'm not sure if there's any updated version that handles it but parted can do it.

    Here's an example of how to do it:

    parted /dev/sda print

    1      17.4kB  1024MB  1024MB  ntfs         primary
    2      1024MB  16144MB  15120MB  ntfs          primary

    /dev/sda1 would be the first partiton

    /dev/sda2 would be the second partition

    You can then just access them like any other normal partition.


  • Howto Restore Acer Aspire E1-531-4406


    Hit Alt + F10 before the system boots and you'll boot into the recovery drive and be able to restore your system, of course note that all of your data will be wiped out.


  • How to Enable RDP Remote Desktop in Windows 2008 Server


    Start -> Administrative Tools -> Server Manager

    Under "Computer Information" click "Configure Remote Desktop".

    Under "System Properties" choose the type of "Allow connections" you want.

    That's all there is to enabling RDP Access in 2008 server.


  • virtio KVM drivers download location


  • "Detecting hardware, please wait..." Ubuntu Install Error Solution


    "Detecting hardware, please wait..."

    Solution

    This occurs if you are installing with low RAM such as 128MB
    Bump it up at least to 512MB for the install


  • lvm how to resize and extend a volume


    lvextend -L +10G /dev/kvmvm/w2k8r2evalstandard
      Extending logical volume w2k8r2evalstandard to 20.00 GiB
      Logical volume w2k8r2evalstandard successfully resized

    The above adds 10GB to the logical volume.  Of course you must resize the filesystem using other tools to take advantage of the space.


  • Asterisk VOIP Sipura/Linksys PAP2T Calls Not Being Received Solution


    This problem seemed to happen recently but was likely causing issues before.

    Now there are a few reasons why this can happen especially if your adapter has DND mode enabled (disable it).

    However that wasn't my issue and I only figured it out the other day  when  by fluke if you're on the phone (making a call) then  calls will come in.

    That's when I figured out the solution:

    This likely applies to other adapters but in a Sipura/Linksys you'll find this under "Advanced" settings for your line.

        NAT Mapping Enable:   NAT Keep Alive Enable:

    Enable both of those especialy the Keep Alive as otherwise the PBX/Asterisk/server won't realize your phone is alive and ready to receive calls.

    The above seems to have solved it for me.


  • OpenVZ mismatched kernel and dev when compiling.


    ./configure
    ./configure: line 91: cd: /lib/modules/2.6.32-042stab084.25/build: No such file or directory

    Error: kernel version not found.
    Please make sure your kernel is configured.

    dr-xr-xr-x.  4 root root   4096 Feb 21 06:13 ..
    lrwxrwxrwx   1 root root     45 Feb 21 06:13 build -> ../../../usr/src/kernels/2.6.32-042stab084.25
    drwxr-xr-x   2 root root   4096 Feb 12 20:18 extra
    drwxr-xr-x  11 root root   4096 Feb 21 06:13 kernel
    -rw-r--r--   1 root root 567702 Feb 21 06:15 modules.alias
    -rw-r--r--   1 root root 547061 Feb 21 06:15 modules.alias.bin
    -rw-r--r--   1 root root   1376 Feb 12 20:19 modules.block
    -rw-r--r--   1 root root     69 Feb 21 06:15 modules.ccwmap
    -rw-r--r--   1 root root 198500 Feb 21 06:15 modules.dep
    -rw-r--r--   1 root root 289392 Feb 21 06:15 modules.dep.bin
    -rw-r--r--   1 root root     68 Feb 12 20:19 modules.drm
    -rw-r--r--   1 root root    665 Feb 21 06:15 modules.ieee1394map
    -rw-r--r--   1 root root    141 Feb 21 06:15 modules.inputmap
    -rw-r--r--   1 root root   1775 Feb 21 06:15 modules.isapnpmap
    -rw-r--r--   1 root root     29 Feb 12 20:19 modules.modesetting
    -rw-r--r--   1 root root   1929 Feb 12 20:19 modules.networking
    -rw-r--r--   1 root root     74 Feb 21 06:15 modules.ofmap
    -rw-r--r--   1 root root  75547 Feb 12 20:17 modules.order
    -rw-r--r--   1 root root 405413 Feb 21 06:15 modules.pcimap
    -rw-r--r--   1 root root   6259 Feb 21 06:15 modules.seriomap
    -rw-r--r--   1 root root 220302 Feb 21 06:15 modules.symbols
    -rw-r--r--   1 root root 280714 Feb 21 06:15 modules.symbols.bin
    -rw-r--r--   1 root root 837314 Feb 21 06:15 modules.usbmap
    lrwxrwxrwx   1 root root      5 Feb 21 06:13 source -> build
    drwxr-xr-x   2 root root   4096 Feb 12 20:18 updates
    drwxr-xr-x   2 root root   4096 Feb 21 06:13 vdso
    drwxr-xr-x   2 root root   4096 Feb 12 20:18 weak-updates
    [root@testbox 2.6.32-042stab084.25]# ls /usr/src/kernels/2.6.32-
    2.6.32-042stab084.26/  2.6.32-431.el6.x86_64/
    [root@testbox 2.6.32-042stab084.25]# ls /usr/src/kernels/2.6.32-042stab084.26/
    arch   c rypto   firmware  include  ipc     lib       Makefile.common  Module.symvers  samples  security  System.map  usr
    block  drivers  fs        init     kernel  Makefile  mm               net             scripts  sound     tools       virt
    [root@testbox 2.6.32-042stab084.25]# ls
    build          modules.alias.bin  modules.dep.bin      modules.isapnpmap    modules.order     modules.symbols.bin  vdso
    extra          modules.block      modules.drm          modules.modesetting  modules.pcimap    modules.usbmap       weak-updates
    kernel         modules.ccwmap     modules.ieee1394map  modules.networking   modules.seriomap  source
    modules.alias  modules.dep        modules.inputmap     modules.ofmap        modules.symbols   updates
    [root@testbox 2.6.32-042stab084.25]# ls ../../../usr/src/kernels/2.6.32-042stab084.25
    ls: cannot access ../../../usr/src/kernels/2.6.32-042stab084.25: No such file or directory

    Linux testbox 2.6.32-042stab084.25 #1 SMP Wed Feb 12 16:04:42 MSK 2014 x86_64 x86_64 x86_64 GNU/Linux
    [root@testbox 2.6.32-042stab084.25]# ls /boot/grub/
    device.map     fat_stage1_5  grub.conf         jfs_stage1_5  minix_stage1_5     splash.xpm.gz  stage2         vstafs_stage1_5
    e2fs_stage1_5  ffs_stage1_5  iso9660_stage1_5  menu.lst      reiserfs_stage1_5  stage1         ufs2_stage1_5  xfs_stage1_5
    [root@testbox 2.6.32-042stab084.25]# ls /boot/grub/^C
    [root@testbox 2.6.32-042stab084.25]# ls /boot/
    config-2.6.32-042stab084.25   initramfs-2.6.32-042stab084.25.img     symvers-2.6.32-042stab084.25.gz   vmlinuz-2.6.32-042stab084.25
    config-2.6.32-431.el6.x86_64  initramfs-2.6.32-431.el6.x86_64.img    symvers-2.6.32-431.el6.x86_64.gz  vmlinuz-2.6.32-431.el6.x86_64
    efi                           initrd-2.6.32-042stab084.25kdump.img   System.map-2.6.32-042stab084.25
    grub                          initrd-2.6.32-431.el6.x86_64kdump.img  System.map-2.6.32-431.el6.x86_64
    [root@testbox 2.6.32-042stab084.25]# rpm -aq|grep vzkernel
    vzkernel-2.6.32-042stab084.25.x86_64
    vzkernel-devel-2.6.32-042stab084.26.x86_64
    [root@testbox 2.6.32-042stab084.25]# yum -y install vzkernel-2.6.32-042stab084.25.x86_64
    Loaded plugins: fastestmirror, security
    Loading mirror speeds from cached hostfile
     * base: mirrors.hustunique.com
     * extras: mirror.bit.edu.cn
     * openvz-kernel-rhel6: ftp.iij.ad.jp


    yum installed the wrong version, the devel does not match the actual running kernel!
     


  • Microsoft Updates suddenly stops at 50% downloading solution


    This seems to mainly affect new installs of Windows and especially on XP randomly.

    There are whole pages dedicated to the subject but none of them have a simple proper solution.

    They and Microsoft say to use "Microsoft Fix It", the only problem is it requires .NET and many new installs of Windows don't have it by default.

    The simple solution you asked for

    Just reboot Windows and that is how I fixed it.


  • Enable Multiple RDP Sessions on Windows XP, Vista, 7 Howto


    http://deepxw.blogspot.ca/search/label/Universal%20Termsrv.dll%20Patch

    The above site has the patch that does this essentialy turning a Desktop Windows into a full fledged RDP server.


  • mencoder howto trim split edit time of mp4 from Samsung Note


    mencoder -fps 30 -ss 00:00:38 -oac lavc -ovc copy 152408.mp4 -o soundedit.mp4

    The -ss flag means to start at 38 seconds (so the first 38 seconds of video will be removed).


  • How to read a conf file without the comments


     cat /etc/some.conf|grep -Ev '^#|^;|^$'

    This assumes that comments start with # or ; (adjust as necessary).  Also note that the ^$ omits blank lines.


  • yum Centos 386 and 64 bit conflict resolution


    This can happen when you install RPMForge or other repos with the wrong architecture and here's how you fix it (simply uninstalling won't usually fix it):

    solution
    yum clean all

    yum -y install openvpn
    Loaded plugins: fastestmirror, presto
    Loading mirror speeds from cached hostfile
     * base: mirror.its.sfu.ca
     * extras: centos.mirror.nexicom.net
     * rpmforge: mirror.cpsc.ucalgary.ca
     * updates: centos.arcticnetwork.ca
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package openvpn.x86_64 0:2.2.2-1.el5.rf will be installed
    --> Processing Dependency: lzo for package: openvpn-2.2.2-1.el5.rf.x86_64
    --> Processing Dependency: libcrypto.so.6()(64bit) for package: openvpn-2.2.2-1.el5.rf.x86_64
    --> Processing Dependency: libssl.so.6()(64bit) for package: openvpn-2.2.2-1.el5.rf.x86_64
    --> Processing Dependency: libpkcs11-helper.so.1()(64bit) for package: openvpn-2.2.2-1.el5.rf.x86_64
    --> Processing Dependency: liblzo2.so.2()(64bit) for package: openvpn-2.2.2-1.el5.rf.x86_64
    --> Running transaction check
    ---> Package lzo.x86_64 0:2.06-1.el5.rf will be installed
    ---> Package openssl098e.x86_64 0:0.9.8e-17.el6.centos.2 will be installed
    ---> Package pkcs11-helper.x86_64 0:1.08-1.el5.rf will be installed
    --> Processing Dependency: libgnutls.so.13(GNUTLS_1_3)(64bit) for package: pkcs11-helper-1.08-1.el5.rf.x86_64
    --> Processing Dependency: libgnutls.so.13()(64bit) for package: pkcs11-helper-1.08-1.el5.rf.x86_64
    --> Finished Dependency Resolution
    Error: Package: pkcs11-helper-1.08-1.el5.rf.x86_64 (rpmforge)
               Requires: libgnutls.so.13()(64bit)
    Error: Package: pkcs11-helper-1.08-1.el5.rf.x86_64 (rpmforge)
               Requires: libgnutls.so.13(GNUTLS_1_3)(64bit)
     You could try using --skip-broken to work around the problem
    ** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows:
    rpmforge-release-0.5.2-2.el6.rf.x86_64 is a duplicate with rpmforge-release-0.5.1-1.el5.rf.i386
    yum -y install openvpn
    Loaded plugins: fastestmirror, presto
    Loading mirror speeds from cached hostfile
     * base: mirror.its.sfu.ca
     * extras: centos.mirror.nexicom.net
     * rpmforge: mirror.cpsc.ucalgary.ca
     * updates: centos.arcticnetwork.ca
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package openvpn.x86_64 0:2.2.2-1.el5.rf will be installed
    --> Processing Dependency: lzo for package: openvpn-2.2.2-1.el5.rf.x86_64
    --> Processing Dependency: libcrypto.so.6()(64bit) for package: openvpn-2.2.2-1.el5.rf.x86_64
    --> Processing Dependency: libssl.so.6()(64bit) for package: openvpn-2.2.2-1.el5.rf.x86_64
    --> Processing Dependency: libpkcs11-helper.so.1()(64bit) for package: openvpn-2.2.2-1.el5.rf.x86_64
    --> Processing Dependency: liblzo2.so.2()(64bit) for package: openvpn-2.2.2-1.el5.rf.x86_64
    --> Running transaction check
    ---> Package lzo.x86_64 0:2.06-1.el5.rf will be installed
    ---> Package openssl098e.x86_64 0:0.9.8e-17.el6.centos.2 will be installed
    ---> Package pkcs11-helper.x86_64 0:1.08-1.el5.rf will be installed
    --> Processing Dependency: libgnutls.so.13(GNUTLS_1_3)(64bit) for package: pkcs11-helper-1.08-1.el5.rf.x86_64
    --> Processing Dependency: libgnutls.so.13()(64bit) for package: pkcs11-helper-1.08-1.el5.rf.x86_64
    --> Finished Dependency Resolution
    Error: Package: pkcs11-helper-1.08-1.el5.rf.x86_64 (rpmforge)
               Requires: libgnutls.so.13()(64bit)
    Error: Package: pkcs11-helper-1.08-1.el5.rf.x86_64 (rpmforge)
               Requires: libgnutls.so.13(GNUTLS_1_3)(64bit)
     You could try using --skip-broken to work around the problem
    ** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows:
    rpmforge-release-0.5.2-2.el6.rf.x86_64 is a duplicate with rpmforge-release-0.5.1-1.el5.rf.i386


  • OpenVZ Quick Install Copy & Paste for Centos 6


    yum -y install wget
    wget -P /etc/yum.repos.d/ http://ftp.openvz.org/openvz.repo
    rpm --import http://ftp.openvz.org/RPM-GPG-Key-OpenVZ
    yum -y install vzkernel vzctl

    After that just reboot and you may also have to enable ip_forward in /etc/sysctl.conf


  • NVIDIA GeForce GT 610 not working in Linux solution - use older 304.117 driver


    I used the slightly older "304.117" version and it worked.

    With the newest version I couldn't get X to start and kept getting these errors in messages/dmesg.

    [ 2346.083660] nvidia 0000:01:00.0: irq 44 for MSI/MSI-X
    [ 2350.608342] NVRM: RmInitAdapter failed! (0x12:0x2b:1831)
    [ 2350.608354] NVRM: rm_init_adapter failed for device bearing minor number 0
    [ 2350.608369] NVRM: nvidia_frontend_open: minor 0, module->open() failed, error -5


  • nf_conntrack: table full, dropping packet solution


    nf_conntrack: table full, dropping packet

    The above in some cases I've seen is a sign of a DOS attack or can occur if users are using services like torrenting, proxy, VPN etc...  Do not take it lightly as the above can knock a server offline if the table becomes full and I've also seen full crashes and kernel panics shortly after.

     


  • yum error installing php solution - exclude php from being installed from third party repos


    Error: Package: php-Monolog-dynamo-1.7.0-1.el6.noarch (epel)
               Requires: php-aws-sdk
    Error: php-pecl-zendopcache conflicts with 1:php-eaccelerator-0.9.6.1-1.el6.x86_64
    Error: php-xcache conflicts with php-pecl-apc-3.1.9-2.el6.x86_64
    Error: php-pecl-zendopcache conflicts with php-pecl-apc-3.1.9-2.el6.x86_64
    Error: Package: php-horde-Horde-Vfs-2.1.2-2.el6.noarch (epel)
               Requires: php-pecl(ssh2) >= 0.12
               Installing: php-pecl-ssh2-0.11.0-7.el6.x86_64 (epel)
                   php-pecl(ssh2) = 0.11.0
    Error: php-pecl-apc conflicts with 1:php-eaccelerator-0.9.6.1-1.el6.x86_64
    Error: php-pecl-apcu conflicts with php-pecl-apc-3.1.9-2.el6.x86_64
    Error: php-pecl-gmagick conflicts with php-magickwand-1.0.9-1.el6.x86_64
    Error: php-xcache conflicts with 1:php-eaccelerator-0.9.6.1-1.el6.x86_64
    Error: php-pecl-zendopcache conflicts with php-xcache-3.0.4-1.el6.x86_64
    Error: php-xcache conflicts with php-pecl-zendopcache-7.0.3-1.el6.x86_64
    Error: php-pecl-http1-devel conflicts with php-pecl-http-devel-2.0.4-1.el6.x86_64
    Error: php-ZendFramework2-common conflicts with php-ZendFramework-1.12.3-1.el6.noarch
    Error: php-pecl-apcu-devel conflicts with php-pecl-apc-devel-3.1.9-2.el6.x86_64
    Error: php-pecl-gmagick conflicts with php-pecl-imagick-2.2.2-4.el6.x86_64
    Error: php-pecl-http1 conflicts with php-pecl-http-2.0.4-1.el6.x86_64
    Error: php-pecl-http conflicts with php-pecl-http1-1.7.6-4.el6.x86_64
     You could try using --skip-broken to work around the problem
     You could try running: rpm -Va --nofiles --nodigest


    Edit all repos in /etc/yum/repos.d/* to exclude=php* (the problem is that repos like rpmforge elrepo, epel have PHP and it ends up conflicting and creating upgrade/install issues with the PHP that comes from the main Centos repo)


  • Centos 6 server crash - " kernel:[735188.961824] Kernel panic - not syncing: Fatal exception in interrupt Write failed: Broken pipe"


     kernel:[735188.961824] Kernel panic - not syncing: Fatal exception in interrupt
    Write failed: Broken pipe

    I'm not sure what is causing this and have never seen it on any server before.


  • CPanel Apache httpd won't start solution: Starting httpd: Syntax error on line 2 of /etc/httpd/conf/httpd.conf: Invalid command 'Alias', perhaps misspelled or defined by a module not included in the server configuration


    root@hkhosting [/]# service httpd start
    Starting httpd: Syntax error on line 2 of /etc/httpd/conf/httpd.conf:
    Invalid command 'Alias', perhaps misspelled or defined by a module not included in the server configuration
                                                               [FAILED]

     

     

    root@hkhosting [/]# vi /etc/httpd/conf/httpd.conf

     

    One way with CPanel is just to use /scripts/easyapache and rebuild everything since who knows what else has gone wrong if the config file got messed up like that.

    This is the entire contents of httpd.conf, it became corrupted somehow.


    Alias /mailman/archives /usr/local/cpanel/3rdparty/mailman/archives/public/
    Alias /pipermail /usr/local/cpanel/3rdparty/mailman/archives/public/
    ScriptAliasMatch ^/?kpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
    ScriptAliasMatch ^/?cpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
    ScriptAlias /scgi-bin /usr/local/cpanel/cgi-sys/scgiwrap
    Alias /java-sys /usr/local/cpanel/java-sys/
    Alias /img-sys /usr/local/cpanel/img-sys/
    ScriptAlias /cgi-sys /usr/local/cpanel/cgi-sys/
    ScriptAliasMatch ^/?whm/?$ /usr/local/cpanel/cgi-sys/whmredirect.cgi
    ScriptAliasMatch ^/?securewhm/?$ /usr/local/cpanel/cgi-sys/swhmredirect.cgi
    Alias /bandwidth /usr/local/bandmin/htdocs/
    Alias /sys_cpanel /usr/local/cpanel/sys_cpanel/
    ScriptAliasMatch ^/?securecpanel/?$ /usr/local/cpanel/cgi-sys/sredirect.cgi
    ScriptAliasMatch ^/?securecontrolpanel/?$ /usr/local/cpanel/cgi-sys/sredirect.cgi
    Include "/usr/local/apache/conf/includes/errordocument.conf"
    ScriptAliasMatch ^/?controlpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
    ScriptAliasMatch ^/?webmail/?$ /usr/local/cpanel/cgi-sys/wredirect.cgi
    ScriptAlias /mailman /usr/local/cpanel/3rdparty/mailman/cgi-bin/
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteMap LeechProtect prg:/usr/local/cpanel/bin/leechprotect
    </IfModule>

     


  • Setting Ulimit


    I never found a solution to do it live (nothing worked that I found) so it looks like a relogin is required.

    Check your maximum file limit

     cat /proc/sys/fs/file-max
    824460

     

    This is different than your actual's user limit which you'll see below

    ulimit -n
    1024

    Try and set it higher but it won't work

    ulimit -n 65000
    -bash: ulimit: open files: cannot modify limit: Operation not permitted

    Set system wide defaults

    sudo vi /etc/security/limits.conf
    *             hard    nofiles           600000
    *             soft    nofiles           500000

    Making it live from a shell session (it won't work for your GNOME/XWindows session itself)
    sudo su
    root@homebox:/home/one# ulimit -n
    1024
    root@homebox:/home/one# ulimit -n 60000

    ulimit -n
    60000

    root@homebox:/home/one# ulimit -n 60000
    root@homebox:/home/one# ulimit -n
    60000
    root@homebox:/home/one# su - one
    one@homebox:~$ ulimit -n
     


  • Centos Howto Upgrade to PHP 5.3 from 5.2


    It's not as simple as "yum install" as you can see below and it doesn't stop there.

     yum install php53
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * rpmforge: mirror.us.leaseweb.net
     * extras: centos.mirror.rafal.ca
     * updates: centos.mirror.nexicom.net
     * base: centos.mirror.nexicom.net
     * addons: centos.mirror.nexicom.net
    Setting up Install Process
    Parsing package install arguments
    Resolving Dependencies
    --> Running transaction check
    ---> Package php53.i386 0:5.3.3-22.el5_10 set to be updated
    --> Processing Dependency: php53-cli = 5.3.3-22.el5_10 for package: php53
    --> Processing Dependency: php53-common = 5.3.3-22.el5_10 for package: php53
    --> Running transaction check
    ---> Package php53-cli.i386 0:5.3.3-22.el5_10 set to be updated
    ---> Package php53-common.i386 0:5.3.3-22.el5_10 set to be updated
    --> Processing Conflict: php53-common conflicts php-common
    --> Restarting Dependency Resolution with new changes.
    --> Running transaction check
    ---> Package php-common.i386 0:5.1.6-43.el5_10 set to be updated
    --> Processing Dependency: php-common = 5.1.6-27.el5_5.3 for package: php-mysql
    --> Processing Dependency: php-common = 5.1.6-27.el5_5.3 for package: php-cli
    --> Processing Dependency: php-common = 5.1.6-27.el5_5.3 for package: php-pdo
    --> Processing Dependency: php-common = 5.1.6-27.el5_5.3 for package: php-imap
    --> Running transaction check
    ---> Package php-pdo.i386 0:5.1.6-43.el5_10 set to be updated
    ---> Package php-imap.i386 0:5.1.6-43.el5_10 set to be updated
    ---> Package php-mysql.i386 0:5.1.6-43.el5_10 set to be updated
    ---> Package php-cli.i386 0:5.1.6-43.el5_10 set to be updated
    --> Processing Conflict: php53-common conflicts php-common
    --> Finished Dependency Resolution
    php53-common-5.3.3-22.el5_10.i386 from updates has depsolving problems
      --> php53-common conflicts with php-common
    Error: php53-common conflicts with php-common

    Run what is below to avoid dependency hell that I decided not to paste.

    yum -y install package-cleanup
    package-cleanup --problems
    package-cleanup --dupes
    package-cleanup --orphans
    rpm -Va --nofiles --nodigest
    #this fixed it
    yum clean all

    This will require downtime but I couldn't fiind another way that worked:

     echo y|yum remove php-*;echo y|yum install php53*

    yum -x php53-odbc64 install php53*


    Stopping httpd:                                            [FAILED]
    Starting httpd: [Wed Jan 22 16:35:58 2014] [warn] module php5_module is already loaded, skipping
    httpd: Syntax error on line 994 of /etc/httpd/conf/httpd.conf: Syntax error on line 3 of /www/conf/a*********-best.com.conf: Syntax error on line 1 of /usr/local/zend/etc/sites.d/zend-default-vhost-80.conf: Include directory '/usr/local/zend/etc/sites.d/http/__default__/0' not found
                                                               [FAILED]

    To solve the above you have to remove some weird stuff that Zend adds to your default vhost.

     

    #ZEND-{DC789661BC47C707017CAF9F2BB500D1}
    #Include "/usr/local/zend/etc/sites.d/zend-default-vhost-80.conf"
    #ZEND-{DC789661BC47C707017CAF9F2BB500D1}


    #ZEND-{15168DADCE0E562BD3FC24EB9302589D}
    #Include "/usr/local/zend/etc/sites.d/globals-*.conf"
    #Include "/usr/local/zend/etc/sites.d/vhost_*.conf"
    #ZEND-{15168DADCE0E562BD3FC24EB9302589D}

    Your php.ini will probably be wiped out and overwritten so make sure you enable short tags or PHP code with <? will not be working and will display as HTML:


    /etc/php.ini
    short_open_tag = On


  • Directadmin Install Error Cannot find /usr/include/openssl/ssl.h. Did you run the pre-install commands?


    Cannot find /usr/include/openssl/ssl.h.
    Did you run the pre-install commands?
    http://help.directadmin.com/item.php?id=354


    yum -y install openssl*


  • cPanel VPS Server Cannot Login as root


    I was worried the server was hacked, I was logged in already as root but couldn't login to CPanel or a new SSH session.  I even reset the password from the shell and it did not work still.

    The reason is CPanel Hulk, it detected a brute-force attack so it locked down the root account entirely even from the correct password.  According to cPanel the best way around this is to whitelist your IP.

    http://forums.cpanel.net/f5/password-not-working-whm-cpanel-root-administrator-297262.html

    I was aware of CPanel Hulk but didn't know it completely locks an account even if the password is correct from non-offending IPs so this is something to be aware of, someone could potentially create a denial of service against any of your services/accounts just be intentionally bruteforcing them.


  • Gnome Terminal Cannot Open Error "There was an error creating the child process for this terminal" "Failed to create pipe for communicating with child process (Too many open files)"


    There was an error creating the child process for this terminal

    Failed to create pipe for communicating with child process (Too many open files)

    I get this when trying to open a new tab or new window even.  I've had far more sessions open (literally dozens) before without getting this error.


  • Howto edit/rotate Samsung/Android Videos in mencoder solution


    Movie-Aspect is undefined - no prescaling applied.
    videocodec: libavcodec (720x1280 fourcc=34504d46 [FMP4])
    [mpeg4 @ 0x2c91c00] timebase not supported by mpeg 4 standard
    Could not open codec.
    FATAL: Cannot initialize video driver.

    That is the error I would get, I thought it was a codec error something else.  By fluke I saw something about ffmpeg where someone recommended manually telling it to the "fps" and it worked.  My phone uses 30fps so I knew to do the following:

    mencoder -fps 30  -vf rotate=1 -o output-copy.avi -nosound -ovc copy 25825.mp4
    All I had to do was specify "-fps 30" and it worked whereas before the resulting video was just 1 frame with nothing basically.

    This seems like it will be common with Samsung phones or maybe a lot of Androids.


  • SSH HowTo Create Port Forwards


    ssh -L 5905:localhost:5900 root@yourserver.com

    The "-L" means to create a port forward to a port on your server.

    The 5905 means the port on your computer that will be used to access the port 5900 on the remote server.

    localhost is the IP that you use to access the port forward (you can change it to 0.0.0.0 which will be all IPs on your system/computer but localhost is good for security and privacy unless a whole network of people need access).


  • /usr/local/cpanel/bin/apache_conf_distiller 100% cpu


    On some CPanel installs we see complaints of "/usr/local/cpanel/bin/apache_conf_distiller" causing 100% cpu usage without any solution.

    Killing the process causes it to spawn again, actually it seems it tends to spawn multiple processes itself.

    Restarting CPanel itself is a temporary but not permanent solution.


  • [emerg] (28)No space left on device: Couldn't create accept lock (/etc/httpd/logs/accept.lock.15449) (5) solution



    [Wed Jan 08 18:50:07 2014] [emerg] (28)No space left on device: Couldn't create accept lock (/etc/httpd/logs/accept.lock.15449) (5)

    This may happen when trying to restart Apache and you find it dies right after starting and check /var/log/httpd/error_logs.

    What is the cause of this?

    1. You could be out of disk space (if you're not then see #2 and below)
    2. You're out of Semaphores, you need to kill all the old ones.


    Check to see current Semaphores, if Apache has stopped it should have none.  If you run the command below and see them you need to manually kill them.


    ipcs -s
    ------ Semaphore Arrays --------
    key        semid      owner      perms      nsems    
    0x00000000 0          apache    600        1        
    0x00000000 229377     apache    600        1        
    0x00000000 262146     apache    600        1        
    0x00000000 294915     apache    600        1        
    0x00000000 327684     apache    600        1        
    0x00000000 360453     apache    600        1        
    0x00000000 1671174    apache    600        1        
    0x00000000 1900551    apache    600        1        
    0x00000000 8781832    apache    600        1        
    0x00000000 8814601    apache    600        1        
    0x00000000 8847370    apache    600        1        
    0x00000000 8880139    apache    600        1        
    0x00000000 8912908    apache    600        1        
    0x00000000 8945677    apache    600        1        
    0x00000000 8978446    apache    600        1        
    0x00000000 13205519   apache    600        1        
    0x00000000 13238288   apache    600        1        
    0x00000000 13271057   apache    600        1        
    0x00000000 13303826   apache    600        1        
    0x00000000 13336595   apache    600        1       
     
     

    The bash script below will kill all the old semaphores and you should be able to start Apache succesfully after that.


    for ipcs in `ipcs -s|awk '{print $2}'`;
    do
    echo "ipcs=$ipcs"
    ipcrm -s $ipcs
    done

     


  • What a hdd hard drive and mdadm RAID array failure looks like in Linux


    [3805108.257042] sd 0:0:0:0: [sda] 1953525168 512-byte hardware sectors: (1.00 TB/931 GiB)
    [3805108.257052] sd 0:0:0:0: [sda] Write Protect is off
    [3805108.257054] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
    [3805108.257066] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
    [3805108.257083] sd 0:0:0:0: [sda] 1953525168 512-byte hardware sectors: (1.00 TB/931 GiB)
    [3805108.257090] sd 0:0:0:0: [sda] Write Protect is off
    [3805108.257092] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
    [3805108.257102] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
    [3805157.877358] ata1: exception Emask 0x10 SAct 0x0 SErr 0x90202 action 0xe frozen
    [3805157.877360] ata1: irq_stat 0x00400000, PHY RDY changed
    [3805157.877363] ata1: SError: { RecovComm Persist PHYRdyChg 10B8B }
    [3805157.877366] ata1: hard resetting link
    [3805158.620050] ata1: SATA link down (SStatus 0 SControl 300)
    [3805158.851429] ata1: hard resetting link
    [3805162.862545] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
    [3805162.878238] ata1.00: configured for UDMA/133
    [3805162.878252] ata1: limiting SATA link speed to 1.5 Gbps
    [3805162.878255] ata1: exception Emask 0x10 SAct 0x0 SErr 0x0 action 0xf t4
    [3805162.878257] ata1: irq_stat 0x00400040, connection status changed
    [3805162.878260] ata1: hard resetting link
    [3805163.802544] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
    [3805163.818012] ata1.00: configured for UDMA/133
    [3805163.818016] ata1: EH complete
    [3805163.818088] sd 0:0:0:0: [sda] 1953525168 512-byte hardware sectors: (1.00 TB/931 GiB)
    [3805163.818098] sd 0:0:0:0: [sda] Write Protect is off
    [3805163.818100] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
    [3805163.818112] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
    [3805163.818129] sd 0:0:0:0: [sda] 1953525168 512-byte hardware sectors: (1.00 TB/931 GiB)
    [3805163.818135] sd 0:0:0:0: [sda] Write Protect is off
    [3805163.818137] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
    [3805163.818147] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
    [3805199.602103] ata1: exception Emask 0x10 SAct 0x0 SErr 0x90200 action 0xe frozen
    [3805199.602106] ata1: irq_stat 0x00400000, PHY RDY changed
    [3805199.602108] ata1: SError: { Persist PHYRdyChg 10B8B }
    [3805199.602112] ata1: hard resetting link
    [3805200.352548] ata1: SATA link down (SStatus 0 SControl 310)
    [3805200.595987] ata1: hard resetting link
    [3805203.342553] ata1: SATA link down (SStatus 0 SControl 310)
    [3805204.390198] ata1: hard resetting link
    [3805208.272545] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
    [3805208.275964] ata1.00: configured for UDMA/133
    [3805208.275977] ata1: exception Emask 0x10 SAct 0x0 SErr 0x0 action 0x9 t4
    [3805208.275979] ata1: irq_stat 0x00000040, connection status changed
    [3805208.278116] ata1.00: configured for UDMA/133
    [3805208.278120] ata1: EH complete
    [3805208.278191] sd 0:0:0:0: [sda] 1953525168 512-byte hardware sectors: (1.00 TB/931 GiB)
    [3805208.278201] sd 0:0:0:0: [sda] Write Protect is off
    [3805208.278203] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
    [3805208.278214] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
    [3805208.278241] sd 0:0:0:0: [sda] 1953525168 512-byte hardware sectors: (1.00 TB/931 GiB)
    [3805208.278257] sd 0:0:0:0: [sda] Write Protect is off
    [3805208.278258] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
    [3805208.278269] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
    [3805211.016992] ata1: exception Emask 0x10 SAct 0x0 SErr 0x90200 action 0xe frozen
    [3805211.016994] ata1: irq_stat 0x00400000, PHY RDY changed
    [3805211.016996] ata1: SError: { Persist PHYRdyChg 10B8B }
    [3805211.017000] ata1: hard resetting link
    [3805211.760051] ata1: SATA link down (SStatus 0 SControl 310)
    [3805216.762533] ata1: hard resetting link
    [3805217.112548] ata1: SATA link down (SStatus 0 SControl 310)
    [3805222.112533] ata1: hard resetting link
    [3805222.462549] ata1: SATA link down (SStatus 0 SControl 310)
    [3805222.462555] ata1.00: disabled
    [3805222.462568] ata1: EH complete
    [3805222.462574] sd 0:0:0:0: rejecting I/O to offline device
    [3805222.462585] ata1.00: detaching (SCSI 0:0:0:0)
    [3805222.462592] end_request: I/O error, dev sda, sector 1887460551
    [3805222.462596] md: super_written gets error=-5, uptodate=0
    [3805222.462599] raid1: Disk failure on sda1, disabling device.
    [3805222.462600] raid1: Operation continuing on 1 devices.
    [3805222.462868] sd 0:0:0:0: [sda] Synchronizing SCSI cache
    [3805222.462964] sd 0:0:0:0: [sda] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK,SUGGEST_OK
    [3805222.462967] sd 0:0:0:0: [sda] Stopping disk
    [3805222.462972] sd 0:0:0:0: [sda] START_STOP FAILED
    [3805222.462973] sd 0:0:0:0: [sda] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK,SUGGEST_OK
    [3805227.022869] RAID1 conf printout:
    [3805227.022871]  --- wd:1 rd:2
    [3805227.022874]  disk 0, wo:0, o:1, dev:sdc1
    [3805227.022875]  disk 1, wo:1, o:0, dev:sda1
    [3805227.024931] RAID1 conf printout:
    [3805227.024935]  --- wd:1 rd:2
    [3805227.024938]  disk 0, wo:0, o:1, dev:sdc1
    cat /proc/mdstat
    Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
    md_d20 : active raid1 sde1[0]
          1953511936 blocks [2/1] [U_]
          bitmap: 231/233 pages [924KB], 4096KB chunk

    md_d1 : active raid1 sda2[1] sdc2[0]
          20490816 blocks [2/2] [UU]
         
    md12 : active raid1 sdb1[0] sdd1[1]
          1953511936 blocks [2/2] [UU]
          bitmap: 0/233 pages [0KB], 4096KB chunk

    md0 : active raid1 sda1[2](F) sdc1[0]
          943730240 blocks [2/1] [U_]
          bitmap: 67/226 pages [268KB], 2048KB chunk
     


  • MySQL How to add a field/column using alter


    ALTER TABLE yourtable ADD COLUMN info VARCHAR(255)


  • PHP does not reload the php.ini setttings until the webserver is restarted


    Just in case anyone is wondering that is the case, it can make troubleshooting impossible if you're making changes to php.ini but don't realize the webserver must be restarted for those changes to apply (contrary to running php-cgi which always looks up the current .ini settings).


  • PHP Warning: imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error: Premature end of JPEG file


    I was having an issue with only certain random/jpeg files with the functions imagecreatefromjpeg imagecreatetruecolor and other related ones.

    This issue was annoying basically it seems like a libgd issue/bug with newer versions of PHP and it was difficult to trace-out.  One very useful thing that helped me was using "php-cgi" and passing the query string as an argument eg:

    php-cgi images.php source=IMG.jpg (that way you get all the error messages which lead me to below):

    PHP Warning:  imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error: Premature end of JPEG file

    The solution is to tweak the PHP GD settings to ignore this warning

    /etc/php.ini

    [gd]
    ; Tell the jpeg decode to ignore warnings and try to create
    ; a gd image. The warning will then be displayed as notices
    ; disabled by default
    ; http://www.php.net/manual/en/image.configuration.php#ini.image.jpeg-ignore-warning
    gd.jpeg_ignore_warning = 1

     


  • Linux Centos 6 Weird Kernel Panic


    Kernel panic - not syncing: Attempted to kill init!
    Pid: 1, comm: init Not tained: 3.2.51-3.el6.x86_64 #1
    Call Trace:
     panic+0x8c/0x1a2
    forget_original_parent+0x34d/0x360
    exit_notify+0x12/0x140
    do_exit+0x1d8/0x400
    do_group_exit_+0x50/0xc0
    sys_exit_group+0x12/0x20
    system_call_fastpath+0x16/0x1b
    panic occurred, switching back to text console


  • iptables howto multiport forward in single line example


    -A PREROUTING -p tcp -m multiport --dports 10000,18080,13306 -j DNAT --to-destination 192.168.5.83


  • Linux Ubuntu Debian Howto Manually Update/Install Thunderbird


    wget http://download-location
    sudo tar xjvf thunderbird-24.2.0.tar.bz2 -C /opt
    ln -s /opt/thunderbird/thunderbird /usr/bin/thunderbird
    [sudo] password for one:
    ln: creating symbolic link `/usr/bin/thunderbird': File exists

    sudo rm /usr/bin/thunderbird
    ln -s /opt/thunderbird/thunderbird /usr/bin/thunderbird

    The above is how I did it, if you don't do it properly you'll find that you are still using the old version (so verify in About that it is the new version).  I've verified the above method works perfectly, it's great if you're using an older version of Linux and need to update the most commonly used programs like Thunderbird and Firefox.


  • Linux Ubuntu Debian Howto Manually Update/Install Firefox


    wget http://download-location
    mv /usr/bin/firefox /usr/bin/firefox-old
    sudo tar xjvf firefox-26.0.tar.bz2 -C /opt
    ln -s /opt/firefox/firefox /usr/bin/firefox

    The above is how I did it, if you don't do it properly you'll find that you are still using the old version (so verify in About that it is the new version).  I've verified the above method works perfectly, it's great if you're using an older version of Linux and need to update the most commonly used programs like Thunderbird and Firefox.


  • Howto Execute PHP from within an HTML or other file with an htaccess file on Apache


    Add this to a new ".htaccess" file inside the directory where the .html resides:

    AddType application/x-httpd-php .php .html


  • DD-WRT Set Static DHCP IP Address For Lease


    Services -> Services

    "Static Leases"

    Fill out an empty line:

    MAC Address Host Name IP Address

    Those first 3 fields are mandatory, if you miss it then the changes will be lost even if you try to save.

    Make sure you've done it right but clicking "Save" and then "Apply Changes" at the bottom to make them active.

    Then get a new DHCP lease and make sure the IP is correct.


  • css rounded image and background setting tutorial/example


    <img src="/someimg.png" style="border-radius: 10px;
        -webkit-border-radius: 50px;
        -moz-border-radius: 10px;background:#FFFFFF">


  • [Hardware Error]: CPU:0 MC4_STATUS[-|CE|MiscV|-|AddrV|CECC]: 0x9c054c84011c011b [Hardware Error]: cache level: L3/GEN, tx: GEN, mem-tx: RD [Hardware Error]: Northbridge Error (node 0): L3 data cache ECC error.


    This server has been running for weeks without issue, it's currently only using 1 of 2 CPUs as it is running in the office as a test bed (mainly due to the handle 12 bay storage/great for testing HDDs).  The errors below seem to mainly be from AMD CPUs, it's only happened a single time and in the days since I got that error it hasn't occurrred.

    Interestingly enough /proc/cpuinfo still shows all 4 cores of the CPU (Opteron 2373 Quadcore HE) and the functionality doesn't seem to be affected (nothing crashed etc..)

    I'm not sure what the issue could be, I wonder if it's the power supply?  It was getting a little whiny/noisy around the time this happened (the pitch it was making is also the beginning stages of power supply failure in my experience).

     

    Message from syslogd@fs12home at Dec  6 18:05:50 ...
     kernel:[3022800.704091] [Hardware Error]: CPU:0 MC4_STATUS[-|CE|MiscV|-|AddrV|CECC]: 0x9c054c84011c011b

    Message from syslogd@fs12home at Dec  6 18:05:50 ...
     kernel:[3022800.704127] [Hardware Error]:     MC4_ADDR: 0x000000042d847a84

    Message from syslogd@fs12home at Dec  6 18:05:50 ...
     kernel:[3022800.704145] [Hardware Error]: Northbridge Error (node 0): L3 data cache ECC error.

    Message from syslogd@fs12home at Dec  6 18:05:50 ...
     kernel:[3022800.704169] [Hardware Error]: cache level: L3/GEN, tx: GEN, mem-tx: RD

     


  • Failed to load VMMR0.r0 (VERR_SUPLIB_OWNER_NOT_ROOT)


    Failed to load VMMR0.r0 (VERR_SUPLIB_OWNER_NOT_ROOT)
     

    In most cases the error above is useful, it generally means /usr or /usb/lib or /usr/lib/virtualbox is not owned by root and this is the cause of the error.

    Solution

    sudo chown root.root /usr/lib


  • cPanel Find/Set Main DNS Servers for Template Howto



    Go to:
    "Server Configuration" -> Basic cPanel & WHM Setup
    Scroll to: "Nameservers" (at the bottom)

    From there you can set the names of the nameserver and their IPs.
    It's very weird and confusing that nothing under IP Functions/DNS has or links to this.


  • openssh-server has no installation candidate Debian/Ubuntu Solution


    I don't know why but some installations don't have this in the database by default.

    To fix it to an:

    sudo apt-get update;sudo apt-get install openssh-server

    and then it will work


  • Fatal error: Out of memory (allocated 6291456) (tried to allocate 7680 bytes)


    Fatal error: Out of memory (allocated 6291456) (tried to allocate 7680 bytes)

    This is usually caused by Wordpress, Drupal or other ridiculously inefficient CMS' out there, as a temporary fix you can increase PHP's memory limit but it's best to find the actual culprit, by disabling add-ons and other scripts etc...


  • Ubuntu/Debian how to update FlashPlayer manually


    Download the latest from Adobe's site and unzip it, enter the directory it creates and type the following:

    sudo cp libflashlayer.so /usr/lib/adobe-flashplugin/
    sudo cp -r usr/* /usr


  • Asterisk iptables block bruteforce attacks howto with fail2ban



    yum -y install fail2ban

    vi /etc/fail2ban/jail.conf

    [asterisk-tcp]

    enabled  = true
    filter   = asterisk
    action   = iptables-multiport[name=asterisk-tcp, port="5060,5061", protocol=tcp]
               sendmail-whois[name=Asterisk, dest=you@example.com, sender=fail2ban@example.com]
    logpath  = /var/log/asterisk/messages
    maxretry = 10

    [asterisk-udp]

    enabled  = true
    filter   = asterisk
    action   = iptables-multiport[name=asterisk-udp, port="5060,5061", protocol=udp]
               sendmail-whois[name=Asterisk, dest=you@example.com, sender=fail2ban@example.com]
    logpath  = /var/log/asterisk/messages
    maxretry = 10

    vi /etc/fail2ban/filter.d/asterisk.conf

    # Fail2Ban configuration file
    #
    # Author: Xavier Devlamynck
    #
    # $Revision$
    #


    [INCLUDES]

    # Read common prefixes. If any customizations available -- read them from
    # common.local
    before = common.conf

    [Definition]

    # Option:  failregex
    # Notes.:  regex to match the password failures messages in the logfile. The
    #          host must be matched by a group named "host". The tag "" can
    #          be used for standard IP/hostname matching and is only an alias for
    #          (?:::f{4,6}:)?(?PS+)
    # Values:  TEXT
    #
    failregex = NOTICE%(__pid_re)s .*: Registration from '.*' failed for '' - Wrong password$
                NOTICE%(__pid_re)s .*: Registration from '.*' failed for '' - No matching peer found$
                NOTICE%(__pid_re)s .*: Registration from '.*' failed for '' - Username/auth name mismatch$
                NOTICE%(__pid_re)s .*: Registration from '.*' failed for '' - Device does not match ACL$
                NOTICE%(__pid_re)s .*: Registration from '.*' failed for '' - Peer is not supposed to register$
                NOTICE%(__pid_re)s .*: Registration from '.*' failed for '' - ACL error (permit/deny)$
                NOTICE%(__pid_re)s failed to authenticate as '.*'$
                NOTICE%(__pid_re)s .*: No registration for peer '.*' (from )$
                NOTICE%(__pid_re)s .*: Host failed MD5 authentication for '.*' (.*)$
                NOTICE%(__pid_re)s .*: Failed to authenticate user .*@.*$

    # Option:  ignoreregex
    # Notes.:  regex to ignore. If this regex matches, the line is ignored.
    # Values:  TEXT
    #
    ignoreregex =
    ~                                                                                                                                                                                                                                           
    ~                                                                                                                                                                                                                                           
    ~                                                                                                                                                                                                                                           
    ~                                             

    chkconfig fail2ban on
    service fail2ban start

    cat /var/log/fail2ban.log
    2013-11-25 09:17:43,789 fail2ban.server : INFO   Changed logging target to /var/log/fail2ban.log for Fail2ban v0.8.7
    2013-11-25 09:17:43,791 fail2ban.jail   : INFO   Creating new jail 'asterisk-udp'
    2013-11-25 09:17:43,828 fail2ban.jail   : INFO   Jail 'asterisk-udp' uses Gamin
    2013-11-25 09:17:43,944 fail2ban.jail   : INFO   Initiated 'gamin' backend
    2013-11-25 09:17:43,985 fail2ban.filter : INFO   Added logfile = /var/log/asterisk/messages
    2013-11-25 09:17:43,987 fail2ban.filter : INFO   Set maxRetry = 10
    2013-11-25 09:17:43,989 fail2ban.filter : INFO   Set findtime = 600
    2013-11-25 09:17:43,991 fail2ban.actions: INFO   Set banTime = 600
    2013-11-25 09:17:44,067 fail2ban.jail   : INFO   Creating new jail 'asterisk-tcp'
    2013-11-25 09:17:44,068 fail2ban.jail   : INFO   Jail 'asterisk-tcp' uses Gamin
    2013-11-25 09:17:44,070 fail2ban.jail   : INFO   Initiated 'gamin' backend
    2013-11-25 09:17:44,072 fail2ban.filter : INFO   Added logfile = /var/log/asterisk/messages
    2013-11-25 09:17:44,074 fail2ban.filter : INFO   Set maxRetry = 10
    2013-11-25 09:17:44,077 fail2ban.filter : INFO   Set findtime = 600
    2013-11-25 09:17:44,078 fail2ban.actions: INFO   Set banTime = 600
    2013-11-25 09:17:44,129 fail2ban.jail   : INFO   Jail 'asterisk-udp' started
    2013-11-25 09:17:44,136 fail2ban.jail   : INFO   Jail 'asterisk-tcp' started
                                                                                                                                                                                                 
    ~                                             


  • service monit status monit dead but subsys locked - solution


    service monit status
    monit dead but subsys locked

     


  • Update wordpress script


    Requirements:

    1.) Enter your root wordpress directory.

    2.) Download the latest wordpress.zip to it.

    #backup your current files just in case

    cp -a . wp-current-bk`date +%Y%m%d`

    unzip wordpress-3.7.1.zip
    rm -rf wp-includes
    rm -rf wp-admin
    echo y|cp -a wordpress/wp-includes .
    echo y|cp -a wordpress/wp-admin .
    echo y|cp -a wordpress/wp-content/* wp-content
    echo y|cp wordpress/* .


  • Centos 6 samba server not showing up in WORKGROUP


    This is different than Centos 5, you have two services btu they are called "smb" and "nmb".

    You need to enable and start "nmb" in order for your samba server to be listed.

    chkconfig nmb on; chkconfig smb on

    service nmb start;service smb start


  • pxelinux slow to enter boot screen/menu


    Trying to load: pxelinux.cfg/default
    boot: _ (why does the cursor flash so long before entering the PXE Boot menu?)


  • htaccess allow only certain IPs howto


    <LIMIT GET POST>
    order deny,allow
    deny from all
    allow from your.ip.here
    </LIMIT>

     


  • CPanel Log File Locations for access_log,error_log, mysql


    All Errors (CPanel does not report by domain, but puts everything in a single log which I think is a bit silly and annoying):

    /usr/local/apache/logs/error_log

    Access_Logs

    They are found within the home directory of the site user eg.:

    /home/admin/access-logs/yoursite.com

    MySQL Logs

     /var/lib/mysql/yourhostname.err


  • MySQL DELETE all but specific items or records howto


    DELETE FROM `wp_comments` WHERE NOT comment_author_email IN ('user@hotmail.com','another@hotmail.com')

    The above is an example of specific records you type out, but you could also base it on a subquery.


  • Delete all comments from wordpress (in case of extreme SPAM)


    *Note this will delete all comments indiscriminately.

    DELETE FROM `wp_comments`
     

    To delete all but save specific comments based on "author e-mail use the following".  Add more e-mails below in the same format if you have more.

    DELETE FROM `wp_comments` WHERE NOT comment_author_email IN ('user@hotmail.com','another@hotmail.com')


  • Dell CS24-NV7 Howto Enable LAN/NICs and PXEBoot in the BIOS


    Dell CS24-NV7

    Unusually the Virtualization was enabled when I got this server but all the NICs were diabled in the BIOS including PXE boot!

    Advanced -> Advanced Chipset Control


    PCI Slot 1 Option ROM: Enabled
    Onboard LAN1 Control: Enabled
    LAN1 Option ROM Scan: Enabled (you need it for PXE boot)
    Onboard LAN2 Control: Enabled
    LAN2 Option ROM Scan: Enabled

    *you will need to reboot and enter the BIOS again before the NVIDIA Boot Agents for the NICs/PXE Agent is visible in the Boot section and boot options.  You'll also need to enter the "Boot section" and hit "x" to enable each one of them for booting and assign them the correct boot order ou prefer.


    Boot:

    PCI BEV: 2-NVIDIA Boot Agent 277.05 (eth0)
             NVIDIA Boot Agent 277.0547 (eth1) 


  • Ubuntu 10.10 100% CPU from apt-get solution


    When manually running it for some reason it decided to ask for/use the CD as a source which I never set.

    Disabling the CD as a source stops this from happening, otherwise apt-get will keep respawning and use 100% CPU.


  • wget test without actually downloading howto


    user the "--spider" switch and you can see what it would do.

    wget -r --spider dontryrealtechtalk.com


  • Linux Bash Remove Last Character from string/variable howto


    somestring="309sfjlks39889d"
    removelast="${somestring%?}


  • VBox/Virtualbox solution to NS_ERROR_CALL_FAILED error


    VBox/Virtualbox solution to NS_ERROR_CALL_FAILED error

    This is likely because you have 2D/3D acceleration enabled and your card doesn't support it.
    Eg. you switched video card drivers or video cards that did support it.

    The funny thing is that you CANNOT disable those options as they are "greyed" out in the VBox client GUI.
    The config file has to be manually changed and fixed with these options "accelerate3D="false" accelerate2DVideo="false"



    Here's how you fix it:
    1.) Close all instances of the VBox Client
    2.) Run the sed command below (replace XP.xml with the path to your VBox machine's configuration file)
    *Note I recommend sed because there are actually usually multiple instances where the acceleration is enabled in the config file.

    sed -i 's/accelerate3D="true"/accelerate3D="false"/g' XP.xml
    sed -i 's/accelerate2DVideo="true"/accelerate2DVideo="false"/g' XP.xml


    After the above I didn't get the error and was able to boot.


  • Vbulletin howto resend confirmation e-mail


    Visit that link

    http://yourforums.com/forum/register.php?do=requestemail

    Or in AdminCP it can be done.


  • VBulletin Enhanced Captcha / RegSecure not showing/working images solution.



    This happened after a customer migrated their hosting and the issue was being unable to access PHP sessions.

    Warning: session_start(): open(/var/lib/php/session/sess_3e0oms763m6mrqekdnnmodlhs3, O_RDWR) failed: Permission denied (13) in /register.php(202) : eval()'d code on line 1

    Solution: (use the correct ownership/permissions)


    chown apache.apache -R /var/lib/php


  • Linux shuf program bash script get random line from file


    shuf -n 1 /path/to/your/file.txt

    The above will give you a random line from the file using the "shuf" command.