Working Ninja
2015-12-30T20:50:04
if [ "$TERM" = "linux" ]; then
    echo -en "\e]P0232323" #black
    echo -en "\e]P82B2B2B" #darkgrey
    echo -en "\e]P1D75F5F" #darkred
    echo -en "\e]P9E33636" #red
    echo -en "\e]P287AF5F" #darkgreen
    echo -en "\e]PA98E34D" #green
    echo -en "\e]P3D7AF87" #brown
    echo -en "\e]PBFFD75F" #yellow
    echo -en "\e]P48787AF" #darkblue
    echo -en "\e]PC7373C9" #blue
    echo -en "\e]P5BD53A5" #darkmagenta
    echo -en "\e]PDD633B2" #magenta
    echo -en "\e]P65FAFAF" #darkcyan
    echo -en "\e]PE44C9C9" #cyan
    echo -en "\e]P7E5E5E5" #lightgrey
    echo -en "\e]PFFFFFFF" #white
    clear #for background artifacting
fi

Source: https://askubuntu.com/questions/147462/how-can-i-change-the-tty-colors#153493

2015-12-20T14:34:30
# apt-get install unattended-upgrades
# dpkg-reconfigure --priority=low unattended-upgrades

More at https://help.ubuntu.com/community/AutomaticSecurityUpdates

2015-11-17T23:19:39
  1. Firmware not loading.
    dmesg | grep -i bluetooth
    
    bluetooth hci0: Direct firmware load for brcm/BCM20702A1-0b05-17cb.hcd failed with error -2
  2. Download Windows driver from ASUS.
    http://dlcdnet.asus.com/pub/ASUS/wireless/USB-BT400/UT_USB_BT400_6516000.zip
  3. Extract and open Win32\bcbtums-win7x86-brcm.inf
  4. Find Product Name (BT400).
    %AsusBT400.DeviceDesc%=RAMUSB17CB,          USB\VID_0B05&PID_17CB       ; 20702 standalone
  5. Find section for "RAMUSB17CB".
    ;;;;;;;;;;;;;RAMUSB17CB;;;;;;;;;;;;;;;;;
     
    [RAMUSB17CB.CopyList]
    bcbtums.sys
    BCM20702A1_001.002.014.1315.1347.hex
     
    [RAMUSB17CB.NTX86]
    Include=bth.inf
    Needs=BthUsb.NT
    FeatureScore=F0
    CopyFiles=RAMUSB17CB.CopyList
     
    [RAMUSB17CB.NTX86.hw]
    AddReg=RAMUSB17CB.NTX86.hw.reg
     
    [RAMUSB17CB.NTX86.hw.reg]
    HKR,,LowerFilters, 0x00010000, "bcbtums"
    HKR,,%RAMPatchFileName%,0x00000, "BCM20702A1_001.002.014.1315.1347.hex"
    HKR,,%RemoteWakeEnabled%,0x00010001,1
    HKR,,%DeviceRemoteWakeSupported%,0x00010001,1
     
    [RAMUSB17CB.NTX86.Services]
    needs=BthUsb.NT.Services
    AddService=bcbtums,,BCBTUMS_Service_Inst, BTWSECFL_EventLog_Inst
  6. Note .hex file referenced: BCM20702A1_001.002.014.1315.1347.hex.
  7. Download hex2hcd.
    https://github.com/jessesung/hex2hcd/
  8. Convert hex to hcd.
    ./hex2hcd BCM20702A1_001.002.014.1315.1347.hex BCM20702A1-0b05-17cb.hcd
  9. Copy to location found via dmesg in Step 1.
    cp BCM20702A1-0b05-17cb.hcd /lib/firmware/brcm/
  10. Reboot (or modprobe -r btusb; modprobe btusb).

ht: http://askubuntu.com/questions/605075/how-to-use-a-bluetooth-headset-mic-in-ubuntu

2015-11-03T08:12:24

Not doing anything but your hard drive is screaming? iotop to the rescue.

iotop

In my case, updatedb.mlocate was the culprit.

2015-10-25T21:28:09
# systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

Monitor will still go into power save mode.

2015-10-24T11:43:09

Redshift sometimes stays enabled, setting the color temperature too low during the day. A quick fix is to set the color temperature from command line:

redshift -O 6000

 

2015-10-21T22:49:47

Every once and a while, I lose network connectivity to the point where my NFS share is unmounted and, when remounted, the Desktop fills up with everything in ~/.

The problem lies in the file ~/.config/user-dirs.dirs. It should be as follows (for my setup):

XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"

So, for example, XDG_DESKTOP_DIR="$HOME/Desktop" when remounted turns into XDG_DESKTOP_DIR="$HOME/", thus the problem. The correction is to replace with the above. I plan to write a script to check for the missing directories after $HOME/ and replace as necessary.

2015-01-02T18:01:19

Here’s the process I followed to get ImageMagick installed on a CentOS 5 DV Server over at Media Temple. I needed ImageMagick to convert PDFs to JPG files.

  1. yum install ImageMagick*
  2. pecl install imagick

    Here’s where I encountered the first hiccup:

    shtool at ‘/var/tmp/imagick/build/shtool’ does not exist or is not executable. Make sure that the file exists and is executable and then rerun this script.
    ERROR: `phpize’ failed

    Luckily I found someone with a similar issue. The fix was to create a different temp folder for pear to use. Steps as follows:

    mkdir rw /tmp2

    pear config-set temp_dir /tmp2

    pecl install imagick

    Build process completed successfully Installing ‘/usr/lib64/php/modules/imagick.so’ Installing ‘/usr/include/php/ext/imagick/php_imagick_shared.h’ Installing ‘/usr/include/php/ext/imagick/php_imagick.h’ Installing ‘/usr/include/php/ext/imagick/php_imagick_defs.h’ install ok: channel://pecl.php.net/imagick-3.1.2 configuration option “php_ini” is not set to php.ini location You should add “extension=imagick.so” to php.ini

  3. Add “extension=imagick.so” to php.ini.
  4. Verify install was successful and ImageMagick is loaded into PHP.

    service httpd graceful

    php -m | grep imagick (should output imagick)

    php -r "print(class_exists('imagick'));" (should output 1)

    rm -rf /tmp2

  5. After confirming that ImageMagick was installed and loaded into PHP, I still had the following error in my application:

    Fatal error: Class ‘imagick’ not found

    Found that the PHP file loaded was different than the default php.ini:

    Loaded Configuration File /var/www/vhosts/system/domain.name/etc/php.ini

    To resolve, I created imagick.ini in /etc/php.d with the following content:

    ; Enable imagick extension module extension=imagick.so

    I then removed the extension from inside the default php.ini file (step 3) to clean things up.

  6. One last restart! service httpd graceful
  7. Check for ImageMagick again via phpinfo() at the domain your application is running on =)

This is a pretty rough outline so if you have any questions, please let me know in a comment below. Thanks!

2014-09-20T17:48:07

Reading log files that are from another time zone can add an additional (and unnecessary) layer to your troubleshooting headache. Most of the servers that I touch are on the Eastern seaboard and thus, depending on the earth’s tilt, the offset can vary (thanks UTC!). To resolve this on CentOS, check out the following two commands:

Make a backup of the current time zone (by moving it):
sudo mv /etc/localtime /etc/localtime.bak

Create a link between desired time zone and /etc/localtime:
sudo ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime

Now run date to verify the changes took.

That’s it!

Source: Change Timezone In Centos