zeldor.biz

Linux, programming and more

Copyright © 2025
Log in

Install Grub from chroot

December 21, 2010 by Igor Drobot 16 Comments

The simple way to install grub/ grub2 from any linux live-CD or any other bootable medium.

Step 1: boot from linux live CD/DVD or even USB
Step 2: mount your hdd
Step 3: chroot in the mounted filesystem
Step 3: install grub
Step 4: reboot

1
2
3
4
5
6
7
8
9
fdisk -l
mount /dev/sda1 /mnt/
mount -t proc none /mnt/proc
mount -o bind /dev /mnt/dev
mount -t sysfs sys /mnt/sys
chroot /mnt/ /bin/bash
update-grub
/usr/sbin/grub-install --recheck --no-floppy /dev/sda
sync & reboot

fdisk -l mount /dev/sda1 /mnt/ mount -t proc none /mnt/proc mount -o bind /dev /mnt/dev mount -t sysfs sys /mnt/sys chroot /mnt/ /bin/bash update-grub /usr/sbin/grub-install --recheck --no-floppy /dev/sda sync & reboot

SUSE Syntax:
update-grub is debian and ubuntu little helper this execute the same as:

1
2
3
grub2-install --recheck --no-floppy /dev/sda
grub2-mkconfig -o /boot/grub2/grub.cfg
mkinitrd

grub2-install --recheck --no-floppy /dev/sda grub2-mkconfig -o /boot/grub2/grub.cfg mkinitrd

Filed Under: Bash, Debian, Ubuntu Tagged With: chroot, Debian, Grub, Grub2, install grub, MBR, openSUSE, Ubuntu

Move min/max/close buttons to the right side

August 13, 2010 by Igor Drobot Leave a Comment

With version 10.4 Ubuntu design team decided to move the “minimize/maximize/close” buttons to the left side. For everybody who do not like this and want their old buttons back on the right, follow the instructions.






Open to the “Terminal” or “Konsole” and run this:

1
gconf-editor

gconf-editor

Now navigate to:

1
apps => metacity => general

apps => metacity => general

And change the key button_layout from:

1
maximize,minimize,close:

maximize,minimize,close:

to

1
menu:minimize,maximize,close

menu:minimize,maximize,close





Even faster is this command you need to run in your terminal/shell:

1
gconftool-2 --set /apps/metacity/general/button_layout --type string menu:minimize,maximize,close

gconftool-2 --set /apps/metacity/general/button_layout --type string menu:minimize,maximize,close

Filed Under: Linux, Ubuntu Tagged With: 10.04, GNOME, Lucid, Style, Ubuntu, ubuntu 10.10

Persistent IPv6 Address

July 21, 2010 by Igor Drobot 1 Comment

I show you, how to add a secondary IPv6 Address to your existing one.
You need only to edit “vim /etc/network/interfaces” file and add the IPv6 networking configuration.

1
2
3
4
5
6
7
8
9
10
11
12
13
# The loopback network interface
auto lo
iface lo inet loopback
 
# The primary network interface
auto eth0
iface eth0 inet static
 address 10.1.100.4
 gateway 10.1.100.1
 netmask 255.255.255.0
 pre-up modprobe ipv6
 post-up ip addr add 2001:470:1f0b:1514::4/64 dev eth0 
 post-up ip route add default via 2001:470:1f0b:1514::1 dev eth0

# The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet static address 10.1.100.4 gateway 10.1.100.1 netmask 255.255.255.0 pre-up modprobe ipv6 post-up ip addr add 2001:470:1f0b:1514::4/64 dev eth0 post-up ip route add default via 2001:470:1f0b:1514::1 dev eth0

Another way to do the same:

1
2
3
4
5
6
pre-up modprobe ipv6
 
iface eth0 inet6 static
 address 2001:470:1f0b:1514::4
 netmask 64
 gateway 2001:470:1f0b:1514::1

pre-up modprobe ipv6 iface eth0 inet6 static address 2001:470:1f0b:1514::4 netmask 64 gateway 2001:470:1f0b:1514::1

Also you can put the ipv6 module in to “/etc/modules” instead of “pre-up modprobe ipv6”

Test it:

1
ping6 ipv6.google.com

ping6 ipv6.google.com

Some complexe example:

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
# The loopback network interface
auto lo
iface lo inet loopback
 
# The primary network interface
allow-hotplug eth0
iface eth0 inet static
        address 188.40.116.234
        netmask 255.255.255.0
        network 188.40.116.0
        broadcast 188.40.116.255
        gateway 188.40.116.206
 
auto eth0:1
iface eth0:1 inet static
        address 192.168.2.70
        netmask 255.255.255.0
 
# IPv6 over tunnel-broker
auto he-ipv6
iface he-ipv6 inet6 v4tunnel
 endpoint   216.66.80.30
 ttl        255
 address    2001:470:1f0a:1604::2
 netmask    64
 mtu        1480
 post-up ip addr add 2001:470:1f0b:1604::1/64 dev eth0
 post-up ip route add ::/0 dev he-ipv6

# The loopback network interface auto lo iface lo inet loopback # The primary network interface allow-hotplug eth0 iface eth0 inet static address 188.40.116.234 netmask 255.255.255.0 network 188.40.116.0 broadcast 188.40.116.255 gateway 188.40.116.206 auto eth0:1 iface eth0:1 inet static address 192.168.2.70 netmask 255.255.255.0 # IPv6 over tunnel-broker auto he-ipv6 iface he-ipv6 inet6 v4tunnel endpoint 216.66.80.30 ttl 255 address 2001:470:1f0a:1604::2 netmask 64 mtu 1480 post-up ip addr add 2001:470:1f0b:1604::1/64 dev eth0 post-up ip route add ::/0 dev he-ipv6

Filed Under: Debian, IPv6, Linux, Networking Tagged With: Debian, interfaces, Ipv6, Linux, network, Ubuntu

Convert mp4 to mp3

June 23, 2010 by Igor Drobot 1 Comment

In this little tutorial I show you how to convert mp4 to mp3.

First method:

1
vlc some-video.mp4 --sout '#transcode{acodec=mp2a, ab=96}:std{access=file, dst= "my_new.mp3", mux=ts}'

vlc some-video.mp4 --sout '#transcode{acodec=mp2a, ab=96}:std{access=file, dst= "my_new.mp3", mux=ts}'

Second one:

Your copy of FFmpeg needs to be capable of outputting mp3:

1
ffmpeg -formats | grep libmp3lame

ffmpeg -formats | grep libmp3lame

1
ffmpeg -i 2Invention_Lonely_Star.MP4 -acodec libmp3lame -ab 128k 2Invention.mp3

ffmpeg -i 2Invention_Lonely_Star.MP4 -acodec libmp3lame -ab 128k 2Invention.mp3

Or a loop for more than one file:

1
for f in *.mp4; do ffmpeg -i $f -acodec libmp3lame -ab 128k $(echo $f | sed 's/\.mp4$/\.mp3/'); done

for f in *.mp4; do ffmpeg -i $f -acodec libmp3lame -ab 128k $(echo $f | sed 's/\.mp4$/\.mp3/'); done




Convert to WAV:

1
mplayer -ao pcm 2Invention_Star.MP4 -ao pcm:file="2Invention_Star.wav"

mplayer -ao pcm 2Invention_Star.MP4 -ao pcm:file="2Invention_Star.wav"

A little convert loop:

1
2
3
4
5
6
7
#!/bin/bash
# 
# m4a2wav
# 
for i in *.m4a; do
    mplayer -ao pcm "$i" -ao pcm:file="${i%.m4a}.wav"
done

#!/bin/bash # # m4a2wav # for i in *.m4a; do mplayer -ao pcm "$i" -ao pcm:file="${i%.m4a}.wav" done

Filed Under: Linux Tagged With: Convert mp4, mp3, mp4 to mp3, Ubuntu

  • « Previous Page
  • 1
  • 2
Yeaaah Cookie! We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok