Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

2013-02-27

How to change shell in Linux

To find out which shell you are using:
echo $SHELL

To change shell:
chsh


Credits:

Joana

How to define environment variable in Linux?

Define the environment variable in
.bashrc, .zshrc or /etc/bashrc or /etc/zshrc
or in a similar file.

Using a Mac OS X, edit /etc/profile
You might also want to know about MacPorts.

Credits:

Joana

2012-10-15

How to set permissions for Linux personal web site

Let's suppose that we have a user account located at ~ and a web site at ~/www

We need to set the directory permissions to 755 allow every

We need to set the files to 644 (owner can r/w, everybody else can r)
    u g w
0 - 0 0 0
1 - 0 0 1
2 - 0 1 0
3 - 0 1 1
4 - 1 0 0
5 - 1 0 1
6 - 1 1 0
7 - 1 1 1
u stands for 'user', g for 'group' and w for 'world'.
These are the classic Unix file permissions.

However, if AFS is being used, we also need to provide permissions in the access control lists (ACL).

The following command gives access to the web folder to anyone:

fs sa www system:anyuser rl

The following lists the existing permissions:

fs la www

More help on AFS
"
There are seven standard AFS permissions, each referred to by one of the letters r, l, i, d, w, k and a. The lida permissions apply to directories and the rwk permissions apply to files.
Directory permissions

l (lookup)
Allows one to list the contents of a directory. It does not allow the reading of files.
i (insert)
Allows one to create new files in a directory or copy new files to a directory.
d (delete)
Allows one to remove files and sub-directories from a directory.
a (administer)
Allows one to change a directory's ACL. The owner of a directory can always change the ACL of a directory that s/he owns, along with the ACLs of any subdirectories in that directory.

File permissions

r (read)
Allows one to read the contents of file in the directory.
w (write)
Allows one to modify the contents of files in a directory and use chmod on them.
k (lock)
Allows programs to lock files in a directory.

"

2012-03-09

Data compression and archiving

An archive file is a file containing several files and directories.

bzip2 -d filename
decompress archive file

tar -xvf filename
extract

tar -cvf filename dir ...
create

tar -zcvf filename dir ...
create a zipped tar file

2012-03-08

Disk Usage (du)

du -h
human readable option - displaying output in kilobytes (K), megabytes (M) and gigabytes (G) rather than just in the default kilobytes

du -sh
summary option - report only the total disk space occupied by a directory tree and to suppress individual reports for its subdirectories

2009-09-25

Talk: Applying SAT to solve dependencies

Paulo Trezentos presented his work about applying SAT techniques for the resolution of dependencies in the installation process of software components. The case study is the Caixa Mágica Linux distribution. Paulo presented an interesting formalization of the software packages dependency problem.

My suggestion at the talk was to have users upload the dependency problem solutions (and not just the problems) and to use the installation profile - server, desktop, netbook, etc - to help put the solutions in context.

It's not my research area but it was a talk that I liked to attend.

2009-07-27

Partition hacking: installing Windows Vista and openSUSE Linux on the same machine

Once in a while a computer scientist has to install a computer. Sounds simple? Think again, especially if you want to perform a multi boot installation. In this case, the goal was to install Windows Vista and openSUSE Linux.

Here are the steps I followed:

(this procedure destroys all data in the computer so make sure you have all your data stored safely elsewhere before starting something similar)

Step 1 - Create partitions

Insert the Linux installation disc.
Restart your computer. Press key combination at start-up to boot from disc (e.g. F8).

Create the partition scheme:
(the sizes are just examples)

P1 (recovery) - NTFS - 13 GB
P2 WinVista - NTFS - 50 GB
P3 WinData - FAT32 - 500 GB
P4 Extended partition
P4.1 Linux Swap - swap - 8 GB
P4.2 Linux - ext3 - 42 GB

No need to format.

FAT32 is supported by Windows and Linux. This way the data partition can be accessed by both Windows and Linux. The drawbacks of using FAT32 are the maximum file size of 4GB and no security and extended attributes.

Take note of the device name for the Linux partition. It should be something like: /dev/sda6 or /dev/sde6.


Step 2 - Install Linux

Continue Linux installation on partition P4.2.

After installation, the MBR is loaded with GRUB.


Step 3 - Install Windows Vista

Insert the Windows installation disc.
Restart your computer. Press key combination at start-up to boot from disc (e.g. F8).

Install Windows on partition P2.

After the installation, GRUB is replaced in the MBR with Windows Boot Manager. This means that it is no longer possible to boot Linux.

Reboot.

Install drivers.
Run Windows Update until there are no more updates available. It is normal to have a large number of updates.


Step 4 - Restore GRUB

Insert the Linux installation disc.
Restart your computer. Press key combination at start-up to boot from disc (e.g. F8).

Choose the "Rescue mode" option and choose the 'root' user.

Rescue> mount /dev/sda6 /mnt

Rescue> grub

grub> find /boot/grub/stage1
(hd0,5)

grub> root (hd0,5)

grub> setup (hd0)

grub> quit

Rescue> reboot

Restart - GRUB should be back in control of the booting process.

If you wish to change the GRUB menu, just edit the /boot/grub/menu.lst file using Linux.

If at any time you need to restore Windows Boot Manager (for a Windows Service Pack installation, for instance), you can use the free tool EasyBCD.


--

Good luck with your installations!