28 Apr 2010 @ 9:42 AM 

Here I will school you on some of the most important aspects of running Oracle 11g. This is not going to be another Oracle 11g new features list, I’ll be just posting any of my research findings here, in a semi-organized way as I just spent some back breaking hours getting this thing running and tuned properly.

The first post is is about Automatic Memory Management. AMM manages all SGA + PGA memory together, allowing it to shift memory from SGA to PGAs and vice versa. You only need to set a MEMORY_TARGET (and if you like, MEMORY_MAX_TARGET parameter).

You can read rest of the general details from documentation, I will talk about how this feature has been implemented on OSD / OS level (or at least how it looks to be implemented).

When I heard about MEMORY_TARGET , then the first question that came into my mind was that how can Oracle shift shared SGA memory to private PGA memory on Unix? This would mean somehow deallocating space from existing SGA shared memory segment and releasing it for PGA use. To my knowledge the traditional SysV SHM interface is not that flexible that it could downsize and release memory from a single shared memory segment. So I started checking out how Oracle had implemented this.

One option of course is not to implement it at all – just do not use the extra space in the extra SGA area and it will be soon paged out if there’s memory pressure (as long as you don’t keep your SGA pages locked – which can’t be used together with MEMORY_TARGET anyway). However should this “unneeded” memory be used again, all would have to be loaded back from swap area.

I started by checking what are the shared memory IDs for my instance:

$ sysresv

IPC Resources for ORACLE_SID "LIN11G" :
Shared Memory:
ID              KEY
1900546         0x00000000
1933315         0xa62e3ad4
Semaphores:
ID              KEY
884736          0x6687edcc
Oracle Instance alive for sid "LIN11G"

Ok, let’s look for corresponding SysV SHM segments:

$ ipcs -m

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x00000000 1900546    oracle    660        4096       0
0xa62e3ad4 1933315    oracle    660        4096       0

The segments are there, but wait a minute, they are only 4kB in size each! If there are no large shared memory segments used, where does Oracle keep its SGA?

The immediate next check I did was looking into the mapped memory for an Oracle instance process – as the SGA should be definitely mapped there!

$ pmap `pgrep -f lgwr`
29861:   ora_lgwr_LIN11G
00110000      4K rwx--    [ anon ]
00111000     32K r-x--  /apps/oracle/product/11.1.0.6/lib/libclsra11.so
00119000      4K rwx--  /apps/oracle/product/11.1.0.6/lib/libclsra11.so
...
...
49000000  16384K rwxs-  /dev/shm/ora_LIN11G_3997699_0
4a000000  16384K rwxs-  /dev/shm/ora_LIN11G_3997699_1
4b000000  16384K rwxs-  /dev/shm/ora_LIN11G_3997699_2
4c000000  16384K rwxs-  /dev/shm/ora_LIN11G_3997699_3
4d000000  16384K rwxs-  /dev/shm/ora_LIN11G_3997699_4
...
...
88000000  16384K rwxs-  /dev/shm/ora_LIN11G_3997699_63
89000000  16384K rwxs-  /dev/shm/ora_LIN11G_3997699_64
bfc1f000     88K rwx--    [ stack ]
 total  1225048K

pmap output reveals that Oracle 11g likes to use /dev/shm for shared memory implementation instead. There are multiple 16MB “files” mapped to Oracle server processes address space.
This is the Linux’es POSIX-oriented SHM implementation, where everything, including shared memory segments, is a file.

Thanks to allocating SGA in many smaller chunks, Oracle is easily able to release some parts of SGA memory back to OS and server processes are allowed to increase their aggregate PGA size up to the amount of memory released.
(Btw, if your MEMORY_MAX_TARGET parameter is larger than 1024 MB then Oracle’s memory granule size is 16MB on Linux, otherwise it’s 4MB).

Note that the PGA memory is still completely independent memory, allocated just by mmap’ing /dev/zero, it doesn’t really have anything to do with shared memory segments ( unless you’re using some hidden parameters on Solaris, but that’s another story ).
PGA_AGGREGATE_TARGET itself is just a recommended number, leaving over from MEMORY_TARGET – SGA_TARGET (if it’s set). And Oracle uses that number to decide how big PGAs it will “recommend” for sessions that are using WORKAREA_SIZE_POLICY=AUTO.

So how does Oracle actually release the SGA memory when it’s downsized?

Compare these outputs:

/dev/shm before starting instance:

$ ls -l /dev/shm/
total 0

Obviously there’s nothing reported as no /dev/shm segments are in use.

/dev/shm after starting instance with fairly large SGA (note that some output is cut for brewity).
See how some of the memory “chunks” are zero in size. These chunks are the ones which have been chosen as victims for destruction (or for not-even-creation) when space was needed or PGA areas. If you look into pmap output for any server processes you will still see this memory mapped into the address space, but it’s not just used because Oracle knows this memory is really freed.

$ ls -l /dev/shm
total 818840
-rw-r----- 1 oracle dba 16777216 Aug 20 23:29 ora_LIN11G_1900546_0
-rw-r----- 1 oracle dba        0 Aug 20 23:29 ora_LIN11G_1933315_0
-rw-r----- 1 oracle dba        0 Aug 20 23:29 ora_LIN11G_1933315_1
-rw-r----- 1 oracle dba        0 Aug 20 23:29 ora_LIN11G_1933315_10
-rw-r----- 1 oracle dba        0 Aug 20 23:29 ora_LIN11G_1933315_11
-rw-r----- 1 oracle dba        0 Aug 20 23:29 ora_LIN11G_1933315_12
-rw-r----- 1 oracle dba        0 Aug 20 23:29 ora_LIN11G_1933315_13
-rw-r----- 1 oracle dba        0 Aug 20 23:29 ora_LIN11G_1933315_14
-rw-r----- 1 oracle dba 16777216 Aug 20 23:37 ora_LIN11G_1933315_15
-rw-r----- 1 oracle dba 16777216 Aug 20 23:37 ora_LIN11G_1933315_16
-rw-r----- 1 oracle dba 16777216 Aug 20 23:37 ora_LIN11G_1933315_17
-rw-r----- 1 oracle dba 16777216 Aug 20 23:37 ora_LIN11G_1933315_18
-rw-r----- 1 oracle dba 16777216 Aug 20 23:37 ora_LIN11G_1933315_19
-rw-r----- 1 oracle dba        0 Aug 20 23:29 ora_LIN11G_1933315_2
-rw-r----- 1 oracle dba 16777216 Aug 20 23:37 ora_LIN11G_1933315_20
-rw-r----- 1 oracle dba 16777216 Aug 20 23:37 ora_LIN11G_1933315_21
-rw-r----- 1 oracle dba 16777216 Aug 20 23:37 ora_LIN11G_1933315_22
-rw-r----- 1 oracle dba 16777216 Aug 20 23:37 ora_LIN11G_1933315_23
-rw-r----- 1 oracle dba 16777216 Aug 20 23:37 ora_LIN11G_1933315_24
...

Another listing, taken after issuing “alter system set pga_aggregate_target=600M”
You can see from below that most of the /dev/shm files which were 16MB in previous listing, have also been zeroed out.

$ ls -l /dev/shm
total 408740
-rw-r----- 1 oracle dba 16777216 Aug 20 23:29 ora_LIN11G_1900546_0
-rw-r----- 1 oracle dba        0 Aug 20 23:29 ora_LIN11G_1933315_0
-rw-r----- 1 oracle dba        0 Aug 20 23:29 ora_LIN11G_1933315_1
-rw-r----- 1 oracle dba        0 Aug 20 23:29 ora_LIN11G_1933315_10
-rw-r----- 1 oracle dba        0 Aug 20 23:29 ora_LIN11G_1933315_11
-rw-r----- 1 oracle dba        0 Aug 20 23:29 ora_LIN11G_1933315_12
-rw-r----- 1 oracle dba        0 Aug 20 23:29 ora_LIN11G_1933315_13
-rw-r----- 1 oracle dba        0 Aug 20 23:29 ora_LIN11G_1933315_14
-rw-r----- 1 oracle dba        0 Aug 20 23:46 ora_LIN11G_1933315_15
-rw-r----- 1 oracle dba        0 Aug 20 23:46 ora_LIN11G_1933315_16
-rw-r----- 1 oracle dba        0 Aug 20 23:46 ora_LIN11G_1933315_17
-rw-r----- 1 oracle dba        0 Aug 20 23:46 ora_LIN11G_1933315_18
-rw-r----- 1 oracle dba        0 Aug 20 23:46 ora_LIN11G_1933315_19
-rw-r----- 1 oracle dba        0 Aug 20 23:29 ora_LIN11G_1933315_2
-rw-r----- 1 oracle dba        0 Aug 20 23:46 ora_LIN11G_1933315_20
-rw-r----- 1 oracle dba        0 Aug 20 23:46 ora_LIN11G_1933315_21
-rw-r----- 1 oracle dba        0 Aug 20 23:46 ora_LIN11G_1933315_22
-rw-r----- 1 oracle dba        0 Aug 20 23:46 ora_LIN11G_1933315_23
-rw-r----- 1 oracle dba        0 Aug 20 23:46 ora_LIN11G_1933315_24
-rw-r----- 1 oracle dba        0 Aug 20 23:46 ora_LIN11G_1933315_25
-rw-r----- 1 oracle dba        0 Aug 20 23:46 ora_LIN11G_1933315_26
-rw-r----- 1 oracle dba        0 Aug 20 23:46 ora_LIN11G_1933315_27
-rw-r----- 1 oracle dba        0 Aug 20 23:46 ora_LIN11G_1933315_28
-rw-r----- 1 oracle dba        0 Aug 20 23:46 ora_LIN11G_1933315_29
-rw-r----- 1 oracle dba        0 Aug 20 23:29 ora_LIN11G_1933315_3
-rw-r----- 1 oracle dba        0 Aug 20 23:46 ora_LIN11G_1933315_30
-rw-r----- 1 oracle dba        0 Aug 20 23:46 ora_LIN11G_1933315_31
-rw-r----- 1 oracle dba        0 Aug 20 23:46 ora_LIN11G_1933315_32
-rw-r----- 1 oracle dba        0 Aug 20 23:46 ora_LIN11G_1933315_33
-rw-r----- 1 oracle dba        0 Aug 20 23:46 ora_LIN11G_1933315_34
-rw-r----- 1 oracle dba 16777216 Aug 20 23:29 ora_LIN11G_1933315_35
-rw-r----- 1 oracle dba 16777216 Aug 20 23:29 ora_LIN11G_1933315_36
-rw-r----- 1 oracle dba 16777216 Aug 20 23:29 ora_LIN11G_1933315_37
-rw-r----- 1 oracle dba 16777216 Aug 20 23:29 ora_LIN11G_1933315_38
...

So, in Linux (tested on OEL5) Oracle 11g is using a new mechanism for managing shared memory. Well this mechanism itself isn’t that new, but it’s unconventional considering the long history of Unix SysV SHM segment use for Oracle SGAs.


Does this all matter? Yes
Why does it matter? There are few administrative differences compared to the conventional implementation.First of all, ipcs -m doesn’t show the full size of these segments anymore. You need to list /dev/shm contents for that.Also, pmap always reports that the memory is mapped (because it is) even though it doesn not have physical backing storage on tmpfs on /dev/shm device.

One more important note is that if you have not configured your tmpfs size on /dev/shm properly, then Oracle fails to allocate new POSIX-style shared memory and will not allow you to use MEMORY_TARGET parameters (startup without those parameters will however succeed).

The error message you likely get looks like that:

SQL> ORA-00845: MEMORY_TARGET not supported on this system

And is accompanied by following entry in alert.log:

Sat Aug 18 12:37:31 2007
Starting ORACLE instance (normal)
WARNING: You are trying to use the MEMORY_TARGET feature. This feature requires the /dev/shm file system to be mounted for at least 847249408 bytes. /dev/shm is either not mounted or is mounted with available space less than this size. Please fix this so that MEMORY_TARGET can work as expected. Current available is 0 and used is 0 bytes.
memory_target needs larger /dev/shm

So you need to configure large enough tmpfs on /dev/shm device to fit all memory up to MEMORY_MAX_TARGET.

The configuration works roughly like that:
(run as root):

# umount tmpfs
# mount -t tmpfs shmfs -o size=1300m /dev/shm
# df -k /dev/shm
Filesystem           1K-blocks      Used Available Use% Mounted on
shmfs                  1331200         0   1331200   0% /dev/shm

This one allows /dev/shm to grow roughly up to 1300MB, allowing you to use MEMORY_MAX_TARGET (or MEMORY_TARGET) set to 1300MB. The Linux-specific Oracle 11g documentation has more details how to configure this.


Note that after resetting various parameters I played with I realized that finally Oracle has implemented the human-friendly way for resetting parameters in SPFILE:

Sys@Lin11g> alter system reset pga_aggregate_target;

System altered.

Sys@Lin11g> alter system reset sga_target;

System altered.

…no scope=spfile sid=’*’ is needed. This resets the parameter in spfile only, the values in memory persist.

Tags Tags: , , , ,
Categories: Oracle, Server-Tek, linux
Posted By: DteK
Last Edit: 28 Apr 2010 @ 09 42 AM

E-mailPermalinkComments (2)
 05 Oct 2009 @ 5:15 PM 

33496193-2-440-ovr-1

HP 1245DX Review

The good: Attractive design skips the usual gray and black; good battery life for a desktop replacement; touch-sensitive multimedia controls; Linux Friendly(relatively)

The bad: Slower performance than core 2 duo; low-res screen not ideal for HD content.

The bottom line: HP’s attractive, multimedia-friendly Pavilion dv7-1245dx is an inexpensive choice for a desktop replacement, as long as you don’t need too much horsepower under the hood.

Here is my review of the HP Pavillion DV7 1245 dx. I purchased in Feb 2009 and now just getting around to this review after some months with it.

My requirements for a laptop were simple. I didnt need the most powerful machine because my QuadCore Desktop will get utilized for any truly CPU intensive task. I needed somthing that had a large screen, full sized keyboard, good battery life and 64bit CPU. I needed something that would compliment my desktop system when I was away. Pretty simple. In that regards I did not need to spend alot of money so my goal was to find these qualities in a machine under $800.

The 1245DX seemed at the time the best choice for what I needed. It had all the requirements, including $700 price tag at the time. While the Turion X2 processor may not have been as fast as a similar spec core 2 duo, it is no slouch. Seeing how I was moving from a 32 bit single core CPU to this, I noticed a huge gain in performance in task such as Video encoding and ISO file creation.

The design of the dv7-1245dx is very similar to the smaller 15-inch dv5-1235dx. HP wisely makes the current dv line of laptops stand out from the crowd, skipping the typical glossy gray-and-black designs for a subtle cross-hatch pattern with a bronze tint, which is more likely to fit into your post-dorm-room decor. I also like the laptop’s single, long hinge, which keeps the display from wobbling.

The touch pad (which has wide-screen-like dimensions) and mouse buttons have a highly reflective mirrored finish. It shows fingerprints and smudges easily, but also offsets the bronze chassis color nicely. One other complaint: the mirrored finish on the touch pad glides less easily against the finger than a traditional touch-pad finish, causing a little bit of finger drag.

For a budget system, the series of lighted, touch-sensitive media controls above the keyboard look especially nice, glowing either white or orange depending on status (Wi-Fi on vs. off, for example which only works on windows.). There’s also a volume slider, but for sensitive volume tweaks I still prefer a physical wheel; touch-controlled volume sliders are finicky and lack the ability to do very fine adjustments. When the system is off or asleep, the button labels literally vanish into the mirrored strip above the keyboard.

The 17-inch wide-screen LCD display offers a 1,440×900 native resolution, which is typical in less expensive desktop replacements, but the more common 1,600×1,200 screens are better for watching HD video content. The glossy screen makes video content pop, but can cause distracting glare while trying to read or type, depending on the lighting in the room.

First Off there are some quick tips that you can do to make this faster right out of the box(for a little more cash however). The stock 5400 RPM drive provided the greatest opportunity for improvement so I decided to go with a Western Digital Scorpio 320GB 7200 RPM drive

Wester Digital Scorpio

This added an additional $89(newegg.com) to the price but was well worth it, especially since this laptop has 2 drive bays! The downside to running two drives however is decreased battery life. Right now my Scorpio has plenty of space still so I am only running 1 drive in it for now.

The other good part of adding a new drive to this is that you can keep the preinstalled copy of windows vista on the stock drive in case you need to sell the machine later on.

As the title implies, my plan was to install linux on this bad boy and see what I could squeeze out of it as far as performance goes and how that would compare to my previous 32bit P4.

So first thing was to crack open the machine and replace the hard drive, pretty simple task.

1245DX Drive Bays

The two drive bays are visible in the picture above. I simply unscrewed the two black mounting screws from the mount tray and pulled the tab to remove the drive.

drive tray

removed drive

I then removed the original drive from the drive tray and replaced it with my new Scorpio (note that to use both drives at the same time, an additional drive tray is needed and not included, I found one using google)

After getting the drive back in, I was ready to install my OS. I first tried Fedora but due to some issues with the version of the kernel in Fedora 11 and unavailable ATI drives for it, I went with a more stable distro in Debian Lenny.

In both distros the install went very well, all hardware included wireless card, camera and mic were all detected.

One thing to note is that the included remote will not work unless you are running windoze.

As well, the touch controls may or may not need to be configured per app. Surprisingly in both KDE and GNOME my touch volume slider worked to control the volume. The media control buttons also work but need to be mapped per application first.

The wireless touch button also works in linux, however it does not change colors to indicate on or off. Mine stays an Amber color whether on or off. After a long bout of trying to figure out why my laptop could not see my SSID on my router which was 3 feet away, I used ‘iwlist’ tool to determine that the wireless card was not even on.

front

1245dx

The 1245dx also has an ESATA port which is convenient for connecting external storage devices. I have found that linux kernel support for this does not seem to work until at least kernel version 2.6.30 which is in Fedora 11, but unfortunately not Debian lenny.

I ultimately choose Debian Lenny over Fedora because stability is more important than bleeding edge on my laptop. I dont want to be out on the road trying to fix drivers or something else crazy like that. Fedora is an excellent distro but better suited for my desktop right now.

Debian is stable, fast, small footprint, and has an excellent package management system. It also does not hold your hands like an Ubuntu distro. Very flexible and similar in alot of ways to my favoured OS, Slackware, Debian is the perfect compliment to this machine.

I use this machine mainly for development work, writing and compiling c/c++ code, as well as some multi media work such as encoding videos, creating and burning ISO files, and watching the occasional movie.

The 1440×900 resolution is certainly lower than the res on most 17″ monitors but certainly still HD quality(higher than 720p) and very much enjoyable to watch on. ATI drivers dont seem to be quite as up to par as nvidia drivers but they get the job needed for this non gaming system. Most of the issues I had revolve around getting the correct driver with support for the kernel you are running. Right now catalyst 9.9 has been released and this seems to work ok except for a few issues when running compiz.

desktop

All said, I am pretty happy with what I got for the price I paid. Under $800 including the Scorpio hard drive and I have a very capable system of being my desktop away from home

Tags Tags: , , , ,
Categories: 64 bit Computing, Laptop, linux
Posted By: DteK
Last Edit: 05 Oct 2009 @ 11 57 PM

E-mailPermalinkComments (1)
 30 Mar 2009 @ 8:50 AM 

What is 1-Wire

1-Wire bus is a communication system developed by Dallas Semiconductor. It is quite similar to I2C, except for the data rate, which is lower, the costs, which are very low, and the range, which is higher. The 1-Wire protocol allows the communication among several devices produced by Dallas Semiconductors/Maxim, such as:

* temperature, humidity, and pressure sensors, thermocouples
* LCD, counters
* eeprom and rom memory, encryption (IP protection)
* identification devices (electronic keys)

The main applications of 1-Wire devices are as follows:

* Print Cartridge ID
* Medical Consumable ID
* Rack Card Calibration and Control
* Printed Circuit Board (PCB) identification and authentication
* Accessory/Peripheral Identification and Control
* IP Protection, Secure Feature Control, Clone Prevention
* Consumer electronics
* Access control
* Electronic cash
* Gaming devices
1-wire_0

 

1-Wire is a half-duplex, bi-directional bus, and the communication is established among a device, the master, which controls through the bus one or more slave(s). The following figure shows the block diagram of the 1-Wire communication bus, with a detail of the master (HOST in the picture) and a generic slave.

1-wire_1

 

 The master device is connected to the bus through an open-drain configuration and to the supply power (Vcc, which ranges from 2.8 to 5.25 V) through the pull-up resistor R (normally its value is 4.7 Kohm). On the other hand, the slave receives all the power it needs from the bus, which is the only wire present. As visible in the above figure, the capacitor inside each slave (usually it is a 800 pF capacitor) will be charged when the bus is in the idle state (corresponding to a high or positive level of the 1-Wire bus). When, instead, the bus is at a low level, that is when the communication between master and slave is taking place, the slave uses the energy stored in the capacitor to power itself. Differently from other bus protocols such I2C or SPI, the 1-Wire bus requires that each slave be physically connected to the bus: if a slave is disconnected, it cannot be operative any longer, thus entering a reset state; when it is connected again to the bus, it wakes up and, receiving the supply power directly from the bus, can declare its presence to the bus controller (the master device).

The principal advantages of the 1-Wire technology are:

  • Inexpensive devices, simple wiring, parasitic power
  • Unique addresses, individually addressable
  • USB, serial and i2c adapters
  • Mature technology, consulting and aftermarket support
  • iButton steel sealed devices
  • Single Contact Sufficient for Control and Operation
  • Unique ID Factory-Lasered in Each Device
  • Power Derived from Signal Bus (”Parasitically Powered”)
  • Multidrop Capable: Supports Multiple Devices on Single Line
  • Exceptional ESD Performance
  • IP Protection, Secure Feature Control, Clone Prevention

Each slave connected to a 1-Wire bus has a unique and unalterable serial number: through this ID, it can be univocally selected and addressed by the master device. The 64-bit ROM number is written during the manufacturing process and it includes the following fields: an 8-bit Family Code which identifies the slave type and functionality (up to 256 slave types are supported), a 48-bit Serial Number, an 8-bit CRC. No clock is necessary in 1-Wire bus, since time synchronization is performed by the slaves on the falling edge of the bus wire controlled by the master. There are two kinds of data rate: standard, with a transmission speed up to about 16 Kbps, and overdrive, which increases the speed by a factor of 10.
The first operation to be executed by an application on the 1-Wire bus is the selection of the slave device. Once a slave has been selected, the master sends specific commands on the bus to write data to or read data from the slave. The reset command is accepted by all the slaves connected to the bus.

OWFS: a nice open-source project related to 1-Wire

Owfs (acronym of One Wire File System) is a project created by Paul H. Alfille and The Owfs Team (Owfs homepage: http://owfs.sourceforge.net/). It is an open-source project developed under Linux operating system with the following purpose: access any 1-Wire device as if it were a regular file belonging to the file system. So, to perform a read operation from all 1-Wire temperature sensors connected to the bus, a shell command like “cat */temperature” would be enough. For instance, the collection of temperature sensors above are all on one bus, individually addressable, and will reconfigure on the fly as items are added or removed. OWFS is an original and useful way to work and experiment the powerful 1-Wire devices of Dallas Semiconductor/Maxim. Moreover, shell commands are powerful and can be organized in script files to be executed (also automatically or on a batch basis) during the development, testing, and validation phases of a 1-wire application.
The main characteristics of Owfs are:

  • Filesystem access
  • Web access (through the application owhttpd)
  • Remote network access (through the application owserver)
  • Direct language support for perl, python, php, tcl, C (libow, ownet)
  • Bootable CD
  • Support for many processors and OS
  • Free under GPL license

Universal 1-Wire COM Port Adapter

Dallas Semiconductor-Maxim offers an interesting tool (DS9097U) for 1-Wire testing and debugging. It connects to the RS232 serial port of a PC (both DB-9 and DB-25 connectors are supported) and, together with a TMEX software driver, allows reading and writing on 1-Wire devices which are connected through a RJ-11 port; both regular and overdrive data rates can be used. With the DB-9 connector it is possible to communicate only with non-eeprom 1-Wire devices, whereas the DB-25 connector allows also to write on 1-Wire eeprom even though an external power supply is requested in that case. The DS9097U adapter is based on the DS2480B Serial 1-Wire Line Driver chip.
Drivers can be freely downloaded from: http://www.ibutton.com/software/tmex/index.html.

1-wire_2

Tags Tags: , , , , ,
Categories: Hardware, linux
Posted By: DteK
Last Edit: 30 Mar 2009 @ 08 50 AM

E-mailPermalinkComments (1)
 19 Mar 2009 @ 11:14 PM 

Since there aren’t any native 64 bit packages of skype for linux, it has been somewhat of a challenge to get a workable solution. I’ve gone through the pain so you can enjoy.

My Specs:

HP DV7-1245DX laptop
AMD Turion X2 64 bit dual core 2.1 Ghz
Fedora 10 x86_64
KDE 3.5
Linux TeK360 2.6.27.19-170.2.35.fc10.x86_64 #1 SMP Mon Feb 23 13:00:23 EST 2009 x86_64 x86_64 x86_64 GNU/Linux

You can install Skype with either static or dynamically linked libraries. I recommend the dynamic version, since it makes use of the existing system libraries that are managed by Fedora. This will minimize any potential library conflicts.
The only thing necessary for you to check is to make sure you have all the 32-bit versions of the libraries Skype requires.
you can use “ldd” to analyze the library requirements for skype. I have conveniently done this step for you and compiled the appropriate yum statement.

as root:

yum install alsa-lib.i386 dbus-libs.i386 e2fsprogs-libs.i386 expat.i386 fontconfig.i386 freetype.i386 glib2.i386 glibc.i686 keyutils-libs.i386 krb5-libs.i386 libcap.i386 libgcc.i386 libICE.i386 libpng.i386 libselinux.i386 libSM.i386 libstdc++.i386 libX11.i386 libXau.i386 libxcb.i386 libXcursor.i386 libXdmcp.i386 libXext.i386 libXfixes.i386 libXi.i386 libXinerama.i386 libXrandr.i386 libXrender.i386 libXScrnSaver.i386 libXv.i386 openssl.i386 qt.i386 qt-x11.i386 zlib.i386

Now, you can install the dynamic version of Skype from here

Choose “Dynamic”, near the lower left of the box in the middle of the page.
you should be downloading the file “skype-2.0.0.72.tar.bz2″

Now, open up a new terminal window, and “cd” into the directory that you downloaded Skype into, and extract and run Skype.

cd ~/skype
tar -jxvf skype-2.0.0.72.tar.bz2
cd skype-2.0.0.72
./skype

Skype should come right up, since you now have all the libraries.

Log in. Skype should now be up and running.

In the main Skype window, hit the “S” in the lower left corner to bring up the menu, then choose Options.

Skype sound device setting:

In Skype, go to Sound Devices. I recommend setting your sound devices to something that contains “hw:SB,0″ in its name. Do this for all 3 choices: sound in, sound out, and ringing. Choose the name of your device that best matches the hardware you want to use. Definitely avoid generic single-word names like “default”, “hdmi”, “pulse”, and so on.
mine looks like:
HDA ATI SB (hw:SB,0)

Skype video settings:

In Skype, go to Video Devices. Try selecting your webcam from the list, and hit Test. My integrated HP webcam was previously setup automatically when I installed Fedora. Fedora has really improved their webcam support in this latest release. Almost every known webcam should work by now.

Now, you’re ready to make a call. Call “echo123″ first, to make sure your sound works. Call your friends, to make sure your video works

And thats pretty much it. Enjoy Skype 2 on 64 bit linux!

Tags Tags: , ,
Categories: 64 bit Computing, Applications, Hardware, Skype, linux
Posted By: DteK
Last Edit: 23 Mar 2009 @ 11 09 AM

E-mailPermalinkComments (26)
 19 Mar 2009 @ 9:11 PM 

Myths

  • “You don’t need 64-bit software with less than 3 GB RAM”
  • “There are less drivers for 64-bit OS”
  • “You will need all new software, all 64-bit”
  • “64-bit software is twice as fast”

read more…

Myths and facts about 64-bit Linux(®).

Tags Tags: , , ,
Categories: 64 bit Computing, Hardware, linux
Posted By: DteK
Last Edit: 19 Mar 2009 @ 11 23 PM

E-mailPermalinkComments (43)

 

If you have large size (21″) or small size (14″) monitor, it is better to use large/small character size. But how do you setup character size in runlevel 3 under Linux?

The answer is simple, use the kernel framebuffer. It allows you to set the Linux text screen (console) to higher or lower resolution. The Linux framebuffer (fbdev) is a graphic hardware-independent abstraction layer to show graphics on a console without relying on system-specific libraries such as SVGALib or the heavy overhead of the X Window System.

Open GRUB configuration file grub.conf

vi grub.conf

Append line vga=0×318 (a 24-bit color depth @ 1024×768 display) to kernel line. At the end your modification should look like as follows:

title Enterprise Linux-base (2.6.18-92.el5)       root (hd0,0)
kernel /vmlinuz-2.6.18-92.el5 ro root=LABEL=/ rhgb quiet vga=0×318
initrd /initrd-2.6.18-92.el5.img

Save and close the file. Reboot the system:

telinit 6

0×318 (hex) is a mode. Here are common modes:

Colors 640×480 800×600 1024×768
8 bits 0×301 0×303 0×305
16 bits 0×311 0×314 0×317
24 bits 0×312 0×315 0×318

See kernel docs - Documentation/i386/boot.txt and Documentation/svga.txt files for more information. You can also pass special parameter called ask i.e. vga=ask for menu.

Please note that not all video cards out there support kernel framebuffer mode. Also you may need to to use special driver.

References:

Tags Tags: , , , , ,
Categories: linux
Posted By: DteK
Last Edit: 11 Mar 2009 @ 09 16 AM

E-mailPermalinkComments (1)
 16 Feb 2009 @ 6:11 PM 

HAVANA (Reuters) - Cuba launched its own variant of the Linux computer operating system this week in the latest front of the communist island’s battle against what it views as U.S. hegemony.

cuba-lnuxThe Cuban variant, called Nova, was introduced at a Havana computer conference on “technological sovereignty” and is central to the Cuban government’s desire to replace the Microsoft software running most of the island’s computers.

The government views the use of Microsoft systems, developed by U.S.-based Microsoft Corp, as a potential threat because it says U.S. security agencies have access to Microsoft codes.

Also, the long-standing U.S. trade embargo against the island makes it difficult for Cubans to get Microsoft software legally and to update it.

“Getting greater control over the informatic process is an important issue,” said Communications Minister Ramiro Valdes, who heads a commission pushing Cuba’s migration to free software.

Cuba, which is 90 miles from Florida, has been resisting U.S. domination in one form or another since Fidel Castro took over Cuba in a 1959 revolution.

Younger brother Raul Castro replaced the ailing 82-year-old leader last year, but the U.S.-Cuba conflict goes on, now in the world of software.

According to Hector Rodriguez, dean of the School of Free Software at Cuba’s University of Information Sciences, about 20 percent of computers in Cuba, where computer sales to the public began only last year, are currently using Linux.

Nova is Cuba’s own configuration of Linux and bundles various applications of the operating system.

Rodriguez said several government ministries and the Cuban university system have made the switch to Linux but there has been resistance from government companies concerned about its compatibility with their specialized applications.

“I would like to think that in five years our country will have more than 50 percent migrated (to Linux),” he said.

Unlike Microsoft, Linux is free and has open access that allows users to modify its code to fit their needs.

“Private software can have black holes and malicious codes that one doesn’t know about,” Rodriguez said. “That doesn’t happen with free software.”

Apart from security concerns, free software better suits Cuba’s world view, he said.

“The free software movement is closer to the ideology of the Cuban people, above all for the independence and sovereignty.”

 

By Esteban Israel - Reuters

Tags Tags: , , , ,
Categories: World, linux
Posted By: DteK
Last Edit: 16 Feb 2009 @ 06 16 PM

E-mailPermalinkComments (0)

Since I have just gotten an IPhone 3G it is finally necessary for me to do a how to on encoding videos that you can view on your IPod or IPhone from movies on your PC or DVD’s in your collection.

First note that there are many tools on different platforms to accomplish this task. Personally I do all of my encoding work from a linux command line as it gives me finer grain control over the configuration and is easier on the resources as video encoding is highly CPU intensive.

That being said, the tools that I use for this tutorial are x-platform, meaning they are available on Linux, Windows, and Mac. i will be concentrating on the Linux command line version of Handbrake as the GUI tools are pretty self explanitory.

Software:

HandBrake is a tool to encode different file formats. There is also a graphical version for Mac and Windows but I prefer the CLI version for Linux.

The binary packages for linux apparently only exist for Ubuntu so if you use a distro such as Slackware like myself, it is necessary to build the program from source.

Install:

The handbrake build uses Jam which is a make like utility. On Fedora you can find this in the fedora yum repos. For Slackware I was able to find it in slacky repo under development, need to add this repo to your slapt-getrc file:(I use slapt-get for package management, if you dont just download and install the tgz file manually)

http://repository.slacky.eu/slackware-12.1/

$>slapt-get –install jam

You also need glibc-2.7 or higher

I was able to find it a slackware packge here:

http://packages.slackware.it/package.php?q=current/glibc-2.7-i486-17

you can upgrade using upgradepkg command:

$>upgradepkg glibc-2.7-i486-17.tgz

this will upgrade your current version of glibc to 2.7

Now install Handbrake

Download handbrake source from:

http://handbrake.fr/rotation.php?file=HandBrake-0.9.3.tar.gz

unpack

$>tar zxvf HandBrake-0.9.3.tar.gz

Build

$>make

(use j switch for multiprocessor machines IE:make -j4 if you have 2 processors)

Now you should end up with a file called HandBrakeCLI in the build directory.

You can move this file to somewhere in your path so you can execute it from anywhere.

now type “HandbrakeCLI –help” and press enter, and you should see the help output of handbrake.

your are successfully installed at this point

Create IPhone Videos:

Now that we have HandBrake installed, it is time to put it to work. The –help command provides a lot of information on how to use the application so if you are comfortable with command line and have experience with linux man pages then you should be right at home. For others are are some steps to encode video:

HandBrakeCLI –help list all of the available options, their meanings and how to use them. At first it might look confusing but don’t let it slow you down, just ignore all the foolishness. You’ll start to understand how to decipher all that helpful information after you’ve looked at how the commands are setup.

You might not have noticed it if your terminal window is too small, but at the very top of the built-in help it says Syntax: HandBrakeCLI [options] -i <device> -o <file>. This line tells you exactly how to construct your HandBrake command. For example, HandBrakeCLI –help, the –help replaces the [options] in the syntax, however, –help is a special option so we don’t specify any -i input device or -o output file name.

Now let’s move on to something that actually uses a DVD. Since chances are that we’ll all be using a differentDVD to test with I’m going to use MY_DVD to represent a generic path, your specific path will be different. You want to use the mount point of the drive.(like /media/dvd or so). Go ahead and insert a DVD, when you see the DVD icon on your desktop you’re ready to go.

If you need to encode a DVD that is already ripped to your HDD then MY_DVD should be the path to your VIDEO_TS folder. Also if you are trying to encode an .avi file or any other such file then you would point to that file.

now at the command line type:

$>HandBrakeCLI –title 0 –input /Volumes/MY_DVD

or
if encoding a ripped dvd

$>HandBrakeCLI –title 0 –input /home/dtek/transformers/VIDEO_TS

or
if encoding a single file

$>HandBrakeCLI –title 0 –input /home/dtek/ironman/ironman-720p.avi

In the previous command –title 0 instructs HandBrakeCLI to scan the DVD and display all kinds of technical information in the Terminal window. This information can be invaluable if you are unsure what exactly is on the DVD. For instance, you may want to add subtitles but are unsure which track contains the English subtitles you want, so HandBrakeCLI –title 0 –input /Volumes/MY_DVD will show you the full list of available subtitles and which track contains which language. It will look something like:

+ subtitle tracks:

+ 1, English (iso639-2: eng)

+ 2, Espanol (iso639-2: spa)

+ 3, Francais (iso639-2: fre)

So, now you know the English subtitles are in subtitle track 1 and you’re ready for your first encode.

$>HandBrakeCLI –subtitle 1 –input /Volumes/MY_DVD –output ~/Desktop/My_DVD.m4v

And that’s all there is to it. You can see in the [options] section we only have –subtitle 3 this time. For every option that you don’t set HandBrakeCLI automatically inserts the “classic” default value. So the above command is equal to inserting a DVD, picking French subtitles, the Classic preset and clicking Start in theGUI.

If you now run

$>HandBrakeCLI –help

and look in the ### Picture Settings sections you’ll see -s, –subtitle <number> and it will make perfect sense how that bit from the built-in help translates into direct use; you’ll also now know that our previous encoding command could have been more succinctly written as:

$>HandBrakeCLI -s 1 -i /Volumes/MY_DVD -o ~/Desktop/My_DVD.m4v

I’ll continue using the long commands for clarity but you can feel free to start substituting the short commands as you learn them

Now lets try to change the encoder to xvid:

$>HandBrakeCLI –subtitle 1 –encoder xvid –input /Volumes/MY_DVD –output ~/Desktop/My_DVD.m4v

and now try to guess what the command would look like for using the x264 encoder instead of xvid. Of course, you guessed:

$>./HandBrakeCLI –subtitle 1 –encoder x264 –input /Volumes/MY_DVD –output ~/Desktop/My_DVD.m4v

Have another look at the built-in help, this time under the ### Video Options at the encoder settings and again you’ll now understand how that help info translates into usage. You can now probably peruse the help and guess correctly how to use nearly, if not all, the commands; and just to prove it to yourself try constructing commands that will:

use the the encoder of your choice but constrain the picture to 640×480

use the x264 video encoder, passthrough audio and deinterlacing

If you came with commands like:

$>HandBrakeCLI –encoder xvid –width 640 –height 480 –input /Volumes/MY_DVD –output ~/Desktop/My_DVD.m4v

and

$>HandBrakeCLI –encoder x264 –aencoder ac3 –deinterlace –input /Volumes/MY_DVD –output ~/Desktop/My_DVD.m4v

then you’re probably ready for something a little less basic. Check this command out

$>HandBrakeCLI –preset “Deux Six Quatre” –input /Volumes/MY_DVD –output ~/Desktop/MY_DVD

As you can probably guess it uses the Deux Six Quatre preset just like the GUI.

Now here is a real life example where I encode a full IronMan dvd that I have previously ripped to my hard drive:

dtek@tek-eserv1:~/ironman$ HandBrakeCLI -C 4 –preset=”iPhone & iPod Touch” -Y 320 -2 -T -r 23.976 –input /eblock/ironman/Ironman720p.avi –output /fblock/rip/ironman.m4v

I explicitly set the number of processors to use with “-C 4″, the default is for Handbrake to auto-detect this so it is really not necessary.

Also ss you can tell I have used the preset settings for iphone with “iPhone & iPod Touch” preset. This presets sets the maxWidth to 480 as we expect for Iphone but leaves the maxHeight blank. I set the maxHeight to 320 with “-Y 320″ option. It also sets a number of other defaults for the IPhone as well, You can get a list of all presets by doing:

HandBrakeCLI –preset-list

The options “-2 -T” tell the application to use 2 pass encoding which greatly increases the video output quality but makes the process take twice as long(think multiple hours on a single processor machine). The -T option says to use turbo mode of the first pass which can speed the process somewhat.

Since the source of this dvd was pal I use ” -r 23.976” to change the frame rate to the NTSC setting of 23.79fps.

Thats pretty much it. You should have enough information to go out and start encoding!

Tags Tags: , , , , ,
Categories: IPhone, linux
Posted By: DteK
Last Edit: 07 Oct 2009 @ 09 02 PM

E-mailPermalinkComments (48)
 25 Nov 2008 @ 2:23 PM 

So far, we covered backing up files locally and over a network. Now let let see how to backup databases(only mysql supported - yet).

The script uses ‘mysqldump’ command to backup the data. That means that the backups are in the SQL dump format. The dumps of all the databases that are backed up are compressed and stored in the destination folder. They will be named in this format - YYYY-MM-DD.tar.gz.

Configuration File

This script reads a configuration file named ‘dbbackup.config’ and backups all the databases specified in that file to another location in the same system. This configuration file must be in the same folder as the perl script. The configuration file format is given below…

Data
Project_Nexty
App_activecollab
# Unwanted_DB - commented - will not be backedup
binco
binnyva

The Perl Script


#!/usr/bin/perl
# Backups all the databases specified in the dbbackup.config file

$backup_folder = '/var/Backup/Special/Databases'; #EDIT THIS LINE

use File::Basename;
my $config_file = dirname($0) . "/dbbackup.config";
my @databases = removeComments(getFileContents($config_file));

chdir($backup_folder) or die("Cannot go to folder '$backup_folder'");

my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$year += 1900;
$mon++;
#Zero padding
$mday = '0'.$mday if ($mday<10);
$mon = '0'.$mon if ($mon<10);

my $folder = "$year-$mon-$mday";
mkdir($folder) or die("Cannot create a folder called '$folder'");

foreach my $database (@databases) {
	next if ($database eq '');
	chomp($database);

	my $table = '';
	if(index($database,' ')+1) { #Get just 1 table in the database - if there is a ' '(space) in the db name
		my @parts = split(' ',$database);
		$database = $parts[0];
		$table = $parts[1];
	}

	print "Backing up $database ... ";

 	my $file = $database;
 	$file .= '_' . $table if($table ne '');
 	$file .= ".sql";

 	`mysqldump -u root $database $table > $folder/$file`;

	print "Done\n";
}
print "Compressing the folder ... ";
`tar -czf $folder.tar.gz $folder/`;
print "Done\nRemoving Folder ... ";
`rm -rf $folder`;
print "Done\n\n";

sub getFileContents {
	my $file = shift;
	open (FILE,$file) || die("Can't open '$file': $!");
	my @lines=<FILE>;
	close(FILE);

	return @lines;
}

sub removeComments {
	my @lines = @_;

	@cleaned = grep(!/^\s*#/, @lines); #Remove Comments
	@cleaned = grep(!/^\s*$/, @cleaned); #Remove Empty lines

	return @cleaned;
}

If you need, you can set this script as a cron job - this will make sure that you don’t have to worry about the backup.

Tags Tags: , , , ,
Categories: MySQL, linux
Posted By: DteK
Last Edit: 25 Nov 2008 @ 02 23 PM

E-mailPermalinkComments (45)

This script will backup the specified files to another computer on your network. You can also use this to send your files to a remote server. This script compliments the last Rsync Backup script. Its possible to combine both the script together, I prefer to keep them separate.
The Setup

For this to work, you need to have a password-less login system over ssh. You should configure the remote system to accept your credentials by giving your public key to the remote server. If you are not sure how to do that, just leave a comment and I’ll make a post on how to set it up.

The configuration file is the same format as the one used in the last Rsync script. But in this case, the file name will be ‘rsyncnetworkbackup.config‘.
The Code

#!/usr/bin/perl

#The folder on the remote system that must be used to store the data
$backup_folder = ‘/home/neo/Backup’; #Final ‘/’ must NOT be there.
# The user for whom we have set up the key based login
$backup_user = ‘neo’;
# The IP address/domain name of the remote system.
$backup_server = ‘192.168.0.30′;

use File::Basename;
my $config_file = dirname($0) . “/rsyncnetworkbackup.config”;
my @all_locations = removeComments(getFileContents($config_file));

foreach my $folder_locations (@all_locations) {
my($folder,$backup_location) = split(/\s+/,$folder_locations);

print “Backing up $folder to $backup_location … “;
`rsync -avze ssh $folder $backup_user\@$backup_server:\”$backup_folder/$backup_location\”`;
print “Done\n”;
}

sub getFileContents {
my $file = shift;
my @lines;

open (FILE,$file) || die(”Can’t open ‘$file’: $!”);

@lines=;
close(FILE);
return @lines;
}

sub removeComments {
my @lines = @_;

@cleaned = grep(!/^\s*#/, @lines); #Remove Comments
@cleaned = grep(!/^\s*$/, @cleaned); #Remove Empty lines

return @cleaned;
}

del.icio.us | Digg it | Furl | ma.gnolia | reddit | StumbleUpon |
Related Posts
# Shell Script to Backup Files Locally Using Rsync
# Perl Script to Backup MySQL Databases
# Nautilus Scripts - Terminal, File Finder

Tags Tags: , , , , ,
Categories: linux
Posted By: DteK
Last Edit: 25 Nov 2008 @ 02 19 PM

E-mailPermalinkComments (44)
\/ More Options ...
Change Theme...
  • Role »
  • Posts »
  • Comments »
Change Theme...
  • VoidVoid (Default)
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LiteLightweight
  • No Child Pages...