Wednesday, February 29, 2012

Programming Languages Comparison

Programming languages are alike. If you know how to program in one language changes are you know how to program in other languages. However the only difference is the syntax. I always wanted a chart that showed this and I finally found it hyperpolyglot.org.

Monday, February 27, 2012

Smart is the New Rich

"Smart is the New Rich" a trending phrase with a book and even a CNN show name after it but it's a load bullshit. This implies that at one point the "Dumb was the Rich" or the "Smart was the Poor"!

Last time I check smart people like Edison Ford, Bill Gates, Thomas Edison and Steve Jobs are not poor and they are old as dirt if not already dead. So this statement saying smart is the "new way" to be rich is only for the fools that believed otherwise. Success comes with hard work and the ability to consistently learn, improve your skills and become "smarter".

Show me someone who was dumb and became rich. Wait... Those who win the lottery, it doesn't take much brain power to pick 8 random numbers. But give them a couple of years before they end up in a worst position.

Friday, February 24, 2012

Quote: Hard work

Hard work beats talent and talent doesn't work as hard. -Mark Cuban

Thursday, February 23, 2012

Installing/Setup Arduino

The video below shows how to install/setup Arduino on Windows 7. However I have Vista and was able to setup up using the same method.





Tags:
install the drive

Wednesday, February 22, 2012

Installing Kdiff3 version control mergetool for Git

kdiff3 is a great GUI mergetool for git. However the installation is more tedious in Windows compared to Linux. Below is instruction on how to install it in Windows.

Download and install program:
http://sourceforge.net/projects/kdiff3/

Add kdiff3 as your Git mergetool
From Git Bash, run
$ git config --global merge.tool kdiff3

Open the file repository/.git/config
and paste the code below


[merge]
tool = kdiff3
[mergetool "kdiff3"]
path = C:/Program Files/KDiff3/kdiff3.exe
keepBackup = false
trustExitCode = false





tags:
git mergetool kdiff3 windows
kdiff3 mergetool is not available
better than vimdiff

Monday, February 20, 2012

Don't look at the results

Don't look at the results, look at the direction.

It's easy to get discouraged when the results are not what you expect it to be. In reality much of the result will come much time after. You may forget what you went through to be where you are today. A farmer cannot plant today and harvest tomorrow. Depending on what he is planting it may take to 7 years to see the fruits of his labor. Not to mention the contingency such as drought, freezing, storm and so on that can keep him from seeing his fruits even longer. But as long he keeps planting one thing is certain "there's a chance"

Friday, February 17, 2012

Desktop Shortcuts Ubuntu 11.10

If you didn't already know, in Ubuntu if you type ctrl+alt+T the default terminal opens up. Now if you wish for other programs to open using keyboard shortcuts, here is how you do it.

Go to "System settings". You can get there by clicking on the circle on the top right hand corner or searching it at the Dash Home (top left corner).

Under "Hardware" click on "Keyboard".

Go to the Shortcut tab and click on the Custom Shortcuts. Click the plus sign (+).

A little window will open asking for Name and Command. Name is for naming of the shortcut and command is the program. Example:
Name: myShortcut
Command: terminator

Now it will appear in the box. Now select it and click where it says disabled and enter the shortcut. Close the window.

That's it! Easy.

Wednesday, February 15, 2012

Linux: Launching a program from Terminal

In linux there're couple different methods to install a program. The most often used and easy is apt-get because it does all the work. All it is a line in the terminal like:
$ sudo apt-get install terminator
and the program will install.

Programs like XAMPP where the package needs to be downloaded and extracted to a specific location. Other programs like netbeans and Komodo Edit where the package is first downloaded then extracted and then run an install script.

Sometimes I like to launch a program using the terminal such as:
$ terminator

When you install netbeans it doesn't give you this feature but I going to show you how to create it.

When netbeans is installed it creates a netbeans folder in your home directory. There you will find a netbeans executable file (~/netbeans-7.1/bin/netbeans). If you run this file it will launch the program. What we need is to put this file symbolic link (symlink) inside the directory that holds these other executable programs which is /usr/local/bin. You do this by
$ sudo ln -s ~/netbeans-7.1/bin/netbeans /usr/local/bin/netbeans

that's it!

Now netbeans may give you an error stating that you do not have permission to write in ~/.netbeans/ What is needed here is to change the permission with chmod. I gave it full access by running
$ sudo chmod -R 777 ~/.netbeans/

now you should be able to open the terminal, type netbeans and the program will launch



tags:
command line

Monday, February 13, 2012

3rd Party Suck!

Don't store files in 3rd party servers! I knew it, look at megaupload was taken down with people files that were legal. That's why you need a personal server for storing important files to avoid these pitfalls. Now many are left with their thumb in their mouth because their work sank with the ship, it's at the bottom of the ocean and good luck trying to get it back.

I've seen web developers put their development source code in dropbox. Yes, it syncs with your other computers but seriously how safe is it to have it out there.

Think about it...

What happens if dropbox gets hacked, I never trust these 3rd party companies saying they delete your stuff. 3rd Parties are infamous in not telling what they do with your information. Someone once told me "its not how safe you are with your information but how safe others are."

Setting up your own server is not difficult, especially with technology getting cheaper. With a little knowledge of Linux, an old computer(or buy one for $70) and with the information on this site you can get it started.

The Benefits:
Not only does it pay for itself in the long run (hosting cost) it also gives you the freedom to customize it with software and hardware. It also give you control with the security. You'll will be able to access your files from anywhere thru ssh, ftp, http and so on. And best of all you'll learn alot.

To get started click this and this.

Thursday, February 9, 2012

Whitelist. A Javascript Object

Blacklisted are those who access were removed and whitelisted are those who are specifically granted access or privilege. Below is a Javascript whitelist object.

//START OBJECT
var white = {
list: new Array(),
request: function(permitted){
for(var value in this.list){
if(permitted == this.list[value]){
return true;
}
}
}
}
white.list = ['jon','max']; //set who has can have access
//END

//Lets test the object
if(white.request('jon')){
//if access granted
alert('welcome VIP')
}else{
//not granted access
alert('Access was never granted to you');
}

Wednesday, February 8, 2012

Quote: Perseverance

To quote President Calvin Coolidge:
“Nothing in the world can take the place of persistence. Talent will not; nothing is more common than unsuccessful men with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated derelicts. Persistence and determination are omnipotent. The slogan ‘press on’ has solved and always will solve the problems of the human race.”

Back in 1995, Steve Jobs added: “I’m convinced that about half of what separates the successful entrepreneurs from the non-successful ones is pure perseverance”.

Michael Jordan quote: “I’ve failed over and over and over again in my life. And that is why I succeed.”

Tuesday, February 7, 2012

Fixing the internet in Ubuntu using driver BCM4312 802.11b/g LP-PHY

What a pain! I recently reinstalled Ubuntu 11.10 on my Dell Latitude D630 and wireless wasn't working. It wasn't picking up any connections. My driver BCM4312 802.11b/g LP-PHY for some reason wasn't installed and when I went to Ubuntu "System settings->Additional Drives" and tried to activate the Broadcom STA wireless driver I would get an error to check /var/log/ folder that didn't exist.

So I connect to the internet using a wire connection and ran this in the terminal

$ sudo apt-get install b43-fwcutter

rebooted the computer then went back to "System settings->Additional Drives" tried to activate the driver again and it worked.

Resources:
https://help.ubuntu.com/11.10/ubuntu-help/net-wireless-troubleshooting-device-drivers.html
http://askubuntu.com/questions/95852/how-to-fix-bcm4312-driver-problem
https://www.evernote.com/shard/s18/sh/d245d647-45aa-474d-b093-a6346c7e9e27/e56bca9b17d774858fb6900cd302d047

Sunday, February 5, 2012

Using git with restricted server/godaddy

You cannot install git on your godaddy hosting server. The alternative would be to connect godaddy server to your computer that already has git installed. What we will be doing is mounting the server folder to a folder on your computer using sshfs. This enables you to run programs installed on your computer for remote servers. (I'm using Ubuntu 11.10)

$ sudo apt-get install sshfs
#$ sshfs hostDirectory computerDirectory
$ sshfs username@hostname:/ ~/Desktop/mount
$ cd mount

# to unmount
$ sudo umount /path #its umount not unmount command


reference:
http://www.howtogeek.com/howto/ubuntu/how-to-mount-a-remote-folder-using-ssh-on-ubuntu/

Friday, February 3, 2012

Hide apache and server software version

When someone access your server from the web they may end up on a error page such as 403 and 404. The issue is having your server output what apache version and server you're running on. This can be a security the risk because if the malicious hacker knows what your working with it makes things easier for them. The way to not publish this information is to configure your apache options. On Ubuntu server 11.10 its located at /etc/apache2/conf.d/security

What needs to be changed is
#
# Optionally add a line containing the server version and virtual host
# name to server-generated pages (internal error documents, FTP directory
# listings, mod_status and mod_info output etc., but not CGI generated
# documents or custom error documents).
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
# Set to one of: On | Off | EMail
#
ServerSignature Off


then restart apache:
$ sudo service apache2 restart

tags:
apache dont 403 error message
apache error message hide ip address
apache error message don't publish ip

Thursday, February 2, 2012

Developing Software

If you want to develop a kick ass software that is salable create an awesome almost impossible project. Let me explain.

You see many of the software we use today was created to solve a problem. It wasn't created because someone taught this would be nice and cool to have. Look at Weta Digital an Oscar winning visual effect company responsible for Lord of the Rings trilogy and Avatar. They created MASSIVE and CityBot because the work they needed in their movies. Another example is 37signals Basecamp which gave birth to Ruby on Rails. There's so many others as well.

I'm a firm believer in solving your problem first and maybe someone else may benefit it from it or not. But if they don't at least you solved your problem.