lost and found ( for me ? )

Showing posts with label linux mint. Show all posts
Showing posts with label linux mint. Show all posts

Linux Mint 14 : burn ISO images with k3b

Here’s an explanation of how to burn an ISO with k3b.

mint14-1 hattori # lsb_release -a
No LSB modules are available.
Distributor ID:    LinuxMint
Description:    Linux Mint 14 Nadia
Release:    14
Codename:    nadia

mint14-1 hattori # uname -ri
3.5.0-21-generic x86_64


install k3b via apt-get
mint14-1 hattori # apt-get install -y k3b


insert a DVD blank media into your CD/DVD drive and start k3b
mint14-1 hattori # k3b




select “New Data Project” and then drag and drop an ISO image you want to burn.


click start to burn the ISO file.


That’s it.

how to install / uninstall metasploint on Linux Mint

Here’s an explanation of how to install / uninstall metasploit.

[ install metasploit ]


# lsb_release -a
No LSB modules are available.
Distributor ID: LinuxMint
Description:    Linux Mint 12 Lisa
Release:        12
Codename:       lisa

# uname -ri
3.5.0-21-generic x86_64


download metasploit

for 32bit ver.
# wget http://downloads.metasploit.com/data/releases/metasploit-latest-linux-installer.run


for 64bit ver.
# wget http://downloads.metasploit.com/data/releases/metasploit-latest-
linux-x64-installer.run

chmod u+x metasploit-latest-linux-x64-installer.run


install.
the installation is very easy , just press enter , enter …
# ./metasploit-latest-linux-x64-installer.run
<snip>
Please wait while Setup installs Metasploit on your computer.

Installing
0% ______________ 50% ______________ 100%
#########################################

----------------------------------------------------------------------------
Setup has finished installing Metasploit on your computer.

Info: To access Metasploit, go to
       https://localhost:3790 from your browser.
Press [Enter] to continue :
#


By default , metasploit will be installed under /opt/metasploit-x.x.x/ directory

update the metasploit framework
# msfupdate
[*]
[*] Attempting to update the Metasploit Framework...
[*]

[*] No updates available


start metasploit
# msfconsole
      =[ metasploit v4.5.0-release [core:4.5 api:1.0]
+ -- --=[ 1000 exploits - 562 auxiliary - 164 post
+ -- --=[ 262 payloads - 28 encoders - 8 nops

msf >
msf > use <tab>
Display all 2020 possibilities? (y or n)
use auxiliary/admin/2wire/xslt_password_reset
use auxiliary/admin/backupexec/dump
use auxiliary/admin/backupexec/registry
use auxiliary/admin/cisco/cisco_secure_acs_bypass
use auxiliary/admin/cisco/vpn_3000_ftp_bypass
use auxiliary/admin/db2/db2rcmd
use auxiliary/admin/edirectory/edirectory_dhost_cook
<snip>


[ uninstall metasploit ]

how to uninstall metasploit
# /opt/metasploit-4.5.0/uninstall
Do you want to uninstall Metasploit and all of its modules? [Y/n]: y

----------------------------------------------------------------------------
Uninstall Status

Uninstalling Metasploit
0% ______________ 50% ______________ 100%
#########################################

Info: Uninstallation completed
Press [Enter] to continue :
#

Linux Mint 14 : install Ubuntu 12.10 Server within KVM via CLI ( no GUI )

Here’s an explanation of how to install Ubuntu VMs with CLI by using virt-install.

KVM host
mint14-1 hattori # lsb_release -a
No LSB modules are available.
Distributor ID: LinuxMint
Description: Linux Mint 14 Nadia
Release: 14
Codename: nadia
mint14-1 hattori # uname -ri
3.5.0-19-generic x86_64
mint14-1 hattori # kvm --version
QEMU emulator version 1.2.0 (qemu-kvm-1.2.0+noroms-0ubuntu2, Debian), Copyright (c) 2003-2008 Fabrice Bellard
mint14-1 hattori # virt-install --version
0.600.2


[ logs including trial and error ]

at first , create a virtual disk for the VM.
# qemu-img create -f qcow2 /var/disk1/libvirt_images/ubuntu1210-01.qcow2 10G
Formatting '/var/disk1/libvirt_images/ubuntu1210-01.qcow2', fmt=qcow2 size=10737418240 encryption=off cluster_size=65536 lazy_refcounts=off


then install the VM over virt-install.
nnn , error
mint14-1 ~ # virt-install --connect qemu:///system --name ubuntu1210-vm01 --ram 512 --disk=/var/disk1/libvirt_images/ubuntu1210-01.qcow2,format=qcow2 -c /home/hattori/ubuntu-12.10-server-amd64.iso --os-type linux --virt-type kvm --arch x86_64 --nographics --vcpus=1 --os-variant ubuntuquantal -w bridge=virbr0 --hvm --extra-args='console=tty0 console=ttyS0,115200n8' --keymap=ja
ERROR    --extra-args only work if specified with --location.


it seems that we use “--extra-args” options when specifying “--location”.

install apache2 to have “virt-isntall” load the iso file over HTTP.
# apt-get install apache2

mint14-1 hattori # mv ubuntu-12.10-server-amd64.iso /var/www/
mint14-1 hattori # ls /var/www/*.iso
/var/www/ubuntu-12.10-server-amd64.iso


still error
mint14-1 ~ # virt-install --connect qemu:///system --name ubuntu1210-vm01 --ram 512 --disk=/var/disk1/libvirt_images/ubuntu1210-01.qcow2,format=qcow2 --location http://127.0.0.1/ubuntu-12.10-server-amd64.iso --os-type linux --virt-type kvm --arch x86_64 --nographics --vcpus=1 --os-variant ubuntuquantal -w bridge=virbr0 --hvm --extra-args='console=tty0 console=ttyS0,115200n8' --keymap=ja
ERROR    Error validating install location: Could not find an installable distribution at 'http://127.0.0.1/ubuntu-12.10-server-amd64.iso'
The location must be the root directory of an install tree.


it seems that I need to specify the ISO mount point instead of the ISO file.

mount the iso file.
mint14-1 hattori # mkdir /var/www/iso_mnt

mint14-1 hattori # mount -t iso9660 /var/www/ubuntu-12.10-server-amd64.iso /var/www/iso_mnt
mount: warning: /var/www/iso_mnt seems to be mounted read-only.

mint14-1 hattori # ls /var/www/iso_mnt/
EFI                 boot   doc      isolinux    pics  preseed
README.diskdefines  dists  install  md5sum.txt  pool  ubuntu


try again. okay , the installation has started.
mint14-1 ~ # virt-install --connect qemu:///system --name ubuntu1210-vm01 --ram 512 --disk=/var/disk1/libvirt_images/ubuntu1210-01.qcow2,format=qcow2 --location http://127.0.0.1/iso_mnt/ --os-type linux --virt-type kvm --arch x86_64 --nographics --vcpus=1 --os-variant ubuntuquantal -w bridge=virbr0 --hvm --extra-args='console=tty0 console=ttyS0,115200n8' --keymap=ja

Starting install...
Retrieving file version.info...                                     |  116 B     00:00 ...
Retrieving file linux...                                            | 9.8 MB     00:00 ...
Retrieving file initrd.gz...                                        |  36 MB     00:00 ...
Creating domain...                                                  |    0 B     00:00     
Connected to domain ubuntu1210-vm01
Escape character is ^]
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu

<snip>


 ┌───────────────────────┤ [!!] Select a language ├────────────────────────┐
 │                                                                         │
 │ Choose the language to be used for the installation process. The        │
 │ selected language will also be the default language for the installed   │
 │ system.                                                                 │
 │                                                                         │
 │ Language:                                                               │
 │                                                                         │
 │                               C                                         │
 │                               English                                   │
 │                                                                         │
 │     <Go Back>                                                           │
 │                                                                         │
 └─────────────────────────────────────────────────────────────────────────┘




<Tab> moves; <Space> selects; <Enter> activates buttons



installing


 ┌───────────────────────┤ [!!] Select a language ├────────────────────────┐
 │                                                                         │
 │ Choose the language to be used for the installation process. The        │
 │ selected language will also be the default language for the installed   │
 │ system.                                                                 │
 │                                                                         │
 │ Language:                                                               │
 │                                                                         │
 │                               C                                         │
 │                               English                                   │
 │                                                                         │
 │     <Go Back>                                                           │
 │                                                                         │
 └─────────────────────────────────────────────────────────────────────────┘




<Tab> moves; <Space> selects; <Enter> activates buttons



after finishing the installation , I can access to the VM over virsh serial console.
virsh # list --all
Id    Name                           State
----------------------------------------------------
2     ubuntu1210-vm01                running

virsh # console 2
Connected to domain ubuntu1210-vm01
Escape character is ^]

Ubuntu 12.10 ubuntu-vm1 ttyS0

ubuntu-vm1 login:



virsh # dumpxml ubuntu1210-vm01
<domain type='kvm'>
 <name>ubuntu1210-vm01</name>
 <uuid>a4320fba-e06b-db0a-43e0-f662d5fd1050</uuid>
 <memory unit='KiB'>524288</memory>
 <currentMemory unit='KiB'>524288</currentMemory>
 <vcpu placement='static'>1</vcpu>
 <os>
   <type arch='x86_64' machine='pc-1.2'>hvm</type>
   <boot dev='hd'/>
 </os>
 <features>
   <acpi/>
   <apic/>
   <pae/>
 </features>
 <clock offset='utc'/>
 <on_poweroff>destroy</on_poweroff>
 <on_reboot>restart</on_reboot>
 <on_crash>restart</on_crash>
 <devices>
   <emulator>/usr/bin/kvm</emulator>
   <disk type='file' device='disk'>
     <driver name='qemu' type='qcow2'/>
     <source file='/var/disk1/libvirt_images/ubuntu1210-01.qcow2'/>
     <target dev='vda' bus='virtio'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
   </disk>
   <controller type='usb' index='0'>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
   </controller>
   <interface type='bridge'>
     <mac address='52:54:00:ac:a8:cb'/>
     <source bridge='virbr0'/>
     <model type='virtio'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
   </interface>
   <serial type='pty'>
     <target port='0'/>
   </serial>
   <console type='pty'>
     <target type='serial' port='0'/>
   </console>
   <memballoon model='virtio'>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
   </memballoon>
 </devices>
</domain>

virsh #



unmount the ISO point
mint14-1 hattori # umount /var/www/iso_mnt


Triple boot : Fedora17’s grub2 has not recognized Linux MInt 14

Three Operating Systems , Win 7 , Fedora 17 and Linux Mint 14 , has been installed in my desktop PC.
Fedora’s Grub2 , which has been installed in MBR , has not recognized Linux Mint 14...

# rpm -qa | grep grub2
grub2-2.0-0.38.beta6.fc17.x86_64
grub2-tools-2.0-0.38.beta6.fc17.x86_64

# uname -ri
3.6.8-2.fc17.x86_64 x86_64

# cat /etc/fedora-release
Fedora release 17 (Beefy Miracle)

Here’s my “fdisk -l” info
# fdisk -l /dev/sda

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe0a4c958

  Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      206847      102400    7  HPFS/NTFS/exFAT  <- Win7
/dev/sda2          206911   308688974   154241032    7  HPFS/NTFS/exFAT <- Win7
/dev/sda3       308690944   615890943   153600000   83  Linux   <-  Fedora 17
/dev/sda4       615892990   976771071   180439041    5  Extended
/dev/sda5       615892992   632276991     8192000   82  Linux swap / Solaris  <- swap for Fedora n’ Mint
/dev/sda6       632279040   976771071   172246016   83  Linux  <- Linux Mint 14

run os-prober command.
Grub detected Win 7 , however did not detect Linux Mint.
# os-prober
 No volume groups found
/dev/sda1:Windows 7 (loader):Windows:chain

Mount the file system in which Linux Mint has been installed. ( /dev/sda6 )
# mount -t ext4 /dev/sda6 tmp_mount_for_Mint

After mounting the filesystem in which Linux MInt has been installed , os-prober detects both Win 7 and Mint.
# os-prober
 No volume groups found
/dev/sda1:Windows 7 (loader):Windows:chain
/dev/sda6:Linux Mint 14 Nadia (14):LinuxMint:linux

I’m not sure the reason ,, however it seems that os-prober seems to detect OSes which have been mounted.

update grub2
# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.6.8-2.fc17.x86_64
Found initrd image: /boot/initramfs-3.6.8-2.fc17.x86_64.img
Found linux image: /boot/vmlinuz-3.6.6-1.fc17.x86_64
Found initrd image: /boot/initramfs-3.6.6-1.fc17.x86_64.img
Found linux image: /boot/vmlinuz-3.6.5-1.fc17.x86_64
Found initrd image: /boot/initramfs-3.6.5-1.fc17.x86_64.img
 No volume groups found
Found Windows 7 (loader) on /dev/sda1
Found Linux Mint 14 Nadia (14) on /dev/sda6
done

unmount
# umount /home/hattori/tmp_mount_for_Mint

If your grub has not recognized OSes installed , it might be worth to try this.

Linux Mint 12 : apache : rewrite module



Here's an explanation of how to use rewrite module



install httpd via apt-get.

# apache2 -v
Server version: Apache/2.2.20 (Ubuntu)
Server built:   Feb 14 2012 16:35:38


find in which directory mod_rewrite.so exists.
# locate mod_rewrite.so
/usr/lib/apache2/modules/mod_rewrite.so


make *.load file under /etc/apache2/mods-enabled/ directory.
# cat /etc/apache2/mods-enabled/rewrite_mod.load
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

# cat /etc/apache2/mods-enabled/mod_ssl.load
LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so


edit /etc/apache2/sites-available/default file.
“AllowOverride None” to “AllowOverride All”
       <Directory /var/www/>
               Options Indexes FollowSymLinks MultiViews
#               AllowOverride None
               AllowOverride All
               Order allow,deny
               allow from all
       </Directory>


restart apache
# /etc/init.d/apache2 restart


if a client accesses to http://web server’s IP/test/zzz.html , Apache will redirect that client to  https from http.
# less /etc/apache2/sites-available/default
<VirtualHost *:80>
       ServerAdmin webmaster@localhost

       DocumentRoot /var/www
       ServerName mint-1
       <Directory />
               Options FollowSymLinks
               AllowOverride None
       </Directory>
       <Directory /var/www/>
               Options Indexes FollowSymLinks MultiViews
#               AllowOverride None
               AllowOverride All
               Order allow,deny
               allow from all

               RewriteEngine ON
               RewriteRule ^test/zzz.html https://mint-1/test/zzz.html [L,R]
       </Directory>

Fedora 16 , ubuntu 11.10 , linux mint 12 : turn off beep sound

[ Fedora ]

edit the following files

- .xsession

[root@fc16 ~]# cat ~/.xsession
xset b off

- .inputrc


[root@fc16 ~]# cat ~/.inputrc
set bell-style none

or add the above line in /etc/inputrc


[root@fc16 ~]# egrep ^"set bell" /etc/inputrc
set bell-style none

- .vim


[root@fc16 ~]# cat ~/.vimrc
set vb

then reboot OS.

[ Ubuntu 11.10 , Linux Mint 12 ]
modprobe -r pcspkr

add the following line in /etc/modprobe.d/blacklist
blacklist pcspkr