tutorials, tips, tricks, commands, programming, linux, windows, database, sql, python, programming language, Fedora, drawing, painting, tutorial, tutorials
Friday, August 10, 2012
OpenGL Driver support for Linux and Windows.
The driver support provides beta support for OpenGL 4.3 and GLSL 4.30 on capable hardware.
For Linux, the version number R304.15 is not the same with the drivers for Windows: R305.53.
All ARB extension specifications can be downloaded here: this page.
For OpenGL 4 capable hardware, these new extensions are provided: ARB_compute_shader ,ARB_multi_draw_indirect ,ARB_shader_image_size ,ARB_shader_storage_buffer_object
You can download all drivers from here.
Friday, July 6, 2012
Testing your disks using dd utility and time.
You can execute copies a large block of data to and from disk.
This will minimize disk caching.
Next is one example if our test system has 1GB of RAM.
It is easy ( 1GB = 250,000 blocks ).
$ time sh -c "dd if=/dev/zero of=bigfile bs=8k count=250000 && sync"
250000+0 records in
250000+0 records out
2048000000 bytes (2.0 GB) copied, 37.0113 s, 55.3 MB/s
real 0m40.910s
user 0m0.172s
sys 0m12.641s
It's very hard to argue with this dd test.
Thursday, July 5, 2012
Using DIGITAL PEN CAMERA eheV1-USB-II with mplayer
This is the device.
The dmesg tell me about this camera:
uvcvideo: Found UVC 1.00 device USB2.0 Camera
If you want to see and not to take frames, then use :
mplayer tv:// driver=v4l2:width=640:height=480:device=/dev/video0 -vo null
You can try to take some frames. I use this:
mplayer tv:// -frames 10 -tv fps=20:driver=v4l2:width=640:height=480:device=/dev/video0 -vo jpeg
The result is ten frames.
On this image I draw one line to see how working default.
And using the zoom ...
Friday, June 15, 2012
Working with old video card and also old Ogre 3D engine and Blender 3D.
If you want to see this, you can go on the tutorials part from my site.
This is the just a result of my simple example.
The result is shown in next image sample.
Thursday, June 14, 2012
News: Programming with google-blocky
Blockly is a web-based, graphical programming language. Users can drag blocks together to build an application. No typing required.
You can see more on google project.
Saturday, May 26, 2012
Show large image like thumbnails in firefox using greasemonkey
Today I focused on a problem you often encounter.
We have a web folder containing a series of large image files. We want to see the folder that contains but would be difficult to download all the images and then view them search to find a picture of us.
I installed Greasemonkey addon and I began to study how it works.
I don't have experience with javascript programming.
I still managed to make the script below:
// ==UserScript==
// @name show-image
// @namespace show-image
// @description show images from files
// @include http://*
// @version 0.1
// ==/UserScript==
var elements = document.getElementsByTagName("a");
for (var i=0; (anchor=elements[i]); i++) {
src = anchor.getAttribute("href");
if (src.indexOf('.gif') > -1 || src.indexOf('.jpg') > -1 || src.indexOf('.JPG') > -1 || src.indexOf('.jpeg') > -1)
{
img = document.createElement('img');
img.setAttribute('src',src);
img.style.width='10%';
anchor.appendChild(img);
}
}
You can add to show the png file by adding in the if condition in the script :
src.indexOf('.png') > -1 || src.indexOf('.PNG') > -1
I hope to help you.
Monday, May 21, 2012
News: Working with python , opengl and ARB ...
The script is very simple and can be found on my graphic-3d.blogspot.com.
I make this with Python 2.6.4 , pyopengl module.
Sunday, April 1, 2012
Fedora online defragmenter for ext4 filesystem
The man page tells us: reduces fragmentation of extent based file.
The file targeted by e4defrag is created on ext4 filesystem made with "-O extent" option (see mke2fs(8)). The targeted file gets more contiguous blocks and improves the file access speed.
Let's try this tool.
You can try under root account this:
# e4defrag -test -cv /home/your_user/
The final result on my account is :
Total/best extents 170276/165520
Fragmentation ratio 0.03%
Fragmentation score 0.24
[0-30 no problem: 31-55 a little bit fragmented: 55- needs defrag]
Also, you have to run e4defrag with the -test parameter for now, since it isn't a fully tested version.
Monday, February 27, 2012
The LightScribe - without labels and handwriting.
Download the packages from here.
Use the root account and install this packages :
# rpm -ivh lightscribe-1.18.24.1-linux-2.6-intel.rpm
Preparing... ########################################### [100%]
1:lightscribe ########################################### [100%]
# rpm -ivh lightscribeApplications-1.18.15.1-linux-2.6-intel.rpm
Preparing... ########################################### [100%]
1:lightscribeApplicationswarning: group admin does not exist - using root%)
warning: group admin does not exist - using root
########################################### [100%]
The path application is /opt/SimpleLabeler/See the files:
$ ll
total 332
drwxr-xr-x. 4 root wheel 4096 Feb 27 14:10 content
-rwxr-xr-x. 1 root wheel 2980 May 19 2010 launchBrowser.sh
drwxr-xr-x. 3 root wheel 4096 Feb 27 14:10 plugins
-rwxr-xr-x. 1 root wheel 43 May 19 2010 qt.conf
-rw-r--r--. 1 root root 16 May 19 2010 qttr.qm
-rwsr-xr-x. 1 root wheel 314088 May 19 2010 SimpleLabeler
-rw-r--r--. 1 root root 16 May 19 2010 simplelabelertr.qm
Run the SimpleLabeler, and you see this :Insert the special media in the special disc drive with the face down.
This is a way to not use labels and handwriting.
Saturday, February 18, 2012
G'MIC plug-in for GIMP.
One best feature is the plugins system. Plugins may be stored in different locations depending upon your distribution.
The author of G'MIC plug-in tell us: The G'MIC plug-in for GIMP proposes a set of various filters to apply on your images, including artistic effects, image denoising, and enhancement algorithms, 3D renderers, etc.. It is a quite large plug-in, integrating a lot of different effects.
You can download the G'MIC plug-in from here.
Unzip the file and go to the folder where is the gmic_gimp file.
Use this command to copy the file in the plug-ins folder.
$ cp gmic_gimp ~/.gimp-2.6/plug-ins/
Once you have installed the plugin just restart the GIMP.The G'MIC will work just if you have opened an image.
You can find it on menu: Filters-> G'MIC... Also, the G'MIC plug-in has available 284 filters.
Saturday, November 26, 2011
Protect your root account.
You can read about the command trap using: man trap.
What is this command?
when the specified event will occur will execute the command specified.
In this case, it will receive signal respectively will execute one command - exit
The source code.
protect()
{
echo "What is the secret ?"
trap protect 2 20
read -s resp
if [ "$resp" != "asd" ]; then
echo "Error!"
exit
fi
}
protect
The result will be leaving the root account if you do not answer the question correctly.Now protect the file against unauthorized changes:
# chmod 700 /root/.bashrc
You can create using the example above, different ways to execute various commands.
Monday, September 26, 2011
Android ARM Assembly by Vikram Aggarwal
The article is written by the developers Vikram Aggarwal, a software engineer at Google.
This article - tutorial consists of a series on learning ARM assembly on Android.
Its subject is "...calling Assembly code from Android applications".
The tutorial contains the necessary source code and details for the reader to understand how it works.
For those who have never used Gas (GNU Assembler), this article is of interest much.
I wonder if there is anyone interested in the Fedora community to write Android applications.
This article can be read here.
Saturday, September 24, 2011
Creating folders and documents with gdata module
The problem that I solved it:
creating folders and documents in your Gmail account.
First, you need to install the gdata module.
In fedora I used:
yum install python-gdata.noarch
Here are the first lines of source code that creates a folder named test-fedoraPython 2.7.1 (r271:86832, Apr 12 2011, 16:16:18)
[GCC 4.6.0 20110331 (Red Hat 4.6.0-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gdata.docs.service
>>> my=gdata.docs.service.DocsService()
>>> my.ClientLogin('your-account@gmail.com','your-password')
>>> my.CreateFolder('test-fedora')
I tried to automate the process of creating folders and I used a list and instruction for>>> folders=['aaa','bbb','ccc']
>>> for f in folders:
... my.CreateFolder(f)
...
To create a document to write more lines of code.This is because there are many types of documents
>>> new_entry = gdata.GDataEntry()
>>> new_entry.title = gdata.atom.Title(text='fedora-test')
>>> category = my._MakeKindCategory(gdata.docs.service.DOCUMENT_LABEL)
>>> new_entry.category.append(category)
>>> created_entry = my.Post(new_entry, '/feeds/documents/private/full')
Here's a simple solution to avoid loss of mail password.>>> import getpass
>>> username = raw_input('Please enter your username: ')
Please enter your username: user1
>>> password = getpass.getpass()
Password:
>>> print username
user1
>>> print password
pass1
I hope you will use this