Showing posts from November, 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 machineCan command the machine to boot from CD or USBHave 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. Now: Boot the your machine and login to your live Linux image. 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 -lMount your original Linux system's hard drive on a directory of your choice
sudo mount /dev/sda1 /media/your_drivechroot your mounted drive
sudo chroot /media/your_driveChange any username's password
sudo passwd (i.e. for root) or sudo passwd anyusername

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.

Ubuntu: Install .deb package and it's dependencies

There are 2 ways to do that

A) Manually
sudo dpkg -i your_package.deb (This will install the package but with the missing dependencies, if there is)sudo apt-get install -f (This will download the missing packages, after that, your are good to go)B) Or you can use gdebi. This package has 2 version, command line and one with a GUI. The GUI one integrates with your file explorer so you right-click your package, and select to open it using Gdebi.
The command line version can be installed by runing this command sudo apt-get install gdebi-core, the GUI version for GNOME can be installed by running the command sudo apt-get install gdebi. For KDE, run the following command sudo apt-get install gdebi-kde.
To use the command line version of gdebi. Just run the following command sudo gdebi your_package.deb.

Ubuntu 13.10: Google chrome window closes when Ctrl+F is pressed

On Ubuntu 13.10, the keyboard shortcut Ctrl+F is set to close windows !

You should simply click on that shortcut, which will allow you to pick another shortcut. You probably would like to press Alt+F4.

Installing Eclipse Kepler on Ubuntu 13.10

I don't know an apt-get way to install the latest Eclipse Kepler for Java EE development.

So you just download the archive file and extract it somewhere. I also have Juno for OC4j development so I also created a "sub" shortcut, or as it's technicly known, a shortcut group within the one shortcut we'll create on the launcher. Basically, you can run your main eclipse environment just by clicking on a launcher icon, and you can also run another application just by right-clicking this icon, and choosing the application you configured.

on your ~/.local/share/applications directory, create a file and call it eclipse.desktop (Or whatever, AFAIK the name doesn't matter).

Put the following in it and change the paths respectively.

[Desktop Entry]
Name=Java EE - Eclipse Kepler
Exec=env UBUNTU_MENUPROXY=0 /home/mgelbana/Downloads…

mysql_install_db: Can't create test file *.lower-test

When I install MySQL on an Ubuntu machine, I tend to move MySQL's data and temp directories to another locations on a bigger partition that the root's.

But even after setting the correct user permissions to the new data directory, attempting to initialize the data directory to have mysql and information_schema schemas will fail, not due to not enough direcotry permissions as the error suggests, but for the security application apparmor that is installed by default with Ubuntu.

I have no interest in using this application but you probably do so you may no want to apply this solution.

/etc/init.d/apparmor stop/etc/init.d/apparmor update-rc.d -f apparmor removeapt-get purge apparmorreboot>> Apply this solution at your own risk  <<

Table 'x' was not locked with LOCK TABLES (1100)

While dumping a table, you might find face this error

Table 'table_name' was not locked with LOCK TABLES (1100)
The solution to this issue is to apply this parameter to mysqldump