Pretty interesting. Wish I’d seen this when I was in school!
Sorting Algorithms as Dances
Wayno
Just another WordPress site
13
Apr
Pretty interesting. Wish I’d seen this when I was in school!
Sorting Algorithms as Dances
Wayno
19
Mar
Subnet masks are absolutely one of the most confusing things I have ever encountered. It is likely, you have also experienced a considerable amount of confusion as well.
Subnet Mask Explained
So let’s define: What is a subnet mask?
I liked this definition which I will use from wikipedia.org on subnet masks.
A subnetwork, or subnet, is a logically visible subdivision of an IP network.[1] The practice of dividing a network into subnetworks is called subnetting.
It breaks a larger network, into smaller subnets. A logical, visible subdivion….Well let’s see how they work.
Key Concepts
1. In order to understand subnet masks, we have to think Binary (base 2)
and NOT decimal (base 10).
2. IPv4 addresses are given in octets. Meaning that we have one byte or 8 binary digits (bits) to represent a number. Lowest number we can represent in 8 bits is zero (0), highest (HIGH VALUE or ALL BITS ON) is 255 (base 10.) Numbering starts at zero (0) and not one (1). So we have 256 choices!
3. Subnet masks are identified with a / or slash after the IP address:
4. 192.168.0.0/30
30 bits CAN’T change. only gives us 2 bit that can change. So it would allow 4 subnet hosts. Remember the 1 bit (on,) means it can NOT change. A zero bit (off,) means it CAN change. BUT one bit is reserved for broadcast, and one bit for network (we can’t use those so we have to subtract that!)
3 2 2 2 1 1 2 8 4 0 6 2 8 4 1111 1111 1111 1111 1111 1111 1111 1100 (binary)
(32 – 30) = 2 bits allowed to change. (2^2) -2 = 2 choices.
NOTE: ^ means raised to the power of. So 2 raised to the power of 2 (2 squared) = 4.
So a subnet mask of 30 allows us to control two (2) subnet hosts.
5. A subnet mask of 20 i.e.
3 2 2 2 1 1 2 8 4 0 6 2 8 4 1111 1111 1111 1111 1111 0000 0000 0000 (binary)
192.168.0.0/20, means (32-20) = 12 bits allowed to changed. (2^12) -2 = 4094.
Again, 2 raised to the 12th power (2x2x2x2x2x2x2x2x2x2x2x2) = 4096.
6. A /24 sub network 192.168.0.0/24
3 2 2 2 1 1 2 8 4 0 6 2 8 4 1111 1111 1111 1111 1111 1111 0000 0000 (binary)
Means 24 bits CAN’T change. (32 – 24) = 8 (2^8) – 2 = 254.
Allows 254 subnet hosts, since we have masked OFF 24 bits, only 8 can change! (minus one bit for broadcast, one bit for network)
—–
Thanks Loni, for looking over my shoulder.
Remember. Bits, nibbles, and bytes can hurt you! Be careful out there!
Wayno
7
Feb
First look at Debian Squeeze
Like many of you in the Ubuntu community, I am concerned over the direction Ubuntu is going, especially with the Unity Interface.
With the release of Debian 6.0 (Squeeze), I thought I’d take it out for a test drive. Debian is NOT recommended if you are a Linux Noob. Sure Ubuntu is based on Debian, but the install is a bit more complicated then doing a typical Ubuntu install. If you are new to Linux, I’d still recommend Ubuntu, hands down.
Hardware:
So what was the install like. Well, it ain’t Ubuntu! Here is what I installed it (Physical Hardware)
AMD 64 Bit, 2GHZ, 2 G ram, 1 t/b hard drive.
An Nvidia GeForce 6150SE nForce 430 graphics card.
1 m/b sec download speed. (hey that’s all I can budget!)
Let me decode that: 64 bit machine, 2 gigahertz CPUS (2), 2 gigabytes of memory, and a 1 terrabyte hard drive.
I installed the 32 bit CD version of Debian, into Virtual Box, since my machine doesn’t support hardware virtualization (thanks Loni!) The virtual machine uses 512 meg of RAM, and 64 meg for graphics.
The default install gives you an ext3 filesystem, which is different from Ubuntu’s ext4 default. Ext4 gives better performance, but there certainly is nothing wrong with ext3.
If you are used to Ubuntu’s ask 7 questions and go away for 30 minutes install, Debian default installation is quite different.
It asks a LOT more questions, installs a bit, asks more questions…it is more interactive then I’d like it to be. Once you get through all the questions, it settles down to the nitty gritty. Downloading 1071 files to update Debian, took about 90 minutes (remember I don’t really have a super high speed connection, and hey this is a virtual box!). After spending 90 minutes to download the updates, it spent another hour configuring all that it had just downloaded. All told the install took about 3 hours, which is far longer then a Ubuntu install. And it requires a broader knowledge base to install.
Debian is basically a bare bones Ubuntu system. It has all the same features, but it doesn’t install anything that truly isn’t wanted or needed. So you need more experience (why I do NOT recommend Debian for Linux Noobs), in deciding what packages/programmes you may want to install.
That said, choice is not a bad thing! I’ll be playing with this over the next few days, and will eventually turn my box called Phoenix, into SquisheeMachine for further testing.
As always, a big thanks to Loni for her guidance.
22
Jul
The built in speakers on the compaq desktop pro, while they work with WIN XP, don’t work with Ubuntu 10.04. However, if you plugin a set of speakers or earphones into the sound output jack on the back (green) works perfectly.
After installing the LIVECD onto the Compaq Desktop Pro, when I rebooted, everything looked okay. I run the updates. Then rebooted AFTER the updates, and then ran into trouble.
Nothing I tried worked! Then I found the secret! You need to create at LEAST 2 admin accounts Before doing the updates. One that you will do the updates after installing the LIVECD, and one that you will use AFTER you do the updates.
Here’s what’s going on. After installing the LIVED CD the monitor resolution is set to 800×600.
However, after installing the updates, the resolution switches to 1024×768. So that account you did the updates with: worthless!
If you logon after the updates with the second account, your good to go. But you need the snippet from here
I created the following file in /etc/X11/xorg.conf RIGHT AFTER DOING THE UPDATES!
DO NOT TRY TO CHANGE THE RESOLUTION TO ANYTHING BUT 1024×768. IT JUST WON’T WORK!
#
# /etc/X11/xorg.conf
#
Section "Device"
Identifier "Intel Corporation 82815 CGC [Chipset Graphics Controller]"
Driver "intel"
BusID "PCI:0:2:0"
EndSection
#
Section "Monitor"
Identifier "Generic Monitor"
Option "DPMS"
HorizSync 31.5-48.5
VertRefresh 40-70
EndSection
#
Section "Screen"
Identifier "Default Screen"
Device "Intel Corporation 82815 CGC [Chipset Graphics Controller]"
Monitor "Generic Monitor"
DefaultDepth 16
SubSection "Display"
Modes "1024x768" "800x600" "640x480"
EndSubSection
EndSection
If you hose the resolution you can try this.
xrandr --output LVDS --mode 1024x768
8
Jul
I have a 1 t/b back up drive, which is a USB drive.
However, the device names seem to change automagically.
Power interruptions, or even things like Virtual Box will cause the drive to dismount and re-mount, changing the device name, and causing havoc elsewhere for things like my music and ftp site which are stored on this device.
So, what’s the easy way to fix this? Well thanks to Loni, here’s what we did:
1. Change directory so we can get information by UUID. (Universally Unique Identifier)
cd /dev/disk/by-uuid
2. Look at the UUID’s in the system:
ls -l
You will get output that looks like this:
@Homer:/dev/disk/by-uuid$ ls -l
total 0
lrwxrwxrwx 1 root root 10 2010-07-08 00:21 14ff50b3-49c0-4dbb-a392-55fb94a7730f -> ../../sdb2
lrwxrwxrwx 1 root root 10 2010-07-07 17:21 5ed81b0d-ae9a-41b1-b4c7-02b500b94bea -> ../../sda5
lrwxrwxrwx 1 root root 10 2010-07-07 17:21 92569F58569F3C43 -> ../../sda1
lrwxrwxrwx 1 root root 10 2010-07-07 17:21 949CA48C9CA46A86 -> ../../sda3
lrwxrwxrwx 1 root root 10 2010-07-07 17:21 c07c1084-ff98-49dc-87c7-672651dc4d2e -> ../../sda4
lrwxrwxrwx 1 root root 10 2010-07-08 00:21 FC1268B212687414 -> ../../sdb1
4. Now let’s edit the Linux file structure table, fstab
Note any thing with a # in it is a comment does not need to be coded!
cd /etc
5. First let’s backup the file in case we make mistake (always have a path back to the way it was, before you messed it up!) More complete details are here.
sudo cp fstab fstab.bkup
6. Now edit the file:
sudo nano fstab
OR
gksudo gedit fstab # use gedit
7. add the following similar lines:
UUID=14ff50b3-49c0-4dbb-a392-55fb94a7730f /waynobfd ext4 rw 0 0
#
UUID=FC1268B212687414 /waynontfs ntfs rw,nosuid,nodev,allow_other,blksize=4096 0 0
The first line above, mounts an ext4 partition by UUID (from the information we obtained before) and gives it the mount point of /waynobfd (previously created with the mkdir command.)
The second line above mounts an ntfs partition, called waynontfs. Handy for use with Windows.
By using UUID, if the device changes due to things like VirtualBox or maybe a power hiccup that affects the drive, though the device may change, the mount point will always be correct.
End of Problems! Thanks Loni!
20
Dec
THANKS LONI
My Acer Aspire D250 Notebook has this wireless lan card:
lspci # get the wireless lan info
01:00.0 Network controller: Atheros Communications Inc. AR928X Wireless Network Adapter (PCI-Express) (rev 01)
and the ath9k module is flakey
1. So let’s first get the Linux Version we’re running:
uname -a # get linux kernel version number
Linux Nelson 2.6.31-16-generic #53-Ubuntu SMP Tue Dec 8 04:02:15 UTC 2009 i686 GNU/Linux
2. so I installed the following:
sudo apt-get install linux-backports-modules-(KernelVersionGoesHere)
ex: sudo apt-get install linux-backports-modules-2.6.31-16-generic
(you must do this (install backports) with any kernel upgrade.)
3. reboot!
No more flakiness!
Didn’t work? No problem:
sudo apt-get purge linux-backports-modules-(KernelVersionGoesHere)
ex: sudo apt-get purge linux-backports-modules-2.6.31-16-generic
reboot!
gone!
Wayno
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.