Archive for the ‘Technology’ Category

Some cool games on facebook

Posted on August 2nd, 2008 in Technology | No Comments »

This site has a lot of good games on facebook.

http://www.socialgn.com/

Learn more about linux on comments

Posted on August 1st, 2008 in Programming, Technology, linux | No Comments »

This was a comment on Slashdot on the article Linux Foundation Promises LSB4 and its very informative. Btw I dont care about the news.

Env followed by the name of a binary, will exec the first binary with that name on the current path. It boils down to how you run a script on UNIX. There are two ways:

The first way is with a command like ’sh foo.sh’. sh will then read foo.sh and execute each command in it in order (if it’s not a shell script, it will hopefully read the magic number and run it).

The second way is to just exec() it. The loader then reads the first few bytes of the file. This tells it what type of file it is. For ELF files, they will be “.ELF”. For Mach-O binaries, they will be 0xFEEDFACE or 0xCAFEBABE, depending on the architecture. For scripts the first two bytes will be “#!”.

If the loader encounters “#!” then it will read the rest of the line execute the specified command (and arguments) and pass the file to it as the last argument. You can see this in operation with the following script:

$ cat foo
#!/bin/echo
This is a file?
$ chmod +x foo
$ ./foo
./foo

RDstore.com (Readers Digest)

If you have a shell script that needs to run with the standard POSIX shell, then there’s no problem. You just specify /bin/sh after the #! and it’s fine. But what happens if you want to use some bash-specific features? On GNU platforms, bash is the default shell and /bin/sh is a hard link to bash, so it’s in /bin. On other platforms it’s a third-party thing and so will be in /usr/local/bin or /opt/something. This is where env comes in.

When you specify “#!/usr/local/env bash” you can safely hard-code the path of env, because POSIX defines where it is. Env then looks up where bash is and execs it with whatever command line arguments it was given. You can see this in action again like this:

$ /usr/bin/env echo test
test

If you just run ‘env’ from a command line to inspect the environment variables, you are most likely just calling a shell built-in command, which lists the things passed in to the third argument to main() and any set since the shell started. Env, however, can be used when you are not launching from a shell. If your program wants to run a shell script, you can just vfork() and exec() it, and the loader will find the correct interpreter. You could always inspect the environment yourself, but having every app do that whenever it needs to run a script is quite silly (especially since it means that the app also has to know the difference between a binary and a script and so on).

Some people still have a habit of hard-coding /bin/bash, and this is probably the kind of crap LSB will encourage (’bash is always in /bin on Linux, and I don’t care about other platforms!’) but the correct thing to do is use env.

Scamschool master finally defeated

Posted on July 31st, 2008 in Technology | No Comments »

Back to basics with this episode: another tough match puzzle *almost* guaranteed to win you a drink. Remember: Tricks get you attention, but selling the answers to puzzles gets you drinks.

The rules are simple: using 6 matchsticks, create 4 equilateral triangles. All 4 triangles have to be the same size, and the sides of each triangle have to be one matchstick long.

http://revision3.com/scamschool/3Dmatchtrick/

Text to speech on mac

Posted on July 31st, 2008 in Technology | No Comments »

If your like me and you hate reading the web and let someone (the computer) read it for you then mac has a good feature that lets it read any selected text. The procedure follows:

* Open System Preferences
* Go to Speech
* Text to speech tab
* Then select Speak selected text when the key is press
* Enter your key combinations
* and your done.

I tried it using firefox and it works perfectly. I hope Orca on Ubuntu would worked properly by default.

Vista Blues

Posted on July 30th, 2008 in Technology | No Comments »

The song here is so true, i’m not a mac fanboy nor a MS hater but vista really sucks.

Will It Blend? - iPhone3G

Posted on July 29th, 2008 in Technology | No Comments »

While a lot of people are dying to get the iphone 3g, this person just blended his new iphone.

Microsoft helps Open Source?

Posted on July 26th, 2008 in Technology, linux | No Comments »

Microsoft supporting Open Source? Yes its true see this article, but there is one thing that you will notice here is that MS knows that 80% of PHP programmer are doing their development on a Windows and deploying it in linux. I wanted to point out that yes we do this but our development server is still linux.

So why linux instead of windows as deployment platform? There are many reasons but here are mine:
* Software are considered part of the system after you install them so you can combine all software and make one ultimate software for your site
* Cron or automatic job in in linux is a lot simpler
* Windows file structure is so hard to get around using command prompt, look at your keyboard where is / and \.
* Windows command prompt doesn’t feel right meaning MS created them to be GUI and why the heck would you still use command line when you have a GUI

And the ultimate reason and also the reason why linux is not mainstream.
Most of the software for servers are created for linux not microsoft, and vice versa most of the software for desktop are created for microsoft not linux. So if the Linux feels that it’s so hard to get the mainstream desktop, MS will feel the same on servers no matter what or who MS is coz if you will be saying MS is MS, then why linux still lead this market after all this years.