Wednesday, December 20, 2006

Bleeping Computer - rundl132.exe - File Information

Bleeping Computer - rundl132.exe - File Information: "Name: [not used]
Filename: rundl132.exe
Command: C:\Windows\rundl132.exe
Description: Added by the W32/Looked-A EXE virus.
File Location: %WinDir%
Startup Type: This program uses either the Load= entry in the win.ini or the registry key HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows\Load to load the program."

Slashdot | Google Deprecates SOAP API

Slashdot | Google Deprecates SOAP API: " {look;gawk;find;sed;talk;grep;touch;finger;find;fl ex;unzip;head;tail; mount;workbone;fsck;yes;gasp;fsck;more;yes;yes;eje ct;umount;makeclean; zip;split;done;exit:xargs!!;)}


So is that why nerds are getting acused of rape? (Not checking return codes...)
The semicolons should be double ampersands, so that execution will stop if a command fails."

O'Reilly Radar > Google Deprecates Their SOAP Search API

O'Reilly Radar > Google Deprecates Their SOAP Search API: "Update #2: Tim writes: On the other hand, SOAP has always been a political football shaped by big companies who were seeking to use it to turn web services back into a controllable software stack. (I remember the first web services summit we did, where a Microsoft developer who I won't name admitted that SOAP was made so complex partly because 'we want our tools to read it, not people.') And it could be that innovation in web services is what we need. However, backwards compatibility is worth preserving, at least for a notice period so people can make an orderly transition. However, it sounds like they are doing that."

Wednesday, December 13, 2006

How To Change The Screen Resolution in C#: "


How To Change The Screen Resolution in C#
By Joshy George

Introduction

This is a sample program that will demonstrate how to change resolution at runtime.

All programmers are facing common problem is how to change screen Resolution dynamically. In .Net 2005 it's very easy to change the screen resolution. Here I will explain you how can we get the Screen resolution and how we will change the resolution at dynamically and while unloading the page it will come as it was before. In dot net we can access the values of user's screen resolution through the Resolution class. It also affects all running (and minimized) programs.

Important Functions

No Functions

Page_Load

Screen Srn = Screen.PrimaryScreen;
tempHeight = Srn.Bounds.Width;
tempWidth = Srn.Bounds.Height;
Page.ClientScript.RegisterStartupScript(this.GetType(), "Error", "");
//if you want Automatically Change res.at page load. please uncomment this code.

if (tempHeight == 600)//if the system is 800*600 Res.then change to
{
FixHeight = 768;
FixWidth = 1024;
Resolution.CResolution ChangeRes = new Resolution.CResolution(FixHeight, FixWidth);
}
Change Resoultion
  switch (cboRes.SelectedValue.ToString())
{
case "800*600":
FixHeight = 800;
FixWidth = 600;
Resolution.CResolution ChangeRes600 = new Resolution.CResolution(FixHeight, FixWidth);
break;

case "1024*768":
FixHeight = 1024;
FixWidth = 768;
Resolution.CResolution ChangeRes768 = new Resolution.CResolution(FixHeight, FixWidth);
break;
case "1280*1024":
FixHeight = 1280;
FixWidth = 1024;
Resolution.CResolution ChangeRes1024 = new Resolution.CResolution(FixHeight, FixWidth);
break;

}

Thursday, December 07, 2006

Varlena, LLC | PostgreSQL General Bits Newsletter: "Turn off triggers for bulk load
[GENERAL] Turning off triggers ? 25-Nov-02

Another issue with bulk loading is triggers firing with each row inserted. If you are sure your data is trustworthy and already meets your referential integrity requirements, you can turn off triggers for the bulk load and turn them back on immediately afterward. You should not use this option when your data is not completely clean.

The reltriggers field in the pg_class table contains the number of triggers active for each table. It can be set to 0 the disable the triggers, but will need to be reset to the proper number of triggers to have them re-enabled.

UPDATE 'pg_class' SET 'reltriggers' = 0 WHERE 'relname' = 'tablename';

UPDATE pg_class SET reltriggers = (
SELECT count(*) FROM pg_trigger where pg_class.oid = tgrelid)
WHERE relname = 'table name';

Contributors: Glen Eustace geustace at godzone.net.nz, Stephan Szabo"

Wednesday, December 06, 2006

should this blog still be called .NET Webservices?

for some program's performance reason, i will recode dataset retuning webservices to .NET Remoting.


-----------------------------

the proxy(stub) code for middletier



using System;
using System.Data;

namespace SyerDll
{
public abstract class RemoteObjectDef : MarshalByRefObject
{
public abstract string Test();

public abstract DataSet ReturnHeader();
}
}

----------------------------------


-----------------------------

sample Client Code:

using System;
using System.Data;

using SyerDll;


class Mate
{


public static void Main()
{

Console.WriteLine("Creating Remote Object.");

string url = "tcp://192.168.10.254:8076/RemoteObjectXXX";
/*RemoteObjectDef ro = (SyerDll.RemoteObjectDef)Activator.GetObject(
typeof(SyerDll.RemoteObjectDef), url );*/

RemoteObjectDef ro = (SyerDll.RemoteObjectDef)Activator.GetObject(
typeof(SyerDll.RemoteObjectDef), url );


DataSet rs = ro.ReturnHeader();


for(int i = 0; i < rs.Tables[0].Rows.Count; i++)
Console.WriteLine(rs.Tables[0].Rows[i]["Lastname"].ToString());

Console.WriteLine("Remote Object says " + ro.Test() );
}

}

-----------------------------------------

sample Server Code:

using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using SyerDll;
using System.Data;


using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels.Tcp;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Ipc;


namespace TheServer
{
public class RemoteObject : SyerDll.RemoteObjectDef
{
public override string Dancer()
{
return "UMD";
// throw new Exception("The method or operation is not implemented.");
}

public override DataSet ReturnHeader()
{
DataSet ds = new DataSet();
DataTable t = new DataTable();

t.Columns.Add("Lastname", typeof(string));

t.Rows.Add("Lennon");
t.Rows.Add("McCartney");
t.Rows.Add("Harrison");
t.Rows.Add("Starr");

// ds.Tables[0].Rows[0][0]
ds.Tables.Add(t);



return ds;

//throw new Exception("The method or operation is not implemented.");
}

public override string Test()
{
return "Hello mike" + DateTime.Now.ToString();
// throw new Exception("The method or operation is not implemented.");


}

static void Main(string[] args)
{


// Set up the configuration parameters through a dictionary
IDictionary properties = new Hashtable();
properties.Add("port", 8076);
properties.Add("secure", false);
// properties.Add("impersonate", false);

// Create an instance of a channel
TcpServerChannel serverChannel =
new TcpServerChannel(properties, null);
ChannelServices.RegisterChannel(serverChannel,false);
// ChannelServices.RegisterChannel(new TcpChannel(8076));
Type RemoteType = Type.GetType("TheServer.RemoteObject");

// RemotingConfiguration.RegisterWellKnownServiceType(RemoteType, "RemoteObjectXXX", WellKnownObjectMode.SingleCall);
RemotingConfiguration.RegisterWellKnownServiceType(typeof(TheServer.RemoteObject), "RemoteObjectXXX", WellKnownObjectMode.SingleCall);

//while(true)
Console.WriteLine("Michael Buen");
Console.ReadLine();
}
}
}

Saturday, December 02, 2006

restore postgresql database

raw backup and restore of postgresql, ala-mssql's sp_attach_db.


copy the whole c:\program files\postgresql

:D


then copy to other computer, set the necessary permission(note: NTFS) , like the windows username: postgres-acct. note that postgres-su (superuser), has no bearing in windows usernames, you must not look for this user

Friday, December 01, 2006

FAQ: Technical - Mono: "What is a 100% .NET application?

A '100% .NET application' is one that only uses the APIs defined under the System namespace and does not use P/Invoke. These applications would in theory run unmodified on Windows, Linux, HP-UX, Solaris, MacOS X and others. Note that this requirement also holds for all assemblies used by the application. If one of them is Windows-specific, then the entire program is not a 100% .NET application. Furthermore, a 100% .NET application must not contain non-standard data streams in the assembly. For example, Visual Studio .NET will insert a #- stream into assemblies built under the 'Debug' target. This stream contains debugging information for use by Visual Studio .NET; however, this stream can not be interpreted by Mono (unless you're willing to donate support). Thus, it is recommended that all Visual Studio .NET-compiled code be compiled under the Release target before it is executed under Mono."

Howto Backup PostgreSQL Databases | nixCraft

Howto Backup PostgreSQL Databases

Posted by LinuxTitli in Linux, Howto, UNIX, Data recovery, Backup

I rarely work on PostgreSQL database. Recently I had received a request to backup PostgreSQL databases as one of our client want to reformat server. PostgreSQL is a one of the robust, open source database server. Like MySQL database server, it also provides utilities for creating backup.

Login as a pgsql user$ su - pgsqlGet list of database(s) to backup$ psql -lBackup database using pg_dump command. pg_dump is a utility for backing up a PostgreSQL database. It dumps only one database at a time. General syntax:
pg_dump databasename > outputfile

To dump a payroll database:
$ pg_dump payroll > payroll.dump.outTo restore a payroll database:
$ psql -d payroll -f payroll.dump.outOR$ createdb payroll
$ psql payroll
However, in real life you need to compress database:$ pg_dump payroll | gzip -c > payroll.dump.out.gzTo restore database use the following command:$ gunzip payroll.dump.out.gz
$ psql -d payroll -f payroll.dump.out
Here is a shell script for same task:#!/bin/bash
DIR=/backup/psql
[ ! $DIR ] && mkdir -p $DIR || :
LIST=$(psql -l | awk '{ print $1}' | grep -vE '^-|^List|^Name|template[0|1]')
for d in $LIST
do
pg_dump $d | gzip -c > $DIR/$d.out.gz
done
Another option is use to pg_dumpall command. As a name suggest it dumps (backs up) each database, and preserves cluster-wide data such as users and groups. You can use it as follows:$ pg_dumpall > all.dbs.outOR$ pg_dumpall | gzip -c > all.dbs.out.gzTo restore backup use the following command:
$ psql -f all.dbs.out postgresReferences:

Wednesday, November 29, 2006

No buffer space available Fix (affected program: PostgreSQL for windows)

No buffer space available Fix: "If you are running Windows NT/2000/XP follow these steps: First step is to launch the registry editor. To do this go to Start, Run and type regedit. In the left pane navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters once there, you must create the entry TcpNumConnections. To do this, right click in the right pane and choose new from the menu and select DWORD Value. Give it the name TcpNumConnections. Then right click it and select modify and enter a value of 200.

Restart your computer, if all goes well then you fixed the problem, if not, revert the changes by restoring the registry. (You may have to reboot to safe mode to do this)."

Tuesday, November 28, 2006

Crystal Reports - Database Login dialog when using datasets - .NET VB:

Re: Crystal Reports - Database Login dialog when using datasets
I found out something... You need to check the properties in the 'Datasource Location' screen on your form/report (in the designer). In more detail... right click on 'Database Fields' and choose 'Set Datasource Location'... then verify or 'Replace' the datatable (or dataset) you have with the new one.

This is a HUGE ISSUE if you were using a custom namespace and, from the previous post/replys had to remove the namespace... it DOES NOT get removed from the datasource. Now, using this 'Set Datasource Location' helps with not having to redesign or drop the fields (or new fields) back on the form... it simply updates it for you.

This got rid of the 'Database Login Dialog' from popping up!

i hope this helps someone
ward0093

boolean queries technique for monthly summary report

The other night at edmug Richard Campbell presented some good SQL Querying Tips & Techniques. A lot of them were about sql 2005 which was nice to see (espeically using Common Table Expressions which are quite handy in the case of recursion).

The coolest thing I found was in regards to a cross tab query. The example used was to get sales amount by month for each employee. As you can see in the following example this is done with a lot of subqueries that builds a hideous execution plan.

SELECT Salespeople.Salesperson, SUM(S1.Quantity*S1.Price) AS Total,
(SELECT SUM(S2.Quantity*S2.Price) FROM Sales AS S2 WHERE
DatePart(mm,S2.Invoice_Date)=1 AND S2.Sales_ID = S1.Sales_ID) AS Jan,
(SELECT SUM(S2.Quantity*S2.Price) FROM Sales AS S2 WHERE
DatePart(mm,S2.Invoice_Date)=2 AND S2.Sales_ID = S1.Sales_ID) AS Feb,
(SELECT SUM(S2.Quantity*S2.Price) FROM Sales AS S2 WHERE
DatePart(mm,S2.Invoice_Date)=3 AND S2.Sales_ID = S1.Sales_ID) AS Mar,
(SELECT SUM(S2.Quantity*S2.Price) FROM Sales AS S2 WHERE
DatePart(mm,S2.Invoice_Date)=4 AND S2.Sales_ID = S1.Sales_ID) AS Apr,
(SELECT SUM(S2.Quantity*S2.Price) FROM Sales AS S2 WHERE
DatePart(mm,S2.Invoice_Date)=5 AND S2.Sales_ID = S1.Sales_ID) AS May,
(SELECT SUM(S2.Quantity*S2.Price) FROM Sales AS S2 WHERE
DatePart(mm,S2.Invoice_Date)=6 AND S2.Sales_ID = S1.Sales_ID) AS Jun,
(SELECT SUM(S2.Quantity*S2.Price) FROM Sales AS S2 WHERE
DatePart(mm,S2.Invoice_Date)=7 AND S2.Sales_ID = S1.Sales_ID) AS Jul,
(SELECT SUM(S2.Quantity*S2.Price) FROM Sales AS S2 WHERE
DatePart(mm,S2.Invoice_Date)=8 AND S2.Sales_ID = S1.Sales_ID) AS Aug,
(SELECT SUM(S2.Quantity*S2.Price) FROM Sales AS S2 WHERE
DatePart(mm,S2.Invoice_Date)=9 AND S2.Sales_ID = S1.Sales_ID) AS Sep,
(SELECT SUM(S2.Quantity*S2.Price) FROM Sales AS S2 WHERE
DatePart(mm,S2.Invoice_Date)=10 AND S2.Sales_ID = S1.Sales_ID) AS Oct,
(SELECT SUM(S2.Quantity*S2.Price) FROM Sales AS S2 WHERE
DatePart(mm,S2.Invoice_Date)=11 AND S2.Sales_ID = S1.Sales_ID) AS Nov,
(SELECT SUM(S2.Quantity*S2.Price) FROM Sales AS S2 WHERE
DatePart(mm,S2.Invoice_Date)=12 AND S2.Sales_ID = S1.Sales_ID) AS Dec
FROM Sales AS S1 INNER JOIN Salespeople ON S1.Sales_ID = Salespeople.Sales_ID
GROUP BY Salespeople.Salesperson, S1.Sales_ID;

A Russiam mathemetician by the name of Rozenshtein has a great query (I beleive it was called a boolean query)

SELECT Salespeople.Salesperson, SUM(Sales.Quantity*Sales.Price) AS Total,
SUM(Sales.Quantity*Sales.Price*(1-ABS(SIGN(DatePart(mm,Sales.Invoice_Date)-1)))) AS Jan,
SUM(Sales.Quantity*Sales.Price*(1-ABS(SIGN(DatePart(mm,Sales.Invoice_Date)-2)))) AS Feb,
SUM(Sales.Quantity*Sales.Price*(1-ABS(SIGN(DatePart(mm,Sales.Invoice_Date)-3)))) AS Mar,
SUM(Sales.Quantity*Sales.Price*(1-ABS(SIGN(DatePart(mm,Sales.Invoice_Date)-4)))) AS Apr,
SUM(Sales.Quantity*Sales.Price*(1-ABS(SIGN(DatePart(mm,Sales.Invoice_Date)-5)))) AS May,
SUM(Sales.Quantity*Sales.Price*(1-ABS(SIGN(DatePart(mm,Sales.Invoice_Date)-6)))) AS Jun,
SUM(Sales.Quantity*Sales.Price*(1-ABS(SIGN(DatePart(mm,Sales.Invoice_Date)-7)))) AS Jul,
SUM(Sales.Quantity*Sales.Price*(1-ABS(SIGN(DatePart(mm,Sales.Invoice_Date)-8)))) AS Aug,
SUM(Sales.Quantity*Sales.Price*(1-ABS(SIGN(DatePart(mm,Sales.Invoice_Date)-9)))) AS Sep,
SUM(Sales.Quantity*Sales.Price*(1-ABS(SIGN(DatePart(mm,Sales.Invoice_Date)-10)))) AS Oct,
SUM(Sales.Quantity*Sales.Price*(1-ABS(SIGN(DatePart(mm,Sales.Invoice_Date)-11)))) AS Nov,
SUM(Sales.Quantity*Sales.Price*(1-ABS(SIGN(DatePart(mm,Sales.Invoice_Date)-12)))) AS Dec
FROM Sales INNER JOIN Salespeople ON Sales.Sales_ID = Salespeople.Sales_ID
GROUP BY Salespeople.Salesperson;


Breaking this down we take the numeric month out of the Invoice date with the DatePart(mm, Sales.Invoice_date) section. Next the value is run through the SIGN method. SIGN converts a number to a +1 if greater than 0, 0 if the value is 0, or -1 if the number is less than 0. Then convert the number to a positive using ABS (absolute value). Then subtract the value from 1 so now we have a boolean 0 or -1 for the current row. Then multiply the data (in this case the queantiy * price) by the value we have been calculated. So if the row is in the current month it will be multiplied by -1, otherwise by 0 (and hence equal 0 so it will not be included in the sum).

Here is a table showing the value at each step


Subtraction SIGN ABS Subtraction
Jan 2 1 1 0
Feb 1 1 1 0
Mar 0 0 0 1
Apr -1 -1 1 0
May -2 -1 1 0
Jun -3 -1 1 0

If you look at the execution plan for this method you will see it is drastically more efficient which really helps with large amounts of data. This technique does not have to be used for dates. A good example Richard Campbell showed was using CharIndex to find a name (as it will return -1 if not found, 0 if an exact match, or greater than 0 if contained within the word). Basically anything you can turn into a numeric to say you have matched something vs. not matched then this technique should be applicable.

connection string for postgresql blob and insufficient base table information error

"Driver={PostgreSQL ANSI};uid=postgres-su;pwd=whiteboard-su;Database=thephoto;Server=localhost;ByteaAsLongVarBinary=1;ReadOnly=0;Parse=1"

Monday, November 27, 2006

mono exe

After using Mono for a while, you'll probably get sick of running programs using the mono command. Fear not though, since there's a little-known Linux feature ready to rescue you: miscellaneous binary format support. This lets you specify applications to run different types of files, much like file associations in Nautilus or Konqueror. Try these commands:

modprobe binfmt_misc
mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
echo ':CLR:M::MZ::/usr/bin/mono:' > /proc/sys/fs/binfmt_misc/register

If everything goes well, running Mono EXE files should work transparently. Put these commands into an appropriate startup script and you should be set. If you're running Debian though, you shouldn't have to bother - the Mono packages are built to set up miscellaneous binary support automatically

Sunday, November 26, 2006

solution to no buffer space available postgresql (postgres is port 5432)

When you try to connect from TCP ports greater than 5000 you receive the error 'WSAENOBUFS (10055)': "RESOLUTION
Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall your operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.
The default maximum number of ephemeral TCP ports is 5000 in the products that are included in the 'Applies to' section. A new parameter has been added in these products. To increase the maximum number of ephemeral ports, follow these steps:
1. Start Registry Editor.
2. Locate the following subkey in the registry, and then click Parameters:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
3. On the Edit menu, click New, and then add the following registry entry:
Value Name: MaxUserPort
Value Type: DWORD
Value data: 65534
Valid Range: 5000-65534 (decimal)
Default: 0x1388 (5000 decimal)
Description: This parameter controls the maximum port number that is used when a program requests any available user port from the system. Typically , ephemeral (short-lived) ports are allocated between the values of 1024 and 5000 inclusive.
4. Quit Registry Editor."

Saturday, November 25, 2006

how to save images in postgresql database

Set ImgXCtrl1.Picture = LoadPicture("c:\windows\wallpaperbrucelee14.jpg")

Set c = New ADODB.Connection
c.CursorLocation = adUseClient
c.Open "Driver={PostgreSQL ANSI};uid=postgres-su;pwd=whiteboard-su;Server=localhost;Database=test;ByteaAsLongVarBinary=1"





Dim jpg As New MycJpg ' core code comes from intel jpeg library

Set r = New ADODB.Recordset
r.CursorLocation = adUseClient
r.Open "SELECT i, imx FROM images where 1 = 0", c, adOpenStatic, adLockOptimistic


Dim b() As Byte
b = jpg.PicToJpba(ImgXCtrl1.Picture)


r.AddNew
r.Fields("i").Value = 3
r.Fields("imx").Value = b
r.Update

Monday, October 30, 2006

Puakma: Under the hood:

3,001 Ajax web chat applications have been written. It's almost a right of passage for developers learning the capabilities of the Ajax paradigm. I have been putting off writing one because there were already 3,000 in existence, but last week I bit the bullet and scratched my itch. Sometimes it's good to do stuff just because you can.

The problem I had to solve is: We are about to start a weekly Tornado meeting. I want everyone to be able to find the chat session easily and have it start at a designated time (and finish so noone can rejoin an old one later!). Further, everyone shouldn't need a fancy schmancy chat client and an account somewhere (eg, skype, msn, icq, ...).

So how does it work?

I have two tables, one called CHATEVENT which holds the meeting information such as start date, time, description etc. The other table is called CHATDATA and this holds the text people type, only row per chat message tagged to a CHATEVENT. At this stage I am not concerned about managing invitees but that could be easily added later. YAGNI

On the client side, each time you type some text in the input field, it is sent to hte server via an ajax request and poked into the CHATDATA field. There is also a client side thread that polls the server for new messages, reading the CHATDATA table to find any new messages since the last poll. Any new messages are returned and dynamically added to the div which holds the chat messages, creating the illusion of messages being pushed to the client.

The trick I found was to ensure everyone only uses the server time for timestamping messages and have the server return the time of the last message. If you don't you'll get things doubled up - or missed.

On performance, because the ajax chat mechanism works on a polling basis you need to tweak the poll interval so that each client will poll regularly enough so the user experience is nice and infrequently enough to reduce the server load.

Hopefully we can get this integrated into podmatcher soon and start using it as the chat medium, that way if you miss a meeting you can come back later and read the pod meeting's transcript.

If you'd like a copy of this Tornado app, email me :-)

Friday, September 22, 2006

Frankly, the Philippine attitude should be like China, which, as the Chinese officials quoted in this book are saying, is concentrating on learning what it can from the US with the vision of one day becoming the designers of products, not just the cheap alternative for countries offshoring their manufacturing needs.

Monday, August 28, 2006

some filipino homonyms ambiguity

http://video.yahoo.com/video/play?vid=18bc876987a407d3ce81d2b4195ce0d1.667581&cache=1 <-- aso nanghahabol ng naka-bisikleta

Saturday, August 26, 2006

original article:
http://www.dvorak.org/blog/?p=6557

Tokyo tops the ‘Big Mac’ index — USA NOT Number One


Residents of Tokyo have the highest purchasing power in the world, edging out people in Los Angeles, Sydney, London and Toronto, according to a new survey by the Swiss banking giant UBS that uses the “Big Mac” as its benchmark.

“Wages only become meaningful in relation to prices — that is, what can be bought with the money earned,” it said.

The bank calculated the “weighted net hourly wage in 14 professions” and divided it into the local price of “a globally available product,” for which it chose McDonald’s flagship hamburger.

“On a global average, 35 minutes of work buys a Big Mac,” it said. “But the disparities are huge: in Nairobi, 1 1/2 hours’ work is needed to buy the burger with the net hourly wage there. In the U.S. cities of Los Angeles, New York, Chicago and Miami, a maximum of 13 minutes’ labor is needed.”

In Tokyo, it takes a mere 10 minutes. Bogota, Colombia, came in last among the 70 cities surveyed at 97 minutes.

Of course, you should add the cost of having your arteries defatted every 20 years or so.

Wednesday, August 16, 2006

Slashdot | Did Humans Evolve? No, Say Americans: ". Show me a single person who is both an aetheist AND against evolution. The problem with religious people is that they have an agenda, and logic usually takes a back seat"

Tuesday, August 15, 2006

For your eyes only


http://research.microsoft.com/university/ntsrclicensees.asp


Windows® Source Code Licensees

North America

Arizona State University
Boston University
Brigham Young University
Brown University
Capitol College
Cogswell College North
Columbia University
Cornell University
Dartmouth College
Eastern Kentucky University
Evangel University
Florida Institute of Technology
Georgia Institute of Technology
Howard University
Lamar University
Louisiana State University at Shreveport
Loyola College in Maryland
Massachusetts Institute of Technology
McGill University
New York University
Oregon Graduate Institute of Science and Technology
Princeton University
Rice University
Saginaw Valley State University
San Jose State University
Seattle Pacific University
Stanford University
Stevens Institute of Technology
SUNY/Stony Brook
Texas A&M University
The Johns Hopkins University
University of Alabama at Birmingham
University of California at Irvine
University of California at Los Angeles
University of California at Riverside
University of California at San Diego
University of California at Santa Cruz
University of Colorado at Boulder
University of Florida
University of Houston at Clear Lake
University of Idaho
University of Illinois
University of Kentucky
University of Memphis
University of Michigan
University of Notre Dame
University of Rochester
University of Southern California
University of Southern Mississippi
University of Texas at Austin
University of Virginia
University of Washington
University of Wisconsin
Vanderbilt University
Walla Walla College
Washington University
Wayne State University
Western Illinois University

International

Brandenburg University of Technology
Budapest University of Technology
Carlos III University of Madrid
Chalmers University of Technology
Czech Technical University
ETH Zentrum
Hebrew University
Humboldt-Universität
INRIA LORRANE
INRIA RENNES
INRIA RHONE-ALPES
INRIA ROCQUENCOURT
KAIST
Keio University
LAAS-CNRS
Lancaster University
MS Institute (MS Australia)
National University of Singapore
Queensland University of Technology
Slovak University of Technology
Swinburne University of Technology
Technion
Technische Universität Darmstadt
Technische Universität Graz
Technische Universität Hamburg-Harburg
Technische Universität München
Technische Universität Wien
Tel Aviv University
Trinity College Dublin
Universidade de Lisboa
Università di Genova
Università di Milano
Universität Kaiserslautern
Universität Karlsruhe
Universität Potsdam
Universität Zu Köln
University College London
University of Aarhus
University of Aizu
University of Alberta
University of Cambridge
University of Cape Town
University of Greenwich at Medway
University of Kent
University of Linz
University of Oslo
University of Patras
University of Salford
University of Southampton
University of Tromsø
University of West Bohemia
Is Full Disclosure Advisable?: "'loose lips sink ships.'"

some patent problem

Slashdot | What's Fedora Up To? Ask the Project Leader: "NTFS support in Fedora/RedHat.
(Score:5, Interesting)
by Anonymous Coward on Monday August 07, @11:58AM (#15859337)
If Fedora is actually not controlled by Red Hat anymore, and Fedora is user-oriented, why are both the only general-purpose GNU/Linux distributions that disable the NTFS driver from the Linux kernel?

Users do need this option (unlike RedHat's customers, which are organizations as far as I know), and for evidence, Linux-NTFS is one of the projects with the most downloads on sourceforge.

I would like to add that NTFS is part of the mainline kernel. Compiling it as a module will cause it to not take any memory resources other than the few kilobytes on disk that any un-used hardware module is taking, unless of course the user has a mounted NTFS partition.

RedHat's reason for disabling NTFS support was that RedHat is a US-based organization and that they fear patenting problems from MS. No law action was ever taken, and no actual patent was referenced. As far as I know, NTFS is not even patented or patentable. Fedora is not RedHat as you say, so this old reasoning is not exactly valid for Fedora. The IBM/SCO saga also cleared the issue about patents in the mainline kernel.

Unless Fedora will change this simple flag in the kernel config file, I assume it is still controlled (and not only sponsered as some would say) by RedHat."
Slashdot | Google Sends Legal Threats to Media Organizations: "Googling woes
(Score:5, Funny)
by Rob T Firefly (844560) on Monday August 14, @09:09AM (#15901979)
(http://robvincent.net/ | Last Journal: Wednesday April 27, @09:22AM)
Once I was feeling artistic, so I Googled how best to Xerox my head onto a Playboy Bunny, maybe using some Scotch Tape, but found out I could Photoshop it instead. So, I had a Coke, grabbed some Kleenex, and got to work.. but was disturbed by my mom coming in to Hoover. So I quickly shut down the PC, and decided to use Crayolas and Play-Doh instead."

Sunday, August 13, 2006

Does PLDT really suck? » @ Ambot ah! [ technology news and reviews ]: "I switched to BayanDSL and have been using it for almost 2 years now. Its a dedicated line (no phone - from the poste, straight to the ADSL MODEM) 384kbps at two-thirds the price I was paying for PLDT’s 256kbps. NO COMPLAINTS - they have 24 hr. service crew and they guarantee a technician at your door in 1 day kung hindi ma-resolve through phone ang problem. I can’t really account for other horror stories out there about Bayan DSL (if any) pero as for me, its been peaches and cream ever since."

Saturday, August 12, 2006

Slashdot | MS .net vs Mono, Open Source: "you've been duped
(Score:4, Informative)
by g4dget (579145) on Wednesday December 25, @09:32PM (#4958666)
(i) Sun has supported third party implentations to the point where they used a third party implementations themself. What's the original linux jvm a third party jvm ( name was black-something, I can't remember).

It's Blackdown Java. It is not a third party implementation. Sun simply dumped their source code onto a bunch of people outside Sun who then fixed a bunch of bugs and ported it to Linux.

IBM has had it's JVM for eons now. There are lots of embedded JVMs.

IBM does not have its own Java implementation--they have a license to Sun's Java implementation, and they replace some of Sun's components with their own.

(ii) Sun has tolerated those implementations for years now.

Sun hasn't tolerated anything. As far as I can tell, anybody who is shipping anything remotely resembling a Java platform implementation has a contractual agreement with Sun. In fact, merely to claim that something is Java, you need a contractual agreement with Sun (because of their trademark).

(iii) In the past, Sun has never shown to be anti-competitive as microsoft. They don't defend or promote Solaris at any cost the way microsoft does.

I see no basis for that statement. Sun simply isn't leveraging their monopoly because they don't have one. As a 15 year Sun customer, all the indications I have seen are that Sun is worse than Microsoft when it comes to cut-throat competition and intellectual property, they are simply not as successful."
Slashdot | MS .net vs Mono, Open Source: "Re:Eclipse and SWT on Monster
(Score:4, Insightful)
by 1000StonedMonkeys (593519) on Wednesday December 25, @08:19PM (#4958463)
Most users' experience with swing can be summed up with the following:

1. Open any swing application
2. Right click the mouse button somewhere a context menu should appear, or click on one of the file menus.
3. Wait 3 seconds
4. Form the incorrect conclusion that Java is slow
5. Go back to using native win32 programs

Sun's been trying to 'fix swing' for the last 5 years, and they've had no luck. What makes you think IBM has the magic bullet?

Swing will never be fast. The same abstractions that make it such a joy to program with make it terribly inefficiant. Print out a stack trace in a event handler function in swing and take a look at how deep it is. Every one of those functions had to be called before the event was process, and ever call had to be done through a table lookup. I'll avoid going into the whole native vs. non-native widgets debate, but forgive me if I remain skeptical about the non-native approach sun has been using with swing.

IBM (well, the company that wrote eclipse that IBM bought) did the right thing when they started from scratch to design SWT. Eclipse is amazingly responsive when compared to any swing application I've seen. Try it out yourself, I think you'll be impressed."
More than an open-source curiosity | Newsmakers | CNET News.com: "The problem with J2EE really is that it became very, very academic and the complexity of all these perfectly designed systems in schools does not necessarily map when you have deadlines and all kinds of other things"

Thursday, August 10, 2006

commandline clipboard under gnome

http://uwstopia.nl/blog/2006/05/command-line-and-the-clipboard

A few days ago I stumbled upon a question in a newsgroup: how to put text on the Gnome clipboard from the command line?

In response, I wrote a small Python script (using PyGTK) that can be used as a pipe in your command line scripts. It puts all data from stdin on the clipboard. For this to work, you will need the correct $DISPLAY environment variable set (which will be the case most of the time, but it doesn’t work from cron for example).

CLI lovers, download copy-to-clipboard here and rejoice!

Update: Sure, there’s also tons of other solutions like xclip and of course the script could be more like a one-liner, but I like to demonstrate the ease of use Python and PyGTK offer.

---------


#!/usr/bin/env python

import sys

import pygtk
pygtk.require('2.0')
import gtk

buffer = []
for line in sys.stdin:
buffer.append(line)

c = gtk.Clipboard()
c.set_text(''.join(buffer))
c.store()
How to redirect output to "clipboard" on command line: "

#:912674 12:42 am on Dec. 26, 2004 (utc 0)

For those not using Cygwin, there is an X-Windows utility called 'xclip' which reads STDIN and puts the input into an X clipboard.

cat filename ¦ xclip

X clipboards are not the same as Gnome or KDE clipboards, however. Someone wrote a bash function for KDE called 'klip' that uses the KDE utility 'klipper' to do the same thing (search for it).. I didn't find anything similar for Gnome, but some Gnome apps play nicely with X clipboards...so maybe xclip would work?

So it will depend on which application are you pasting into, unfortunately. "

Wednesday, August 09, 2006

Find the most recently changed files (recursively) [linux] [find] [command] [line] [morten] [recently] [changed]: "Find the most recently changed files (recursively) (See related posts)

find . -type f -printf '%TY-%Tm-%Td %TT %p\n' | sort"

Monday, August 07, 2006

open a port

Just in case you need it in the future, I use this for opening a port:
Code:
iptables -I INPUT -p tcp --dport $1 -j ACCEPT
Where $i is the port number you wish to open.

Like the others said, it sounds to me like telnet is not even running, and the connection refused is because there isn't actually a service to connect to.

backup tomboy notes

[tomboy-list] Backup files:

Hi Shannon,

Tomboy stores all your notes in ~/.tomboy/*.note. It keeps a few simple
settings in GConf, but nothing major.

-Alex

On Fri, 2004-12-10 at 20:43 +0000, Shannon Baker wrote:
> I move data and reinstall on my machines fairly frequently but don't want to
> lose my Tomboy notes. What files do I need to back up to transfer them to
> another machine? Is there any special process or procedure to reimport them
> on the new machine?
>
> Thanks
>
> Shannon T. Baker
>

linux equivalent

c:\documents and settings\start menu

/usr/share/applications/

-----------------

system-wide startup folder

/etc/xdg/autostart

linux

c:\documents and settings\start menu

/usr/share/applications/

-----------------

system-wide startup folder

/etc/xdg/autostart

Sunday, August 06, 2006

system wide startup programs

aiken@aiken-laptop:/etc/xdg/autostart$ ls
compiz.desktop gnome-volume-manager.desktop
gnome-power-manager.desktop update-notifier.desktop
aiken@aiken-laptop:/etc/xdg/autostart$
this solved the gset-compiz settings problem

aiken@aiken-laptop:~/.gconf/apps$ chmod 777 %gconf.xml
aiken@aiken-laptop:~/.gconf/apps$
/etc/gconf/gconf.xml.defaults$ sudo gedit %gconf-tree.xml
Howto Install xorg-aiglx + compiz (packages) - Ubuntu Forums:

Howto Install xorg-aiglx + compiz (packages)

All packages as based on Kristian Høgsberg fixes, forums compiz packages and official packages.

They provide to get compiz run on aiglx.

I'm running it on my i915 laptop, and the performance is actually quite impressive. For those people using NVidia should continue to use Xgl server. compiz-aiglx don't work on this card !

1. Download packages

aiglx :
First you should add reggaemenu compiz repository in you source.list
Code:
deb http://xgl.compiz.info/ dapper aiglx
deb http://xgl.compiz.info/ dapper main

and update all deb
Code:
sudo apt-get update
sudo apt-get dist-upgrade

you should install latest dri modules packages :
Code:
sudo apt-get install linux-dri-modules-common linux-dri-modules-`uname -r`

if after a linux-restricted-modules or linux-image update you have some troubles, start this command to regenerate modules.dep :
Code:
sudo /sbin/ldm-manager

compiz:

compiz aiglx are now partially official, compiz-vanilla or compiz-quinn packages work now on xorg-aiglx. All compiz-aiglx packages are now deprecated, well first uninstall all compiz-aiglx packages

Code:
sudo aptitude purge compiz-aiglx compiz-aiglx-gnome
you can then either install compiz-vanilla packages :
Code:
sudo apt-get install compiz-vanilla-aiglx compiz-vanilla compiz-vanilla-gnome
or compiz-quinn packages:
Code:
sudo apt-get install compiz-quinn-aiglx compiz compiz-gnome

2. Configure Xorg

Good news you can rework in 24 depth mode
Edit your Screen section and modify your DefaultDepth
Quote:
DefaultDepth 24

Warning this options are necessary !

first activate dri,dbe, glx and all necessary modules like this :
Quote:
Section "Module"
# Load "GLcore"
Load "bitmap"
Load "ddc"
Load "dbe"
Load "dri"
Load "extmod"
Load "freetype"
Load "glx"
Load "int10"
Load "type1"
Load "vbe"
EndSection

add Option "XAANoOffscreenPixmaps" and remove all other option in device section like this :
Quote:
Section "Device"
Identifier "Intel Corporation Intel Default Card"
Driver "i810"
Option "XAANoOffscreenPixmaps"
BusID "PCI:0:2:0"
EndSection

add AIGLX option in your ServerLayout section like this :
Quote:
Section "ServerLayout"
Option "AIGLX" "true"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
InputDevice "Synaptics Touchpad"
EndSection

uncomment all dri section
Quote:
Section "DRI"
Mode 0666
EndSection


and you must have:
Quote:
Section "Extensions"
Option "Composite" "Enable"
EndSection

is required.


3. Configure gdm

Create or modify /etc/gdm/gdm.conf-custom to change your xorg server like this:
Quote:
[servers]
0=aiglx

[server-aiglx]
name=aiglx server
command=/usr/bin/Xorg-air :0
flexible=true

and restart gdm
Quote:
sudo /etc/init.d/gdm restart

4. Compiz-aiglx start script
the compiz-aiglx start script is now in package and automatically started on all gnome session startup. If you have some trouble with it you can remove compiz-aiglx.desktop file in /etc/xdg/autostart.

5. Fix totem playback

To have an optimised video playing on xorg-aiglx :

-> if you have totem-gstreamer :
launch gstreamer-properties and select on default video playback "XWindow (NoXv)" in video tab.

-> if you have totem-xine :
edit ~/.gnome2/totem_config and replace this line :
Quote:
#video.driver:auto
by
Quote:
video.drivershm

Have fun

Friday, August 04, 2006

how to install wine and cabextract

Ubuntu Dapper 6.06

You have to enable universe packages first. It is also recommended that you use the official winehq ubuntu package:

1) Open /etc/apt/sources.list
Code:
sudo gedit /etc/apt/sources.list


2) Uncomment following lines:
Code:
deb http://us.archive.ubuntu.com/ubuntu dapper universe
deb-src http://us.archive.ubuntu.com/ubuntu dapper universe


3) Add this line:
Code:
deb http://wine.budgetdedicated.com/apt breezy main


4) Close gedit and run an update:
Code:
sudo apt-get update


5) Install wine and cabextract:
Code:
sudo apt-get install wine cabextract
Following on from my last post about PostgreSQL, i've found a couple of things were 'off' with the setup, so this is a quick re-write and update... on with the show!

So, if the last guide worked, what's different with this set-up...

* We now enable and use the default 'postgres' user account to administrate our database server (saves creating a new one)!
* We also fix a couple of issues with the networking set-up.
* We now use the latest build of PostgreSQL - v8.1.
* This set-up is less of a 'hack', than the last guide (i've been reading since then).

Before we move on, this guide was tested on (and intended for) the current stable build of Ubuntu (5.04 - Breezy Badger), but it should also work fine on any other build of Ubuntu/Debian (6.06 - Dapper Drake etc).

First off, PostgreSQL 8.1 isn't in the main repositories in Breezy, you'll need to have backports enabled to get hold of the latest packages. Once you've done that, let's move on.

Right, now let's install the database server. At the command-line, enter the following (Or you can do all this in Synaptic - just search for and install the packages listed in the commands):

> sudo apt-get install postgresql-8.1 postgresql-client-8.1
> sudo apt-get install pgadmin3 pgadmin3-data

This installs the database server, and the pgAdmin administration application (If you don't really get on with the pgAdmin GUI, there is an alternative in the form of phpPgAdmin - a web-based administration interface. A quick 'How To' on getting this up will be coming shortly! ;) ).

Now we need to reset the password for the 'postgres' admin account for the server, so we can use this for all of the system administration tasks. Type the following at the command-line (substitute in the password you want to use for your administrator account):

> sudo su postgres -c psql template1
template1=# ALTER USER postgres WITH PASSWORD '*password*';
template1=# \q

Then, from here on in we can use pgAdmin to run the database server. To get a menu entry for pgAdmin do the following...

> sudo gedit /usr/share/applications/pgadmin.desktop

Then paste the following into the file:

[Desktop Entry] Comment= PostgreSQL Administrator III
Name=pgAdmin III
Encoding=UTF-8
Exec=pgadmin3
Terminal=false
Comment[en_GB]=PostgreSQL Administrator III
Icon=/usr/share/pixmaps/pgadmin3.xpm
Type=Application
Categories=GNOME;Application;Database;System;
Name[en_GB]=pgAdmin III

Then save the file and exit gedit. You should find the launcher in the System Tools section of the Applications menu. Alternatively, you could just type 'pgadmin3' at the shell. The wizards to connect to the database should be pretty simple to figure out.

Finally, we need to open up the server so that we can access and use it remotely - unless you only want to access the database on the local machine (The guidelines here are for opening up your server on a secure LAN - if you are not on a secure LAN you may want to look into adding SSL authentication before proceeding with these steps).

To do this, first, we need to edit the postgresql.conf file:

> sudo gedit /etc/postgresql/8.1/main/postgresql.conf

Now, to edit a couple of lines in the 'Connections and Authentication' section...

Change the line:

#listen_addresses = 'localhost'

to

listen_addresses = '*'

and also change the line:

#password_encryption = on

to

password_encryption = on

Then save the file and close gedit.

Now for the final step, we must define who can access the server. This is all done using the pg_hba.conf file.

> sudo gedit /etc/postgresql/8.1/main/pg_hba.conf

Now add the following lines to the file:

# Allow any user on the local system to connect to any database under
# any user name using Unix-domain sockets (the default for local
# connections).
#
# Database administrative login by UNIX sockets
local all all trust

# TYPE DATABASE USER CIDR-ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all md5

# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5

# Connections for all PCs on the subnet
#
# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
host all all [ip address] [subnet mask] md5

and in the last line, add in your subnet mask (i.e. 255.255.255.0) and the IP address of the machine that you would like to access your server (i.e. 138.250.192.115). However, if you would like to enable access to a range of IP addresses, just substitute the last number for a zero and all machines within that range will be allowed access (i.e. 138.250.192.0 would allow all machines with an IP address 138.250.192.x to use the database server).

That's it, now all you have to do is restart the server and all should be working!
> sudo /etc/init.d/postgresql-8.1 restart

Tuesday, August 01, 2006

vmware installation

ftvcs
April 13th, 2005, 03:26 PM
I got te same problem, but i found a solution:
as root i did:

apt-get install linux-headers-2.6.10-5-386

and then entered on the vmware installation:

/usr/src/linux-headers-2.6.10-5-386/include

I hope this helps some of you.

corefile
April 16th, 2005, 08:08 PM
if you have the correct headers installed all you have to do is create a symlink for the missing /usr/src/linux


for instance for me

in the /usr/src directory I did:

ln -s linux-headers-2.6.10-5-k7/ linux

and every thing was fine after that.
building kopete

problem:
Can't find X includes. Please check your installation and add the correct paths!


solution:
install kde-dev

chikka dependency problem

To solve my problem, I did a "sudo dpkg -i --force-depends package-name.deb" so that version problems will be ignore
put this in /etc/bash.bashrc for monodevelop to work:

export MOZILLA_FIVE_HOME=/usr/bin/mozilla

If your laptop takes too long to configure network interfaces, especially when you are not on an network, you can stop it from waiting by hitting Ctrl+C. This will cause this step to be skipped.

On a more permanent basis, you can modify the amount of time your computer waits for network configuration as follows:

Edit /etc/dhcp3/dhclient.conf

Edit the line that says:
#timeout 60
to read
timeout 20

Now your laptop will only try for 20 seconds to configure the network interfaces. 20 seconds is ample time for my laptop’s network interfaces to get configured. (I actually use nm-applet, but that is another story…)

If you want to disable the configuration of the ethernet network interface (eth0) at startup, edit “/etc/network/interfaces” and comment out the line “auto eth0“. You will have to bring up eth0 manually later, by doing $sudo ifup eth0 whenever you are plugged into the network.

Sunday, July 30, 2006

Reasons why Reiser4 is great for you:

* Reiser4 is the fastest filesystem, and here are the benchmarks.
* Reiser4 is an atomic filesystem, which means that your filesystem operations either entirely occur, or they entirely don't, and they don't corrupt due to half occuring. We do this without significant performance losses, because we invented algorithms to do it without copying the data twice.
* Reiser4 uses dancing trees, which obsolete the balanced tree algorithms used in databases (see farther down). This makes Reiser4 more space efficient than other filesystems because we squish small files together rather than wasting space due to block alignment like they do. It also means that Reiser4 scales better than any other filesystem. Do you want a million files in a directory, and want to create them fast? No problem.
* Reiser4 is based on plugins, which means that it will attract many outside contributors, and you'll be able to upgrade to their innovations without reformatting your disk. If you like to code, you'll really like plugins....
* Reiser4 is architected for military grade security. You'll find it is easy to audit the code, and that assertions guard the entrance to every function.

V3 of reiserfs is used as the default filesystem for SuSE, Lindows, FTOSX and Gentoo. We don't touch the V3 code except to fix a bug, and as a result we don't get bug reports for the current mainstream kernel version. It shipped before the other journaling filesystems for Linux, and is the most stable of them as a result of having been out the longest. We must caution that just as Linux 2.6 is not yet as stable as Linux 2.4, it will also be some substantial time before V4 is as stable as V3.

discussion about reiserfs

EVERY computer needs a u.p.s.

(Score:5, Insightful)
by FrankHaynes (467244) on Monday August 23, @11:59PM (#10052991)
Write on the blackboard 10^10000000 times:

"EVERY computer needs an uninterruptible power supply. EVERY one."

There are so many problems of which you might not be aware, aside from those requiring you to run fsck afterwards, which are solved by a good u.p.s. that you'd be penny-wise, pound-foolish for not putting a u.p.s. on every machine in sight.

My clients think that I can walk on water simply because I eliminated a large share of unexplainable wierdnesses from their machines by installing an inexpensive u.p.s. on every single one.

Solid, clean power is very important to a stable computing system. I cannot stress this enough.
> > E: /var/cache/apt/archives/tzdata_2006g-2_all.deb: trying to overwrite
> > `/usr/share/zoneinfo/Africa/Algiers', which is also in package locales
> >
> Absolutely, this happens when you have to put on tzdata, which is needed for
> libc6.
> dpkg --force overwrite /var/cache/apt/archives/tzdata._2006g-2_all.deb
> should do it

The answer was:

sudo dpkg --force-overwrite
--install /var/cache/apt/archives/tzdata_2006g-2_all.deb

But thanks for putting me on the right track.

1.9.7 really looks good.

Thanks, Bill, for the info that it was on sid. If anyone notices when
future versions make it there, I'd appreciate the announcement.

how to burn cd in Ubuntu

how to burn cd in Ubuntu

in nautilis (the file manager)

type: burn:///

Saturday, July 29, 2006

ugly openoffice fonts


I think the problem the OP has is withthe font rendering in OpenOffice. I have to agree that it does pretty bad job with most fonts. I haven't found any solution for this, but at least everything looks OK when printed to paper or exported to PDF

Friday, July 28, 2006

converting FLV to MPG

sudo apt-get install ffmpeg 
ffmpeg -i video.flv -ab 56 -ar 22050 -b 500  -s 320x240 video.mpg 

finally to make your life easier just put it a script file to excute later

mkdir ~/scripts;
echo 'ffmpeg -i $1 -ab 56 -ar 22050 -b 500 -s 320x240 $1.mpg' > f2mpg.sh;
mv Flv2Mpg.sh ~/scripts

now whenever you want to convert FLV file to mpg just shot the

 ~/scripts/f2mpg.sh Flv_video_file_name.flv

Tuesday, July 25, 2006

Disable Synaptics Touchpad

original article:


http://ubuntu.wordpress.com/2006/03/24/disable-synaptics-touchpad/


March 24, 2006

Posted by ubuntonista in ubuntu, guides. trackback

I needed a quick way to disable and enable my synaptics touchpad at will, and I found one.

Make sure that in you /etc/X11/xorg.conf file, you have:


Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "HorizScrollDelta" "0"
Option "SHMConfig" "on"
EndSection

Notice the Option “SHMConfig” “on” line — that is the one that you really need to have in there. This allows you to change some configuration parameters for the synaptics touchpad without restarting Xorg (Xserver).

Now that is taken care of.

All you have to do to disable your synaptics touchpad is to execute the command:
$synclient TouchpadOff=1

and to turn it back on, you can execute the command
$synclient TouchpadOff=0

TIP: To make it even easier to turn the touchpad on and off, you can set a keyboard shortcut and bind the shortcuts to the command to turn it on, and off, and use the keyboard shortcuts.

Sunday, July 23, 2006

change keybindings of show desktop, Ctrl+Alt+d to Windows D

With each release of GNOME, I think it pulls further ahead of KDE. I’ve been using GNU/Linux for 5 years now, and I have seen GNOME destroy KDE in terms of usability, and now (finally) in terms of speed as well. I love the things you can configure with GNOME when you know what youre doing. Using GConf, you can go to “apps–>metacity–>global_keybindings” and edit the keybindings to whatever you want. Change “show_desktop” to “M” and you’re set (Mod4 is the Winblows key). You can further your Windows-esque interface by setting “panel_run_dialog” to “R” and making one of the run_commands “F” and editting the corresponding command to be “gnome-search-tool”. T is nice to run an xterm, and I like to set B and Z to be “xmms -f” and “-r” to control xmms skipping while its still minimized. I am excited for 2.8! One question, my mouse cursor has a shadow with transparency, why can’t my windows have shadows?

customized keybindings and desktop elements

gconf-editor

unix autoexec.bat

/etc/profile

/etc/bash.bashrc

Friday, July 21, 2006

ubuntu: No sound in youtube.com (flash)

Original Article:

http://ubuntuforums.org/showthread.php?t=187752&highlight=sound+flash

The problem is that Flash is old and doesn't support Ubuntu's directory structure for esd properly. It wants to use /tmp/.esd/socket for the sound connection. But Ubuntu uses /tmp/.esd-/socket for the sound (the uid for the user that installed Ubuntu is 1000). A quick hack you can do to fix this is to symbolic link that directory. To do that, go to System - Preferences - Sessions - Startup programs and add
Code:
ln -s /tmp/.esd-1000 /tmp/.esd
to the list (assuming your uid is 1000, change it accordingly if it isn't), then logout and log back in. After doing this, Flash sound should work properly.


to get the the current logged user's id: go to terminal: Application > Accessories > Terminal. type: id



Wednesday, July 19, 2006

sql injection attacks increasing

PHP doesn't force you to do that by hand, you can make use of the numerous database abstraction layers for PHP, like PDO [php.net] or PEAR::DB [php.net].

Here is an example, taken straight from PDO's page:
$stmt = $dbh->prepare("INSERT INTO REGISTRY (name, value) VALUES (:name, :value)");
$stmt->bindParam(':name', $name);
$stmt->bindParam(':value', $value);

$name = 'one';
$value = 1;
$stmt->execute();
The framework is there, PHP developers need to make use of it, but sadly things like the following are still common:
mysql_query('SELECT value FROM REGISTRY WHERE name = "' . $name . '"');

cpu frequency scaling

Original Article:


http://ubuntu.wordpress.com/2005/11/04/enabling-cpu-frequency-scaling/

I use the CPU Frequency Scaling Monitor on my panel to see the speed of my CPU. I have a centrino laptop. Ubuntu automatically increases the speed (frequency) of my laptop when the demand is more, and manages things very well.

However, when I am plugged in, I want to run my laptop at the maximum possible frequency at certain times. It turns out that the CPU Frequency Scaling Monitor can also have the functionality to change the Frequency, by “Governing” the CPU frequency. However, by default, on my laptop, left-clicking on the Monitor in the Panel did not give me the option to change the frequency.

In order to be able to change the operating frequency, your processor should support changing it. You can find out if your processor has scaling support by seeing the contents of files in the /sys/devices/system/cpu/cpu0/cpufreq/

For example, on my system:

$cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
gives:

1300000 1200000 1000000 800000 600000

Which means that the above frequencies (in Hz) are supported by my CPU.
and…
$cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
gives:

userspace powersave ondemand conservative performance

All those are the different “modes” I can operate the CPU at. Userspace, for example, regulates the frequency according to demand. Performance runs the CPU at max-frequency, etc…

On the Ubuntu Forums, I read that one can manually change the frequency by executing commands like:
$ cpufreq-selector -f 1300000
which will set the frequency to 1.3 GHz.

Now, I was interested in being able to change the power mode (between the different values listed in the “governors” above, manually by using the Cpu Frequency Panel Monitor.

I found out from the Forums, again, that changing the permissions of the cpufreq-selector binary by doing a:
$sudo chmod +s /usr/bin/cpufreq-selector

will allow me to acheive this. However, I was curious as to why Ubuntu does not, by default, allow me to choose the frequency using the CPU Frequency Panel Monitor, and what the “right” or “correct” way of enabling this is.

With a little bit of detective work, I found the reason why things are the way they are in Bug #17604 :

Oh, please, not another setuid root application if we can avoid it. Which file does cpufreq-selector need access to to change the CPU speed? And why should a normal user be able to change the CPU speed in the first place? The automatic CPU speed works well enough for the majority of users, and control freaks can always use sudo to manually set the speed, or deliberately shoot themselves in the foot by making the binary suid root (as explained in README.Debian).

Anyways, since I really want to “shoot my self in the foot” using my CPU ;) , so I read the readme:
$cat /usr/share/doc/gnome-applets-data/README.Debian

and as suggested in it, I did a
$ sudo dpkg-reconfigure gnome-applets
and answered “Yes” to the question regarding setting the suid of the cpufreq-selector executable. Now, by left-clicking on the CPU Frequency Monitor Applet, I can choose the frequency for my processor, and things couldn’t be better!!

P.S.: A lot of my detective work could have been avoided had I read the README in the first place. Stupid me.


install httrack from source

http://spiderzilla.mozdev.org/installation.html


Spiderzilla for GNU/Linux (or other *nix systems) Linux

This version is working only when you have xfree and HTTrack packages installed.
Why Xfree? Because Spiderzilla is using xterm.
After that you can install HTTrack from sources from this address httrack-3.33.tar.gz.

To install HTTrack here are the command lines:
$ tar xvfz httrack-*.tar.gz
$ cd httrack-*
$ ./configure --prefix=/usr/local && make
# make install
(root permissions required to install HTTrack)
$ /usr/local/bin/httrack

For more information look to www.httrack.com.

Install SpiderZilla for Linux
Download SpiderZilla for Linux (88 KB)

A script "skrypt.sh" has to be executable!
$ chmod +x skrypt.sh
(in ~/.mozilla/firefox/profiles/xxxxxxxx.default/extensions/{3cd27e92-1a30-11da-94c6-00e08161165f}/httrack/skrypt.sh)

Spiderzilla for MacOSX MacOSX

This version is working only when you have X11 and HTTrack packages installed.

You must install X11 for Apple in order to have xterm,
After that you can install HTTrack from sources from this address httrack-3.33.tar.gz.

To install HTTrack here are the command lines:
$ tar xvfz httrack-*.tar.gz
$ cd httrack-*
$ ./configure --prefix=/usr/local && make
# make install
(root permissions required to install HTTrack)
$ /usr/local/bin/httrack

./configure is crazy

TIA
configure: error: C++ preprocessor "/lib/cpp" fails sanity check.

Try apt-get gcc cpp g++

guess what, this substantial code works in linux mono c# yipee!!! :D

to compile in mono:


mcs m.cs -r:System.Data -r:System.Windows.Forms -r:System.Drawing

to run:

mono m.exe




-----------------------------------



original article:

http://www.bobpowell.net/dropshadowtext.htm

using System;

using System.Drawing;

using System.Drawing.Text;

using System.Drawing.Drawing2D;

using System.Collections;

using System.ComponentModel;

using System.Windows.Forms;

using System.Data;



namespace textdropshadow

{

///

/// Summary description for Form1.

///


public class Form1 : System.Windows.Forms.Form

{

///

/// Required designer variable.

///


private System.ComponentModel.Container components = null;



public Form1()

{

//

// Required for Windows Form Designer support

//

InitializeComponent();



this.SetStyle(ControlStyles.ResizeRedraw,true);

}



///

/// Clean up any resources being used.

///


protected override void Dispose( bool disposing )

{

if( disposing )

{

if (components != null)

{

components.Dispose();

}

}

base.Dispose( disposing );

}



#region Windows Form Designer generated code

///

/// Required method for Designer support - do not modify

/// the contents of this method with the code editor.

///


private void InitializeComponent()

{

//

// Form1

//

this.AutoScaleBaseSize = new System.Drawing.Size(16, 36);

this.BackColor = System.Drawing.Color.White;

this.ClientSize = new System.Drawing.Size(376, 293);

this.Font = new System.Drawing.Font("Tahoma", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));

this.Name = "Form1";

this.Text = "Form1";

this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form1_Paint);



}

#endregion



///

/// The main entry point for the application.

///


[STAThread]

static void Main()

{

Application.Run(new Form1());

}



protected override void OnPaintBackground(PaintEventArgs e)

{

LinearGradientBrush b=new LinearGradientBrush(this.ClientRectangle,Color.Blue,Color.AliceBlue,90f);

e.Graphics.FillRectangle(b,this.ClientRectangle);

b.Dispose();

}



private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)

{

//Make a small bitmap

Bitmap bm=new Bitmap(this.ClientSize.Width/4,this.ClientSize.Height/4);

//Get a graphics object for it

Graphics g=Graphics.FromImage(bm);

// must use an antialiased rendering hint

g.TextRenderingHint=TextRenderingHint.AntiAlias;

//this matrix zooms the text out to 1/4 size and offsets it by a little right and down

Matrix mx=new Matrix(0.25f,0,0,0.25f,3,3);

g.Transform=mx;

//The shadow is drawn

g.DrawString("Text with a dropshadow",Font,new SolidBrush( Color.FromArgb(128, Color.Black)), 10, 10, StringFormat.GenericTypographic );

//Don’t need this anymore

g.Dispose();

//The destination Graphics uses a high quality mode

e.Graphics.InterpolationMode=InterpolationMode.HighQualityBicubic;

//and draws antialiased text for accurate fitting

e.Graphics.TextRenderingHint=TextRenderingHint.AntiAlias;

//The small image is blown up to fill the main client rectangle

e.Graphics.DrawImage(bm,this.ClientRectangle,0,0,bm.Width,bm.Height,GraphicsUnit.Pixel);

//finally, the text is drawn on top

e.Graphics.DrawString("Text with a dropshadow",Font,Brushes.White,10,10,StringFormat.GenericTypographic);

bm.Dispose();

}

}

}

Tuesday, July 18, 2006

What users hate about IT pros

http://www.networkworld.com/news/2006/071706widernet-end-users.html?page=2

Which brings up another common complaint: techno-jargon. The technical terms and shorthand that IT managers throw around create an air of mystery and superiority to those not in the know, some say. And that may be by design.

"While they make you feel stupid on the one hand, they also shroud solutions in mystery, which I believe is a job protection/justification strategy," says Lisa, a partner with a financial services firm in the Boston area.
—-FIXED!!!!——

/dev/snd/seq failed: No such file or directory

solution: modprobe snd-seq

Monday, July 17, 2006

how to change domain or workgroup in Ubuntu

How to change computer Domain/Workgroup

* Read #General Notes
* Read #How to install Samba Server for files/folders sharing service

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
sudo gedit /etc/samba/smb.conf

* Find this line

...
workgroup = MSHOME
...

* Replace with the following line

workgroup = new_domain_or_workgroup

* Save the edited file

sudo testparm
sudo /etc/init.d/samba restart

equivs (for yahoo messenger dependency workaround)

Circumvent Debian package dependencies
This package provides a tool to create Debian
packages that only contain dependency information.

If a package P is not installed on the system, packages
that depend on P cannot normally be installed. However,
if equivalent functionality to P is known to be installed,
this tool can be used to trick the Debian package management
system into believing that package P is actually installed.

Another possibility is creation of a meta package. When this
package contains a dependency as "Depends: a, b, c", then
installing this package will also select packages a, b and c.
Instead of "Depends", you can also use "Recommends:" or
"Suggests:" for less demanding dependency.

Please note that this is a crude hack and if thoughtlessly used,
it might possibly do damage to your packaging system. And please
note as well that using it is not the recommended way of dealing
with broken dependencies. Better file a bug report instead.


Cedega on Dapper
April 22nd, 2006.

The .deb package of Cedega will not install on Ubuntu’s Dapper, because of the missing “xlibs” dependency. Lots of workarounds are available on Ubuntu Forums and Transgaming’s support page. “Installing the Breezy version of xlibs” and “converting the .deb into .tgz and back to .deb” are examples of them. I like neither of them.

Introducing “equivs”. With equivs one can create dummy packages used to satisfy the (Debian) package administration. The process of creating a dummy involves two steps: creating a control file, and building the package. After installing this package with dpkg, the system “believes” the software to be installed, an will accept other packages depending on it.


-------------------------------------------------------------

So, let’s create a xlibs dummy package:

# sudo apt-get install equivs
# mkdir $HOME/temp ; cd $HOME/temp
# equivs-control xlibs
# pico xlibs
(contents of xlibs)

Section: misc
Priority: optional
Standards-Version: 3.5.10

Package: xlibs
Version: 6.8.2-77
Maintainer: Your Name

# equivs-build xlibs
# sudo dpkg -i xlibs_6.8.2-77_all.deb

Sunday, June 11, 2006

LAMP. Linux Apache Mono PostgreSQL

ubuntu debian packagement really rocks. just by doing apt-get install or using synaptic package manager i was able to run mono xsp in no time.

i had written my first c# webservices in linux mono today.

next thing to learn is how to install mono from source and use mod_mono (faster than xsp)

and use codebehind, i.e. dll deployment, no source on server (for security reason)

Saturday, June 10, 2006

just setup ubuntu 6.06 last night

tried samba sharing

kailangan pa i-execute sa commandline yung:

smbpasswd -a yourusernamehere


iba pa yung samba password kesa password ng OS

Wednesday, May 31, 2006

Slashdot | Ubuntu 6.06 'Dapper Drake' Beta Available: "Ubuntu is not _just_ for n00bs.

Does a 'n00b' system admin run Debian?
not usually.

Debian is preferred because
(a) 'apt-get' makes life so blindingly simple that you don't need to worry about 90% of the hassels that come with other distros (rpm-hell anyone?)
(b) It's stable
(c) 'It Just Works!' (tm)

Ubuntu is: ALL the best of Debain + Quicker updates.
How long did it take for Debain to support SATA in the stable release? Too damn long!

Ubuntu is not totally user friendly, ie it wasn't untill Dapper that there was a GUI for setting up a pppoe internet connection. (try telling Mom to: open a terminal, type pppoe-conf, and follow the prompts.)
Sounds great on paper.

My mom, Uncle x2, wife, Mother & Father in-laws, and CLIENTS all run Ubuntu because it is easier for me to manage/admin.
I'm not a n00b. I got desperately tired of waiting for Debian Stable. Now I have all the good of Debian + modern packages.
"



The thing that makes Ubuntu the distro to have is that it has a growing "n00b base". This benefits experienced Linux users, because if they are running the same distro as the people they will end up supporting, then the Linux community as a whole becomes stronger and easier for people to get into. Wouldn't it be nice to run the same system as everyone else you know, and still be using Linux?

Sunday, May 14, 2006

This can be applied to programming : )

Jeet Kune Do - Wikipedia, the free encyclopedia:


Bruce Lee's Jeet Kune Do Quotes

  • "The usefulness of a cup is its emptiness". - Be prepared to accept new knowledge and not be hindered or biased by old knowledge.
  • "Using no way as way". - Don't have preconcieved notions about anything.
  • "Having no limitation as limitation". - Don't be confined by anything, achieve true freedom.
  • "From form to formless and from finite to infinite". - Don't be confined by limitations and forms.
  • The consciousness of "self" is the greatest hindrance to the proper execution of all physical action - This is actually a Zen or Chan maxim which means to "be in the moment" and NOT be distracted by your own thought process. The Zen quote is: "If you seek it, you will NOT find it". The "Western" counterpart to this is the term "Being in the Zone".
  • "If people say Jeet Kune Do is different from "this" or from "that," then let the name of Jeet Kune Do be wiped out, for that is what it is, just a name. Please don't fuss over it." - Don't get hung up on labels and parameters. JKD is alive and therefore always changing; don't try to box it in.

Friday, May 12, 2006

Things to learn

* integrate Windows Desktop App to Webservices hosted on Linux's written in Mono C#

* on near future, learn desktop front-end using GTK# or WxWidgets.NET(whichever of the two is more mature for the task) C# under Linux, but need to learn first the good stuffs on VS.NET 2005 System.Windows.Forms

Sunday, April 30, 2006

Minimalist XML. Formula Script Generator

i created this XML to avoid creating database for sql server script generator, this would simplify adding formula to summary tables. code generator is written in c#, c#'s literal string are way too cool for this task :)


<?xml version="1.0" encoding="utf-8"?>

<TableSummary
nbsp;Comment="
nbsp;This is a summary table, there are two types of summary table, one is by actual count, and the other is count by trail">


<?xml version="1.0" encoding="utf-8"?>

<TableSummary
 Comment="
 This is a summary table, there are two types of summary table, one is by actual count, and the other is count by trail">


 <ByActualCount>

   <Tables Comment="the following tables have no date:">
     <BranchIndividualMotor/>
     <IndividualMotor/>
     <Motor/>
     <RptOnBranchMotor/>
   </Tables>

   
   <Formulas Comment="formulas of by actual count, no date trailing">
     <InQty>
       MIN_A_QTY
       + MFL_A_QTY
       + MRS_A_QTY
       + MRB_A_QTY
       + MRP_A_QTY
       + MSR_A_QTY
       + MRI_A_QTY
       + MNR_A_QTY
     </InQty>

     <OutQty>
       MPR_D_QTY
       + MMB_D_QTY
       + MSI_D_QTY
       + MSC_D_QTY
       + MMN_D_QTY
       + MAM_D_QTY
     </OutQty>


     <ActualQty>
       (
       MIN_A_QTY
       + MFL_A_QTY
       + MRS_A_QTY
       + MRB_A_QTY
       + MRP_A_QTY
       + MSR_A_QTY
       + MRI_A_QTY
       + MNR_A_QTY
       )
       -
       (
       MPR_D_QTY
       + MMB_D_QTY
       + MSI_D_QTY
       + MSC_D_QTY
       + MMN_D_QTY
       + MAM_D_QTY
       )
     </ActualQty>

     
     <InCost>
       MIN_A_COST
       + MFL_A_COST
       + MRS_A_COST
       + MRB_A_COST
       + MRP_A_COST
       + MSR_A_COST
       + MRI_A_COST
       + MNR_A_COST
     </InCost>




   </Formulas>




 </ByActualCount>



 <ByTrailCount>

   <Tables Comment="the following tables have date to facilitate trailing:">
     <RptOnBranchMotorDaily/>
     <RptOnBranchMotorMonthly/>
     <RptOnBranchMotorYearly/>
     <RptOnMotorDaily/>
     <RptOnMotorMonthly/>
     <RptOnMotorYearly/>
   </Tables>

   <Formulas Comment="formulas of bytrail count, with date:">
     <InQty>
       MIN_A_QTY
       + MFL_A_QTY
       + MRS_A_QTY
       + MRB_A_QTY
       + MRP_A_QTY
       + MSR_A_QTY
       + MRI_A_QTY
       + MNR_A_QTY
     </InQty>

     <OutQty>
       MPR_D_QTY
       + MMB_D_QTY
       + MSI_D_QTY
       + MSC_D_QTY
       + MMN_D_QTY
       + MAM_D_QTY
     </OutQty>

     <EndQty Comment="if sql server facilitates nested formula, we can simplify the formula below  with this: BeginQty + InQty - OutQty">

       BeginQty
       
       +
       
       (
       MIN_A_QTY
       + MFL_A_QTY
       + MRS_A_QTY
       + MRB_A_QTY
       + MRP_A_QTY
       + MSR_A_QTY
       + MRI_A_QTY
       + MNR_A_QTY
       )
       
       -
       
       (
       MPR_D_QTY
       + MMB_D_QTY
       + MSI_D_QTY
       + MSC_D_QTY
       + MMN_D_QTY
       + MAM_D_QTY
       )
     </EndQty>


     <InCost>
       MIN_A_COST
       + MFL_A_COST
       + MRS_A_COST
       + MRB_A_COST
       + MRP_A_COST
       + MSR_A_COST
       + MRI_A_COST
       + MNR_A_COST
     </InCost>

     <OutCost>
       MPR_D_COST
       + MMB_D_COST
       + MSI_D_COST
       + MSC_D_COST
       + MMN_D_COST
       + MAM_D_COST
     </OutCost>

     <EndCost>
       BeginCost
       
       +

       (
       MIN_A_COST
       + MFL_A_COST
       + MRS_A_COST
       + MRB_A_COST
       + MRP_A_COST
       + MSR_A_COST
       + MRI_A_COST
       + MNR_A_COST
       )

       -

       (
       MPR_D_COST
       + MMB_D_COST
       + MSI_D_COST
       + MSC_D_COST
       + MMN_D_COST
       + MAM_D_COST
       )
     </EndCost>

     <InstallmentProfit>
       MSI_D_PRICE - MSI_D_COST
     </InstallmentProfit>

     <CashProfit>
       MSC_D_PRICE - MSC_D_COST
     </CashProfit>

     <RepossessedProfit>
       MAM_D_PRICE - MAM_D_COST
     </RepossessedProfit>

     
     <TotalProfit Comment=
       "InstallmentProfit + CashProfit + RepossessedProfit">


       (MSI_D_PRICE - MSI_D_COST)
       +
       (MSC_D_PRICE - MSC_D_COST)
       +
       (MAM_D_PRICE - MAM_D_COST)

     </TotalProfit>


   </Formulas>


   
 </ByTrailCount>



</TableSummary>