Tag Archives: linus

Interesting C program and Linux kernel source safe after all.

This is a little program I wrote in C that picks a random monster to attack the player. I think I already have this posted somewhere, but I thought I would post this once again as someone might be interested in this again. Programming in C instead of more modern programming languages like C++ is heaps of fun, the Linux kernel is written in C and it works just fine, the server hosting this fine website is running on a Linux box in a swamp guarded by an Alligator named Snappy. And he does the job of good hosting management just fine.

/* Emacs style mode select: -*- linux-c-mode -*-
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

#include 
#include 
#include 

int cool(void) {
  int i;
  int k;

  i = 15;
  k = 0;
  srand((unsigned)time(NULL));
  k = rand() % i;
  return k;
}

const char* x[] = {
  "Baron of Hell", "Demon", "Hellknight",
  "Cyberdemon", "Mancubus", "Revenant",
  "Heretic Imp", "Zombieman", "Sergeant",
  "Beholder", "Moloch", "Satyr",
  "Afrit", "Ettin", "Maulator",
};

int main() {
  char *player;
  player = getenv("LOGNAME");

  printf("%s was slaughtered by a %s.\n",player , x[cool()]);

  return 0;
}

Recently I got a 1680×1050 flat panel display to replace my 17″ CRT and it is connected via the HDMI output instead of the older VGA output. I temporarily had it connected as well as the CRT and experimented with dual monitors with Gnome 2. The monitors setup in the Gnome settings menu allowed me to select it as a second monitor and drag windows from one desktop to another, this was very easy to setup; easier than what I have heard from users trying to set this sort of thing up on Ubuntu 11.04, they had a lot of problems, this is very bad when on Debian Stable you can just use a couple of mouse clicks and the dual monitors are working perfectly right away. This makes me wonder if Ubuntu is really moving forward or taking us backwards. I only have the flat screen right now, it was easy to adapt to this after using a CRT for so long. Once you have used a CRT for a long time and then switch to a LCD panel, it looks concave, but this goes away quickly. After the kernel.org servers were cracked into there has been some scaremongering about the source being tainted, but there are many reasons why this would be quite difficult. more information here: http://linux-foundation.org/weblogs/lwf/2011/08/31/the-cracking-of-kernelorg/.

Linux is 20 years old today!

The best thing about Debian at the moment is not that the Unity/Gnome3 desktop is in absentia, it is that it is the most stable and secure distribution of the Linux operating system. I have used other distributions of Linux and I am promoting Ubuntu quite a bit even though I am not running that distribution at all. Debian is the father of Ubuntu and Linux Mint and they it does not have any of the horrible quirks of Ubuntu like the bloated and demanding Unity desktop interface, that is too much like Mac OS X. It would be better in Unity if you could have a more Mac like dock on the bottom of the screen instead of the vertical bar on the left. Apparently you hold down the ALT key to customise the toolbars on the Gnome 3 desktop, but that is not as intuitive as the old Gnome 2 desktop where you right-click on the applets and you can move them around. But just install Xfce and that can replace Gnome perfectly well, I am sure that Xubuntu will still be around and will be quite adequate for the task of providing a usable Linux desktop with a very easy to use desktop interface.

In other news, it is 20 years ago today that the Linux operating system was born, 20 years ago when Linus Torvalds posted the famous message to comp.os.minix telling the world that he was working on a small project that would not be big and professional like Minix, but was just a hobby. Who knew how popular this free operating system would turn out to be. With large companies like Red Hat behind Linux and the enormous popularity of the Ubuntu distribution, Linux has moved ahead into many arenas with many websites on the Internet like mine powered by Linux and Apache, the free operating system is a very good and reliable alternative to the Windows Server operating system from Microsoft. The first Linux distribution I used was Red Hat 6.2 and that was when I had Windows `98 on my computer. I was amazed at the hardware support in Linux and the software such as the Gimp that allowed me to edit pictures and the overall quality as well as the fact that countless re-boots were not needed to install Red Hat compared to Windows.

http://www.theinquirer.net/inquirer/feature/2103890/linux.

http://www.thelinuxdaily.com/2010/04/the-first-linux-announcement-from-linus-torvalds/.

Linux anecdotes

http://liw.fi/linux-anecdotes/

Some very interesting Linux anecdotes on this website, stories from the very early days of the Linux operating system, before we had the easy to install Linux distributions we use today. Apparently Linus Torvalds is/was a Doom fan and spent a lot of time playing that game as well as Prince of Persia. I guess many, many people have played that incredible game over the years. I have played around with the old linuxxdoom source code and managed to run that on a 256 color X11 session. But the sdldoom port is easier to get running on a modern PC. Nowadays there are source ports like Zdoom that can be compiled on Linux. I am reading through this book: The Ultramarines Omnibus by Graham McNeill, a story that follows a team of Warhammer 40K Ultramarines in their struggle against many evil foes and the struggles and glorious battles they fight.

The Ultramarines Omnibus [Book]

I recommend this book to any fan of the Warhammer 40K universe and even though I have never played the tabletop game or anything, I find this a riveting read with the weapons and history of the Emperors finest soldiers described with amazing detail. If you are a fan of the Warhammer universe then definitely grab a copy of this book, it is well worth the read.

http://www.google.com/products/catalog?q=ultramarines+omnibus&oe=utf-8&rls=org.mozilla:en-US:unofficial&client=iceweasel-a&um=1&ie=UTF-8&tbm=shop&cid=2827446894620238999&sa=X&ei=63BDTu_fC4fgiALX4d3NAg&ved=0CCwQ8wIwAw

20 years of Linux, interview with Linus Torvalds.

Tux nuking Windows.

Tux nuking Windows.

There is a story over on Slashdot about the 20 year anniversary of the Linux operating system.  Linux has come a long way in the 20 year history and now it is a very robust and reliable operating system. Since Linus Torvalds needed a free version of the proprietary UNIX operating system that existed at the time, he started work on a his own version of the OS that became the Linux kernel. He started work on the Linux kernel, using the UNIX-like operating system MINIX in 1991. Nowadays, even mobile telephones such as the Google Android series use Linux as well as the Nokia N900. The TiVo video recorder also runs a modified Linux kernel and the TiVo Digital Video Recorder (DVR) operating system to enable television recording and playback  powered by open source software. The main benefit of running Linux for a web server and embedded applications is the low memory requirements of the operating system as you do not need a desktop environment installed for a simple web server that is easily administered remotely with Webmin or through SSH. And the Linux kernel is customized without any stress through the menuconfig interface before building it to select or disable drivers and options you may or may not need. This means you can disable the compilation of PCMICIA drivers if you are on a desktop PC. As well as building the kernel for your specific CPU type. This is a very powerful feature as well as the various distributions of Linux that are tailored to many roles, such as media center or penetration testing. Backtrack is a good example of the latter. As well as the awesome knoppix Live DVD, that is perfect for fixing your system and recovering Windows files from a corrupted installation.

You can not do that with Windows, it uses the kernel compiled by Redmond and you have to put up with the annoying quirks present in the NT kernel. I have found the best thing about using Linux when installing a new hard disk is that I created two partitions with gparted about 240 gigabytes each and formatted them and it only took gparted a couple of seconds to format each partition, it takes Windows ages to do that. That is why I like to use Ubuntu to take care of partitioning and file management tasks. The drive in question was a 500 gigabyte Seagate Barracuda 7200.12 500GB 16MB SATA 7200RPM hard disk that I purchased to extend my computer`s storage space. If Windows had a proper file-system like ext4 then it would be much faster and would run much smoother to boot. I have installed a previous hard disk a while ago, a 500 gigabyte hard disk identical to the one I recently purchased and Windows XP disk management took hours to format the 230 gigabyte partitions. But Microsoft software is not always the best solution, even MSN Hotmail runs on Apache/FreeBSD servers. But considering the amount of traffic that service receives every day it is unlikely that the server would be able to scale handle that much traffic without downtime. The NT/IIS combination works for some websites but a UNIX/Linux LAMP server is better for others. Here are my existing Linux and Windows partitions, the large ones are for storing multimedia files on /dev/sdc, that is the hard drive I bought most recently and /dev/sdb is the drive with Ubuntu 11.04 and finally, /dev/sda is the hard drive with Windows 7. The partitions are NTFS to share files easily between Windows and Linux. Adding a SATA hard disk is so easy these days, not having to worry about master and slave jumper settings and other annoying IDE idiosyncrasies that I am glad to leave behind. A SATA cable has only one connection per cable and this makes the whole installation as simple as plugging in the SATA cable and the power supply cable from the PSU and you are set.

thx@Morgoth:~$ sudo fdisk -l /dev/sdc

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00036257

 

Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1       30596   245760000    7  HPFS/NTFS
/dev/sdc2           30596       60802   242625536    7  HPFS/NTFS
thx@Morgoth:~$ sudo fdisk -l /dev/sdb

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8cfdd929

Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       31871   256002048    7  HPFS/NTFS
/dev/sdb2   *       31871       44774   103643136   83  Linux
/dev/sdb3           44775       60072   122880000   83  Linux
/dev/sdb4           60072       60802     5858305    5  Extended
/dev/sdb5           60072       60334     2097152   82  Linux swap / Solaris
/dev/sdb6           60334       60802     3760128   83  Linux
thx@Morgoth:~$ sudo fdisk -l /dev/sda

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b2eeb



 

 

 

 Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      102400    7  HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2              13       19458   156185600    7  HPFS/NTFS
thx@Morgoth:~$

20 years of Linux. It has been a good ride.

http://www.walkernews.net/2007/06/22/download-official-redhat-linux-iso-image/.

Gyroscopically stabilized Chicken.

The link above is to the Redhat 6.2 Linux distribution, the first version of Linux I used. It ran very well on a Celeron 600 with 64MB of RAM and integrated graphics. Linux has come so far since it was first released, the desktop has gotten even easier to use and with the release of Ubuntu, the Linux desktop has become a reality for more and more users all over the world. Some schools are even installing Ubuntu instead of Windows. I am downloading a CD ISO of Redhat Linux 6.2 and I will be posting screen shots of the distribution running in Virtualbox very soon. That will be very interesting taking a look back at the older Linux distributions and how far we have come in all this time. I will actually make a Youtube video of Redhat 6,2 running and show off the very cool software that came with it. There were good games for Linux back in the day, but now we have Doom, Quake, Unreal Tournament original and UT 2003,2004 and Quake 3 and 4.

There is a huge list of games for Linux and they are very good games, you can play the original Quake in the Darkplaces source port with greatly improved graphical quality and support for high-resolution graphics. Quake 4 has a native Linux client and a graphical installer. Linux is free of the malware and viruses that plague Windows systems and is almost as secure as the legendary OpenBSD UNIX operating system. There are HOWTOs that tell you how to write viruses for a Linux system infecting the ELF executable format used by Linux, I am not sure how many people actually have used that though, that is why you have NOVELL AppArmor or NSA Selinux installed to combat these sorts of viruses.

But Windows is a target for malware and virus writers because it is so popular and has more security holes like Internet Explorer 6.0 which is still being used sadly. Even Internet Explorer 7.0 has a few bugs regarding CSS. Internet Explorer 9.0 is much, much better and supports just about all CSS and HTML 5.0. In the video I am linking to I am showing Internet Explorer running the ACID tests 1, 2 and 3 and it does very well, much better than IE 6 ever could. Getting back to Linux, there is also Wine, which I have used to run Command & Conquer Tiberian Sun perfectly well, and it can also run World of Warcraft although the setup is rather arcane and complex, but if you could run that game on a more secure and stable operating system then it would be worth all of the effort. It is disappointing that Unreal Tournament 2007 is not available on Linux, we will have to try running it in wine or contenting ourselves with the 2004 release, which is very good mind you, the 2004 version included drivable vehicles in the assault mode and flying craft you could man, which is very cool indeed.

And as I said, it is a very good game for Linux along with Quake4. The first ever Linux distribution was MCC Interim Linux in 1992. The files of the distribution are still available and it was the first Linux distribution that was capable of being installed on a computer.

I have included this video explaining the origins of the Linux operating system as spoken my Linus Torvalds himself. He wanted a free version of the commercial UNIX and so he coded the free Linux kernel and created the free open-source operating system we have today. I hate to think of what the world would be like without a free operating system that is free of viruses and free of the annoying Malware and Adware that plagues the Windows systems of the world. Windows 7 when used with a limited user account is very secure and stable, but Linux will always be more secure than the closed source counterpart. Despite the bully boy tactics of Microsoft that had the machines in the OLPC project running Windows instead of Linux, it has been decided that Linux is best for the job and with improvements to power management code it is perfectly suited for the task of running on a cheap and relatively low specification machine.

FreeBSD is also good for running on a laptop, but they decided on Linux and that is fine by me as developing countries need all of the help they can get and a free and open operating system instead of a closed and unreliable Windows installation is what they deserve. Microsoft only care about their bottom line and not the consumer anyway, Windows 7 is not too bad at all, but Windows XP is practically abandon-ware by now and should not be used these days unless your machine is very old, and then you would be better off with Xubuntu. Nowadays there is ulitelinux that is a very minimal installation of Ubuntu that can run on older machines and give them a new lease of life. If you are using a ethernet modem to access the Internet like I am then you would not need to run Gnome in Linux and you could run Fluxbox or Lxde or even Blackbox and then you would hardly use any memory running such a sleek and fast desktop.