Tuesday, October 5, 2010

Setting Up Disk Partitions

http://www.linuxsa.org.au/tips/disk-partitioning.html

2.5 GB - /
0.5 GB - /boot
5.0 GB - /tmp
5.0 GB - /var
4 GB swap (in the middle, same size as memory)
5.0 GB /usr
?.? GB /home (whatever is left over)

30 GB drive seems to work fine.


Remote VNC Desktop

http://digg.com/news/technology/Remote_Desktop_for_Linux


Display Binary Files

http://wiki.answers.com/Q/How_do_you_display_a_binary_file_in_Linux

Use hexdump or od (oct dump).

Tuesday, September 28, 2010

file command

The file command:

http://linux.about.com/library/cmd/blcmdl1_file.htm

file [ -bciknsvzL ] [ -f namefile ] [ -m magicfiles ] file Am ] ...
file -C [ -m magicfile ]

File test each argument in an attempt to classify it.  

Three set of tests:  filesystem tests, magic number tests, and language tests.

The first test that succeeds prints the file type.

NOTE:  This test devices also.

Getting the source code for file:

Add the following line to the /etc/apt/sources.list file.

Update the sources.


 $ apt-get update
Get the source

 
$ apt-get source file







Wednesday, August 18, 2010

Server Message Block (SMB)

http://en.wikipedia.org/wiki/Server_Message_Block

An application network protocol known as "Microsoft Windows Network" in Windows systems.

Implemented by Samba on Linux systems and other Unix like systems.

Also called Common Internet File System (CIFS).

Friday, August 6, 2010

Wonderful Linux Command-line Cheat Sheet

http://www.pixelbeat.org/cmdline.html

rsync command is a network efficient file copier.  I need to learn more about this.

Doing a Grub Repair from a Live Ubuntu CD


This was done using a Ubuntu 10.04 live CD.

This is the guide I followed:  


SystemRescueCD looks pretty good, but there is no need to use it if you have any live Linux CD with the correct tools.

SystemRescueCD didn't have a cool picture so I grab a general picture from here:  http://behdad.ws/post/681808291/rescue-cds

First you must know the '/' and '/boot' mount points.  '/boot' may not need to be mounted, if it is included under the root mount point.

To find this information use System => Administration => Disk Utility.  You can also get this information running 'fdisk -l' as root.

In my case the install was on a single partition on /dev/sda3.





ubuntu@ubuntu:~$ sudo mkdir /mnt/linux
ubuntu@ubuntu:~$ sudo mount /dev/sda3 /mnt/linux
ubuntu@ubuntu:~$ sudo mount -o bind /proc /mnt/linux/proc
ubuntu@ubuntu:~$ sudo mount -o bind /dev /mnt/linux/dev
ubuntu@ubuntu:~$ sudo mount -o bind /sys /mnt/linux/sys
ubuntu@ubuntu:~$ sudo chroot /mnt/linux /bin/bash
root@ubuntu:/# grub-install /dev/sda
Installation finished. No error reported.
root@ubuntu:/# exit
exit
ubuntu@ubuntu:~$ sudo umount /mnt/linux/{dev,proc,sys}
ubuntu@ubuntu:~$ sudo umount /mnt/linux
ubuntu@ubuntu:~$ 

Reboot the computer and Grub should now work.  The link to repairing a damage Grub gives a more detailed description.  It might also be good to read the section on Grub to understand how Grub works.

The reason this works is because the Grub information selecting the Linux and Windows boots is located in the /mnt/linux/boot folder and was never damaged.


Good luck.