lost and found ( for me ? )

Fedora 18 : how to install eclipse


[root@localhost ~]# cat /etc/fedora-release ; uname -ri
Fedora release 18 (Spherical Cow)
3.7.2-204.fc18.x86_64 x86_64

you can install eclipse with yum groupinstall.
[root@localhost ~]# yum grouplist | grep -i eclipse
  Fedora Eclipse

[root@localhost ~]# yum groupinfo eclipse
Loaded plugins: langpacks, presto, refresh-packagekit

Group: Fedora Eclipse
Group-Id: eclipse
Description: Integrated Development Environments based on Eclipse.
Mandatory Packages:
  eclipse-cdt
  eclipse-jdt
Default Packages:
  eclipse-callgraph
  eclipse-changelog
  eclipse-collabnet-merge
  eclipse-dtp
  eclipse-egit
  eclipse-fedorapackager
  eclipse-mpc
  eclipse-mylyn
  eclipse-mylyn-context-cdt
  eclipse-mylyn-context-java
  eclipse-mylyn-tasks-bugzilla
  eclipse-mylyn-tasks-trac
  eclipse-mylyn-tasks-web
  eclipse-oprofile
  eclipse-packagekit
  eclipse-pde
  eclipse-pydev
  eclipse-rpm-editor
  eclipse-subclipse
  eclipse-valgrind
Optional Packages:
  eclipse-cmakeed
  eclipse-dltk-ruby
  eclipse-dltk-tcl
  eclipse-eclemma
  eclipse-epic
  eclipse-findbugs
  eclipse-moreunit
  eclipse-mylyn-fedora-integration
  eclipse-photran
  eclipse-phpeclipse
  eclipse-quickrex
  eclipse-rpmstubby
  eclipse-shelled
  eclipse-texlipse
  eclipse-veditor
[root@localhost ~]#

install Fedora Eclipse
# yum groupinstall "Fedora Eclipse" -y


start eclipse via GUI Icon.



[ add PyDev plugin ]

Eclipse GUI -> help -> eclipse marketplace
search “python” and install PyDev






after installing the plugin , restart eclipse to reflect the config.

GUI -> WIndow -> Preference -> PyDev -> Editor -> Interpreter - Python

auto config -> select all -> OK





create a project

GUI -> file -> new project -> PyDev Project
click next



enter a project name and check “create src folder …” 




create a python file under src directory ( GUI -> test01 -> src -> right click -> New -> File )




right click “test01.py” -> Run as



Fedora 18 : change default language


[root@localhost ~]# cat /etc/fedora-release
Fedora release 18 (Spherical Cow)

[root@localhost ~]# uname -ri
3.7.2-204.fc18.x86_64 x86_64

install “system-config-language” if you have not installed it.
[root@localhost ~]# yum install system-config-language -y

run system-config-language



reboot the OS to reflect the configuration.

[root@localhost ~]# init 6

Python IDE : IEP ( Interactive Editor for Python )

[ about IEP ]

IEP is one of Python IDE tools.

There are Windows ver. , MAC OS ver. and Linux ver.http://code.google.com/p/iep/

[ how to use IEP ]


[root@localhost hattori]# cat /etc/fedora-release
Fedora release 18 (Spherical Cow)

[root@localhost hattori]# uname -ri
3.7.2-204.fc18.x86_64 x86_64

[root@localhost hattori]# python --version
Python 2.7.3

download IEP
# iep-3.1.1.linux64.tar.gz

[root@localhost hattori]# tar xzvf iep-3.1.1.linux64.tar.gz

[root@localhost hattori]# cd iep/


start iep
[root@localhost iep]# pwd
/home/hattori/iep

[root@localhost iep]# ./iep &









How to install untangle 9.4 within KVM

Here’s how to install untangle 9.4 within KVM.

[ about untangle ]

http://www.untangle.com/
untangle acts as a gateway for web filter , captive portal , virus block , firewall etc.

[ build untangle VM including trial and error logs ]

KVM host info
# libvirtd –version
libvirtd (libvirt) 0.9.13

# kvm --version
QEMU emulator version 1.2.0 (qemu-kvm-1.2.0+noroms-0ubuntu2.12.10.2, Debian), Copyright (c) 2003-2008 Fabrice Bellard


download an ISO from http://www.untangle.com/
mint-1 hattori # ls ISO_files/untangle*
ISO_files/untangle_940_x32.iso


Before installing untangle within KVM , mount the ISO to confirm on which Linux distributions untangle is based.
mint-1 hattori # mount ISO_files/untangle_940_x32.iso tmp_mount -t iso9660 -o loop


untangle 9.4 seems to be based on Debian lenny.
mint-1 tmp_mount # pwd
/home/hattori/tmp_mount
mint-1 tmp_mount # cat dists/lenny/Release
Suite: stable
Codename: lenny
Date: Mon, 21 Jan 2013 19:42:19 +0000
Architectures: i386
Components: main
Description: mirror for lenny
MD5Sum:
5c74aba3d6cc7f95c5ddf25bca781472       81 main/binary-i386/Release
64cdc9b47e682d97364221e088959418   709827 main/binary-i386/Packages
8c64b1142d1a389f36788f3695b27721   224779 main/binary-i386/Packages.gz
0ff9a07cfeb5a97f1329bedd34cfbe6a   189093 main/debian-installer/binary-i386/Packages
6ff2d79ade21baabd654a31de5ecae99    46047 main/debian-installer/binary-i386/Packages.gz


unmount
mint-1 tmp_mount # cd /home/hattori/
mint-1 hattori # umount tmp_mount/


build untangle VM with virt-manager

OS type : Linux
Version : Debian Lenny


Please note that untangle requires at least two NICs. So before installing untangle , please add two vNICs or more.

the installation is very easy .. just click , click ..


untangle requires at least two NICs.
In my environment , I added only one vNIC.

shutdown the untangle VM , add one more vNIC which means that the untangle VM has two vNICs totally , and boot the VM again.

OMG , the VM has not recognized the vNIC I added after the installation..
I still face the same error after adding one more vNIC and rebooting the VM.

Okay , I’ll reinstall untangle..
build the VM again.
add two vNICs before the installation and then start the installation.


select the network topology.  one is router mode , the other is bridge mode.



okay , I finished the initial setup.

The following is the Web GUI.

You can add applications you’d like to use over the internet.
Some packages are free of charge , some are commercial.

Fedora 18 : how to burn an ISO image with CLI ( wodim )

small tips.
You can burn an ISO image into CD / DVD media with CLI by using wodim command.

[root@localhost ~]# cat /etc/fedora-release
Fedora release 18 (Spherical Cow)

[root@localhost ~]# uname -ri
3.7.2-204.fc18.x86_64 x86_64

install wodim via yum
[root@localhost ~]# yum install -y wodim

[root@localhost ~]# wodim --version
Cdrecord-yelling-line-to-tell-frontends-to-use-it-like-version 2.01.01a03-dvd
Wodim 1.1.11
Copyright (C) 2006 Cdrkit suite contributors
Based on works from Joerg Schilling, Copyright (C) 1995-2006, J. Schilling

check your CD/DVD drive path. nn , can’t find the location.
[root@localhost ~]# wodim --devices
wodim: No such file or directory.
Cannot open SCSI driver!
For possible targets try 'wodim --devices' or 'wodim -scanbus'.
For possible transport specifiers try 'wodim dev=help'.
For IDE/ATAPI devices configuration, see the file README.ATAPI.setup from
the wodim documentation.

check the device name from dmesg.
Seen from the output , my CD/DVD-ROM drive path seems to be /dev/sr0
[root@localhost ~]# dmesg | egrep -i "cd-rom|dvd-rom"
[    1.609196] ohci_hcd 0000:00:14.5: irq 18, io mem 0xfe7f6000
[    1.663828] usb usb7: Manufacturer: Linux 3.7.2-204.fc18.x86_64 ohci_hcd
[    1.664011] uhci_hcd: USB Universal Host Controller Interface driver
[    1.735715] usb 1-4: new high-speed USB device number 3 using ehci_hcd
[    1.838744] ata2.00: ATAPI: hp        DDVDW TS-H653R, 0E00, max UDMA/100
[    1.842532] scsi 1:0:0:0: CD-ROM            hp       CDDVDW TS-H653R  0E00 PQ: 0 ANSI: 5
[    1.846239] sr0: scsi3-mmc drive: 40x/40x writer dvd-ram cd/rw xa/form2 cdda tray
[    1.846246] cdrom: Uniform CD-ROM driver Revision: 3.20
[    1.846586] sr 1:0:0:0: Attached scsi CD-ROM sr0
[    2.076998] usb 3-3: new low-speed USB device number 2 using ohci_hcd
[    2.593983] usb 2-6: new high-speed USB device number 4 using ehci_hcd
[   13.020578] usb 5-1: new low-speed USB device number 2 using ohci_hcd
[   13.426786] usb 5-2: new full-speed USB device number 3 using ohci_hcd

check the device info with udevadm
[root@localhost ~]# udevadm info --query=all --name=/dev/sr0
P: /devices/pci0000:00/0000:00:11.0/ata2/host1/target1:0:0/1:0:0:0/block/sr0
N: sr0
L: -100
S: cdrom
S: disk/by-id/ata-hp_DDVDW_TS-H653R_R3786GBZ414203
E: DEVLINKS=/dev/cdrom /dev/disk/by-id/ata-hp_DDVDW_TS-H653R_R3786GBZ414203
E: DEVNAME=/dev/sr0
E: DEVPATH=/devices/pci0000:00/0000:00:11.0/ata2/host1/target1:0:0/1:0:0:0/block/sr0
E: DEVTYPE=disk
E: ID_ATA=1
E: ID_ATA_SATA=1
E: ID_ATA_SATA_SIGNAL_RATE_GEN1=1
E: ID_BUS=ata
E: ID_CDROM=1
E: ID_CDROM_CD=1
E: ID_CDROM_CD_R=1
E: ID_CDROM_CD_RW=1
E: ID_CDROM_DVD=1
E: ID_CDROM_DVD_PLUS_R=1
E: ID_CDROM_DVD_PLUS_RW=1
E: ID_CDROM_DVD_PLUS_R_DL=1
E: ID_CDROM_DVD_R=1
E: ID_CDROM_DVD_RAM=1
E: ID_CDROM_DVD_RW=1
E: ID_CDROM_MEDIA=1
E: ID_CDROM_MEDIA_DVD_R=1
E: ID_CDROM_MEDIA_SESSION_COUNT=1
E: ID_CDROM_MEDIA_SESSION_NEXT=1
E: ID_CDROM_MEDIA_STATE=blank
E: ID_CDROM_MEDIA_TRACK_COUNT=1
E: ID_CDROM_MRW=1
E: ID_CDROM_MRW_W=1
E: ID_MODEL=hp_DDVDW_TS-H653R
E: ID_MODEL_ENC=hp\x20\x20\x20\x20\x20\x20\x20\x20DDVDW\x20TS-H653R\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
E: ID_REVISION=0E00
E: ID_SERIAL=hp_DDVDW_TS-H653R_R3786GBZ414203
E: ID_SERIAL_SHORT=R3786GBZ414203
E: ID_TYPE=cd
E: MAJOR=11
E: MINOR=0
E: MPATH_SBIN_PATH=/sbin
E: SUBSYSTEM=block
E: TAGS=:seat:systemd:uaccess:
E: USEC_INITIALIZED=117573

/dev/cdrom is a symbolic link to /dev/sr0
[root@localhost hattori]# ls -l /dev/cdrom
lrwxrwxrwx. 1 root root 3 Jan 24 00:02 /dev/cdrom -> sr0

insert a blank DVD media and burn the ISO into that media.
[root@localhost ~]# wodim -v dev=/dev/cdrom speed=8 -eject /home/hattori/Fedora-18-x86_64-DVD/Fedora-18-x86_64-DVD.iso
wodim: No write mode specified.
wodim: Assuming -tao mode.
wodim: Future versions of wodim may have different drive dependent defaults.
TOC Type: 1 = CD-ROM
scsidev: '/dev/cdrom'
devname: '/dev/cdrom'
scsibus: -2 target: -2 lun: -2
Linux sg driver version: 3.5.27
Wodim version: 1.1.11
SCSI buffer size: 64512
Device type    : Removable CD-ROM
Version        : 5
Response Format: 2
Capabilities   :
Vendor_info    : 'hp      '
Identification : 'CDDVDW TS-H653R '
Revision       : '0E00'
Device seems to be: Generic mmc2 DVD-R/DVD-RW.
Current: 0x0011 (DVD-R sequential recording)
Profile: 0x0015 (DVD-R/DL sequential recording)
Profile: 0x0016 (DVD-R/DL layer jump recording)
Profile: 0x002B (DVD+R/DL)
Profile: 0x001B (DVD+R)
Profile: 0x001A (DVD+RW)
Profile: 0x0014 (DVD-RW sequential recording)
Profile: 0x0013 (DVD-RW restricted overwrite)
Profile: 0x0012 (DVD-RAM)
Profile: 0x0011 (DVD-R sequential recording) (current)
Profile: 0x0010 (DVD-ROM)
Profile: 0x000A (CD-RW)
Profile: 0x0009 (CD-R)
Profile: 0x0008 (CD-ROM)
Profile: 0x0002 (Removable disk)
Using generic SCSI-3/mmc DVD-R(W) driver (mmc_mdvd).
Driver flags   : SWABAUDIO BURNFREE
Supported modes: PACKET SAO
Drive buf size : 1081344 = 1056 KB
Beginning DMA speed test. Set CDR_NODMATEST environment variable if device
communication breaks or freezes immediately after that.
FIFO size      : 4194304 = 4096 KB
Track 01: data  4362 MB        
Total size:     5009 MB (496:17.92) = 2233344 sectors
Lout start:     5009 MB (496:19/69) = 2233344 sectors
Current Secsize: 2048
HINT: use dvd+rw-mediainfo from dvd+rw-tools for information extraction.
Blocks total: 2298496 Blocks current: 2298496 Blocks remaining: 65152
Speed set to 11080 KB/s
Starting to write CD/DVD at speed   8.0 in real unknown mode for single session.
Last chance to quit, starting real write in    0 seconds. Operation starts.
Waiting for reader process to fill input buffer ... input buffer ready.
Performing OPC...
Starting new track at sector: 0
Track 01: 4362 of 4362 MB written (fifo 100%) [buf  99%]   8.1x.
Track 01: Total bytes read/written: 4573888512/4573888512 (2233344 sectors).
Writing  time:  527.256s
Average write speed   6.4x.
Min drive buffer fill was 99%
Fixating...
Fixating time:   13.773s
wodim: fifo had 72044 puts and 72044 gets.
wodim: fifo was 0 times empty and 23074 times full, min fill was 73%.
[root@localhost ~]#

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 Zentyal 3.0-1 amd64 within KVM

Here’s an explanation of how to install Zentyal within KVM.

[ about zentyal ]

In short , zentyal is a small business server similar to pfSense , PacketFence , Utangle etc.
please check the below URL , if you’d like to know the detail about zentyal more.
http://www.zentyal.org/
I’m now looking for captive portal tool…

# libvirtd –version
libvirtd (libvirt) 0.9.13

# kvm --version
QEMU emulator version 1.2.0 (qemu-kvm-1.2.0+noroms-0ubuntu2.12.10.2, Debian), Copyright (c) 2003-2008 Fabrice Bellard


I’ll build the VM in KVM by using zentyal-3.0-1-amd64.iso.

[ build zentyal VM with virt-manager ]

Seen from the zentyal site (http://www.zentyal.org/) , zentyal 3 is based on Ubuntu 12.04 LTS.




the installation is similar to Ubuntu 12.04 LTS’s installation.




the installation has completed!




[ how to enable console access to the VM with “virsh console” ]

confirm the VM has a serial port

on the KVM host

# virsh dumpxml zentyal3-vm01 | egrep -i "console|serial"
   <serial type='pty'>
     <alias name='serial0'/>
   </serial>
   <console type='pty' tty='/dev/pts/1'>
     <target type='serial' port='0'/>
     <alias name='serial0'/>
   </console>


on the VM , make /etc/init/ttyS0.conf file
root@zentyal-1:~# cat /etc/init/ttyS0.conf
start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]

respawn
exec /sbin/getty -L 115200 ttyS0 vt102


make grub.cfg
# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-29-generic
Found initrd image: /boot/initrd.img-3.2.0-29-generic
done


add write permission
# chmod u+w /boot/grub/grub.cfg


edit grub.cfg
add the red lines
serial -speed=115200 -unit=0 -word=8 -parity=no -stop=1
terminal -timeout=10 serial

menuentry 'Ubuntu, with Linux 3.2.0-29-generic' --class ubuntu --class gnu-linux --class gnu --class os {
       recordfail
       gfxmode $linux_gfx_mode
       insmod gzio
       insmod part_msdos
       insmod ext2
       set root='(hd0,msdos1)'
       search --no-floppy --fs-uuid --set=root 96d5cc44-a368-470d-a4ae-831a6b5ee47e
       linux   /vmlinuz-3.2.0-29-generic root=/dev/mapper/zentyal--1-root ro   quiet splash $vt_handoff console=ttyS0,115200n8
       initrd  /initrd.img-3.2.0-29-generic


reboot the VM
virsh # reboot zentyal3-vm01
Domain zentyal3-vm01 is being rebooted


access to the VM via console
virsh # console zentyal3-vm01
Connected to domain zentyal3-vm01
Escape character is ^]

Ubuntu 12.04.1 LTS zentyal-1 ttyS0

zentyal-1 login: root
Password:
Welcome to Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-29-generic x86_64)

* Documentation:  https://help.ubuntu.com/

                   *** Zentyal WARNING ***

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.


Ubuntu 12.04 LTS : change system language via CLI

small tips
Here’s how to change system language via CLI.

Edit /etc/default/locale

# cat /etc/default/locale
LANG="en_US.UTF-8"
LANGUAGE="en_US:en"


Edit /var/lib/locales/supported.d/local
# cat /var/lib/locales/supported.d/local
en_US.UTF-8 UTF-8


Issue locale-gen command to reflect on it.
# locale-gen
Generating locales...
 en_US.UTF-8... up-to-date
Generation complete.


Finally then reboot the OS
# init 6

Python : execute Linux commands in python by using popen2 or subprocess

small tips.
Here’s an example of how to use popne2 / subprocess .


# python --version
Python 2.7.3


[ use popne2 ]

nnn , the output includes empty lines..
# python
Python 2.7.3 (default, Sep 26 2012, 21:51:14)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import popen2
>>> cmd1 = 'ls -a'
>>> stdout_cmd1,stdin_cmd1,stderr_cmd1 = popen2.popen3(cmd1)
>>> for i in stdout_cmd1.readlines():
...     print i
...
.

..

.ICEauthority
    <- empty line
.Xauthority
    <- empty line
.Xmodmap

.aptitude

.bash_history

.cache

.config
<snip>
>>>


to remove empty lines , use rstrip() method.
>>> stdout_cmd1,stdin_cmd1,stderr_cmd1 = popen2.popen3(cmd1)
>>> for i in stdout_cmd1.readlines():
...     print i.rstrip()
...
.
..
.ICEauthority
.Xauthority
.Xmodmap
.aptitude
.bash_history
.cache
.config
.dbus
.gconf
.gnome2
.gns3
.gstreamer-0.10
.gtk-bookmarks
.guestfish
.gvfs
.john
.lesshst
.linuxmint
.local
.mateconf
.mateconfd
.mbrowse
.mbrowse_bookmarks
.msf4
.pki
.profile
.pulse
.pulse-cookie
.rnd
.scapy_history
.selected_editor
.spicec
.ssh
.synaptic
.toprc
.virsh
.virt-manager
.virtinst
.vnc
.w3af
.xsession-errors
Desktop
Documents
Downloads
Music
Pictures
Public
Templates
Videos


[ use subprocess ]
# python
Python 2.7.3 (default, Sep 26 2012, 21:51:14)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>> cms1 = 'ls -a'
>>> for i in result_cmd1.stdout.readlines():
...     print i.rstrip()
...
.
..
.ICEauthority
.Xauthority
.Xmodmap
.aptitude
.bash_history
.cache
.config
.dbus
.gconf
.gnome2
.gns3
.gstreamer-0.10
.gtk-bookmarks
.guestfish
.gvfs
.john
.lesshst
.linuxmint
.local
.mateconf
.mateconfd
.mbrowse
.mbrowse_bookmarks
.msf4
.pki
.profile
.pulse
.pulse-cookie
.rnd
.scapy_history
.selected_editor
.spicec
.ssh
.synaptic
.toprc
.virsh
.virt-manager
.virtinst
.vnc
.w3af
.xsession-errors
Desktop
Documents
Downloads
Music
Pictures
Public
Templates
Videos
>>>