Pages

Your Ad Here

This Blog is not to read or go through

because, I have never been such a mess


Search the blog instead

Showing posts with label Command Help. Show all posts
Showing posts with label Command Help. Show all posts

Wednesday, June 23, 2010

Kannel restart script | Attempting to Kill a process in linux until it gets killed

Restarting kannel wasn't simpler, as the bearerbox was not exiting on single stop command for Kannel. So needed to do some tricks on killing the bearerbox first. See the code

#!/bin/bash
while [ true ]
do
 echo "quering bearerbox"
 sleep 1
 count=$(ps -C "bearerbox" | wc -l)
 echo $count
 if [ $count -eq 2 ]
 then
  echo "attempting to kill bearerbox"
  killall bearerbox
 else
  sleep 1
  echo "======= bearerbox killed ========"
  break
 fi
done
sleep 1
bearerbox /etc/kannel/kannel.conf
smsfox /etc/kannel/kannel.conf

Altering system default timezone in linux

Reference:
http://www.cyberciti.biz/faq/howto-linux-unix-change-setup-timezone-tz-variable/


Change Linux timezone

Select the method as per your Linux distribution:

If you are using Fedora / RHEL / Cent OS Linux

Type the redhat-config-date command at the command line to start the time and date properties tool.
# redhat-config-date
OR type setup and select time zone configuration (good for remote ssh text based Linux server sessiob)
# setup
Select timezone configuration
Fig.01: Redhat / CentOS Server Setting Up Timezone
Fig.01: Redhat / CentOS Server Setting Up Timezone
Now, just follow on screen instructions to change timezone.

Set timezone using /etc/localtime configuration file [any Linux distro]

Often /etc/localtime is a symlink to the file localtime or to the correct time zone file in the system time zone directory.

Generic procedure to change timezone

Change directory to /etc
# cd /etc
Create a symlink to file localtime:
# ln -sf /usr/share/zoneinfo/EST localtime
OR some distro use /usr/share/zoneinfo/dirname/zonefile format (Red hat and friends)
# ln -sf /usr/share/zoneinfo/EST localtime
OR if you want to set up it to IST (Asia/Calcutta):
# ln -sf /usr/share/zoneinfo/Asia/Calcutta localtime
Please mote that in above example you need to use directory structure i.e. if you want to set the timezone to Calcutta (India) which is located in the Asia directory you will then have to setup using as above.
Use date command to verify that your timezone is changed:
$ date
Output:
Tue Aug 27 14:46:08 EST 2006

Use of environment variable

You can use TZ environment variable to display date and time according to your timezone:
$ export TZ=America/Los_Angeles
$ date

Sample Output:
Thu Aug 27 11:10:08 PST 2006

Tuesday, February 16, 2010

runlevels in redhat

simple interface to configure runlevels

ntsysv --level

eg. ntsysv --level 016 edits runlevels 0, 1, and 5

Sunday, August 16, 2009

not in the database

select src from (
select "node/1" as src
union select "node/2" as src
union select "node/3" as src
) temp where src not in (select src from drupal_url_alias)

Saturday, July 11, 2009

checking the distro name in linux

$ cat /etc/*-release
or
$ cat /etc/*-version

Wednesday, May 6, 2009

low level formatting in linux

Source: http://tldp.org/LDP/LGNET/issue37/tag/38.html


dd if=/dev/zero of=/dev/hda
... to wipe out the whole first IDE drive, or
dd if=/dev/zero of=/dev/sda
... to wipe out the whole first SCSI drive.
Actually you could just blow away one sector on these drives using
dd if=/dev/zero of=/dev/sda count=1
It wouldn't make sense to do this to other drives (/dev/hdb, /dev/hdc, /dev/sdb, etc) since their boot sectors aren't referenced as code and you can reformat those drives with normal DOS or Linux commands to re-make your filesystems on them. However, you can issue this command for all of your drives if you like. In fact you should be able to do something like:
for i in a b c d; do
dd if=/dev/zero of=/dev/hd$i
done
... to get four IDE drives or
for i in a b c d e f g ; do
dd if=/dev/zero of=/dev/hd$i
done
... to wipe out all seven disks on a SCSI chain.
(?)

Friday, January 23, 2009

Sound in MSI VR 420 Laptop

After I bought my first laptop MSI VR 420 with genuine Vista installed, I installed Kubuntu 8.04 Hardy. Everything one fine except the sound was not working.

dmesg produced this error
hda_codec: Unknown model for ALC883, trying auto-probe from BIOS..


... ... ...
lots of headaches
... ... ....

And finally,
This was how I made it working.
modprobe -r snd_hda_intel
modprobe snd_hda_intel model=3stack-dig


And it worked.

The first thing I played was
http://www.meronepalma.com/song/425

Sunday, March 9, 2008

Error:1235- This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'

If you try the following you will find it fails in mysql version 4.1,

SELECT
COUNT(*)
FROM
TABLE_1
WHERE
ROW (PK_PART_1, PK_PART_2) IN
(
SELECT
PK_PART_1, PK_PART_2
FROM
TABLE_2
LIMIT
10 -- This is the basis of the whole idea
)
AND
Whatever;

The above fails with the warning ...

ERROR 1235 (42000): This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'

However, you can get the desired behaviour with a slight rewrite...

SELECT
COUNT(*)
FROM
TABLE_1
INNER JOIN
(
SELECT
PK_PART_1, PK_PART_2
FROM
TABLE_2
LIMIT
10 -- HEY HEY!
) AS VIRTUAL_TABLE_2
ON
TABLE_1.PK_PART_1 = TABLE_2.PK_PART_1 AND
TABLE_1.PK_PART_2 = TABLE_2.PK_PART_2
WHERE
Whatever;

And it works like a charm!

Sunday, March 2, 2008

Swap in Linux

Had a swap space allocated but it was not mounted as so, and my computer had regular memory problems.

So what I did was,

  • checked the swap partition first
  • added the entry in /etc/fstab file as
    • /dev/sda3 none swap sw 0 0
  • sudo swapon -a
  • checked by using cat /proc/swaps and it was found the following
    • /dev/sda3 partition 1052248 423616 -1


Thursday, January 3, 2008

965 Boards sound configuration in linux

Install backport packages

#!/bin/sh
wget -c http://archive.ubuntu.com/ubuntu/pool/main/l/linux-backports-modules-2.6.22/linux-backports-modules-2.6.22-14-generic_2.6.22-14.10_i386.deb
wget -c http://archive.ubuntu.com/ubuntu/pool/main/l/linux-meta/linux-backports-modules-generic_2.6.22.14.21_i386.deb

Saturday, December 22, 2007

PHP: Dynamic Image Generation

PHP: Dynamic Image Generation Print Email

Creating images on the fly can be a very useful skill. PHP has some built-in image generation functions, further more, to generate new images or edit existing images on the fly using PHP, we need to have the GD library installed. In this tutorial we will show you how to get quite interesting and useful effects using image handling functions. We will review two practical tasks: creating security images (captcha) on the fly and building a bar chart using numerical values retrieved from MySQL database.

Creating security images on the fly

At first, have a look at the following script that creates captcha image. Next, we will consider each step of image generation in details.

//Send a generated image to the browser
create_image();
exit();

function create_image()
{
//Let's generate a totally random string using md5
$md5 = md5(rand(0,999));
//We don't need a 32 character long string so we trim it down to 5
$pass = substr($md5, 10, 5);

//Set the image width and height
$width = 100;
$height = 20;

//Create the image resource

$image = ImageCreate($width, $height);

//We are making three colors, white, black and gray
$white = ImageColorAllocate($image, 255, 255, 255);
$black = ImageColorAllocate($image, 0, 0, 0);
$grey = ImageColorAllocate($image, 204, 204, 204);

//Make the background black
ImageFill($image, 0, 0, $black);

//Add randomly generated string in white to the image
ImageString($image, 3, 30, 3, $pass, $white);

//Throw in some lines to make it a little bit harder for any bots to break
ImageRectangle($image,0,0,$width-1,$height-1,$grey);
imageline($image, 0, $height/2, $width, $height/2, $grey);
imageline($image, $width/2, 0, $width/2, $height, $grey);

//Tell the browser what kind of file is come in
header("Content-Type: image/jpeg");

//Output the newly created image in jpeg format
ImageJpeg($image);

//Free up resources
ImageDestroy($image);
}
?>

To create a new image or edit an existing one, we need to create image identifier. In the preceding example we created an empty canvas by calling ImageCreate() function, passing it width and height of a new image as a parameters. Another way to do it is to read the existing image from the file. Depending on the file format you can do it using one of the following functions: ImageCreateFromPNG(), ImageCreateFromGIF(), ImageCreateFromJPEG(). Parameter of each function is a file name.

Then, we need to choose colors to be used while painting. For this we can use ImageColorAllocate() function and image identifiers for red, green, and blue (RGB) components of necessary color will be passed as parameters.

On the next step, we will generate our image. First, using ImageFill() function we will create black background. Parameters of this function are: image identifier, initial coordinates of the area to be filled and fill color. Then, we will use ImageString() function to add text to the image. Its parameters are – image identifier, font, coordinates for the first text position and text color. Finally, we will draw two lines and a rectangular to protect our image a little bit. Please note, that the final point of the rectangular has the following coordinates: $width-1 and $height-1. If they were equal to $width and $height, than the rectangular would have exceeded canvas frame.

When we had created the image, we can output it either to a browser, or to a file. Our example shows how to output it to the browser. We need to inform the browser, that we will output the image, not the text or html-code. To do it, call Header() function, setting image MIME-type. It’s worth mentioning that Header() function can not be executed if HTTP header has already been sent. After sending the header we can output our image using ImageJpeg() function, passing it image identifier as a parameter.

When we have finished working with the image we need to free up resources using ImageDestroy() function.

Back to top

Building a bar chart

In the example below, using graphic functions we will build a bar chart based on the values stored in MySQL database. In our case, values represent poll results.

In this example we will use poll database. To create it run the following SQL script in your MySQL server:

CREATE DATABASE `poll`;
USE poll;

CREATE TABLE `results` (
book_type VARCHAR(50),
num_votes INT
);

INSERT INTO `results` values
('Classic', 15),
('Fantasy', 7),
('Humor', 32),
('Mystery', 12),
('Poetry', 25);

Script building a bar chart is quite long, so let's divide it into two parts and discuss them separately. The first part of the script connects to MySQL database and requests data that will be represented in the bar chart.

//Querying the database to get poll results

//connection to the database
$dbhandle = mysql_connect("localhost", "root", "")
or die("Unable to connect to MySQL");

//select a database to work with
$selected = mysql_select_db("poll",$dbhandle)
or die("Could not select examples");

//execute the SQL query and return records
$result = mysql_query("SELECT * FROM results");

$num_poller = mysql_num_rows($result);
$total_votes = 0;

//fetch the data from the database
while ($row = mysql_fetch_array($result)) {
$total_votes += $row{'num_votes'}; //calculating total number of votes
}

//nulling the pointer $result
mysql_data_seek($result,0);

//close the connection
mysql_close($dbhandle);

In the second part of the script first of all we will calculate variables needed to build the chart. Then, we prepare primary image and actually output data. Results for each genre are picked from the database one by one, percentage of votes is calculated, and then bars and explanatory notes are outputted.

In this script we are using TrueType fonts to get anti-aliased text. Functions that work with the TrueType fonts have its own peculiarities. First, you need to point where the fonts are located. For this, system variable GDFONTPATH is set. Then, we need to set the font name. TrueType fonts are rendered using ImageTTFText().

We have already discussed above all functions used for drawing, the code has been commented and is quite clear, so you shouldn’t have any trouble.

//Tell gd2, where your fonts reside
putenv('GDFONTPATH=C:\WINDOWS\Fonts');
$font = 'arial';

//Set starting point for drawing
$y = 50;

//Specify constant values
$width = 700; //Image width in pixels
$bar_height = 20; //Bars height
$height = $num_poller * $bar_height * 1.5 + 70; //Calculating image height
$bar_unit = ($width - 400) / 100; //Distance on the bar chart standing for 1 unit

//Create the image resource
$image = ImageCreate($width, $height);

//We are making four colors, white, black, blue and red
$white = ImageColorAllocate($image, 255, 255, 255);
$black = ImageColorAllocate($image, 0, 0, 0);
$red = ImageColorAllocate($image, 255, 0, 0);
$blue = imagecolorallocate($image,0,0,255);

//Create image background
ImageFill($image,$width,$height,$white);
//Draw background shape
ImageRectangle($image, 0, 0, $width-1, $height-1, $black);
//Output header
ImageTTFText($image, 16, 0, $width/3 + 50, $y - 20, $black, $font, 'Poll Results');

while ($row = mysql_fetch_object($result)) {
if ($total_votes > 0)
$percent = intval(round(($row->num_votes/$total_votes)*100));
else
$percent = 0;

//Output header for a particular value
ImageTTFText($image,12,0,10, $y+($bar_height/2), $black, $font, $row->book_type);
//Output percentage for a particular value
ImageTTFText($image, 12, 0, 170, $y + ($bar_height/2),$red,$font,$percent.'%');

$bar_length = $percent * $bar_unit;

//Draw a shape that corresponds to 100%
ImageRectangle($image, $bar_length+221, $y-2, (220+(100*$bar_unit)), $y+$bar_height, $black);
//Output a bar for a particular value
ImageFilledRectangle($image,220,$y-2,220+$bar_length, $y+$bar_height, $blue);
//Output the number of votes
ImageTTFText($image, 12, 0, 250+100*$bar_unit, $y+($bar_height/2), $black, $font, $row->num_votes.' votes cast.');

//Going down to the next bar
$y = $y + ($bar_height * 1.5);

}

//Tell the browser what kind of file is come in
header("Content-Type: image/jpeg");

//Output the newly created image in jpeg format
ImageJpeg($image);

//Free up resources
ImageDestroy($image);
?>

Back to top

Using dynamically generated images on the other pages

Since the header can be sent only once and it is the only way to tell the browser that you are going to send image, it is not so easy to insert automatically generated images to the regular pages. There are three ways to do it:

  • The whole page can consist of the image.
  • You can save image in the file and then refer to it using HTML descriptor.
  • You can put a script producing image in HTML descriptor, e.g.:
Dynamically generated image

Related Articles

How to connect to MySQL database using PHP

Back to top

Tags: DYNAMIC IMAGE GENERATION GD CAPTCHA GRAPH STORE CACHE

Add To: Add to dzone dzone | Digg this digg | Add to del.icio.us del.icio.us | Stumble it stumbleupon


Hide Comments | Add New
Thank you for really useful tutorial!
# Posted by noizze | 27 Nov 2006 05:26:34
Very well written, thank you for the tip with putting the image in a html descriptor.
# Posted by fips | 2 Jan 2007 20:45:34
Great tutorial for the captcha, but it lacks the mechanism on how to tell the server to store and validate the security code against the user's input.
# Posted by OJ | 10 Jan 2007 22:33:04
Hello Sir It's REALLY useful, But i cannot use it.

Becoz the functions here referred is not identified in my PHP. So pls help to Configure it in WAMP 1.4 . Pls any body know it,pls mail me with details,

Thanks alot ....
# Posted by Anes P.A | 14 Jan 2007 22:39:47
Check your PHP and GD version first.
Use the latest stable version.
# Posted by JOKERz | 26 Jan 2007 04:55:19
thanx! very simple yet usable code... it is really easy to understand...
# Posted by smiley_sheinnize | 20 Feb 2007 22:17:00
how can i create pie chart using this code pls send me one example source code.
# Posted by bhavu_tailor | 10 Mar 2007 03:11:35
This Tutorial Worked For Me! Thanks For That!

To Make Charts, However, I Use The PHP/SWF Charts Found Here: http://www.maani.us/charts/index.php. I Try To Add In One Or Two Of Those Into Every Backend I Create. It Really Makes The Admin Go, "Wow!" Every Time.
# Posted by Rick Clark | 20 Mar 2007 15:19:08
sir,
when i run this program,
i got an error
Warning: imagettftext() [function.imagettftext]: Could not find/open font
how to find it in my php.ini file

im using WAMP5 1.6.6 version.
i went to php.ini file and uncommented php_gd2.dll to enable gd
and also commented to generate images dynamically.
;tidy.clean_output = Off

this tutorial is very useful for me.
# Posted by nalini | 22 Mar 2007 22:39:28
If you get "Warning: imagettftext() [function.imagettftext]: Could not find/open font" One easy fix is to simply copy the font file (i.e., arial.ttf), and paste it directly in the same folder as your PHP file. With Windows, the arial.ttf font file is typically located in C:\WINDOWS\Fonts\arial.ttf. There are, of course, other solutions.
# Posted by Geri | 28 Mar 2007 10:09:07
Very nice code .. It is usefull
# Posted by vinoth | 16 Apr 2007 21:54:40
Thanks for your help, I have implemented it in one of my projects : vk-systems.com for image validation.
# Posted by kapinder | 11 May 2007 00:50:05
Good morning everyone,

I am stuck on this problem - I need to know how to deal with this issue - what I am trying to do is modify the original image's size and location, while keeping it's physical size. For example, a 200X200 image of a cat will be resized by $percent, BUT be imagecopyresampled() into an image of the same size as the original, or 200X200. This is necessary for my project. So, my problem is that, when imagecopyresampled() at 98%, the image actually looks like it is resampled at 102%. Can someone please tell me what I've done wrong?

Thank you!


if (isset($_GET['image'])) {
move_save_image($_GET['image'], $_GET['x'], $_GET['y'], $_GET['percent']);
}
else {
echo "Could not load image";
}

function move_save_image($image, $x=0, $y=0, $percent=100) {

$image_withpath = "../dynproducts/dynimages/" .$image;

if (file_exists($image_withpath)) {
header('content-type: image/jpeg');

$modified = imagecreatefromjpeg($image_withpath);
$modified_size = getimagesize($image_withpath);

$width = $percent / 100 * $modified_size[0];
$height = $percent / 100 * $modified_size[1];

$visible_image = imagecreatetruecolor($width, $height);

$dest_x = $x;
$dest_y = $y;
$dest_a = $x * -1;
$dest_b = $y * -1;

imagecopyresampled($visible_image, $modified, 0, 0, $dest_a, $dest_b, $modified_size[0],$modified_size[1], $width, $height);

imagejpeg($visible_image, '', 80);

imagedestroy($visible_image);
imagedestroy($modified);
}
else {
echo "File does not exist.";
}

}
# Posted by Derge | 1 Jun 2007 06:05:22
hello webcheatsheet!

you php notes very useful and easy to understanding.please send quiz program using php
# Posted by anitha | 26 Sep 2007 08:26:34
It's REALLY useful
can i use different color for each Strip?
and how i can create image for vertical graph

thx
# Posted by pankaj | 23 Nov 2007 05:57:51
Very good code
thank you

Thursday, December 20, 2007

Flip the text using unicode

http://www.revfad.com/flip.html

Sunday, December 16, 2007

Partitioning by script

Source: Lissot.net
A reader requested a demonstration of automatic partitioning. The task was to create partitions of fixed size and allow the last partition to consume remaining space. Since the calculations used in this exercise are revelatory of partitioning issues, the first version of the script is included below, in the hopes that it might be of use. This section will be expanded in Version 4 of this HOWTO.

#!/bin/sh

partitionSizes=( 1000000000 256000000 NA ) ; # size in bytes, NA=unspecified
partitionTypes=( 83 82 83 ) ; # see available types: sfdisk -T
partitionFlags=( bootable NA NA )
blockSize=1024
start=1

#---------------------------------------------------------------#
# Do not modify contents below this line
#---------------------------------------------------------------#


function GetGeometry ()
{
numberOfBlocks=`sfdisk -s $1` || exit 1
bytes=$(($numberOfBlocks * 1024))

geometry=(`sfdisk -g $1`) || exit 1
cylinders=${geometry[1]}
heads=${geometry[3]}
sectors=${geometry[5]}


cylinderSize=`echo "scale=4; $numberOfBlocks / $cylinders" | bc` || exit 1
}


function WritePartitionInfo
{
let partitionNumber=$index+1

partitionFlag=${partitionFlags[$index]}
[ $partitionFlag != NA ] || partitionFlag=

partitionType=${partitionTypes[$index]}
[ $partitionType != NA ] || partitionType=

if [ ${partitionSizes[$index]} = "NA" ]
then
cylindersNeeded=
else
cylindersNeeded=`echo "${partitionSizes[$index]} / ( $cylinderSize * $blockSize )" | bc`
fi

echo "${1}$partitionNumber : start= $start, size= $cylindersNeeded, Id= $partitionType, $partitionFlag"
echo "${1}$partitionNumber : start= $start, size= $cylindersNeeded, Id= $partitionType, $partitionFlag" >> $outputFile

[ -z "$start" ] && start=0
[ -z "$cylindersNeeded" ] && cylindersNeeded=0
start=`echo "scale=4; $start + $cylindersNeeded + 1" | bc` || exit 1
}


# ---------------------------------------------------------------------- #
# ------------------------ MAIN ------------------------------ #
# ---------------------------------------------------------------------- #


[ $# -eq 1 ] || { echo "usage: auto_partition.sh device (e.g. /dev/hda)"; exit 1;}
[ -b $1 ] || { echo "$1 not a block device"; exit 1;}
outputFile=${1#/dev/}_proposed


GetGeometry $1

echo "bytes: $bytes"
echo "blocks: $numberOfBlocks"
echo "cylinders: $cylinders"
echo "heads: $heads"
echo "sectors: $sectors"



#echo "unit: cylinders" > $outputFile
> $outputFile

for index in `jot ${#partitionSizes[@]} 0`
do
WritePartitionInfo
done


# This is it! Write the partition table
sfdisk /dev/sda --no-reread < sda_proposed

Saturday, December 8, 2007

Compiling opengl with libraries solved

g++ rect.cc -o rect -lGLU -lGL -lglut

OpenGL 2.1 Reference Page Official

OpenGL 2.1 Reference Pages





A
glAccum
glActiveTexture
glAlphaFunc
glAreTexturesResident
glArrayElement
glAttachShader
Top


B
glBegin
glBeginQuery
glBindAttribLocation
glBindBuffer
glBindTexture
glBitmap
glBlendColor
glBlendEquation
glBlendEquationSeparate
glBlendFunc
glBlendFuncSeparate
glBufferData
glBufferSubData
Top


C
glCallList
glCallLists
glClear
glClearAccum
glClearColor
glClearDepth
glClearIndex
glClearStencil
glClientActiveTexture
glClipPlane
glColor
glColorMask
glColorMaterial
glColorPointer
glColorSubTable
glColorTable
glColorTableParameter
glCompileShader
glCompressedTexImage1D
glCompressedTexImage2D
glCompressedTexImage3D
glCompressedTexSubImage1D
glCompressedTexSubImage2D
glCompressedTexSubImage3D
glConvolutionFilter1D
glConvolutionFilter2D
glConvolutionParameter
glCopyColorSubTable
glCopyColorTable
glCopyConvolutionFilter1D
glCopyConvolutionFilter2D
glCopyPixels
glCopyTexImage1D
glCopyTexImage2D
glCopyTexSubImage1D
glCopyTexSubImage2D
glCopyTexSubImage3D
glCreateProgram
glCreateShader
glCullFace
Top


D
glDeleteBuffers
glDeleteLists
glDeleteProgram
glDeleteQueries
glDeleteShader
glDeleteTextures
glDepthFunc
glDepthMask
glDepthRange
glDetachShader
glDisable
glDisableClientState
glDisableVertexAttribArray
glDrawArrays
glDrawBuffer
glDrawBuffers
glDrawElements
glDrawPixels
glDrawRangeElements
Top


E
glEdgeFlag
glEdgeFlagPointer
glEnable
glEnableClientState
glEnableVertexAttribArray
glEnd
glEndList
glEndQuery
glEvalCoord
glEvalMesh
glEvalPoint
Top


F
glFeedbackBuffer
glFinish
glFlush
glFog
glFogCoord
glFogCoordPointer
glFrontFace
glFrustum
Top


G
glGenBuffers
glGenLists
glGenQueries
glGenTextures
glGet
glGetActiveAttrib
glGetActiveUniform
glGetAttachedShaders
glGetAttribLocation
glGetBufferParameteriv
glGetBufferPointerv
glGetBufferSubData
glGetClipPlane
glGetColorTable
glGetColorTableParameter
glGetCompressedTexImage
glGetConvolutionFilter
glGetConvolutionParameter
glGetError
glGetHistogram
glGetHistogramParameter
glGetLight
glGetMap
glGetMaterial
glGetMinmax
glGetMinmaxParameter
glGetPixelMap
glGetPointerv
glGetPolygonStipple
glGetProgram
glGetProgramInfoLog
glGetQueryObject
glGetQueryiv
glGetSeparableFilter
glGetShader
glGetShaderInfoLog
glGetShaderSource
glGetString
glGetTexEnv
glGetTexGen
glGetTexImage
glGetTexLevelParameter
glGetTexParameter
glGetUniform
glGetUniformLocation
glGetVertexAttrib
glGetVertexAttribPointerv
Top


H
glHint
glHistogram
Top


I
glIndex
glIndexMask
glIndexPointer
glInitNames
glInterleavedArrays
glIsBuffer
glIsEnabled
glIsList
glIsProgram
glIsQuery
glIsShader
glIsTexture
Top


L
glLight
glLightModel
glLineStipple
glLineWidth
glLinkProgram
glListBase
glLoadIdentity
glLoadMatrix
glLoadName
glLoadTransposeMatrix
glLogicOp
Top


M
glMap1
glMap2
glMapBuffer
glMapGrid
glMaterial
glMatrixMode
glMinmax
glMultMatrix
glMultTransposeMatrix
glMultiDrawArrays
glMultiDrawElements
glMultiTexCoord
Top


N
glNewList
glNormal
glNormalPointer
Top


O
glOrtho
Top


P
glPassThrough
glPixelMap
glPixelStore
glPixelTransfer
glPixelZoom
glPointParameter
glPointSize
glPolygonMode
glPolygonOffset
glPolygonStipple
glPopAttrib
glPopClientAttrib
glPopMatrix
glPopName
glPrioritizeTextures
glPushAttrib
glPushClientAttrib
glPushMatrix
glPushName
Top


R
glRasterPos
glReadBuffer
glReadPixels
glRect
glRenderMode
glResetHistogram
glResetMinmax
glRotate
Top


S
glSampleCoverage
glScale
glScissor
glSecondaryColor
glSecondaryColorPointer
glSelectBuffer
glSeparableFilter2D
glShadeModel
glShaderSource
glStencilFunc
glStencilFuncSeparate
glStencilMask
glStencilMaskSeparate
glStencilOp
glStencilOpSeparate
Top


T
glTexCoord
glTexCoordPointer
glTexEnv
glTexGen
glTexImage1D
glTexImage2D
glTexImage3D
glTexParameter
glTexSubImage1D
glTexSubImage2D
glTexSubImage3D
glTranslate
Top


U
glUniform
glUnmapBuffer
glUseProgram
Top


V
glValidateProgram
glVertex
glVertexAttrib
glVertexAttribPointer
glVertexPointer
glViewport
Top


W
glWindowPos
Top


glu
gluBeginCurve
gluBeginPolygon
gluBeginSurface
gluBeginTrim
gluBuild1DMipmapLevels
gluBuild1DMipmaps
gluBuild2DMipmapLevels
gluBuild2DMipmaps
gluBuild3DMipmapLevels
gluBuild3DMipmaps
gluCheckExtension
gluCylinder
gluDeleteNurbsRenderer
gluDeleteQuadric
gluDeleteTess
gluDisk
gluEndCurve
gluEndPolygon
gluEndSurface
gluEndTrim
gluErrorString
gluGetNurbsProperty
gluGetString
gluGetTessProperty
gluLoadSamplingMatrices
gluLookAt
gluNewNurbsRenderer
gluNewQuadric
gluNewTess
gluNextContour
gluNurbsCallback
gluNurbsCallbackData
gluNurbsCallbackDataEXT
gluNurbsCurve
gluNurbsProperty
gluNurbsSurface
gluOrtho2D
gluPartialDisk
gluPerspective
gluPickMatrix
gluProject
gluPwlCurve
gluQuadricCallback
gluQuadricDrawStyle
gluQuadricNormals
gluQuadricOrientation
gluQuadricTexture
gluScaleImage
gluSphere
gluTessBeginContour
gluTessBeginPolygon
gluTessCallback
gluTessEndContour
gluTessEndPolygon
gluTessNormal
gluTessProperty
gluTessVertex
gluUnProject
gluUnProject4
Top


glX
glXChooseFBConfig
glXChooseVisual
glXCopyContext
glXCreateContext
glXCreateGLXPixmap
glXCreateNewContext
glXCreatePbuffer
glXCreatePixmap
glXCreateWindow
glXDestroyContext
glXDestroyGLXPixmap
glXDestroyPbuffer
glXDestroyPixmap
glXDestroyWindow
glXFreeContextEXT
glXGetClientString
glXGetConfig
glXGetContextIDEXT
glXGetCurrentContext
glXGetCurrentDisplay
glXGetCurrentDrawable
glXGetCurrentReadDrawable
glXGetFBConfigAttrib
glXGetFBConfigs
glXGetProcAddress
glXGetSelectedEvent
glXGetVisualFromFBConfig
glXImportContextEXT
glXIntro
glXIsDirect
glXMakeContextCurrent
glXMakeCurrent
glXQueryContext
glXQueryContextInfoEXT
glXQueryDrawable
glXQueryExtension
glXQueryExtensionsString
glXQueryServerString
glXQueryVersion
glXSelectEvent
glXSwapBuffers
glXUseXFont
glXWaitGL
glXWaitX
Top

OpenGL Miscellaneous State Variables


GL_LIST_BASE
Description: Setting of glListBase
Attribute group: list
Initial value: 0
Get command: glGetIntegerv

GL_LIST_INDEX
Description: Number of display lists under construction; 0 if none
Attribute group:
Initial value: 0
Get command: glGetIntegerv

GL_LIST_MODE
Description: Mode of display list under construction; undefined if none
Attribute group:
Initial value: 0
Get command: glGetIntegerv

GL_ATTRIB_STACK_DEPTH
Description: Attribute stack pointer
Attribute group:
Initial value: 0
Get command: glGetIntegerv

GL_NAME_STACK_DEPTH
Description: Name stack depth
Attribute group:
Initial value: 0
Get command: glGetIntegerv

GL_RENDER_MODE
Description: glRenderMode setting
Attribute group:
Initial value: GL_RENDER
Get command: glGetIntegerv


Description: Current error code(s)
Attribute group:
Initial value: 0
Get command: glGetError
Your Ad Here