Category Archives: Linux Plus

GRUB shows Windows 7 instead of Windows 10

source: link

author: david6

After installing Windows 10, every time I get a kernel update or I run the update-grub2 it always shows Windows 7 instead of Windows 10. How do I fix this permanently?

The reason why it still shows Windows 7 instead of Windows 10 is that the file /usr/lib/os-probes/mounted/20microsoft does not contain the label for Windows 10, so during the os-prober detection of the OS it falls back to Windows 7.

To correct this, you need to make the following changes to the /usr/lib/os-probes/mounted/20microsoft file:

NOTE: Always make a backup of the file before modifying it!

if item_in_dir -q bootmgr "$2"; then
        # there might be different boot directories in different case as:
        # boot Boot BOOT
        for boot in $(item_in_dir boot "$2"); do
                bcd=$(item_in_dir bcd "$2/$boot")
                if [ -n "$bcd" ]; then
                        if grep -qs "W.i.n.d.o.w.s. .1.0" "$2/$boot/$bcd"; then
                                long="Windows 10 (loader)"
                        elif grep -qs "W.i.n.d.o.w.s. .8" "$2/$boot/$bcd"; then
                                long="Windows 8 (loader)"
                        elif grep -qs "W.i.n.d.o.w.s. .7" "$2/$boot/$bcd"; then
                                long="Windows 7 (loader)"

the changes above are changing the line if grep -qs "W.i.n.d.o.w.s. .8" "$2/$boot/$bcd"; then to elif grep -qs "W.i.n.d.o.w.s. .8" "$2/$boot/$bcd"; then, and adding if grep -qs "W.i.n.d.o.w.s. .1.0" "$2/$boot/$bcd"; then and long="Windows 10 (loader)" above that line and saving it.

Once saved, then running os-prober now looks like this:

terrance@terrance-ubuntu:~$ sudo os-prober
[sudo] password for terrance: 
/dev/sdf1:Windows 10 (loader):Windows:chain

then running update-grub2 it will now make the updates to your /boot/grub/grub.cfgpermanent anytime you get a kernel update so it will show the correct version of Windows now (example below):

terrance@terrance-ubuntu:~$ sudo update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.19.0-26-generic
Found initrd image: /boot/initrd.img-3.19.0-26-generic
Found linux image: /boot/vmlinuz-3.13.0-58-generic
Found initrd image: /boot/initrd.img-3.13.0-58-generic
Found linux image: /boot/vmlinuz-3.13.0-57-generic
Found initrd image: /boot/initrd.img-3.13.0-57-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 10 (loader) on /dev/sdf1
done

Hope this helps!

Advertisements

Connecting to xampp MySQL server using MySQL Workbench

Go to /opt/lampp/etc/ and open my.cnf file.

Find skip-networking and comment it out: #skip-networking

You should be able to connect to your xampp MySQL server on localhost:3306

 

source: http://stackoverflow.com/questions/16581709/problems-connecting-to-port-3306-mysql-workbench-with-xampp

Removing Dot-Underscore Files

by Kadin2048 @ http://kadin.sdf-us.org/

This is just a quick note, mostly for my own reference, of a few ways to easily delete the dot-underscore (._foo,._bar, etc.) files created by (badly-behaved) Mac OS X systems on non-AFP server volumes.

First of all, if you’re in a mixed-platform environment, you probably want to run this command on your Mac:

defaults write com.apple.desktopservices DSDontWriteNetworkStores true

This doesn’t stop the creation of dot-underscore (resource fork) files, but it does at least cut down on the creation of their equally-obnoxious cousin, the “.DS_Store” file. I’m not aware of a way to automatically and persistently suppress the creation of resource fork files on platforms that don’t deal with resource forks, though.

For the record, it’s not that I’m against the idea of resource forks or filesystem metadata … I think metadata is great and I wish filesystems supported more of it! But hacky solutions like .DS_Store and dot-underscore resource forks are not going to convince anyone who’s on the fence, and give the Mac OS a reputation for crapping all over shared network resources.

Continue reading Removing Dot-Underscore Files

Subtitle manipulation tools for Linux

By Razvan T. Coloja on February 07, 2008 (7:00:00 PM) @ http://archive09.linux.com/feature/125978

Subtitles may not mean much for the English-speaking part of the world, but for the rest of us, they are the difference between truly enjoying a movie or just watching the screen, trying to decipher the events. While Windows has a nice variety of tools to manipulate subtitles, Linux applications too can accomplish such tasks. From editing to ripping to converting, here is a list of some useful tools.

Continue reading Subtitle manipulation tools for Linux

Turn on Bash Smart Completion

Little TAB key
Image by Kai Hendry via Flickr

Posted by Carthik @ http://embraceubuntu.com/

The Bash shell has this sweet feature where you can use the TAB key to auto-complete certain things. For example, when I am in my home directory, the following command:
$cd Do[TAB-key]
will automatically yield:
$cd Documents

If you are an absolute novice, like I was, not so long ago, discovering tab completion in the terminal can make you go “Wow!”. Wait till you hear the rest now :)

Though you can use the TAB key to complete the names of files and directories, by default the completion is pretty “dumb”. If you have already typed $cd D you would expect that the tab key would cause only the directory names to be completed, but if I try it on my machine, the tab completion tool uses filenames too.

Now, don’t despair! There is now a smart bash tab completion trick you can use. Smart completion even complete the arguments to commands!!

To enable smart completion, edit your /etc/bash.bashrc file. Uncomment the following lines, by removing the # in the beginning of the lines:

#if [ -f /etc/bash_completion ]; then
# . /etc/bash_completion
#fi

Now you can use tab completion to power your way through commands.

You can even extend bash smart completion to your own favourite commands by using /etc/bash_completion, the “complete” utility and /etc/bash_completion.d . Explaining the nitty-gritty is beyond me. I refer you to the Debian Administration gurus for more information regarding smarter bash completion.

Source: http://embraceubuntu.com/2006/01/28/turn-on-bash-smart-completion/

Combine MP4/M4V Files in Linux/Ubuntu

by Andrew Martin @http://www.thetechrepo.com/

You may want to combine multiple mp4/m4v video files into one continuous video. In order to do this, you need to install the gpac library of programs onto Ubuntu. Open up Terminal and run:

 

sudo apt-get install gpac

 

This will install the gpac library. One of the programs included with it is MP4Box, which you can use to concatenate the video files. If you are using 64 bit Linux or get an error like MP4Box: error while loading shared libraries: libgpac.so: cannot open shared object file: No such file or directory, then you need to link the shared library to /usr/lib:

 

sudo ln -s /usr/local/lib64/libgpac.so /usr/lib/libgpac.so

 

Now to convert your files, add -cat filename.mp4 for each of your files to this command, with -new combinedfile.mp4 as your output, combined file:

 

MP4Box -cat vid1.mp4 -cat vid2.mp4 -cat vid3.mp4 -new combinedfile.mp4

 

Once the process finishes, your combined video file will be in combinedfile.mp4.

source: http://www.thetechrepo.com/main-articles/530-combine-mp4m4v-files-in-linuxubuntu