Monday, April 7, 2014

Install AMD Catalyst 13.12 Driver with patch on Ubuntu 13.10

This is a copy-paste post from this one only for my personal reference and just in case the original post is gone for any reason.

  • Download
  • Extract it and you will get
  • chmod +x
  • ./ --extract catalyst
  • cd catalyst
  • Apply the patch manualy:
at the end of the file catalyst/common/lib/modules/fglrx/build_mod/kcl_acpi.c, starting with line 990, there is
    if (!ACPI_SUCCESS(acpi_get_table_with_size(id, 0, &hdr, &tbl_size)))
    tbl_size = 0x7fffffff;
    if (!ACPI_SUCCESS(acpi_get_table(id, 0, &hdr)))
delete everything to the end of the file and replace with this
    if (!ACPI_SUCCESS(acpi_get_table_with_size(id, 0, &hdr, &tbl_size)))
    tbl_size = 0x7fffffff;
    if (!ACPI_SUCCESS(acpi_get_table(id, 0, &hdr)))
        return KCL_ACPI_ERROR;
    return KCL_ACPI_OK;
  • sudo ./ 13.251 --buildpkg Ubuntu/saucy
  • Change owner and group (from root to your user) for generated .deb files placed one directory up (sudo chown fglrx* and sudo chgrp fglrx*), and install them all via Software Center (or from command line as root).
To open amdcccle, run this sudo /usr/lib/fglrx/bin/amdcccle

Saturday, April 5, 2014

Installing Git's latest version on Ubuntu

Here are the commands to run to install the latest version of the source-control system, Git, on Ubuntu.

sudo apt-get install python-software-properties #I'm not sure if this line is necessary
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git

Sunday, February 2, 2014

Replace\remove last occurrence of a string using regular expressions

Try this regex (^.+)b(.+$)

Example (Remove the last b character)

    System.out.println("1abchhhabcjjjabc".replaceFirst("(^.+)b(.+$)", "$1$2"));

Outputs (Notice the underlined portion of string)


Wednesday, January 15, 2014

Fix Virtualbox clipboard (copy & paste) functionality between the host and guest machine

First make sure you have this option enabled

Then on your guest machine (i.e. running on Virtualbox), kill the VBoxClient process then run VBoxClient-all.

I'm not sure, but I strongly think this should only work only after installing the Virtualbox additions.

Ubuntu 13.10: Installing Xfce 4.12

I had a very nice impression when I tried Xubuntu. That was exactly the idea I had about linux. Stylish, very fast, space savvy and highly configurable. There is nothing I've tried to customize with Xubuntu's panels that I couldn't.

Here is how to have this nice experience alongside Ubuntu's Unity

sudo su
add-apt-repository -y ppa:xubuntu-dev/xfce-4.10
add-apt-repository -y ppa:xubuntu-dev/xfce-4.12
apt-get -y update
apt-get -y install xfce4

  1. The -y switch is to assume "yes" to all questions
  2. Adding xfce 4.10 ppa will avoid you some dependencies problems

Saturday, November 23, 2013

Linux: How to reset root's or any other user's password

I've tried this only on Ubuntu server but it should work on all Linux-based machines. But first you must fulfill the following requirements:

  • Have physical access to the machine
  • Can command the machine to boot from CD or USB
  • Have a live Linux image on a CD or a USB stick. You can usually boot an installable image and choose to "Try" Linux and not install it.
  1. Boot the your machine and login to your live Linux image. 
  2. Decide on which disk does your original Linux system reside one (i.e. the one you need to reset the root password for).
    sudo fdisk -l
  3. Mount your original Linux system's hard drive on a directory of your choice
    sudo mount /dev/sda1 /media/your_drive
  4. chroot your mounted drive
    sudo chroot /media/your_drive
  5. Change any username's password
    sudo passwd (i.e. for root) or sudo passwd anyusername

Friday, November 22, 2013

Google Chrome: Middle click scrolling in Ubuntu

Middle-click scrolling doesn't work on Chrome when it's running on Ubuntu (Not sure if this also applies to all Linux distros), for a reason I do not know about. But I know a workaround (not a solution to the root cause), it's this chrome extension.

After installing the extension, Remember to reload your page for the extension to take effect.