Pages

Friday, November 26, 2010

Savage Server and Selinux under Fedora 14

If you want to install fedora Savage Game Server 14, you will have problems with SELinux.
Use this commands to fix it.
$ chcon -t execmem_exec_t '/home/mythcat/SavageSer/silverback.bin'

Thursday, November 25, 2010

Fun with F-Spot 0.8.0 and sqlite3

Today I focused on the F-Spot version 0.8.0.
I knew that contains a database that keeps information about the pictures.
I found the database and tried a few commands:
$ cd .config/
$ cd f-spot/
$ ls
addin-db-001  photos.db
Once I found the database, I started SQLite3. See the example below:
$ sqlite3  photos.db 
SQLite version 3.7.2
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .tables
exports         meta            photo_versions  rolls         
jobs            photo_tags      photos          tags          
sqlite> .schema photos
CREATE TABLE photos (
 id   INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, 
 time   INTEGER NOT NULL, 
 base_uri  STRING NOT NULL, 
 filename  STRING NOT NULL, 
 description  TEXT NOT NULL, 
 roll_id   INTEGER NOT NULL, 
 default_version_id INTEGER NOT NULL, 
 rating   INTEGER NULL 
);
CREATE INDEX idx_photos_roll_id ON photos(roll_id);
sqlite> select * from photos;
1|1279913277|file:///home/mythcat/Photos/2010/07/23|IMG_2970.JPG||1|1|0
It is easy to use and implemented various python scripts.

Sunday, November 21, 2010

Linux and denial of service - DoS

A denial-of-service attack (DoS attack) or distributed denial-of-service attack (DDoS attack) is an attempt to make a computer resource unavailable to its intended users.
We can see more on the wiki web page.

On Linux we can see if an attack is attempted with this:

netstat -ant | grep SYN_RECV | wc -l
This is an indication of a denial of service (DoS) attack against your system's X port.

It is likely one attack against a public service such as a web server or mail server.

Thursday, November 11, 2010

Notifications in Fedora 14

We use the following command
$ notify-send  "This is some text"
or
$zenity --info --text "This is some text"
This will display a text balloon "This is some text".
The problem appears when we want to display the output of a command.
For this, I used a python script. Here's the source code:
#!/usr/bin/env python
import os
import sys
import pynotify
pynotify.init("Output comand")
arg=sys.argv[1]
print arg
s = os.popen(arg).read()
n = pynotify.Notification("Output",s)
n.show()
If you wish to use a compound command, then you will need to use quotes.
For example, we use the command "ls-a 'as follows:
$python testpy.py "ls -a"
This is just a small example, you can create more complex applications.

Saturday, November 6, 2010

How Install Firefox 4 on Fedora 14.

Firefox is one of the latest versions of the Mozilla .

It is currently available in two repositories - Remi and Spot.

See the next steps if you want install Firefox 4.

First , go on super user shell.

# wget http://repos.fedorapeople.org/repos/spot/firefox4/fedora-firefox4.repo -O /etc/yum.repos.d/fedora-firefox4.repo

Now, you can install Firefox 4

# yum --enablerepo fedora-firefox4 install firefox4

That is all.

Fedora 14 and Blender 3D

It is a great disappointment to me that Fedora 14 comes with Blender 3D version 2.49b-10.
I expected a pleasant surprise to see version 2.5.
Here is the result:

# yum search blender
Loaded plugins: langpacks, presto, refresh-packagekit
Adding en_US to language list
updates/pkgtags                                                   |  10 kB     00:00     
============= Matched: blender =====================
blenderplayer.i686 : Standalone blender player
LuxRender-blender.i686 : Blender export plugin to LuxRender
blender.i686 : 3D modeling, animation, rendering and post-production
spe.noarch : Python IDE with UML,PyChecker,Debugger,GUI design,Blender & more
libpano13-tools.i686 : Tools that use the libpano13 library
yofrankie-bge.noarch : 3D Game with characters from Big Buck Bunny movie
Of course, you can use version 2.5 from the official site.

Sunday, October 31, 2010

Ogre 3D on Fedora - first step.

My son has 2 years old.
I had to make a little game to keep him busy.
Little known to push so I used the arrow keys to make it more interesting.
First Ogre 3D tutorial

Saturday, October 2, 2010

"Sintel premiere" by Blender 3D Team

The last project named "Sintel" is better than expected .
I watched all projects and this  is one of the best.
Sintel official page

Thursday, September 30, 2010

A new update for "SEO Starter Guide".

Google say us:
"About two years ago we published our first SEO Starter Guide, which we have since translated into 40 languages..." The new version is more explicit and useful to have it.
Unfortunately, it is not translated in all languages.
I wonder why Google does not use the open source community to translate them.
Now we can download the new update from here.

Wednesday, September 22, 2010

Python, pyuno and OpenOffice

Some time ago, I discovered Python. Then I saw that he can work with the OpenOffice.
Today I will briefly introduce how to do this. I do this in Windows XP, and Windows users could benefit.
In the folder : C:\Program Files\OpenOffice.org 3\program there was a file called python.exe.
Go there and type the following script to start OpenOffice:

import os
import subprocess
import sys
import time
import uno

NoConnectionException = uno.getClass("com.sun.star.connection.NoConnectException")
ooffice = 'soffice "-accept=socket,host=localhost,port=8100;urp;"'
def start_OOo():
    '''Starts OpenOffice.org with a listening socket.'''
    # Start OpenOffice.org and report any errors that
    # occur.
    try:
        retcode = subprocess.call(ooffice, shell=True)
        if retcode < 0:
            print >>sys.stderr, \
                "OOo was terminated by signal", \
                -retcode
        elif retcode > 0:
            print >>sys.stderr, \
                "OOo returned", \
                retcode
    except OSError, e:
        print >>sys.stderr, "Execution failed:", e
    # Terminate this process when OOo has closed.
    raise SystemExit()
started_OOo = False
if not started_OOo:
    print "Starting OOo"
    started_OOo = True
    start_OOo()
time.sleep(3)
print "OOo started"
This will start OpenOffice 3.
We can use now python scripts to create any type of file used by OpenOffice.
Let show one image create with few lines :

Thursday, September 2, 2010

My linux counter machine

The Linux Counter website is a good site to share your machine's info.

At Sep 02 2010 16:22:56 GMT, there are
125104
users registered
133701
machines registered
My guess at the number of Linux users:
Twenty-nine million 
 
My number machine is :

We can use a script to registers or updates a machine's info in the counter.
The script allows here.
We can use add, update and send mail with info about your Linux machine.
We can add a crontab job with -c arg.
The user ID must only be able to send mail and write to its own home directory.

Sunday, August 22, 2010

Create html file with bash script using awk

We will present a more special method of using the Linux command line.
This method comes in helping those who need to text or HTML content.
In fact, a combination of Linux commands to get an output.
Suppose we have a list of jpeg files in folder image.
They should exist into HTML to be displayed.
As we know an image has the form:
<img src="image/name_of_jpeg.jpg" alt="" /> 
The list of file is :
11.jpg,12.jpg,13.jpg,14.jpg,15.jpg
My method uses two commands: ll and awk.
First, I will display files:
$ ll | awk '/jpg/ {print $9}'
11.jpg
12.jpg
13.jpg
14.jpg
15.jpg 
I created one variable f1.
In these variables put the beginning of each line:
f1=‘<img src="image‘; 
We add two sed commands.
First, remove the space before the file name.
The second will add the rest to complete the link.
The xargs command is used with echo and print the first part of the link.
Finally we use <<< aaaa.html to output the HTML file.
The full script is here .

Friday, August 13, 2010

OpenGL - OpenGL Utility Toolkit (GLUT) on Fedora 13

The freeglut allows the user to create and manage windows containing OpenGL contexts.
This library allows the user to use mouse, keyboard and joystick functions.

#yum install freeglut-devel
...
Dependencies Resolved
================================================================================
 Package                   Arch        Version               Repository    Size
================================================================================
Installing:
 freeglut-devel            i686        2.6.0-5.fc13          updates      112 k
Installing for dependencies:
 libX11-devel              i686        1.3.1-3.fc13          fedora       1.0 M
 libXau-devel              i686        1.0.5-1.fc12          fedora        13 k
 libXdamage-devel          i686        1.1.2-2.fc13          fedora       8.8 k
 libXext-devel             i686        1.1.2-2.fc13          updates       77 k
 libXfixes-devel           i686        4.0.4-2.fc13          fedora        11 k
 libXxf86vm-devel          i686        1.1.0-1.fc13          fedora        17 k
 libdrm-devel              i686        2.4.21-2.fc13         updates       64 k
 libxcb-devel              i686        1.5-1.fc13            fedora       139 k
 mesa-libGL-devel          i686        7.8.1-8.fc13          updates      486 k
 mesa-libGLU-devel         i686        7.8.1-8.fc13          updates      111 k
 xorg-x11-proto-devel      noarch      7.4-36.fc13           fedora       250 k
Transaction Summary
================================================================================
Install      12 Package(s)
Some tutorials about glut on C programming language: Glut and C tutorial