Archive for the ‘linux’ Category

Ubuntu Alarm

Posted on August 10th, 2008 in Hacks, Ubuntu, linux | No Comments »

I had been looking for some alarm related software in Ubuntu, and i had found a solution using vlc together with cron job, so i had made my own alarm.

First Create a shell script
> sudo gedit alarm.sh
> Enter the following
#!/bin/sh
/usr/bin/amixer -c 0 sset Master,0 99%
/usr/bin/vlc --intf dummy --repeat /home/almond/gising.mp3
> Save and exit
> chmod +x ./alarm.sh

What this does is create a file what will set the mixer to 99 volume (amixer -c 0 sset Master,0 99%) and call vlc to play your mp3 using a dummy interface module (no interface inshort) and repeat the music unlessly. Then make the file executable.

Next stuff is to make an automatic/cron job for you (by default this will use vim as editor)
If the following does not work, follow the alternative instruction
> crontab -e
> press i to insert the following line
* 7 * * 1,2,3,4,5 /path/to/alam.sh
> exit vim (esc then :wq)

(This will make the alarm every 7am from monday to friday)

Fujitsu Computer Systems Corporation

Alternative instruction
> touch crontab
> gedit crontab
> Enter the following
* 7 * * 1,2,3,4,5 /path/to/alam.sh
> crontab -u crontab
> sudo /etc/init.d/cron restart

What this does it create a new cron file under you username and restart the cron process.

If you want a more simple approach try this one
http://alarm-clock.pseudoberries.com/, there is a guide on how to install it on linux.

I used the cron approach, now how to stop the music?
This will be fun coz you have to really wake up and type something or open system monitor to stop all vlc. If you cannot locate your system monitor then type these commands
> top
memorize the process id of vlc and press q
> kill -9

Hope this does wake you up, just don’t go back to bed after stopping the music.

Linux Pre-Installs In the UK Hit 2.8%

Posted on August 6th, 2008 in linux | No Comments »

This should probably be one of the best news in the linux community for this pass months.

http://linux.slashdot.org/article.pl?sid=08/08/04/2140203&from=rss

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.

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.

Ubuntu Weekly Newsletter releases 100th issue

Posted on July 21st, 2008 in Ubuntu, linux | No Comments »

The community-driven Ubuntu Weekly Newsletter (UWN) today released its 100th issue. UWN is a weekly round up of the goings-on in the Ubuntu community.

More on
http://www.tectonic.co.za/?p=2653

If Yahoo hate Microsoft, why they won’t make software in linux?

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

Yahoo had rejected Microsoft multiple time, and they have contributed to open source community with projects like the YUI javascript library. What makes me wonder is that why are they not even making software on linux? If you look at their unix download page http://downloads.yahoo.com/?p=unix all of downloads seems not to be from yahoo. And from what i know (which i might be wrong), yahoo has no plan of even building software for linux. If you look at their messenger/IM client, they didn’t even manage to upgrade it for years or has no future plans for it.

If yahoo doesn’t notice yet, almost all the places where they are strong, people are starting to use the cheap laptop that run on linux (asus eee and likes), and more and more my friends are switching from yahoo to skype (which is good anyway).

I do know that they are not a software company and windows is still their biggest market, but if they supported Mac with their new softwares, why in the world would they leave linux when they hated Microsoft?

Download All Rapidshare Link At Once

Posted on July 1st, 2008 in Hacks, Technology, linux | 2 Comments »

Update: Thanks to Thomas, we could use the linkify addon
https://addons.mozilla.org/en-US/firefox/addon/7878

Sometimes you might stumble on some sites where gives you a list of rapidshare link (not really a link) and you want to download all of it, you cant do Ctrl + click, or Open All Urls in new tab on firefox tab mix plus. So how to do it? This requires you to use the terminal, vi, premium Rapidshare account and Unix base OS (sorry windows user, you can still do this but your on your own).
Read the rest of this entry »

Full Circle Magazine Just released Issue 14

Posted on June 28th, 2008 in Ubuntu | No Comments »

As the title indicates, for the ubuntu funs out there head over http://fullcirclemagazine.org/issue-14/

Ubuntu team readies for 8.04.1

Posted on June 23rd, 2008 in Ubuntu, linux | No Comments »

With Ubuntu 8.04.1 scheduled to be released on July 3 the Ubuntu development team is putting the final touches to the popular Linux distribution. Ubuntu 8.04.1 not a new release of Ubuntu but an updated CD image so that users trying Ubuntu 8.04 for the first time only have to download the CD
More read at http://www.tectonic.co.za/?p=2513

Ubuntu’s Clock

Posted on June 15th, 2008 in Technology, linux | No Comments »

Another interesting stuff on ubuntu is the the clock, by default has Time, Date and Calendar. But as i was messing around with it i figure out something cool.
Read the rest of this entry »