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.

  • VBOX/Virtualbox how to resize the disk file image vdi


    VBoxManage modifyhd "my.vdi" --resize 60000
    
    Note the above will resize my.vdi to 60,000MB
    

  • OpenVZ Error: Failed to load 2nd level quota solution


    Syncing private
    Live migrating container...
    Syncing 2nd level quota
    11000: invalid option -- F
    Usage: vzdqload quotaid [-c file] commands
    Loads user/group qouta information from stdin into quota file.
        -c file    use given quota file
    Commands specify what user/group information to load:
        -G    grace time
        -U    disk limits
        -T    expiration times
    Error: Failed to load 2nd level quota


    #solution


    yum -y update vzctl

    The reason this seems to happen is because OpenVZ (vzctl) on the destination node is out of date and lacks some features or has changed compared to what the source node has. 

    Updating vzctl fixed the above problem.

     


  • 99.99 % [jbd2/drbd0-8] highiowait


    I have not found the source of this but essentially it seems like drbd and ext4 may not play well but I have to confirm still.

    In either case an older DRBD setup with older hard drives seems to have little to no iowait, but the main difference is the drbd partition is ext3 and not ext4.  I will experiment and see if that fixes this, then we will know that DRBD and ext4 have issues.


  • heartbeat cross talk


    I do not understand why heartbeat would try to communicate with another system not considered part of the node:

     

    heartbeat: [8280]: WARN: string2msg_ll: node [otherbox.com] failed authentication
     


  • Openvz error solutions Container already locked (error) can't lock quota file, some quota operations are performing for id 1200


    rm /vz/lock/1200.lck
    rm: remove regular file `/vz/lock/1200.lck'? y

    vzctl start 1200
    Container already locked



    vzctl start 1200
    Starting container ...
    vzquota : (error) can't lock quota file, some quota operations are performing for id 1200
    vzquota on failed [7]

    vzquota off 1200
    vzctl start 1200
    vzquota on 1200


    root@rttbox ~]# vzquota off 1200
    vzquota : (error) Quota off syscall for id 1200: Device or resource busy
    vzquota : (error)     Possible reasons:
    vzquota : (error)     - Container's root is not unmounted
    vzquota : (error)     - there are opened files inside container's root/private area
    vzquota : (error)     - your current working directory is inside a container directory
    vzquota : (error)       root/private area
    [root@rttbox ~]# vzctl start 1200
    Container is already running
    [root@rttbox ~]# vzquota on 1200
    vzquota : (warning) Quota is running for id 1200 already
     


    The above is what happens when everything is fine but it takes a long time for the quota update to complete, such after a live migration etc... you know it is often the case when the normal tricks don't work:

    eg. removing the .lck file, turning quota on and off.


  • blocked for more than 120 seconds issues with iowait and timeout on Live Linux distribution while writing to physical disk


    This happened while an mdadm array was syncing, all access from writing a new blank file to opening a small .txt file was very slow:

     

    [222117.312078] kjournald starting.  Commit interval 5 seconds
    [222117.685060] EXT3-fs (md0): using internal journal
    [222117.685096] EXT3-fs (md0): mounted filesystem with ordered data mode
    [222122.376847] kjournald starting.  Commit interval 5 seconds
    [222122.602825] EXT3-fs (md2): using internal journal
    [222122.602866] EXT3-fs (md2): mounted filesystem with ordered data mode
    [223081.568032] INFO: task kjournald:352 blocked for more than 120 seconds.
    [223081.568069] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    [223081.568121] kjournald       D ef1e41c0     0   352      2 0x00000000
    [223081.568157]  eee0dac0 00000046 ef1e41c0 ef1e41c0 0000cab8 00000000 e971ee70 22650000
    [223081.568219]  e8c11c9f ccb941c0 eee0dc74 ccb941c0 eee0dac0 ccb941c0 ccb941c0 00000000
    [223081.568280]  eee0daf4 eee0daf4 ef1e4204 ff48eeaf c102e1e0 e971ee70 00000012 ff48eeaf
    [223081.568341] Call Trace:
    [223081.568375]  [<c102e1e0>] ? dequeue_task_fair+0x149/0x1d6
    [223081.568411]  [<c11939a6>] ? journal_commit_transaction+0x12c/0xd02
    [223081.568446]  [<c1605d15>] ? __schedule+0x5cb/0x5f2
    [223081.568478]  [<c1047ef5>] ? wake_up_bit+0x56/0x56
    [223081.568510]  [<c103bfe1>] ? lock_timer_base+0x19/0x34
    [223081.568541]  [<c103c48c>] ? try_to_del_timer_sync+0x5c/0x63
    [223081.568574]  [<c1197306>] ? kjournald+0xb5/0x1cc
    [223081.568604]  [<c1047ef5>] ? wake_up_bit+0x56/0x56
    [223081.568633]  [<c1197251>] ? commit_timeout+0x5/0x5
    [223081.568663]  [<c1047b9f>] ? kthread+0x63/0x68
    [223081.568692]  [<c1047b3c>] ? kthread_worker_fn+0x114/0x114
    [223081.568725]  [<c160cbbe>] ? kernel_thread_helper+0x6/0xd
    [223081.568756] INFO: task vi:530 blocked for more than 120 seconds.
    [223081.568787] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    [223081.568838] vi              D 00000002     0   530  32563 0x00000004
    [223081.568873]  cc72dee0 00000086 00000003 00000002 c1098a00 00000000 00204033 22636000
    [223081.572601]  00000002 ccb941c0 cc72e094 ccb941c0 cc72dee0 ccb941c0 ccb941c0 eec86180
    [223081.572662]  c10284ce 00000002 00000001 00000005 cc263dec 00000000 00000001 eec03870
    [223081.572723] Call Trace:
    [223081.572751]  [<c1098a00>] ? __alloc_pages_nodemask+0x121/0x572
    [223081.572785]  [<c10284ce>] ? find_busiest_group+0x244/0x7e5
    [223081.572818]  [<c104e4e8>] ? timekeeping_get_ns+0x10/0x48
    [223081.572850]  [<c104f849>] ? ktime_get_ts+0x76/0x7d
    [223081.572880]  [<c1605fff>] ? io_schedule+0x6c/0xa4
    [223081.572911]  [<c10e40f0>] ? sleep_on_buffer+0x5/0x8
    [223081.572941]  [<c1606255>] ? __wait_on_bit_lock+0x2f/0x68
    [223081.572973]  [<c10e40eb>] ? unmap_underlying_metadata+0x41/0x41
    [223081.573005]  [<c10e40eb>] ? unmap_underlying_metadata+0x41/0x41
    [223081.573037]  [<c1606329>] ? out_of_line_wait_on_bit_lock+0x9b/0xa3
    [223081.573071]  [<c1047f1e>] ? autoremove_wake_function+0x29/0x29
    [223081.573103]  [<c10e4210>] ? __lock_buffer+0x1c/0x1e
    [223081.573133]  [<c1192e25>] ? do_get_write_access+0x4f/0x305
    [223081.573166]  [<c11928e1>] ? start_this_handle+0x27a/0x2d6
    [223081.573197]  [<c1196d5a>] ? journal_add_journal_head+0x85/0xec
    [223081.573230]  [<c11930f3>] ? journal_get_write_access+0x18/0x26
    [223081.573263]  [<c1154fde>] ? __ext3_journal_get_write_access+0x16/0x36
    [223081.573298]  [<c114ae9a>] ? ext3_orphan_add+0x78/0x13e
    [223081.573328]  [<c1192a4e>] ? journal_start+0x80/0xa7
    [223081.573359]  [<c1147da7>] ? ext3_setattr+0x180/0x2ad
    [223081.573391]  [<c10d627e>] ? notify_change+0x182/0x252
    [223081.573424]  [<c10c40d6>] ? do_truncate+0x61/0x77
    [223081.573455]  [<c10ce12b>] ? do_last+0x4c4/0x52f
    [223081.573485]  [<c10ce620>] ? path_openat+0x9f/0x285
    [223081.573514]  [<c10ce8aa>] ? do_filp_open+0x21/0x5d
    [223081.573545]  [<c10c10a8>] ? kmem_cache_alloc+0x21/0xd9
    [223081.573576]  [<c10cc7ed>] ? getname_flags+0x24/0xd5
    [223081.573606]  [<c10c3779>] ? do_sys_open+0x58/0xd1
    [223081.573636]  [<c10c3836>] ? sys_open+0x1e/0x23
    [223081.573666]  [<c160711c>] ? syscall_call+0x7/0x7


    [224161.572060] INFO: task kjournald:349 blocked for more than 120 seconds.
    [224161.572099] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    [224161.572151] kjournald       D ef1e41c0     0   349      2 0x00000000
    [224161.572187]  eee0f7a0 00000046 ef1e41c0 ef1e41c0 0000cbae 00000000 e07bdd83 22650000
    [224161.572248]  dfcdf1fd ccb941c0 eee0f954 ccb941c0 eee0f7a0 ccb941c0 ccb941c0 00000000
    [224161.572310]  eee0f7d4 eee0f7d4 ef1e4204 ff52147a c102e1e0 e07bdd83 0000001d ff52147a
    [224161.572371] Call Trace:
    [224161.572405]  [<c102e1e0>] ? dequeue_task_fair+0x149/0x1d6
    [224161.572441]  [<c11939a6>] ? journal_commit_transaction+0x12c/0xd02
    [224161.572477]  [<c1605d15>] ? __schedule+0x5cb/0x5f2
    [224161.572509]  [<c1047ef5>] ? wake_up_bit+0x56/0x56
    [224161.572541]  [<c103bfe1>] ? lock_timer_base+0x19/0x34
    [224161.572573]  [<c103c48c>] ? try_to_del_timer_sync+0x5c/0x63
    [224161.572605]  [<c1197306>] ? kjournald+0xb5/0x1cc
    [224161.572635]  [<c1047ef5>] ? wake_up_bit+0x56/0x56
    [224161.572664]  [<c1197251>] ? commit_timeout+0x5/0x5
    [224161.572694]  [<c1047b9f>] ? kthread+0x63/0x68
    [224161.572723]  [<c1047b3c>] ? kthread_worker_fn+0x114/0x114
    [224161.572757]  [<c160cbbe>] ? kernel_thread_helper+0x6/0xd
    [224161.572789] INFO: task vi:791 blocked for more than 120 seconds.
    [224161.572821] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    [224161.572872] vi              D 00000010     0   791    552 0x00000000
    [224161.572907]  cc47f380 00000086 00000040 00000010 c1820380 00000000 00000000 22629000
    [224161.572968]  00000002 ccb941c0 cc47f534 ccb941c0 cc47f380 ccb941c0 ccb941c0 ef1b8c40
    [224161.573029]  eec03870 eec44a40 c14747c5 eec03860 eec86100 c10284ce 00000002 00000001
    [224161.573090] Call Trace:
    [224161.573117]  [<c14747c5>] ? cpumask_next_and+0x20/0x2b
    [224161.573150]  [<c10284ce>] ? find_busiest_group+0x244/0x7e5
    [224161.573183]  [<c104e4e8>] ? timekeeping_get_ns+0x10/0x48
    [224161.573214]  [<c104f849>] ? ktime_get_ts+0x76/0x7d
    [224161.573244]  [<c1605fff>] ? io_schedule+0x6c/0xa4
    [224161.573275]  [<c10e40f0>] ? sleep_on_buffer+0x5/0x8
    [224161.573305]  [<c1606255>] ? __wait_on_bit_lock+0x2f/0x68
    [224161.573337]  [<c10e40eb>] ? unmap_underlying_metadata+0x41/0x41
    [224161.573370]  [<c10e40eb>] ? unmap_underlying_metadata+0x41/0x41
    [224161.573402]  [<c1606329>] ? out_of_line_wait_on_bit_lock+0x9b/0xa3
    [224161.573435]  [<c1047f1e>] ? autoremove_wake_function+0x29/0x29
    [224161.573468]  [<c10e4210>] ? __lock_buffer+0x1c/0x1e
    [224161.573498]  [<c1192e25>] ? do_get_write_access+0x4f/0x305
    [224161.573530]  [<c1196d5a>] ? journal_add_journal_head+0x85/0xec
    [224161.573562]  [<c11930f3>] ? journal_get_write_access+0x18/0x26
    [224161.573596]  [<c1154fde>] ? __ext3_journal_get_write_access+0x16/0x36
    [224161.573630]  [<c1145c46>] ? ext3_reserve_inode_write+0x2d/0x5a
    [224161.573663]  [<c114aeb2>] ? ext3_orphan_add+0x90/0x13e
    [224161.573693]  [<c1147da7>] ? ext3_setattr+0x180/0x2ad
    [224161.573726]  [<c10d627e>] ? notify_change+0x182/0x252
    [224161.573758]  [<c10c40d6>] ? do_truncate+0x61/0x77
    [224161.573790]  [<c10ce12b>] ? do_last+0x4c4/0x52f
    [224161.573819]  [<c10ce7b1>] ? path_openat+0x230/0x285
    [224161.573849]  [<c10ce8aa>] ? do_filp_open+0x21/0x5d
    [224161.573880]  [<c10cc7ed>] ? getname_flags+0x24/0xd5
    [224161.573910]  [<c10c3779>] ? do_sys_open+0x58/0xd1
    [224161.573940]  [<c10c3836>] ? sys_open+0x1e/0x23
    [224161.573970]  [<c160711c>] ? syscall_call+0x7/0x7
    [224161.573999] INFO: task grub:817 blocked for more than 120 seconds.
    [224161.574031] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    [224161.574082] grub            D 00000002     0   817  32563 0x00000004
    [224161.574117]  cc47eb40 00000082 c109a37f 00000002 0000000e 00000000 c9eabec4 22643000
    [224161.574178]  00000000 ccb941c0 cc47ecf4 ccb941c0 cc47eb40 ccb941c0 ccb941c0 c9eabf1c
    [224161.574239]  c1093d65 0000000e 00000001 c9eabf38 00000000 c9eabf34 00000000 c8270270
    [224161.574300] Call Trace:
    [224161.574325]  [<c109a37f>] ? write_cache_pages+0x10d/0x2be
    [224161.574358]  [<c1093d65>] ? find_get_pages_tag+0x37/0xd1
    [224161.574390]  [<c1025f08>] ? __wake_up+0x2c/0x3b
    [224161.574419]  [<c1048067>] ? prepare_to_wait+0x14/0x52
    [224161.574450]  [<c11971b3>] ? log_wait_commit+0xa9/0xf1
    [224161.574480]  [<c1047ef5>] ? wake_up_bit+0x56/0x56
    [224161.574510]  [<c1153556>] ? ext3_sync_fs+0x5d/0x67
    [224161.574541]  [<c10f9d6f>] ? dquot_quota_sync+0x193/0x235
    [224161.574572]  [<c10f9bdc>] ? dquot_file_open+0x25/0x25
    [224161.574603]  [<c10e1fc4>] ? __sync_filesystem+0x69/0x69
    [224161.574634]  [<c10e1f8b>] ? __sync_filesystem+0x30/0x69
    [224161.574664]  [<c10c6a1f>] ? iterate_supers+0x4e/0x8d
    [224161.574695]  [<c10e2005>] ? sys_sync+0x36/0x49
    [224161.574724]  [<c160711c>] ? syscall_call+0x7/0x7

     


  • SELinux targeted policy relabel is required


    You may get this after a long time of not rebooting but especially if you have rsync'd a / partition or deployed an image to another VPS or computer, you will often have this issue.

    The good thing it usually just takes a reboot.

    Here is more info from Centos


  • possible SYN flooding on port 80. Sending cookies.


    Errors like this are shown on high usage servers and ports so it is common to see it on http and even imap ports:

    possible SYN flooding on port 80. Sending cookies.

    The Linux kernel will even detect flooding on OpenVZ containers:

    possible SYN flooding on ctid 6000, port 993. Sending cookies.

    In many cases this is not an issue and is more so simply a result of regular, but high usage traffic.


  • mdadm how to create mdadm.conf config file


    It is as simple as the command below, it will then update your mdadm.conf or create it in /etc/mdadm.conf

    mdadm --detail --brief --scan > /etc/mdadm.conf
     


  • Apache Centos Stopping httpd: [ OK ] Starting httpd: [Wed Jun 29 19:29:44 2016] [warn] _default_ VirtualHost overlap on port 80, the first has precedence [Wed Jun 29 19:29:44 2016] [warn] _default_ Virtual


    Stopping httpd:                                            [  OK  ]
    Starting httpd: [Wed Jun 29 19:29:44 2016] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
    [Wed Jun 29 19:29:44 2016] [warn] _default_ VirtualHost overlap on port 443, the first has precedence

    In order to avoid the above message and a conflict where only a default/first domain by alphabet gets served you need to use NameVirtualHost in httpd.conf

    Add the following to httpd.conf:

    NameVirtualHost *:80
    NameVirtualHost *:443


  • The connection was reset The connection to the server was reset while the page was loading.


    In Firefox I cannot connect to any website, proxy is disabled and outside network access is confirmed, no system or manual proxy was set on this Linux Mint/Ubuntu system.  Normally this can be caused by proxy or DNS problems and the weird thing is that traceroute and ping to other IPs worked fine but even connecting to sites by IP was not working.

    The connection was reset

    The connection to the server was reset while the page was loading.

        The site could be temporarily unavailable or too busy. Try again in a few moments.
        If you are unable to load any pages, check your computer's network connection.
        If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.


    This even causes apt-get to fail to install packages

     

    The solution:

    This was a virtual machine cloned in VirtualBox and for some silly reason it clones the MAC address, so there was the original machine running with the same MAC.  The solution is to regenerate a new MAC address from the VBOX config.


  • Openvz kernel: [10186978.064405] TCP: time wait bucket table overflow (CT3)


    kernel: [10186978.064405] TCP: time wait bucket table overflow (CT3)

    Varying opinions are out there but in general it seems like the most common culprit is a lack of privvmpages, with a modern OpenVZ system the best way is to set privvmpages as equal to what your RAM is and this has resolved the messages on another system.

    If it's truly a TCP issue you can adjust the following parameters:

    Source: Openvz forums

    1) Per-system tw_count is greater than per-system max_tw_buckets limit:
    tw_count < sysctl_max_tw_buckets
    net.ipv4.tcp_max_tw_buckets = 1800000
    IMHO very unlikely in your situation

    2) Per-VE counter is greater than per-VE max_tw_buckets limit:
    tw_count < sysctl_tcp_max_tw_buckets_ub
    net.ipv4.tcp_max_tw_buckets_ub = 165360


  • astrachat connection problems in Android 5.01 Lollipop


    I wanted to use Astrachat because it seems to be the only app that has video, pic and file sharing for Jabber but I cannot even connect despite any other client working fine including Xabber and others.

     

    astrachat "Oops.. We can't connect to the account that you provide above.  Please recheck your account detail".

    Unfortunately to make it worse there doesn't seem to be any error log or more details about the issue.

    The jabberd server requires start tls and I have hard coded the info into Astrachat as well and that didn't work.

    Here is the jabberd log:

    Jul 13 16:47:36 jabberbox jabberd/c2s[14145]: [8] [192.168.5.66, port=26400] connect
    Jul 13 16:47:37 jabberbox jabberd/c2s[14145]: [8] [192.168.5.66, port=26400] disconnect jid=unbound, packets: 0

     

    If I choose "NON-SASL Login" and disable "TLS/SSL (Establish secure connection on network) then I get a start tls error on the server:

     [8] got pre STARTTLS packet, dropping
     


  • sed how to avoid escaping


    sed gets to be a pain and a real mess and is hard to read and understand when you have to escape things like / etc.

    I did not realize until recently that you don't need to use / as a separator, you can use virtually any non letter or number character.

    Eg we have used # as the separator to avoid having to escape the forward slashes and in this way the command is plain, easy to understand, edit and saves time/hassle without the need for escaping.

    sed -i s#http://someurl.com#http://anotherurl.com#/g


  • Ubuntu/Debian OpenVZ Template Problems No Networking and SSH not starting


    It all comes down to a bug essentially where you are running an older kernel that doesn't support the newer Debian templates.  The solution is to update your OpenVZ kernel.

    Here are some symptoms of the problem/lack of kernel support:

     

    Ubuntu Template 12.04 requires a manual network start:
    service networking start

    sshd will not start:
    /usr/sbin/sshd
    PRNG is not seeded

    mknod /dev/random c 1 8

    service ssh start
    ssh start/running, process 30022

    #but netstat does not show it running

    #also no processes are started it looks like init is not getting called.

    init 2


  • HTML files in Apache still displaying as raw text even with DefaultType, ForceType etc.


    There was only one solution here and it was the following:

    edit /etc/httpd/conf/httpd.conf

    Comment the lines for the Mime Magic Module:


    #   MIMEMagicFile /usr/share/magic.mime
    #    MIMEMagicFile conf/magic

      *Don't forget to restart Apache and clear your browser cache twice

    I was using DefaultType and ForceType and the weird thing is for MOST files it was fine, but a few randomly did not like this becuase it appears Mime Magic was determing and rewriting the Mime Type and basically overruling the .htaccess I had (yes I had AllowOverride in the VHOST conf too).
     

    I hope this helps out someone else as it took me ages to sort out.


  • wget ignore robots.txt howto


    wget -e robots=off
    
    It is as simple as the above and this is something one must watch out carefully when using wget because you may think you have archived or downloaded content when you never did due to a nofollow/robots.txt statement.
    
    

  • Uploading Error HTTP error. Wordpress Upload Error Solution


    When you start uploading larger images in Wordpress you have to make sure your maximum attachment size is large enough and that the execution time is not too short:

    Uploading
    Error
    HTTP error.


    [Thu May 12 16:32:25 2016] [error] [client 10.10.5.2] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /httpdocs/blog/wp-includes/class-wp-image-editor-gd.php on line 182


    Solution Edit php.ini to increase the maximum_execution_time variable to 80 seconds
    vi /etc/php.ini

    max_execution_time = 80
     


  • mysql_real_escape_string returns an empty string solution


    This is a common mistake but many people do not realize this function comes from mysql itself, so therefore you need an active mysql connection open.

    Usually the string will be empty and null when you call it from outside of the database connection portion of your code.

    eg. an example of the wrong way and creating a null/empty string

    $var = mysql_real_escape_string($myself)

    mysql_connect();

    // returns null/empty

    As you can see above the escape was called before we connected to the db so that's why it returns empty.

    How to fix it (put the escape call after you connect to mysql):

    mysql_connect();

    $var = mysql_real_escape_string($myself)

     

    There realy should be more of a warning from PHP itself because an empty string could cause havoc with database transactions.

    Another way the problem can be created:

    Sometimes as coders we get too smart and thank "we'll update all of our unescaped data to be escaped and mass replace all functions with sed"

    sed -i s/'addslashes('/'mysql_real_escape_string('/g admin.php

    A good example is the above, why does it break?  Because as we showed earlier typically most coders will do the string manipulation outside of the database call section.


  • Script runs fine from shell but not from cron job in Linux/Unix Debian/Ubuntu/Mint/Centos


    Usually the cause is inexplicable because some things just don't work correctly even when calling all commands by their full path.

    Usually adding the following to your crontab file at the top will fix/solve the issue:

    SHELL=/bin/sh
    PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

     


  • Cannot Read License File cPanel Solution


    This can happen because port 80 is not open, or your license has expired and/or your IP is out of date and also if the license server itself from cPanel is having issues.

    In most cases as long as you have a valid license the following command will solve it:

     /usr/local/cpanel/cpkeyclt
    Updating cPanel license...Done. Update succeeded.
    Building global cache for cpanel...Done

     



    Cannot Read License File
    To access the interface, you must install the license and ensure that the license is active.

        To ensure that the server is licensed, navigate to http://verify.cpanel.net/, and enter the server’s public IP address.
        If the server is licensed, run the /usr/local/cpanel/cpkeyclt command as the root user.
        Make certain that port 80 is open to contact our license server and that your server’s hostname is a FQDN.

    If you do not currently own a license, register at the cPanel Store and request a trial license in the Free Services section.

    You can purchase or lease a license directly from cPanel, or from one of our Partners.

    After you successfully activate the license, reload the page and the message will no longer display.


  • Centos and obfsproxy install errors


    pip install obfsproxy
    /usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
      InsecurePlatformWarning
    You are using pip version 7.1.0, however version 8.1.1 is available.
    You should consider upgrading via the 'pip install --upgrade pip' command.
    Collecting obfsproxy
    /usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
      InsecurePlatformWarning
      Downloading obfsproxy-0.2.13.tar.gz (93kB)
        100% |████████████████████████████████| 94kB 39kB/s
    Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/lib/python2.6/site-packages (from obfsproxy)
    Collecting PyCrypto (from obfsproxy)
      Downloading pycrypto-2.6.1.tar.gz (446kB)
        100% |████████████████████████████████| 446kB 259kB/s
    Collecting Twisted (from obfsproxy)
      Downloading Twisted-16.1.1.tar.bz2 (2.9MB)
        100% |████████████████████████████████| 2.9MB 95kB/s
        Complete output from command python setup.py egg_info:
        Traceback (most recent call last):
          File "<string>", line 20, in <module>
          File "/tmp/pip-build-7aeuJC/Twisted/setup.py", line 57, in <module>
            main(sys.argv[1:])
          File "/tmp/pip-build-7aeuJC/Twisted/setup.py", line 36, in main
            from twisted.python.dist import (
          File "./twisted/__init__.py", line 55, in <module>
            _checkRequirements()
          File "./twisted/__init__.py", line 17, in _checkRequirements
            raise ImportError("Twisted requires Python 2.7 or later.")
        ImportError: Twisted requires Python 2.7 or later.

    #try again after installing these packages
    yum -y install python-crypto gcc make

    pip install obfsproxy
    #same result as before
     ImportError: Twisted requires Python 2.7 or later.

    #there is no python 2.7 package for Centos 6

    #build it ourselves


  • There was a problem importing one of the Python modules required to run yum. The error leading to this problem was:



    There was a problem importing one of the Python modules
    required to run yum. The error leading to this problem was:

       No module named yum

    Please install a package which provides this module, or
    verify that the module is installed correctly.

    It's possible that the above module doesn't match the
    current version of Python, which is:
    2.7.9 (default, Apr 21 2016, 16:51:58)
    [GCC 4.4.7 20120313 (Red Hat 4.4.7-16)]

    If you cannot solve this problem yourself, please go to
    the yum faq at:
      http://yum.baseurl.org/wiki/Faq

     
    Solution

    Revert back to the stock Centos Python and do not ever overwrite the default Python.  You can install a newer python along side but NEVER overwrite the default or it will break things like Python or you will have to manually symlink a lof of things to manually use the old/original python.


  • curl: (35) SSL connect error solution


    curl -k https://somesite.org
    curl: (35) SSL connect error


    The site used to work until I got a new SSL cert
    Updating curl with (yum -y install curl) made it work again.

     


  • Mint/Ubuntu/Debian error twisted/test/raiser.c:4:20: fatal error: Python.h: No such file or directory #include Python.h


    Simple solution install python-dev

    sudo apt-get install python-dev libyaml-dev libpam-dev


  • find: missing argument to '-mtime'


    This is using find and -mtime in Centos Linux, it simply takes "n" (which is a day) as a number and you can specifiy a + or - to say older or less than a certain age.

    # (show everything older than 1 day)

    find . -mtime +1

     


  • openvpn 2.3.10-1.el6 issues auth-env does not work correctly for auth-user-pass-verify


    openvpn 2.3.10-1.el6 issues
     

    in the .conf

    auth-user-pass-verify "passwordcheck $username $password $untrusted_ip"  via-env


    auth-env does not work correctly in OpenVPN 2.3:


    Sat Apr 23 02:30:22 2016 - $username - $untrusted_ip - login failure

    But OpenVPN 2.2 does work as expected.

    It could be that the specified script automatically receives those variables and manually passing them breaks things in OpenVPN 2.3?


  • How to modify HTML/Themeforest Themes to work in any path statically using unix/linux's sed command


    For themes and custom CMS setups, the typical HTML theme is not ready to go at all but here are some common sed commands (search and replace that will get most of them working without breaking as you'd expect).

    The problem is that often the theme directory will be separate from the content and this will break the relative paths that these themes use.

    sed -i s/'href="'/'href="/themes/yourtheme/'/g index.html
    sed -i s/'src="'/'src="/themes/yourtheme/'/g index.html
    sed -i s/"url(.."/"url(/themes/yourtheme/"/g *.css

    In the order of the above

    replace all instances of href=" with href="/themes/yourtheme/

    replace all instances of src=" with src="/themes/yourtheme/

    replace all instances of "url(.. with url(/themes/yourtheme/


  • vps windows 2008 datacenter error code 0xc004c020


    Does anyone have any suggestions on how to handle this error code?  It is for a client who has a Windows 2008 R2 Datacenter License and wants to install virtual instances on the same host.


  • cp copy all contents of directory to another one including hidden files and folders howto


    cp -a /your/source/. /your/dest/

    -a preserves all file atributes and symlinks

    the "." at the end of /source/ includes all hidden files such as .htacess, .bash_history, .ssh etc..

    The / in /dest/ makes sure the contents go into it instead of replacing /dest itself (eg. if you did not have the / at the end).


  • Cannot load /etc/httpd/modules/mod_file_cache.so into server: /etc/httpd/modules/mod_file_cache.so:


    Stopping httpd:                                            [FAILED]
    Starting httpd: httpd: Syntax error on line 73 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/mod_file_cache.so into server: /etc/httpd/modules/mod_file_cache.so: cannot open shared object file: No such file or directory
                                                               [FAILED]
    This is usually because the file is not found in the expected location.   This often happens when moving an httpd.conf between different servers and versions of Apache.  I

    In this case for some reason in a newer version of Apache the module mod_file_cache.so is missing.

    In the case of Centos/RHEL 5 it was, but in RHEL/Centos 6 mod_file_cache is missing according to this from the RHEL website:

    4.4. Apache HTTP Server

    Below is a list of changes for the Apache HTTP Server that are noteworthy when migrating to Red Hat Enterprise Linux 6:
    • The mod_file_cache, mod_mem_cache, and mod_imagemap modules are no longer supported.

    The Solution/Replacement

    mod_disk_cache or mod_cache

    It is as simple as the following in httpd.conf

    CacheEnable disk /
     

    This significantly improves the load times especially when Apache is using ProxyPass as a proxy server in front of the real host.


  • Apache SSL Reverse Proxy Very Slow Solution


    This is a simple fix but not a simple problem and it still doesn't make sense to me.

    But in a nutshell if your target proxy server works fast when accessing directly over SSL then this may be your issue.

    It seems SSL does not play nicely when the target proxy destination/host has a riduculously long key (such as 8192 bits long).  Now this is normally not a problem, in fact the target server could be accessed with hardly any delay directly despite such a long key.

    However when throwing a Proxy and Reverse Proxy with SSL in front of it, made requests take 20-30 seconds (not milliseconds but actual seconds).

    I found many proposed solutions or people saying it should be that slow, but that's just not the case, yes SSL is slower but it shouldn't be this slow.  Disabling or enabling all SSL protocols also made no difference.

    Solution

     

    The problem was instantly solved by replacing the target server's SSL key with a 2048 bit one ( a smaller one). I think this is a big where the SSLProxyPass just can't handle the request properly when the target SSL server has a large public key.

    Additional Performance Improvements


    Use the "CacheEnable disk /" directive in httpd.conf


  • PDF Cannot Open Interactive Solution Ubuntu/Debian/Mint Please wait... If this message is not eventually replaced by the proper contents of the document, your PDF viewer may not be able to display this type of document. You can upgrade to the latest


    Please wait...
    If this message is not eventually replaced by the proper contents of the document, your PDF
    viewer may not be able to display this type of document.
    You can upgrade to the latest version of Adobe Reader for Windows®, Mac, or Linux® by
    visiting http://www.adobe.com/products/acrobat/readstep2.html.
    For more assistance with Adobe Reader visit http://www.adobe.com/support/products/
    acrreader.html.
    Windows is either a registered trademark or a trademark of Microsoft Corporation in the United States and/or other countries. Mac is a trademark
    of Apple Inc., registered in the United States and other countries. Linux is the registered trademark of Linus Torvalds in the U.S. and other
    countries.

    There is a new style of PDFs floating around called "interactive PDFs", and not just fillable forms but more advanced onces that behave more like an HTML and Javascript dynamic form where dropdowns change etc.. This is a horrible idea and mistake because it is very difficult to save and reopen the contents between different Adobe versions and even different Operating Systems (some things just don't save or reopen properly).  Aside from that no standard Linux PDF reader can read these either.

    The only native Linux solution is an old Adobe Acrobat reader from 2013 (they seem to have abandoned Linux for everything) but you can still download and install it here quite easily:

    ftp://ftp.adobe.com/pub/adobe/reader/unix/9.x/9.5.5/enu/

    I used this .deb package for myself


  • Error: database disk image is malformed - yum error solution and fix


    I got this when running yum on a Centos 6 machine:

    Error: database disk image is malformed

    It was easily fixed with the following command:

    yum clean all


  • esniper error on Linux Mint 17.2 Debian/Ubuntu: Cannot connect to URL : SSL connect error: gnutls_handshake() failed: Illegal parameter Retrying... esniper encountered a bug. It looks like your esniper version is not current. You have version 2.28


    Auction 262382440107: Cannot connect to URL : SSL connect error: gnutls_handshake() failed: Illegal parameter
    Retrying...
    esniper encountered a bug.  It looks like your esniper version is not
    current.  You have version 2.28.0, the newest version is 2.31.0.
    Please go to http://esniper.sf.net/ and update your copy of esniper.


  • Nvidia Linux Card not working due to LSI 9200/SAS2008 IRQ conflict


    At first my BIOS said the card may not work right because there is no more option ROM space.

    I disabled the Option ROM for both LSI 1068 and 2008 chipsets, Network Boot ROM and most other PCI slots, Serial Port, etc... and the message went away but the card still does not work properly.

    But it still cannot initialize the card properly (does not work):

    [   33.943272] NVRM: This PCI I/O region assigned to your NVIDIA device is invalid:
    [   33.943272] NVRM: BAR0 is 0M @ 0x0 (PCI:0000:18:00.0)
    [   33.943279] NVRM: The system BIOS may have misconfigured your GPU.
    [   33.943286] nvidia: probe of 0000:18:00.0 failed with error -1
    [   33.943943] NVRM: The NVIDIA probe routine failed for 1 device(s).
    [   33.943953] NVRM: None of the NVIDIA graphics adapters were initialized!
    [   33.943958] [drm] Module unloaded
    [   33.944975] systemd-udevd[2015]: Failed to apply ACL on /dev/dri/card0: No such file or directory
    [   34.281514] NVRM: This PCI I/O region assigned to your NVIDIA device is invalid:
    [   34.281514] NVRM: BAR0 is 0M @ 0x0 (PCI:0000:18:00.0)
    [   34.281521] NVRM: The system BIOS may have misconfigured your GPU.
    [   34.281528] nvidia: probe of 0000:18:00.0 failed with error -1
    [   34.281844] NVRM: The NVIDIA probe routine failed for 1 device(s).
    [   34.281847] NVRM: None of the NVIDIA graphics adapters were initialized!
    [   34.281849] [drm] Module unloaded

    One thing is that lspci lists the SAS2008 card before the graphics card and I have not tried the other PCI x8 port yet:

    0000:00:00.0 RAM memory: NVIDIA Corporation MCP55 Memory Controller (rev a2)
    0000:00:01.0 ISA bridge: NVIDIA Corporation MCP55 LPC Bridge (rev a3)
    0000:00:01.1 SMBus: NVIDIA Corporation MCP55 SMBus Controller (rev a3)
    0000:00:02.0 USB controller: NVIDIA Corporation MCP55 USB Controller (rev a1)
    0000:00:02.1 USB controller: NVIDIA Corporation MCP55 USB Controller (rev a2)
    0000:00:04.0 IDE interface: NVIDIA Corporation MCP55 IDE (rev a1)
    0000:00:05.0 IDE interface: NVIDIA Corporation MCP55 SATA Controller (rev a3)
    0000:00:05.1 IDE interface: NVIDIA Corporation MCP55 SATA Controller (rev a3)
    0000:00:05.2 IDE interface: NVIDIA Corporation MCP55 SATA Controller (rev a3)
    0000:00:06.0 PCI bridge: NVIDIA Corporation MCP55 PCI bridge (rev a2)
    0000:00:06.1 Audio device: NVIDIA Corporation MCP55 High Definition Audio (rev a2)
    0000:00:08.0 Bridge: NVIDIA Corporation MCP55 Ethernet (rev a3)
    0000:00:09.0 Bridge: NVIDIA Corporation MCP55 Ethernet (rev a3)
    0000:00:0a.0 PCI bridge: NVIDIA Corporation MCP55 PCI Express bridge (rev a3)
    0000:00:0d.0 PCI bridge: NVIDIA Corporation MCP55 PCI Express bridge (rev a3)
    0000:00:0f.0 PCI bridge: NVIDIA Corporation MCP55 PCI Express bridge (rev a3)
    0000:00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor HyperTransport Configuration
    0000:00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor Address Map
    0000:00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor DRAM Controller
    0000:00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor Miscellaneous Control
    0000:00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor Link Control
    0000:00:19.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor HyperTransport Configuration
    0000:00:19.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor Address Map
    0000:00:19.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor DRAM Controller
    0000:00:19.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor Miscellaneous Control
    0000:00:19.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor Link Control
    0000:01:05.0 FireWire (IEEE 1394): Texas Instruments TSB43AB22A IEEE-1394a-2000 Controller (PHY/Link) [iOHCI-Lynx]
    0000:05:00.0 Serial Attached SCSI controller: LSI Logic / Symbios Logic SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon] (rev 03)
    0000:18:00.0 VGA compatible controller: NVIDIA Corporation GT218 [GeForce 210] (rev a2)

    0000:18:00.1 Audio device: NVIDIA Corporation High Definition Audio Controller (rev a1)
    0000:2b:00.0 PCI bridge: NEC Corporation uPD720400 PCI Express - PCI/PCI-X Bridge (rev 06)
    0000:2b:00.1 PCI bridge: NEC Corporation uPD720400 PCI Express - PCI/PCI-X Bridge (rev 06)
    0001:40:00.0 RAM memory: NVIDIA Corporation MCP55 Memory Controller (rev a2)
    0001:40:01.0 RAM memory: NVIDIA Corporation MCP55 LPC Bridge (rev a3)
    0001:40:01.1 SMBus: NVIDIA Corporation MCP55 SMBus Controller (rev a3)
    0001:40:0d.0 PCI bridge: NVIDIA Corporation MCP55 PCI Express bridge (rev a3)
    0001:6b:00.0 SCSI storage controller: LSI Logic / Symbios Logic SAS1068E PCI-Express Fusion-MPT SAS (rev 08)

     

    The Solution

     

    I moved the LSI card to another PCI slot and it fixed it, basically if the SAS2008 is shown before the Nvidia card it is game over.  Notice the order after I switched the physical slot (of course if you have no other slots this is a big problem).  Even disabling the Option ROM on the SAS2008 did not fix it until I switched PCI slots:

     

    0000:18:00.0 VGA compatible controller: NVIDIA Corporation GT218 [GeForce 210] (rev a2)
    0000:18:00.1 Audio device: NVIDIA Corporation High Definition Audio Controller (rev a1)
    0000:2b:00.0 PCI bridge: NEC Corporation uPD720400 PCI Express - PCI/PCI-X Bridge (rev 06)
    0000:2b:00.1 PCI bridge: NEC Corporation uPD720400 PCI Express - PCI/PCI-X Bridge (rev 06)
    0001:40:00.0 RAM memory: NVIDIA Corporation MCP55 Memory Controller (rev a2)
    0001:40:01.0 RAM memory: NVIDIA Corporation MCP55 LPC Bridge (rev a3)
    0001:40:01.1 SMBus: NVIDIA Corporation MCP55 SMBus Controller (rev a3)
    0001:40:0a.0 PCI bridge: NVIDIA Corporation MCP55 PCI Express bridge (rev a3)
    0001:40:0d.0 PCI bridge: NVIDIA Corporation MCP55 PCI Express bridge (rev a3)
    0001:45:00.0 Serial Attached SCSI controller: LSI Logic / Symbios Logic SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon] (rev 03)
    0001:6b:00.0 SCSI storage controller: LSI Logic / Symbios Logic SAS1068E PCI-Express Fusion-MPT SAS (rev 08)


  • SAS2008 LSI 9200-E Linux Upgrade Flash Firmware with sas2flash


    Download from here http://www.avagotech.com/products/server-storage/host-bus-adapters/sas-9200-8e#downloads

     

    sudo Installer_P20_for_Linux/sas2flash_linux_i686_x86-64_rel/sas2flash -listall
    LSI Corporation SAS2 Flash Utility
    Version 20.00.00.00 (2014.09.18)
    Copyright (c) 2008-2014 LSI Corporation. All rights reserved

        Adapter Selected is a LSI SAS: SAS2008(B2)  

    Num   Ctlr            FW Ver        NVDATA        x86-BIOS         PCI Addr
    ----------------------------------------------------------------------------

    0  SAS2008(B2)     17.00.01.00    11.00.00.06    07.33.00.00     00:05:00:00

        Finished Processing Commands Successfully.
        Exiting SAS2Flash.



    sudo Installer_P20_for_Linux/sas2flash_linux_i686_x86-64_rel/sas2flash -f UEFI_BSD_P20/uefi_bsd_rel/x64sas2.rom
    LSI Corporation SAS2 Flash Utility
    Version 20.00.00.00 (2014.09.18)
    Copyright (c) 2008-2014 LSI Corporation. All rights reserved

        Adapter Selected is a LSI SAS: SAS2008(B2)  

        Executing Operation: Flash Firmware Image

            ERROR: Firmware Image does not have a Valid Signature.

            Firmware Image Validation Failed!

        Due to error remaining commands will not be executed.
        Unable to Process Commands.
        Exiting SAS2Flash.
     


  • Apache Vhost HowTo Serve Same Content using a different domain and IP


    There are a few ways of doing this and all basically involve using the reverse proxy or "ProxyPass" feature of Apache to accomplish it.

    1.) Create a normal vhost and simply symlink the root directory of the site you want to mirror.

    Eg. originalsite.com and newsite.com

    /vhosts/originalsite.com/httpdocs

    You would symlink like this:

    ln -s /vhosts/originalsite.com/httpdocs vhosts/originalsite.com/

    2.) A flexible way and the best way if you want the mirror/different site to have a different IP address but still serve the same content.


    This would be in your vhost.conf

    ServerName differentdomain.com
    ServerAlias www.differentdomain.com
    ProxyPass / http://yourmainsite.com/
    ProxyPassReverse / http://yourmainsite.com/

    Alternative Way If You Want To Proxy The Same Domain through a different IP (eg. for SEO geolocation purposes you could host all content on a single server and then put proxies in front of it)


    ServerName maindomani.com
    ServerAlias www.maindomain.com
    ProxyPass / http://ip.ip.ip.ip/
    ProxyPassReverse / http://ip.ip.ip.ip/
    ProxyPreserveHost On


    *Make sure you keep the "/" at the end of yourmainsite.com or it will not work properly.
    The above is a preferable for me because it will keep working even if the backend server config or IP changes.

    Caveats Issues To Take Into Account

    When doing this with live, public sites that are indexed in search engines you could get penalized or just plain confuse people so there are issues to handle.

    First of all if you force all requests to go to a certain domain or on SSL, you will have to consider how to handle it by updating your .htaccess

    Also if you don't want to get penalized for duplicate content, you will need to add some code to your site to determine if it is being accessed by the main host name, if not then you should dynamically insert a nofollow and noindex into your <head> section.

    <meta name="robots" content="noindex, nofollow" />

     


  • Check Linux Ubuntu/Debian/Mint Version from Command Line


    To check the version of Ubuntu just use the lsb_release command as shown below and you will be able to see the exact Ubuntu version you have installed.

    lsb_release -a
    No LSB modules are available.
    Distributor ID:    Ubuntu
    Description:    Ubuntu 14.04 LTS
    Release:    14.04
    Codename:    trusty


  • Linksys PAP2T No delay in dialing recommended fast dial plan


    I modified the default to the following for faster local dialing for North American area codes:

    (*xx|[3469]11|0|00 [2-9]xxxxxxS0|[2-9]xxxxxxxxxS0|1xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.)

    This is what I added to the above: "[2-9]xxxxxxxxxS0" so any 9 digit number is dialed instantly xxx-xxx-xxxx (the S0 at the end makes it dial right away).  This makes dialing much quicker and is recommended.

    *Note the [2-9] is necessary otherwise the x matches a 1 so if you dial long distance or a toll-free number it dials the first 10 digits of it and cuts off the last one.

    I finally fixed this after years of slow dialing.  It is also important to note that almost all dialing delay problems are caused by your phone adapter (ATA/VOIP) dial plan and not the server side.  It is also shocking that many companies do not supply their ATAs with proper, fast dial plans at least for local dialing.


  • Linksys PAP2T No Dialtone and Cannot Hear Caller


    I have two lines on my PAP2T and the only thing that solved this problem rather instantly was to change the line with the problem to using port 5060 instead of 5061 (so both lines are using port 5600). Note that I am not forwarding either port in my router either.

    Some of the symptoms of this problem for me were the following:

    • No dialtone or it would take several tries.
    • You answer a call but the phone keeps ringing (takes a few times to answer).
    • You answer a call and cannot hear the caller but they can hear you.

  • iptables: Applying firewall rules: iptables-restore: line 40 failed


     service iptables start 
    iptables: Applying firewall rules: iptables-restore: line 40 failed
                                                               [FAILED]

    vi /etc/sysconfig/iptables
    Line 40 is just:
    COMMIT
     

    It turned out that the correct iptables modules were not enabled for the OpenVZ container, enabling and rebooting the container fixed it.


  • MySQL PHP adding a backslash/escaping apostrophes Solution


    The first thing to diagnose is what is actually in the database (use PHPMyAdmin or CLI).

    You will of course either find that the backslash is either in the database or not.

    If the backslash is in the database you probably have magic quotes gpc/runtime on and/or are calling the "addslashes()" function which does this.

    If you are escaping your data with mysql_real_escape_string() then think again, you probably have magic quotes gpc enabled either in php.ini or in an .htaccess

    Most people will remember to check php.ini, but what if there is an old htaccess or one you did not remember.

    In my case here is what I found:

    php_flag magic_quotes_gpc off
    php_flag magic_quotes_runtime on

    Solution, turn off magic quotes runtime:

    php_flag magic_quotes_gpc off
    php_flag magic_quotes_runtime off

    After that the problem should be solved.

    Here is a thread where I think the answer may very well be mine in many cases.


  • Linksys E2500 DD-WRT Upgrade Instructions and Enabling 5ghz with Tomato Firmware


    1.) Flash directly to this file:

    http://tomato.groov.pl/download/K26RT-N/build5x-132-EN/Linksys%20E-series/tomato-E2500-NVRAM60K-1.28.RT-N5x-MIPSR2-132-Max.zip

    *I was never able to get the larger "Mega" file to work, at least not initially so I recommend the file above.

    To enable 5ghz I had to do the "Clear NVRAM" Option before it was shown.

    2.) Or if you don't need 5ghz (most devices do not support it and cannot see it) I prefer DD-WRT:

    Latest versions here:

     

    ftp://ftp.dd-wrt.com/betas/2016/03-07-2016-r29218/broadcom_K3X/dd-wrt.v24-29218_NEWD-2_K3.x_mega-e2500.bin

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

    dd-wrt upgrade problems when you have more than one unit that you have accessed before from the same browser.
    Clear cache and cookies

    #when upgrading make sure you choose reset to firmware defaults or you may have problems getting web interface after like me!

    I could not even reboot the connection would reset on me until I cleared cache and cookies it seems it was inteferring from another dd-wrt that was on the same

    After upgrading only telnet was up (no port 80 web interface):

    telnet 192.168.1.1
    Trying 192.168.1.1...
    Connected to 192.168.1.1.
    Escape character is '^]'.

    DD-WRT v3.0-r29218 mega (c) 2016 NewMedia-NET GmbH
    Release: 03/07/16

    Linksys E2500 login: root
    Password:
    ==========================================================
     
         ___  ___     _      _____  ______       ____  ___
        / _ / _ ___| | /| / / _ /_  __/ _  __|_  / / _
       / // / // /___/ |/ |/ / , _/ / /   | |/ //_ <_/ // /
      /____/____/    |__/|__/_/|_| /_/    |___/____(_)___/
                                                        
                           DD-WRT v3.0
                       http://www.dd-wrt.com
     
    ==========================================================


    BusyBox v1.24.1 (2016-03-07 09:39:54 CET) built-in shell (ash)

    root@Linksys E2500:~# reboot
    root@Linksys E2500:~# Connection closed by foreign host.

    #this did not fix it so I held the reinitialize button on the bottom of the unit for 10seconds
    #this did fix it with the reset/reinitialize (I should have chose reset to defaults when upgrading)
    I still have this problem even when choosing reset to firmware defaults


  • PAP2T Linksys VOIP strange ring problem


    The problem is that the default of most of these units is set for non-North American phones so the ring sounds like it cuts off and is not  sequential.

    How To Fix the Issue

    Click on "Provisioning" and make sure you are in Advanced mode.

         

    Set the following options:

    Ring Waveform: Sinusoid

    Ring Frequency: 25

    Now your phone will ring normally and properly.


  • A start job is running for /etc/rc.local Compatibility


    According to this and my own experience it is the case that you have started something running in the foreground or a server that does not terminate with a normal rc.d script.  The server will reboot once you kill whatever command or process that is.


  • Linux Mint/Ubuntu/Debian Window Controls Missing Solution


    If Linux Mint 17 or other has no window buttons/controls you can do the following from terminal:

    marco --replace&
    Sometimes it can be fixed if you go to your themes/appearance and choose a new one but in the case like mine where Compiz is installed but not running/working then that fix will not work and will require the marco command above.

    What if you can't type in a terminal Window?

    If you close that terminal window the problem reappears only worse, you will not be able to type anything in any window so you cannot do the fix again.


    Do a Ctrl+Alt+F1 and login by terminal and do the following:

    marco --replace -d :0&  (:0 specifies the X session number).

    To find the Xsession #:
    cat /tmp/.X0-lock
         28520



    ps aux|grep 28520

    user       9725  0.0  0.0  11748  2200 pts/23   S+   00:24   0:00 grep --color=auto 28520
    root     28520  2.3  0.5 476780 181152 tty7    Rs+  Mar13  34:43 /usr/bin/X :0 -audit 0 -auth /var/lib/mdm/:0.Xauth -nolisten tcp vt7

    "/usr/bin/X :0" shows that it is ":0" and that is why we will pass to marco's -d option


  • Linux Mint/Ubuntu/Debian Dual NICs networks problem when enabling and disabling one device


    The Scenario

    You have dual NICs and you disable NIC1 which uses 192.168.1.1 as its gateway.  With NIC2 you enable it/connect it to another network which also has the gateway 192.168.1.1

    Everything will work fine at this point.

    When switching back to NIC1 even with NIC2 disabled and even unplugged, the OS basically can't pick up the new/updated ARP entry of the old device for 192.168.1.1 and perhaps thinks it is a security risk or spoof of some sorts and blocks it all.  You may think there is an issue somewhere else but the syslog shows the issue below.

    Mar 13 23:16:58 mybox dbus[1698]: [system] Rejected send message, 7 matched rules; type="method_return", sender=":1.9" (uid=0 pid=2031 comm="/usr/sbin/dnsmasq --no-resolv --keep-in-foreground") interface="(unset)" member="(unset)" error name="(unset)" requested_reply="0" destination=":1.6" (uid=0 pid=1983 comm="NetworkManager ")
    Mar 13 23:16:59 mybox dbus[1698]: [system] Rejected send message, 7 matched rules; type="method_return", sender=":1.9" (uid=0 pid=2031 comm="/usr/sbin/dnsmasq --no-resolv --keep-in-foreground") interface="(unset)" member="(unset)" error name="(unset)" requested_reply="0" destination=":1.6" (uid=0 pid=1983 comm="NetworkManager ")
    Mar 13 23:17:01 mybox CRON[27807]: pam_unix(cron:session): session opened for user root by (uid=0)
    Mar 13 23:17:01 mybox CRON[27807]: pam_unix(cron:session): session closed for user root
    Mar 13 23:17:16 mybox sudo: pam_unix(sudo:auth): conversation failed
    Mar 13 23:17:16 mybox sudo: pam_unix(sudo:auth): auth could not identify password for [one]
    Mar 13 23:17:24 mybox smbd[21006]: pam_unix(samba:session): session closed for user nobody
    Mar 13 23:17:41 mybox dbus[1698]: [system] Rejected send message, 7 matched rules; type="method_return", sender=":1.9" (uid=0 pid=2031 comm="/usr/sbin/dnsmasq --no-resolv --keep-in-foreground") interface="(unset)" member="(unset)" error name="(unset)" requested_reply="0" destination=":1.6" (uid=0 pid=1983 comm="NetworkManager ")
    Mar 13 23:17:42 mybox dbus[1698]: [system] Rejected send message, 7 matched rules; type="method_return", sender=":1.9" (uid=0 pid=2031 comm="/usr/sbin/dnsmasq --no-resolv --keep-in-foreground") interface="(unset)" member="(unset)" error name="(unset)" requested_reply="0" destination=":1.6" (uid=0 pid=1983 comm="NetworkManager ")

    Solution

     sudo service network-manager restart
    network-manager stop/waiting
    network-manager start/running, process 31647
     


  • Linux Mint Network Manager Connection Disconnect Option Grayed Out


    This is a real pain because I had to manually unplug ethernet cables for network testing or to use an alternate network or guarantee physical access to one network segment is cut off. 

    For some reason this happened after I killed dbus because it was confused and blocking packets thinking they were coming from the wrong interface since eth0 and eth1 both had the same subnet and gateway.

    I eventually did a "service network-manager restart" but the option was still grayed out until hours later the option returned and I could click disconnect.

     


  • Errors were found while checking the disk drive for /.


    I will start by saying I think I know what caused this boot-time error on Linux Mint but should also apply to Debian and Ubuntu.

    I changed my BIOS time to several hours in the past to match the current time, but this caused Linux to think there were incorrect filesystem times. 

    The problem is that it seems when you hit this I am not sure what is happening, it doesn't seem to be doing fsck and hangs without prompting the user. 

    What I have found is that you can usually hit "S" to skip fsck or "Y" to try and fix it and it may boot.  It did in my case but X did not start probably because fsck did not complete.

    So I rebooted and then got the error "Starting Enable Remaining Boot-Time Encrypted Block Devices" but it hangs there too for ages not seeming to do anything.  I think I hit "S" and was given the option to fsck so I said yes and this fixed it all and allowed boot to complete.  I did have to ignore mounting /tmp to get there though.

    Another solution is that for some there are bad fstab entries causing the issue but that was not my case.

    I am fairly comfortable with Linux/Debian but this threw me for a loop, the problem is that it is not obvious what is happening and it is hard to get prompted to fsck, there should be a definitive action or prompt to ask you to fsck or not etc....


  • Contact Us


    Thanks for your e-mail.

    We'll reply as soon as possible to $email
    "; } $form = <<< HTML
    $thanksmessage

    To Contact Us Send Us A Message Below

    E-mail Address

    Your Message

    HTML; ?>

    Contact RealTechTalk


  • Redirect www host to non-www Linux Apache modrewrite


    The below forces all request to your domain to go to the main non-www root domain.

    Updated code:

    RewriteCond %{HTTP_HOST} !=domain.com
    RewriteRule ^(.*)$ https://newurl.com/subdir/$1 [R=301,L]

    If you don't want it to go to a subdirectory:

    RewriteCond %{HTTP_HOST} !=domain.com
    RewriteRule ^(.*)$ https://newurl.com/$1 [R=301,L]

    Bad code:

    This code is bad because the REQUEST_URI is not valid or correct if you want to rewrite to a subdirectory and may cause a // home page etc...

    RewriteCond %{HTTP_HOST} !=domain.com
    RewriteCond %{HTTP_HOST} !=""
    RewriteRule ^ http://domain.com/%{REQUEST_URI} [R=301,L]


  • Force SSL for all URLs Apache htaccess modrewrite


    The best way is as below in .htaccess using modrewrite, any request that is not SSL will be redirected to https://domain.com and the exact same URL

    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://domain.com/$1 [R=301,L]


  • WHMCS CC Encryption Hash Location


    The location of the hash is stored in the configuration.php file and is really a bit of pain to have to pull out everytime but this is how WHMCS stores its encryption key hash to see the full credit card number.


  • Debian Ubuntu Mint Samba Share config file location


    /var/lib/samba/usershares

    But note that it is just simple file sharing if you need directory mask, create mask etc... you still need to edit the smb.conf file to create your share.

    Here is an example file:

    comment=
    usershare_acl=S-1-1-0:R,S-1-22-1-1000:F
    guest_ok=y
    sharename=BabyPhotos


  • Debian Linux Ubuntu Mint connect to pptp from terminal bash shell




    apt-get install pptp-linux
    echo "yourvpnusername * yourpasspass *" >> /etc/ppp/chap-secrets


    vi /etc/ppp/peers/provpnaccounts.com

    enter (ignore the lines):

    ============
    pty "pptp server.provpnaccounts.com --nolaunchpppd"
    name testuser
    #remotename PPTP
    require-mppe-128
    file /etc/ppp/options.pptp

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

    #add this to /etc/ppp/ip-up

    Where eth0 is your NIC and ppp0 is the name of your VPN connection

    route del default eth0
    route add default dev ppp0

    Connect:
    pppd call provpnaccounts.com

    Disconnect:
    killall pppd

    Customize it

    What I do is add the following to /etc/rc.local

    pppd call provpnaccounts.com

    Make it so the VPN reconnects by itself:

    vi /etc/ppp/options

    persist

    To make it even more fun let's make it so the system can only connect to the outside world if it is connected to the VPN

     


  • Linux Debian/Ubuntu/Centos How To Force Internet Traffic Through PPTP L2TP OpenVPN Account Only


    The following assumes the computer is local/physical to you and/or it always has a LAN IP so it can be accessed on site without having a default gateway.

    The key to this is not to set a default gateway for your computer or you can set a script on boot or other time to delete the gateway (where eth0 is the NIC you are using):

    route del default eth0

    50.80.20.2 is the VPN server you connect to

    192.168.1.1 is your LAN default gateway/router

    ip route add 50.80.20.2 via 192.168.1.1

    The routing command above makes it so the only external traffic not passing through the VPN is the connection to the IP of your VPN (necessary of course to be able to establish the connection).

    With the above even if you lose the connection to your VPN no traffic can reach the outside without being connected to the VPN.


  • vi Debian Linux Ubuntu Mint arrow key problem linux ssh bash shell terminal


    Debian/Ubuntu vi keyboard problem, up and down arrows do not work and instead make an A (Up), B (Down), C (Right) or D(Left).

    The working solution

    (you could also add the set nocompatible to /etc/vim/vimrc to make it system wide-will not be applied until reboot I believe):

    echo "set nocompatible" > ~/.vimrc

    some suggest entering this in vi but it did not work for me:

    :set term=cons25
    The arrow keys work but then Home and End produce garbage characters
     

     


  • Is this partition table correct starting and ending partition on same cylinder?


       Device Boot      Start         End      Blocks   Id  System
    /dev/sdc1               1         132     1060256+  fd  Linux raid autodetect
    Partition 1 does not end on cylinder boundary.
    Partition 1 does not start on physical sector boundary.
    /dev/sdc2             132        2744    20972860   fd  Linux raid autodetect
    /dev/sdc3            2744       60801   466350884+  fd  Linux raid autodetect

    Notice we have partitions ending and starting on the same cylinder.  I cannot duplicate this in fdisk as it will say the value is out of range and not allowed.


  • Vbox Cannot register the hard disk


    Cannot register the hard disk '/media/Debian8.vdi' {d01efabc-aacf-4614-b29c} because a hard disk '/home/VirtualBox VMs/Debian/Debian8.vdi' with UUID {d01efabc-aacf-4614-b29} already exists.

    This is what happens if you move the VDI to another location.
    The easiest way is to delete/remove the machine from VBOX and then reimport it from the new location.


  • Mount a SMB Samba share in fstab Linux Debian/Ubuntu/Centos


    Add the following to fstab where 192.168.1.125/Media is the samba share and where /home/homeuser/Downloads is where you want to mount.

    Change user and pass to what is needed (if no pass is required it still works fine with the below).

    //192.168.1.125/Media /home/homeuser/Downloads cifs        user=guest,pass=bla 0 0


    mount: wrong fs type, bad option, bad superblock on //192.168.1.125/Media,
           missing codepage or helper program, or other error
           (for several filesystems (e.g. nfs, cifs) you might
           need a /sbin/mount.<type> helper program)

           In some cases useful info is found in syslog - try
           dmesg | tail or so.


    *Make sure you install cifs-utils or equivalent so you have the mount.cifs binary


  • Avocent 8020 KVM Java Icedtea Viewer "Network Connect Error" Solution


    It seems every other updated version of Java or Icedtea breaks things and I will save the frustration of Java for another post.

    To fix this error you need to edit the java.security file manually (I recommend updating all in case there is any confusion about what version is being executed):

    Solution

    sudo vi /usr/lib/jvm/*/jre/lib/security/java.security

    Notice the * (wildcard) this will have vi open up every version's java security for you to change or you could also try the most recent version.

    Make the following line look like this:

    jdk.tls.disabledAlgorithms=SSLv3, RC4

    After that the error was fixed and finally the KVM viewer worked again (I wish you could just use VNC or other more reliable ways).


  • tsclient (Terminal Server RDP Client) missing in Debian, Ubuntu, Linux Mint


    This was a horrible shock after upgrading from Ubuntu 9 to Linux Mint 17 and I found that the last distro to support tsclient was Debian Squeeze.

    For some reason it has disappeared for a long time and the new options such as rdesktop and gnome-rdp do not have any start menu entry and just aren't done as well as tsclient.

    Fortunately there is a solution:

    tsclient surprisingly can be downloaded as a direct .deb package and it fails with some various dependency errors when installing but works just fine.

    You can download it here: https://packages.debian.org/squeeze/amd64/tsclient/download


  • Centos Add Multiple IP Addresses in a range without manually setting each static IP


    This is actually very simple and this example assumes your network device is "eth0"

    In Centos your network config would be the following: /etc/sysconfig/network-scripts/ifcfg-eth0

    Take the same path and just add a "-range0"

    So to add a range create the following file: /etc/sysconfig/network-scripts/ifcfg-eth0-range0

    IPADDR_START=192.168.1.50

    IPADDR_END=192.168.1.99

    CLONENUM_START=0

    Obviously change the IPADDR_START and IPADDR_END to suit your subnet and actual range you are looking for.

    This is much easier than having eth0:0 to eth:50 etc... set manually or


  • grub> setup (hd1) Checking if "/boot/grub/stage1" exists...


    It freezes on "grub> setup (hd1)
    Checking if "/boot/grub/stage1" exists..."

    Basically it looks like the partiion table is corrupt or the data/files are not there.


  • Centos installing grub problems suspect gpt problem


    grub> root (hd0,0)
    root (hd0,0)
     Filesystem type is ext2fs, partition type 0xfd
    grub> setup (hd0)
    setup (hd0)


    But if you do:
    root (hd1,0)
    setup (hd1)

    it does work, I think hd0/sda had a GPT partition that was not removed properly (what I did was just dd bs=512 count=1 the partition table from another drive since the partition table should be identical).

     Checking if "/boot/grub/stage1" exists... no
     Checking if "/grub/stage1" exists... yes
     Checking if "/grub/stage2" exists... yes
     Checking if "/grub/e2fs_stage1_5" exists... yes
     Running "embed /grub/e2fs_stage1_5 (hd1)"...  27 sectors are embedded.
    succeeded
     Running "install /grub/stage1 (hd1) (hd1)1+27 p (hd1,0)/grub/stage2 /grub/grub.conf"... succeeded
    Done.

    ==============
    Checking for gpt with gdisk:

    GPT fdisk (gdisk) version 0.8.10

    Partition table scan:
      MBR: MBR only
      BSD: not present
      APM: not present
      GPT: not present


    ***************************************************************
    Found invalid GPT and valid MBR; converting MBR to GPT format
    in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
    typing 'q' if you don't want to convert your MBR partitions
    to GPT format!
    ***************************************************************


    ===========

    gdisk /dev/sda
    GPT fdisk (gdisk) version 0.8.10

    Partition table scan:
      MBR: MBR only
      BSD: not present
      APM: not present
      GPT: not present


    ***************************************************************
    Found invalid GPT and valid MBR; converting MBR to GPT format
    in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
    typing 'q' if you don't want to convert your MBR partitions
    to GPT format!
    ***************************************************************


    Command (? for help): p
    Disk /dev/sda: 976773168 sectors, 465.8 GiB
    Logical sector size: 512 bytes
    Disk identifier (GUID): 4DE51E1D-DC93-43EC-B670-44A0A9FEE114
    Partition table holds up to 128 entries
    First usable sector is 34, last usable sector is 976773134
    Partitions will be aligned on 8-sector boundaries
    Total free space is 5099 sectors (2.5 MiB)

    Number  Start (sector)    End (sector)  Size       Code  Name
       1              63         2120575   1.0 GiB     FD00  Linux RAID
       2         2120576        44066295   20.0 GiB    FD00  Linux RAID
       3        44066296       976768064   444.7 GiB   FD00  Linux RAID

    Command (? for help): g
    b    back up GPT data to a file
    c    change a partition's name
    d    delete a partition
    i    show detailed information on a partition
    l    list known partition types
    n    add a new partition
    o    create a new empty GUID partition table (GPT)
    p    print the partition table
    q    quit without saving changes
    r    recovery and transformation options (experts only)
    s    sort partitions
    t    change a partition's type code
    v    verify disk
    w    write table to disk and exit
    x    extra functionality (experts only)
    ?    print this menu

    Command (? for help): r

    Recovery/transformation command (? for help): p
    Disk /dev/sda: 976773168 sectors, 465.8 GiB
    Logical sector size: 512 bytes
    Disk identifier (GUID): 4DE51E1D-DC93-43EC-B670-44A0A9FEE114
    Partition table holds up to 128 entries
    First usable sector is 34, last usable sector is 976773134
    Partitions will be aligned on 8-sector boundaries
    Total free space is 5099 sectors (2.5 MiB)

    Number  Start (sector)    End (sector)  Size       Code  Name
       1              63         2120575   1.0 GiB     FD00  Linux RAID
       2         2120576        44066295   20.0 GiB    FD00  Linux RAID
       3        44066296       976768064   444.7 GiB   FD00  Linux RAID

    Recovery/transformation command (? for help): ?
    b    use backup GPT header (rebuilding main)
    c    load backup partition table from disk (rebuilding main)
    d    use main GPT header (rebuilding backup)
    e    load main partition table from disk (rebuilding backup)
    f    load MBR and build fresh GPT from it
    g    convert GPT into MBR and exit
    h    make hybrid MBR
    i    show detailed information on a partition
    l    load partition data from a backup file
    m    return to main menu
    o    print protective MBR data
    p    print the partition table
    q    quit without saving changes
    t    transform BSD disklabel partition
    v    verify disk
    w    write table to disk and exit
    x    extra functionality (experts only)
    ?    print this menu

    Recovery/transformation command (? for help): g

    MBR command (? for help): g
    a    toggle the active/boot flag
    c    recompute all CHS values
    l    set partition as logical
    o    omit partition
    p    print the MBR partition table
    q    quit without saving changes
    r    set partition as primary
    s    sort MBR partitions
    t    change partition type code
    w    write the MBR partition table to disk and exit

    MBR command (? for help): g
    a    toggle the active/boot flag
    c    recompute all CHS values
    l    set partition as logical
    o    omit partition
    p    print the MBR partition table
    q    quit without saving changes
    r    set partition as primary
    s    sort MBR partitions
    t    change partition type code
    w    write the MBR partition table to disk and exit

    MBR command (? for help): w

    Converted 3 partitions. Finalize and exit? (Y/N): y
    Warning: The kernel is still using the old partition table.
    The new table will be used at the next reboot.
    GPT data structures destroyed! You may now partition the disk using fdisk or
    other utilities.

    ===========
    I can even do
    root (hd1,0)
    setup (hd0) and it will work.........but not hd0,0 even though both are in the same RAID array on the same partition


  • bash scripting for loop set number of iterations


    A handy trick in bash that can be adapted to many useful tasks:

    for i in {1..99}; do

    echo $i

    done

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99


  • linux bash mass rename tool Centos/Debian/Ubuntu


    Say you have a bunch of files like this:

    file-01.jpg

    file-02.jpg

    ...............

    What if you want to mass rename them?

    the rename tool can work just like sed

    For Debian based distros:

    Note "file" is what we search for and "newname" is what we replace it with, so substitute according to your requirements.

    rename s/file/newname/ name-file-*.jpg

    For RHEL Centos:

    rename file newname file-*
     


  • Cannot get mono to work properly on Linux Mint


     

    mono/wine not working in Ubuntu/Linux Mint/Debian:



    The assembly mscorlib.dll was not found or could not be loaded.
    It should have been installed in the `/usr/lib/mono/2.0/mscorlib.dll' directory.

     

    solution:

    sudo apt-get install mono-complete
     

     

     Problems:

    mono does not work well for even simple things like a Winrar self extracting .exe file:

    File does not contain a valid CIL image.

    Try wine (you can never get it to work or install)



    sudo apt-get install wine1.6-amd64
    Reading package lists... Done
    Building dependency tree      
    Reading state information... Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help resolve the situation:

    The following packages have unmet dependencies:
     wine1.6-amd64 : Depends: libopencl-1.1-1
                     Depends: wine1.6:any (= 1:1.6.2-0ubuntu4)
    E: Unable to correct problems, you have held broken packages.
    user@box:~$

    sudo apt-add-repository ppa:ubuntu-wine/ppa
    sudo apt-get update

    sudo apt-get install wine1.8-amd64
    Reading package lists... Done
    Building dependency tree      
    Reading state information... Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help resolve the situation:

    The following packages have unmet dependencies:
     wine1.8-amd64 : Depends: libopencl-1.1-1
                     Depends: wine1.8:any (= 1:1.8.0-0ubuntu1)
    E: Unable to correct problems, you have held broken packages.


    nvidia-libopencl1-346-updates


  • CPanel SNI error


    Your server does not support SNI, so all of your SSL websites must use the same SSL certificate. An update to the certificate on an existing SSL website will affect all of your SSL websites, and new SSL websites must use the currently installed certificate.


  • Bing/Microsoft Ads flex.atdmt.com causing problems for ad tracking and site loading


    I was asked to troubleshoot why a site wasn't loaded or responding properly, it turned out they were using some old javascript tracker from Bing/Microsoft that is no longer valid or working.  You have to wait forever for it to time out but it really did disrupt the functionality of a very important site:

    flex.atdmt.com

    If you have the above code in javascript on your site remove or comment it out.


  • imagemagick converting jpg images to pdf file size too large


    If the file size is too large you need to resize them on the fly:

    convert -resize 25% *.jpg output.pdf

    The resize flag takes a % I have tried without and it seems to take it as pixels and becomes way too small.

    You can also play with the "-quality 25" flag to decrease file size even more.


  • convert imagemagick pdf to jpg is too small when converting solution


    It is a common issue and here is the solution (increase the density/dpi):

    convert -density 120 some.pdf output.jpg

    You will need to play with the density setting to get the perfect file size and resolution.

    If you want a smaller file you can always use the "-quality" switch and eg. -quality 25 would be 25%/100 quality


  • How To Record Your Screen with Linux




    Istanbul:


    At least in Linux Mint the latest 17.2 version Istanbul freezes when "In process of saving to Disk" even with the workaround of not having Sound recording enabled.  It looks like a great app but bugs like this seem to have plague it for over 8 years!

    Kazam:

    This little app works great, its only bug is that when you try to tell it to record a window or area it puts a gray cover over the whole screen so you have to guess where the window is and hope you clicked right.  It seems again like another bug but is a minor issue since it actually records and works quite well otherwise.

     


  • Virtualbox Error


    In plain English this happens after you upgrade VBOX and it rebuilds kernel modules based on a newer kernel than you are running (eg. you upgraded your kernel but haven't booted into it).

    It is too bad there is not a standard work around that would allow it to realize this and keep old kernel modules and use them if it detects your current kernel is older than the most recently build modules.

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

    RTR3InitEx failed with rc=-1912 (rc=-1912)

    The VirtualBox kernel modules do not match this version of VirtualBox. The installation of VirtualBox was apparently not successful. Executing

    '/etc/init.d/vboxdrv setup'

    may correct this. Make sure that you do not mix the OSE version and the PUEL version of VirtualBox.


    Result Code:
    NS_ERROR_FAILURE (0x80004005)
    Component:
    Machine
    Interface:
    IMachine {480cf695-2d8d-4256-9c7c-cce4184fa048}
     


  • How to get/display full path to file in Linux/Unix


    It is just the readlink command with the -f switch and it will display the full path, very handy to save time when you want to copy and paste the location of a file or script etc..

     readlink -f updatehtaccess.sh
    /var/lib/updatehtaccess.sh

     


  • kernel:[14277.697049] EDAC MC0: UE row 4, channel-a= 0 channel-b= 1 labels "-": (Branch=0 DRAM-Bank=0 RDWR=Read RAS=7048 CAS=0 FATAL Err=0x4 (>Tmid Thermal event with intelligent throttling disabled))


    I am getting this error:

     kernel:[14277.697049] EDAC MC0: UE row 4, channel-a= 0 channel-b= 1 labels "-": (Branch=0 DRAM-Bank=0 RDWR=Read RAS=7048 CAS=0 FATAL Err=0x4 (>Tmid Thermal event with intelligent throttling disabled))
     

    But many people believe this is a bug/false message and the server is running stably.


  • CPanel Cannot Login HTTP error 401 You do not have permission to access this page.


    HTTP error 401

    You do not have permission to access this page.

    It was actually a bad hosts entry or where your IP was somehow added to /etc/hosts.deny this is what you will see from CPanel


  • Failed to open a session for the virtual machine XPCB. Implementation of the USB 2.0 controller not found! Because the USB 2.0 controller state is part of the saved VM state, the VM cannot be started. To fix this problem, either install the 'Oracle V


    I have guest extensions installed but still getting the error:


    Failed to open a session for the virtual machine XPCB.
    Implementation of the USB 2.0 controller not found!
    Because the USB 2.0 controller state is part of the saved VM state, the VM cannot be started. To fix this problem, either install the 'Oracle VM VirtualBox Extension Pack' or disable USB 2.0 support in the VM settings (VERR_NOT_FOUND).

    This seems to stem more from moving an old VM from an older VBOX to a newer version (because freshly installed VMs could use USB just fine).  The only way I got it working was to remove guest additions, reboot, reinstall guest additions and then re-enable USB and it worked just fine after.  If you have migrated your VM to a newer version of VBOX host machine, then don't believe anyone who says "just install guest additions" especially if they are already installed.


  • OpenVZ how to enable FUSE in the container


    vzctl set 2 --devnodes fuse:rw --save

    Where "2" is the ctid


  • How to manually mount Linux disk image partition without using losetup


    In this case we want to mount partition #2

    fdisk -lu Centos-6.6-x86_64.img
    You must set cylinders.
    You can do this from the extra functions menu.

    Disk Centos-6.6-x86_64.img: 0 MB, 0 bytes
    255 heads, 63 sectors/track, 0 cylinders, total 0 sectors
    Units = sectors of 1 * 512 = 512 bytes

                    Device Boot      Start         End      Blocks   Id  System
    Centos-6.6-x86_64.img1            2048     1026047      512000   82  Linux swap / Solaris
    Partition 1 does not end on cylinder boundary.
    Centos-6.6-x86_64.img2   *     1026048    10485759     4729856   83  Linux
    Partition 2 does not end on cylinder boundary.


    I want to mount partition 2 which starts at 1026048.

    Specify offset as: 1026048 * 512 = 525336576

    How to mount partition number 2

    mount -t ext4 -o loop,offset=525336576 Centos-6.6-x86_64.img /mnt


  • Debian 8 Jessie in Linux OpenVZ Container does not work on Centos host


    It sounds like this is corrected in later versions of the OpenVZ kernel but I am not sure, it may also be that a much newer kernel is needed and Centos may not have a recent enough kernel.

    *Debain 7.0 however does work fine as a temporary fix or work around.

    Debian 8 OpenVZ no IP and networking not working:

    lo        Link encap:Local Loopback 
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

    venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 
              BROADCAST POINTOPOINT NOARP  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)



    service networking restart
    Failed to get D-Bus connection: No such file or directory


  • bash script Get Model and Serial Number of All Hard Disks in Server on Linux


    for disk in `fdisk -l|grep "Disk /dev"|awk '{print $2}'|sed s/://g`; do
    echo "$disk" && smartctl -d ata -a "$disk" -T permissive|grep -iE 'Device Model:|Serial Number:'
    echo "---------------"
    done

    *Make sure you have smartctl from smartmon tools installed


      Sample output:

    /dev/sdc
    Device Model:     ST3750640NS
    Serial Number:    5QD3MZBP
    ---------------
    /dev/sdb
    Device Model:     ST3750640NS
    Serial Number:    5QD3RCTL
    ---------------
    /dev/md0
    Device Model:     [No Information Found]
    Serial Number:    [No Information Found]
    ---------------
    /dev/md2
    Device Model:     [No Information Found]
    Serial Number:    [No Information Found]
    ---------------
    /dev/md1
    Device Model:     [No Information Found]
    Serial Number:    [No Information Found]


  • How to scp transfer a file in Linux with spaces


    Say you have a path like this "/some/path/here with spaces/".  If you try to transfer it you will get a message along the lines of:

    scp -rp 192.168.0.12:"/some/path/here space/" .

    scp: /some/path/here: No such file or directory
    scp: space: No such file or directory

    You can escape each space but what a pain that is especially if you have multiple spaces in the path.

    The simplest way is to use the following instead:


    scp -rp 192.168.0.12:'"/some/path/here space/"' .

    or


    scp -rp 192.168.0.12:'"/some/path/here space/"' .

    As you can see we are basically padding it with a '" or "' on either side to make the shell interpret it as a literal instead of thinking the space is where the path name ends.


  • unfortunately lg keyboard has stopped - LG Phone Keyboard Issue


    This seems to effect many other LG phones , specifically their keyboard app and basically makes your phone unusable where you cannot use the keyboard because that message keeps popping up and the keyboard will not load.

    unfortunately lg keyboard has stopped solution:

    1. Go to your settings and manage apps and find the LG Keyboard app:

    2. Stop it from running, delete all data and clear all cache.

    After the above you will probably find that your keyboard responds better and more quickly too.


  • Location of cPanel apache access logs


    It is very handy to remember this and nice that the logs for all domains are in a central location:

    /usr/local/apache/domlogs


  • Windows showing wrong drive size after resizing the VPS/image or cloning howto fix


    1, Enter the command prompt

    Start -> cmd

    2. Start diskpart

    diskpart

    3. Find the drive that has the wrong size

    list volume

    4. Select the volume (in this example we use volume 2)

    select volume 2

    5. Extend the volume

    extend filesystem

    *Note the "extend filesystem" and not just extend, this is because our space is allocated and just not correctly reported to the NTFS system so it is necessary or you will ge the failure below"

    result:

    Diskpart successfully extended the volume

    failure:

    Virtual Disk Service error:

    The size of the extent is less than the minimum

    *I don't know why the above error happens,normally it is if the partition cannot extend that far because the next partition or volume is next but this is not the case on this system.

     


  • How to manually save bash history


    This is useful in the case you are not properly logged in via an OpenVZ session or even a normal SSH session that you fear may go down (if the connection is broken the history is not saved).

    Save your bash_history like this:

    history -w ~/.bash_history

    You can always change the above to another file eg /tmp/somefile.txt or ~/someotherfile.txt


  • Linux how to combine images into a single one using convert from ImageMagick


    convert -append file1.jpg file2.jpg output.jpg

    The above is all there is to it.

    file1.jpg and file2.jpg are the ones to combine (the order is used) and output.jpg is the combined image.


  • Mysql how to backup/copy row from one table to another


    INSERT INTO articles_backup
    SELECT * FROM articles WHERE articleID="118"

    It is so simple we always recommend people do this when updating their database so you always have a backup.

    The above inserts the copy into the table "articles_backup" which has an identical structure.

    It selects the entry from "articles" where the articleID is "118" but of course you can adapter yours to whatever the situation is.


  • mdadm real example of recovery and rebuilding of the array on Centos 6


    In this example we have 2 drives in a RAID array and /dev/sdb is the one that failed.  /dev/sda1 is also the /boot partition which we tell grub to install on /dev/sdb eg install root (hd0,0) /dev/sda1 on the new drive /dev/sdb (hd1)
     

    First copy the partition table from /dev/sda to /dev/sdb

    dd if=/dev/sda of=/dev/sdb bs=512 count=1

    Run partprobe to detect the new partition table
    partprobe

    Add the partitions of the replacement drive /dev/sdb back to the array


    mdadm --manage /dev/md0 -a /dev/sdb1
    mdadm --manage /dev/md1 -a /dev/sdb2
    mdadm --manage /dev/md2 -a /dev/sdb3

     

    Install grub on the new drive
    grub
    root (hd0,0)
    setup (hd1)


  • Microsoft Access .mdb files how to view them on Linux Ubuntu/Debian


    The package "mdbtools-gmdb" works very well but I was not able to get the forms working that were part of the .mdb but you can at least view all of the rows and Export to CSV


  • Centos 6 how to guide convert LVM non-RAID into mdadm 1/10 RAID array live without reinstalling


    Here is the scenario you or a client have a remote machine that was installed as a standard/default minimal Centos 6.x machine on a single disk with LVM for whatever reason.  Often many people do not know how to install it to a RAID array so it is common to have this problem and why reinstall if you don't need to?  In some cases on a remote system you can't easily reinstall without physical or KVM access.

    So in this case you add a second physical or disk or already have one and want to make it a RAID array but don't want much downtime, dataloss etc...

    In this tutorial we will show you how to turn this default install into a mdadm ARRAY with RAID10 on the / and a RAID 1 /boot and RAID 1 SWAP all without any downtime or other intervention (assuming all goes well and all steps are followed) :)

    Install rsync:

    yum -y install rsync

    #disable selinux! otherwise you won't be able to login (it will logout #instantly and show this in the logs

    sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

    centos cannot login session closed immediately


    login: pam_unix(login:session): session opened for user root by LOGIN(uid=0)
    login: ROOT LOGIN ON tty1
    pam_unix(login:session): session closed for user root

    Step 1.)
    Create your partitions on the second disc (I assume your second disc is /dev/sdb).
    md0=/dev/sdb1 is a 500M /boot partition
    md1=/dev/sdb2 is a 1024M swap partition
    md2=/dev/sdb3 is the / partition

    fdisk /dev/sdb

    WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
             switch off the mode (command 'c') and change display units to
             sectors (command 'u').

    Command (m for help): n
    Command action
       e   extended
       p   primary partition (1-4)
    p
    Partition number (1-4): 1
    First cylinder (1-652, default 1):
    Using default value 1
    Last cylinder, +cylinders or +size{K,M,G} (1-652, default 652): +500M

    Command (m for help): n
    Command action
       e   extended
       p   primary partition (1-4)
    p
    Partition number (1-4): 2
    First cylinder (66-652, default 66):
    Using default value 66
    Last cylinder, +cylinders or +size{K,M,G} (66-652, default 652): +1024M

    Command (m for help): n
    Command action
       e   extended
       p   primary partition (1-4)
    p
    Partition number (1-4):
    Value out of range.
    Partition number (1-4): 3
    First cylinder (198-652, default 198):
    Using default value 198
    Last cylinder, +cylinders or +size{K,M,G} (198-652, default 652):
    Using default value 652

    Command (m for help): t
    Partition number (1-4):
    Value out of range.
    Partition number (1-4): 1
    Hex code (type L to list codes): fd
    Changed system type of partition 1 to fd (Linux raid autodetect)

    Command (m for help): t
    Partition number (1-4): 2
    Hex code (type L to list codes): fd
    Changed system type of partition 2 to fd (Linux raid autodetect)

    Command (m for help): t
    Partition number (1-4): 3
    Hex code (type L to list codes): fd
    Changed system type of partition 3 to fd (Linux raid autodetect)

    Command (m for help): p

    Disk /dev/sdb: 5368 MB, 5368709120 bytes
    255 heads, 63 sectors/track, 652 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x0008b7d9

       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1               1          65      522081   fd  Linux raid autodetect
    /dev/sdb2              66         197     1060290   fd  Linux raid autodetect
    /dev/sdb3             198         652     3654787+  fd  Linux raid autodetect

    Command (m for help): w
    The partition table has been altered!

    Calling ioctl() to re-read partition table.
    Syncing disks.

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

    Step 2.) Create RAID arrays
    md0=/dev/sdb1 is a 500M /boot partition
    md1=/dev/sdb2 is a 1024M swap partition
    md2=/dev/sdb3 is the / partition

    mdadm --create /dev/md0 --metadata=0.90 --level=1 --raid-devices=2 /dev/sdb1 missing
    mdadm --create /dev/md1 --level=10 --raid-devices=2 --layout=f2 /dev/sdb2 missing
    mdadm --create /dev/md2 --level=10 --raid-devices=2 --layout=f2 /dev/sdb3 missing


    [root@localhost ~]# mdadm --create /dev/md0 --metadata=0.90 --level=1 --raid-devices=2 /dev/sdb1 missing
    mdadm: array /dev/md0 started.
    [root@localhost ~]# mdadm --create /dev/md1 --level=10 --raid-devices=2 --layout=f2 /dev/sdb2 missing
    mdadm: Defaulting to version 1.2 metadata
    mdadm: array /dev/md1 started.
    [root@localhost ~]# mdadm --create /dev/md2 --level=10 --raid-devices=2 --layout=f2 /dev/sdb3 missing
    mdadm: Defaulting to version 1.2 metadata
    mdadm: array /dev/md2 started.

    [root@localhost ~]# cat /proc/mdstat
    Personalities : [raid1] [raid10]
    md2 : active raid10 sdb3[0]
          3652608 blocks super 1.2 512K chunks 2 far-copies [2/1] [U_]
         
    md1 : active raid10 sdb2[0]
          1058816 blocks super 1.2 512K chunks 2 far-copies [2/1] [U_]
         
    md0 : active raid1 sdb1[0]
          521984 blocks [2/1] [U_]

    Step 3.) Make filesystems on RAID arrays
    md0=/dev/sdb1 is a 500M /boot partition
    md1=/dev/sdb2 is a 1024M swap partition
    md2=/dev/sdb3 is the / partition
         

    mkfs.ext4 /dev/md0
    mke2fs 1.41.12 (17-May-2010)
    Filesystem label=
    OS type: Linux
    Block size=1024 (log=0)
    Fragment size=1024 (log=0)
    Stride=0 blocks, Stripe width=0 blocks
    130560 inodes, 521984 blocks
    26099 blocks (5.00%) reserved for the super user
    First data block=1
    Maximum filesystem blocks=67633152
    64 block groups
    8192 blocks per group, 8192 fragments per group
    2040 inodes per group
    Superblock backups stored on blocks:
        8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409

    Writing inode tables: done                           
    Creating journal (8192 blocks): done
    Writing superblocks and filesystem accounting information: done

    This filesystem will be automatically checked every 31 mounts or
    180 days, whichever comes first.  Use tune2fs -c or -i to override.
    [root@localhost ~]# mkswap /dev/md1
    mkswap: /dev/md1: warning: don't erase bootbits sectors
            on whole disk. Use -f to force.
    Setting up swapspace version 1, size = 1058812 KiB
    no label, UUID=821efb1f-95cd-4aab-803b-e26d9fa6a920
    [root@localhost ~]# mkfs.ext4
    mkfs.ext4     mkfs.ext4dev 
    [root@localhost ~]# mkfs.ext4 /dev/md2
    mke2fs 1.41.12 (17-May-2010)
    Filesystem label=
    OS type: Linux
    Block size=4096 (log=2)
    Fragment size=4096 (log=2)
    Stride=128 blocks, Stripe width=256 blocks
    228480 inodes, 913152 blocks
    45657 blocks (5.00%) reserved for the super user
    First data block=0
    Maximum filesystem blocks=935329792
    28 block groups
    32768 blocks per group, 32768 fragments per group
    8160 inodes per group
    Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736

    Writing inode tables: done                           
    Creating journal (16384 blocks): done
    Writing superblocks and filesystem accounting information: done

    This filesystem will be automatically checked every 37 mounts or
    180 days, whichever comes first.  Use tune2fs -c or -i to override.



    Step 4.) Create chroot environment/mount RAID arrays

    md0=/dev/sdb1 is a 500M /boot partition
    md1=/dev/sdb2 is a 1024M swap partition
    md2=/dev/sdb3 is the / partition


    mount /dev/md2 /mnt
    mkdir /mnt/boot
    mount /dev/md0 /mnt/boot/

    #time to rsync all your files
    rsync -Phaz / --exclude=/mnt --exclude=/sys/* --exclude=/proc/* /mnt

    sent 243.20M bytes  received 377.68K bytes  1.87M bytes/sec
    total size is 635.16M  speedup is 2.61


    #setup chroot environment

    for mount in dev sys proc; do
    mount -o bind /$mount /mnt/$mount
    done

    #chroot
    chroot /mnt

    #setup mdadm.conf
    for md in 0 1 2; do
    mdadm --detail --brief /dev/md$md >> /etc/mdadm.conf
    done

    #create new initrd with correct mdadm info
    dracut -f

    #get UUID of / for the next steps
    blkid /dev/md2
    /dev/md2: UUID="0e68a84d-cb61-4856-b23b-c2e2aa8294fb" TYPE="ext4"

    #backup grub menu.lst
    cp /boot/grub/menu.lst /boot/grub/menu.lst-before-raid

    #disable selinux just in case
    sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

    #change this:
    default=0
    timeout=5
    splashimage=(hd0,0)/grub/splash.xpm.gz
    hiddenmenu
    title CentOS (2.6.32-431.el6.x86_64)
            root (hd0,0)
            kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=VolGroup/lv_root  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
            initrd /initramfs-2.6.32-431.el6.x86_64.img

    #

    #to:
    default=0
    timeout=5
    #splashimage=(hd0,0)/grub/splash.xpm.gz
    hiddenmenu
    title CentOS (2.6.32-431.el6.x86_64)
            root (hd1,0)
            kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=UUID=0e68a84d-cb61-4856-b23b-c2e2aa8294fb KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
            initrd /initramfs-2.6.32-431.el6.x86_64.img

    #

    #install grub on second drive


    [root@localhost /]# 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> root (hd1,0)
    root (hd1,0)
     Filesystem type is ext2fs, partition type 0xfd
    grub> setup (hd1)
    setup (hd1)
     Checking if "/boot/grub/stage1" exists... no
     Checking if "/grub/stage1" exists... yes
     Checking if "/grub/stage2" exists... yes
     Checking if "/grub/e2fs_stage1_5" exists... yes
     Running "embed /grub/e2fs_stage1_5 (hd1)"...  27 sectors are embedded.
    succeeded
     Running "install /grub/stage1 (hd1) (hd1)1+27 p (hd1,0)/grub/stage2 /grub/grub.conf"... succeeded
    Done.
    grub>


    #edit fstab
    #change
    /dev/mapper/VolGroup-lv_root /                       ext4    defaults        1 1
    UUID=ed0608b8-271a-47e9-b0ee-88060a006b0d /boot                   ext4    defaults        1 2
    /dev/mapper/VolGroup-lv_swap swap                    swap    defaults        0 0
    tmpfs                   /dev/shm                tmpfs   defaults        0 0
    devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
    sysfs                   /sys                    sysfs   defaults        0 0
    proc                    /proc                   proc    defaults        0 0
                                                                                              
    #

    #get /boot ID
    blkid /dev/md0
    /dev/md0: UUID="4bcf5b66-9d0c-4f5b-a9d8-2d524fbf1ccf" TYPE="ext4"

    # swap ID
    blkid /dev/md1
    /dev/md1: UUID="821efb1f-95cd-4aab-803b-e26d9fa6a920" TYPE="swap"

    #backup /etc/fstab
    cp /etc/fstab /etc/fstab-beforeraid

    #to
    UUID=0e68a84d-cb61-4856-b23b-c2e2aa8294fb /                       ext4    defaults        1 1
    UUID=4bcf5b66-9d0c-4f5b-a9d8-2d524fbf1ccf /boot                   ext4    defaults        1 2
    UUID=821efb1f-95cd-4aab-803b-e26d9fa6a920 swap                    swap    defaults        0 0
    tmpfs                   /dev/shm                tmpfs   defaults        0 0
    devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
    sysfs                   /sys                    sysfs   defaults        0 0
    proc                    /proc                   proc    defaults        0 0
                                                                                             
    #




    #final and crucial grub setup, we need to tell grub that the root is on hd1,0 (or sdb1) and to install it to the first hard drive (which is what will boot and will enter the old environment if we don't do this):
        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> root (hd1,0)
    root (hd1,0)
     Filesystem type is ext2fs, partition type 0xfd
    grub> setup (hd0)
    setup (hd0)
     Checking if "/boot/grub/stage1" exists... no
     Checking if "/grub/stage1" exists... yes
     Checking if "/grub/stage2" exists... yes
     Checking if "/grub/e2fs_stage1_5" exists... yes
     Running "embed /grub/e2fs_stage1_5 (hd0)"...  27 sectors are embedded.
    succeeded
     Running "install /grub/stage1 d (hd0) (hd0)1+27 p (hd1,0)/grub/stage2 /grub/grub.conf"... succeeded
    Done.
     


  • Centos cannot login by console or ssh session closed immediately


    In my case I could login with the initial install but I rsync'd everything over while preserving ownership and permissions to another RAID partition and booted from that.was fine before. The problem is that you are kicked out the second you login and the problem was SELINUX for some reason (perhaps it noticed something strange when it was moved to the new partition)


    login: pam_unix(login:session): session opened for user root by LOGIN(uid=0)
    login: ROOT LOGIN ON tty1
    pam_unix(login:session): session closed for user root

    #in my case the issue was selinux so disable it

    How to disable SELinux

     

    Here were the error/denied messages in /var/log/audit/audit.log

     

    type=AVC msg=audit(1445614919.831:12): avc:  denied  { entrypoint } for  pid=1072 comm="login" path="/bin/bash" dev=md2 ino=632 scontext=unconfined_u:system_r:abrt_helper_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:file_t:s0 tclass=file
    type=AVC msg=audit(1445614924.074:22): avc:  denied  { entrypoint } for  pid=1077 comm="login" path="/bin/bash" dev=md2 ino=632 scontext=unconfined_u:system_r:abrt_helper_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:file_t:s0 tclass=file
    type=AVC msg=audit(1445614943.809:38): avc:  denied  { entrypoint } for  pid=1088 comm="login" path="/bin/bash" dev=md2 ino=632 scontext=unconfined_u:system_r:abrt_helper_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:file_t:s0 tclass=file
    type=AVC msg=audit(1445614969.449:48): avc:  denied  { entrypoint } for  pid=1093 comm="login" path="/bin/bash" dev=md2 ino=632 scontext=unconfined_u:system_r:abrt_helper_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:file_t:s0 tclass=file
     


  • openvz yum problem Centos 6.5 cannot find file on mirror:



    #solution

    Edit /etc/yum.repos.d/openvz.repo
    For the first two entries comment out #mirrorlist and uncomment #baseurl and then it worked

    openvz yum problem Centos 6.5 cannot find file on mirror:

    yum update
    Loaded plugins: fastestmirror
    Determining fastest mirrors
     * openvz-kernel-rhel6: mirrors.ustc.edu.cn
     * openvz-utils: mirrors.ustc.edu.cn
    base                                                     | 3.7 kB     00:00    
    base/primary_db                                          | 4.6 MB     00:13    
    centosplus                                               | 3.4 kB     00:00    
    centosplus/primary_db                                    | 1.1 MB     00:03    
    contrib                                                  | 2.9 kB     00:00    
    contrib/primary_db                                       | 1.2 kB     00:00    
    extras                                                   | 3.4 kB     00:00    
    extras/primary_db                                        |  32 kB     00:00    
    openvz-kernel-rhel6                                      | 2.8 kB     00:00    
    http://mirrors.ustc.edu.cn/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://ftp.cuhk.edu.hk/pub/Linux/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://ftp.riken.jp/Linux/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://ftp.iij.ad.jp/pub/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://www.ftp.ne.jp/Linux/MISC/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.secureax.com/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] Downloaded more than max size for http://www.secureax.com/: 10950 > 9305
    Trying other mirror.
    http://ftp.yz.yamagata-u.ac.jp/pub/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.wanxp.id/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirrors.digipower.vn/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.supremebytes.com/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror2.scalabledns.com/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://kartolo.sby.datautama.net.id/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://download.openvz.org/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.lon.cenexo.com/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://openvz.mirrors.ovh.net/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.ubiquityservers.com/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.hdcore.eu/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirrors.vinahost.vn/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.fdcservers.net/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirrors.sphere.ly/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 12] Timeout on http://mirrors.sphere.ly/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: (28, 'connect() timed out!')
    Trying other mirror.
    http://mirror.h1host.ru/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.tocici.com/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://openvz.mirrors.skynet.be/pub/openvz.org/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.serverbeheren.nl/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 7 - "Failed to connect to 2001:67c:16b4:b010::1: Network is unreachable"
    Trying other mirror.
    http://mirror.trouble-free.net/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://openvz.webdesk.ru/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://ftp.yzu.edu.tw/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://ftp.heanet.ie/mirrors/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://ftp.linux.cz/pub/linux/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.jmu.edu/pub/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.vpsfree.cz/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.cogentco.com/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.bytemark.co.uk/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://ftp.fi.muni.cz/pub/linux/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirrors.nic.cz/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirrors.bangmodhosting.com/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.duomenucentras.lt/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://openvz.slaskdatacenter.com/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://openvz.mirror.serveriai.lt/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirrors.bestthaihost.com/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirrors.thzhost.com/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 403 Forbidden"
    Trying other mirror.
    http://ftp.ticklers.org/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.as24220.net/pub/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://ftp.fsn.hu/pub/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.zetup.net/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.nexcess.net/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.logol.ru/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.lagoon.nc/pub/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://ftp.nluug.nl/pub/os/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirrors.gigenet.com/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://openvz.hitme.net.pl/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://ftp.wicks.co.nz/pub/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://ftp-stud.hs-esslingen.de/pub/Mirrors/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.23media.de/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.ukhost4u.com/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://openvz.copahost.com/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://openvz.rinet.ru/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.checkdomain.de/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirrors.sonic.net/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirrors.neterra.net/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://openvz.just-hosting.ru/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.maeh.org/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.softaculous.com/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.optusnet.com.au/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://artfiles.org/openvz.org/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://linux.nsu.ru/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.vutbr.cz/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.mirohost.net/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://openvz.tsukuba.wide.ad.jp/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.yandex.ru/mirrors/download.openvz.org/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.netinch.com/pub/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://ftp.lip6.fr/pub/linux/distributions/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.ihc.ru/download.openvz.org/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirrors.syringanetworks.net/OpenVZ/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirrors.netix.net/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.steadfast.net/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://openvz.spd.co.il/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://ftp.colocall.net/pub/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirrors.xservers.ro/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://ftp.hawo.net/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://ftp.hawo.stw.uni-erlangen.de/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://ftp.acc.umu.se/mirror/openvz.org/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://openvz.mirror.garr.it/mirrors/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://openvz.proserve.nl/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://ftp.fau.de/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.satellite-service.ru/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.datacenter.by/pub/download.openvz.org/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirror.as43289.net/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://openvz.uberglobalmirror.com/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://ftp.cc.uoc.gr/mirrors/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://mirrors.ircam.fr/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://openvz.mindstudios.com/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 12] Timeout on http://openvz.mindstudios.com/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: (28, 'connect() timed out!')
    Trying other mirror.
    http://linorg.usp.br/openvz/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://openvz.mirror.triple-it.nl/kernel/branches/rhel6-2.6.32/current/repodata/8670e12519a6cccfe7ede0226dd94ce1956005df-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
     


  • mount -o bind permanent in /etc/fstab howto


    mount -o bind /somedir /anotherdir

    In /etc/fstab

    /somedir /anotherdir none bind 0 0


  • Virtualbox errors on Ubuntu/Debian/Mint


     

    The solution was to reinstall the vbox dkms package and do a manual modprobe of the modules it makes.

    I never sorted out the unable to start due to the USB issue, I did have the guest additions installed but the only way to boot was to change the pointing device from USB to PS2 and then to disable the USB controller (if your pointing device is set as USB, disabling USB will not work because it will re-enable by default when it sees your pointing device is USB, this is why you must set it to PS2 before disabling USB).

    ===========

    Failed to open a session for the virtual machine XPCB.
    The virtual machine 'XPCB' has terminated unexpectedly during startup with exit code 1.


    Kernel driver not installed (rc=-1908)

    The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing

    '/etc/init.d/vboxdrv setup'

    as root. If it is available in your distribution, you should install the DKMS package first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary.

    =========

    sudo apt-get install virtualbox-dkms
    [sudo] password for one:
    Reading package lists... Done
    Building dependency tree      
    Reading state information... Done
    The following NEW packages will be installed:
      virtualbox-dkms
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    Need to get 538 kB of archives.
    After this operation, 4,321 kB of additional disk space will be used.
    Get:1 http://archive.ubuntu.com/ubuntu/ trusty-updates/multiverse virtualbox-dkms all 4.3.10-dfsg-1ubuntu5 [538 kB]
    Fetched 538 kB in 1s (447 kB/s)         
    Selecting previously unselected package virtualbox-dkms.
    (Reading database ... 188970 files and directories currently installed.)
    Preparing to unpack .../virtualbox-dkms_4.3.10-dfsg-1ubuntu5_all.deb ...
    Unpacking virtualbox-dkms (4.3.10-dfsg-1ubuntu5) ...
    Setting up virtualbox-dkms (4.3.10-dfsg-1ubuntu5) ...
    Loading new virtualbox-4.3.10 DKMS files...
    First Installation: checking all kernels...
    Building only for 3.16.0-38-generic
    Building initial module for 3.16.0-38-generic
    Done.

    vboxdrv:
    Running module version sanity check.
     - Original module
       - No original module exists within this kernel
     - Installation
       - Installing to /lib/modules/3.16.0-38-generic/updates/

    vboxnetadp.ko:
    Running module version sanity check.
     - Original module
       - No original module exists within this kernel
     - Installation
       - Installing to /lib/modules/3.16.0-38-generic/updates/

    vboxnetflt.ko:
    Running module version sanity check.
     - Original module
       - No original module exists within this kernel
     - Installation
       - Installing to /lib/modules/3.16.0-38-generic/updates/

    vboxpci.ko:
    Running module version sanity check.
     - Original module
       - No original module exists within this kernel
     - Installation
       - Installing to /lib/modules/3.16.0-38-generic/updates/

    depmod.......

    DKMS: install completed.

    =========

    sudo modprobe vboxdrv
    one@Opteron2419:~$ sudo modprobe vboxnetadp
    one@Opteron2419:~$ sudo modprobe vboxpci
    one@Opteron2419:~$ sudo modprobe vboxnetflt
    one@Opteron2419:~$ sudo modprobe vboxnetsf
    modprobe: FATAL: Module vboxnetsf not found.
    one@Opteron2419:~$ sudo modprobe vboxsf
    modprobe: ERROR: could not insert 'vboxsf': No such device
    one@Opteron2419:~$ sudo modprobe vboxsf
    modprobe: ERROR: could not insert 'vboxsf': No such device
    one@Opteron2419:~$ sudo modprobe vboxguest
    modprobe: ERROR: could not insert 'vboxguest': No such device
    one@Opteron2419:~$ sudo modprobe vboxvideo


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

    Failed to open a session for the virtual machine XPCB.
    Implementation of the USB 2.0 controller not found!
    Because the USB 2.0 controller state is part of the saved VM state, the VM cannot be started. To fix this problem, either install the 'Oracle VM VirtualBox Extension Pack' or disable USB 2.0 support in the VM settings (VERR_NOT_FOUND).


  • How To Install Linux Mint 17.2 on mdadm RAID with a separate boot partition


    I was surprised to see that Linux Mint at the latest 17.2 version still has NO mdadm installer option, and worse the installer will not be able to create a proper booting environment even when you do install it.

    How to setup mdadm in Linux mint LiveCD

    sudo su

    apt-get install mdadm

    # partition as you need and then create your mdadm devices

    # create your SWAP md0

    mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1

    # create your boot md1 (remember to use the --metadata=0.90 or it will not be bootable and it must be RAID 1 as RAID 10 cannot be booted

    mdadm --create /dev/md1 --level=1 --metadata=0.90 --raid-devices=2 /dev/sda2 /dev/sdb2

    # create root mdadm md2

    mdadm -create /dev/md2 --level=10 --layout=f2 --raid-devices=2 /dev/sdb3 /dev/sdb3

    Run the installer

    Double click each mdadm array to create the appropriate partition (eg. md0 is swap, md1 is /boot and md2 is /)

    Choose to install the boot loader on sda (it doesn't really matter because it will not succeed or work even if Linux Mint says it did).

     

    The Most Crucial Part, to chroot and install the necessary utilities

    I admit I spent a few days sorting this out because I have never had a problem in the past normally installing grub 0.97 by using the old manual way.  Linux mint uses the newer grub2 and is more complex/picky but also does it all for you as long as you do it as below.

    mount /dev/md2p1 /mnt

    # do not forget to mount your /boot or grub-install will NEVER work

    mount /dev/md1p1 /mnt/boot

    mount=/mnt

    for bind in dev sys proc; do

    mount -o bind /$bind /$mount/$bind

    chroot /mnt

    apt-get -y install mdadm grub2

    grub-install /dev/sda

    grub-install /dev/sdb

    #change the grub-install portion to match the physical devices that make up your boot partition and make sure you just point to the raw disk and not a specific partition

    #the above last command should do it and get you booting

     

     


  • Linux sudo config sudoers to run command without a password howto


    Before reading on remember to put the line at the bottom of /etc/sudoers as from experience what happen is that other rules cancel out what you have added.

    If your sudoers setup is correct it will work immediately upon saving without requiring a reboot.

    Edit /etc/sudoers

    yourusername    ALL = NOPASSWD: /path/to/command

    *Once again remember the above should be on the bottom of the sudoers file or it may not work.


  • ONVIF Linux Security Camera Setup


    First of all this seems to apply to many ONVIF devices
    Hard coded IP: 192.168.1.10 (yes not kidding no DHCP!)
    00:12:12:9C:C2:00

    To view RTSP stream use VLC, or openRTSP or other RTSP capable software:


    rtsp://192.168.1.10/user=admin_password=tlJwpbo6_channel=1_stream=0.sdp

    user: admin
    password: blank
    http://ip/Login.htm
    Uses Quicktime and is a poor quality picture and slow
    Cannot change password

    There is also port 8899 open that an Android app found
    Video In: 1
    Alarm In: 2
    Alarm Output: 1
    Audio In: 1
    Build Date:2014/10/23 16:54:2
    System: V4.02.R12.00006510.10010.1303
    Serial ID: e2ae8546ba493897


    Starting Nmap 5.21 ( http://nmap.org ) at 2015-10-13 17:05 PDT
    Nmap scan report for 192.168.1.10
    Host is up (0.0050s latency).
    Not shown: 996 closed ports
    PORT     STATE SERVICE
    23/tcp   open  telnet
    80/tcp   open  http
    554/tcp  open  rtsp
    8899/tcp open  unknown