Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Jun 25, 2008

0

Jokes On Linux

Well, i'm in a mood to laugh tonight and I searching google for all kind of funny stuff. Suddenly I came upon one jokes about talking programmer, here is the jokes:

Three male programmers were in the bathroom standing at the urinals.
The first programmer finishes, walks over to the sink to wash his hands.
He then proceeds to dry his hands very carefully. He uses paper towel after paper towel and ensures that every single spot of water on his hands is dried.
Turning to the other two, he says, "At Microsoft, we are trained to be extremely thorough."
The second programmer finishes his task at the urinal and he proceeds to wash his hands. He uses a single paper towel and makes sure that he dries his hands using every available portion of the paper towel.
He turns and says, "At Intel not only are we trained to be extremely thorough but we are also trained to be extremely efficient."
The third programmer finished and walks straight for the door, shouting over his shoulder, "At Sun, we don`t piss on our hands.
Courtesy of Syid Arif
Yeah, It was funny. But the most important thing is, this jokes just made my day! Nice one.

Bookmark This Article:

Feed Me Digg this Stumble Upon this Send this Reddit this Add to Technorati Favorites Directory of Computers/Tech Blogs Programming Blogs - BlogCatalog Blog Directory

Your Ad Here

Apr 18, 2008

4

Update: Numbers Combination Creator

I did make a post about my script to generate numbers combination depends on user input to set the number of digits a few weeks ago. And I was thinking to make it more clean and user friendly after received a comments from "Pak Leman".

So here is the update of the scripts. The script will asked user to input the digits of combination to generate. And will asked user to give the output filename. So no more "sh script 8 > huhu.txt" . To run the script just run "sh script" and it will ask you all the details using script.

So here is the full codes of the script, and also pictures of the output:

#!/bin/sh
echo "Please give the digits for combinations[8-63]: \c"
read digit
echo "Please type the output file name: \c"
read OUTFILE

FINISH=`expr "10^"$digit"" | bc -l`

if [ $digit -lt 8 -o $digit -gt 64 ]
then
clear
echo "The digit you specify is ' $digit '. "
echo "Please enter a valid digit [8-63]: \c"
read digit
else
break
fi

COUNT="-1"
while [ $COUNT != `expr $FINISH - 1` ] ; do
COUNT=`expr $COUNT + 1`
printf "%+"$digit"s\n" $COUNT | sed s^\ ^0^g >> $OUTFILE
done

So any opinion on how to improve the script are most welcome. Somehow the script still allow digits more than 63. Still looking forward to repair this script. Any thought or advise are welcome. Please drop some comments.

Bookmark This Article:

Feed Me Digg this Stumble Upon this Send this Reddit this Add to Technorati Favorites Directory of Computers/Tech Blogs Programming Blogs - BlogCatalog Blog Directory

Your Ad Here

Apr 14, 2008

7

Script to generate Numbers Combination

This is a script to generate combinations of numbers from 0-9 depends on how many digits you specify when running the scripts. It's a simple script that took me 5 minutes to write. Plus I got the idea of writing this script from one of my friend.

This script is useful for those who wants to generate a wordlist for bruteforce. Here is the scripts:

#!/bin/sh
# Usage:
# sh [script name] [digits specify] > [output file] &
digit=$1
FINISH=`expr "10^"$digit"" | bc -l`
COUNT="-1"
while [ $COUNT != $FINISH ] ; do
COUNT=`expr $COUNT + 1`
printf "%+"$digit"s\n" $COUNT | sed s^\ ^0^g
done
Why do I only write scripts for numbers combination? The answer is simple, if I wrote a script that will create a combination of all ascii letters, then it will be too much for a single machine to generate and also will took you a long long time to generate.

If you want to calculate how much time it will take to generate a combination of digits with quantity of letters(ascii) then you can do calculation on this website, Generator Calculator.

Look at the time needed to generate a full ascii password list. It's not worth your time to do that. If you ever need a full ascii generator, than you can download it right here.

* The script will be update soon to be more user friendly.

Bookmark This Article:

Feed Me Digg this Stumble Upon this Send this Reddit this Add to Technorati Favorites Directory of Computers/Tech Blogs Programming Blogs - BlogCatalog Blog Directory

Your Ad Here

Apr 12, 2008

3

LOLcode Programming


I woke up when my girlfriend sms me "morning" . So I go to my laptop and start my day with surfing. So I start surfing on my new router's modification. But I found something interesting on one of the open blog on the net, It's called LOLCode.

So I start wondering what is LOLcode is all about, I start reading and go read more on the link given. Found out, that LOLcode is actually fun to play with. It's a silly programming based on 1337-speak(gamers/hackers slang)

There is an official site for LOLcode. This language has turned into a Programming Language called LOLCode for which there are already at least TWO .NET implementations. So here is the LOLcode example:


HAI
CAN HAS STDIO?
I HAS A VAR
IM IN YR LOOP
UP VAR!!1
VISIBLE VAR
IZ VAR BIGGER THAN 10? KTHXBYE
IM OUTTA YR LOOP
KTHXBYE
Funny isnt it? maybe you would like to try it for your self, but is has too many keyword that hard to understand unless someone explain it to you. So happy coding guys~!

Bookmark This Article:

Feed Me Digg this Stumble Upon this Send this Reddit this Add to Technorati Favorites Directory of Computers/Tech Blogs Programming Blogs - BlogCatalog Blog Directory

Your Ad Here

Apr 3, 2008

0

UBUNTU: Help promote Ubuntu

This post is about helping spreading Ubuntu Linux. I wondering when the time is just around the corner for ubuntu release, but still there is no propaganda of the Hardy Heron release hits the Malaysian Community. Here is sumthing to start with. Help promoting latest release of Ubuntu which using codename "Hardy Heron" would be appreciated.

How can you help to promote? Add a countdown widget of Hardy Heron release so that people will aware of the release date. It's not that hard to put a countdown widget on your blogs or website, just copy and paste this script and you are good to go.

This is the example of the script:


[script type="text/javascript" src="http://www.ubuntu.com/files/countdown/display.js"][/script]
But you need to make it works please change "[" to "<" and "]" to ">" as blogspot cannot make a post if there is symbol of html tags there. Hope that there will be more people willing to put countdown widget on their blogs to give awareness to Malaysian about the upcoming Ubuntu Release.

:)

Bookmark This Article:

Feed Me Digg this Stumble Upon this Send this Reddit this Add to Technorati Favorites Directory of Computers/Tech Blogs Programming Blogs - BlogCatalog Blog Directory

Your Ad Here

Mar 27, 2008

0

LINUX: Coloring your zsh shell in ubuntu

Some people will be bored looking at colorless terminal as i usually look. I do 50% of my laptop by using my terminal(CLI) on my Ubuntu 7.10 Gutsy Gibbon. I used to use bash shell a few weeks ago and bash do have some coloring on the shell, but still a lil bit boring.

But recently I change myself to zsh shell to do more shell programming. It's not the best shell for script/programming, but I get/read a lot of feedback from other linux user that this shell is suitable for shell scripting/programming.

So I this is simple tutorial on how to color your terminal to your need and make it a litle bit interesting to look at, so maybe you can spend more time to do you programming :P

First of all, you need to know the color code for shell, here is the list:

  • Choices : red, green, yellow, blue, magenta, cyan and white. The color codes for this are 30 (black), 31(red), 32 (green), 33 (yellow), 34 (blue), 35 ( magenta), 36 (cyan), 37 (white).
So now for coloring the zsh shell, you need to make a file name ".zshrc" on user's home folder. you can create the file by this command:
  • touch ~/.zshrc
After that, you need to do a litle coding to make your shell prompt. Open up your .zshrc that you just created by using any text editor of your choices. As for me, I prefer to use nano. So here is my command:
  • nano ~/.bashrc
This will open the .zshrc file inside your terminal, it is plain file without any text inside. So all you have to do is write the code. Here is some tips:
  • for prompt option you just need to add "PROMPT=" command inside .zshrc but if you would like to make some differences, you can try to do it on the right side by using this "RPROMPT="
  • here is some variable which will be recognized by shell: (%n)Username , (%B , %b)Bold text, (%~)Current Directory, (%U , %u)Underline, (%m)Machine name, (%h)Number of shell's history, (%t)Time and etc.
  • For coloring you have to use this %{\e[0;31m%} , and by changing number "31" you can change the color by the code given earlier.
  • So here is a simple example to create your prompt: paste this inside your .zshrc
    • PROMPT=$'%{\e[0;32m%}%UTell zsh what to do!%u %{\e[0m%}'
    • Save and exit.
    • Restart your terminal and you will see your prompt changing to :
      • Tell zsh what to do!
  • So you can try yourself to color up your terminal shell by writing your own .zshrc ~!
here is my screenshots:After applying the .zshrc in home folder

Bookmark This Article:

Feed Me Digg this Stumble Upon this Send this Reddit this Add to Technorati Favorites Directory of Computers/Tech Blogs Programming Blogs - BlogCatalog Blog Directory

Your Ad Here