Posts Tagged ‘UNIX’

To compile without root privileges on a POSIX-compliant system

Monday, October 15th, 2007

To compile without root privileges on a POSIX-compliant system:

ARCH=`uname -sm | tr " [:upper:]" "\-[:lower:]"`
./configure --prefix=$HOME/local --exec-prefix=$HOME/local/$ARCH && make && make install

Compile LaTeX to PDF

Tuesday, January 30th, 2007

A quick script to compile a LaTeX file to a PDF:

#!/bin/bash
FILE=$1
if [ -a $FILE.tex ]; then
        latex $FILE && dvipdf $FILE.dvi && rm -f $FILE.log $FILE.aux $FILE.dvi
else
        echo $FILE.tex does not exist!
        exit 1
fi

iloog on MacBook

Sunday, January 7th, 2007
iloog on MacBook

iloog on MacBook, uploaded by thatha.

A picture of iloog by ILUG running on my MacBook.

iloog is a Gentoo-based LiveCD produced by the Ioannina Linux User Group (I.L.U.G.), targeted mainly towards students and scientists. iloog’s purpose is to create a multi-purpose tool that will suit the needs of our growing user-base through an intensive development process that follows the “release early, release often” paradigm of open source software.

A nifty disclaimer for incoming console connections

Sunday, January 7th, 2007

This computer system is for authorized users only. All activity is logged and regulary checked.
Individuals using this system without authority or in excess of their authority are subject to
having all their rights revoked. Any illegal services run by user or attempts to disrupt the
operations of this server or its services will be reported to law enforcement, and said user
will be punished to the full extent of the law. Anyone using this system consents to these terms.

Halt-less Linux, How-To Prohibit a Linux Box from Halting

Friday, January 5th, 2007

There are some cases that you need a Linux box to never halt—never ever. Even if you specifically request it…

To protect yourself from yourself one could do the following:

cd /sbin/
mv halt halt.real
chmod 000 halt.real
ln -s reboot halt
mv poweroff poweroff.real
chmod 000 poweroff.real 
ln -s reboot poweroff

It would also be wise to modify /etc/init.d/halt. Find the following section:

# See how we were called.
case "$0" in
   *halt)
        message=$"Halting system..."
        command="/sbin/halt"
        ;;

and turn it into

# See how we were called.
case "$0" in
   *halt)
        echo $"$0: this system may not be halted!"
        exit 1
        message=$"Halting system..."
        command="/sbin/halt"
        ;;

.

Also, you may want to set up an exception in sudoers (always use visudo to edit it). Here’s a simple way of prohibiting users to “sudo shutdown -h now” or “sudo halt“:
Cmnd_Alias HALT = /sbin/shutdown, /sbin/halt
%wheel ALL=(ALL) ALL, !HALT

Should you need to reboot, sudo reboot should suffice.

Warning: If your box is connected directly to a UPS you might want to refrain from messing up with halt.

How-To Use EV1Servers’ Remote Console

Tuesday, January 2nd, 2007

All the information you need can be displayed via ServerCommand. It should look like:
EV1Servers-ServerCommand-ConsoleInformation

You need to ssh USERNAME:70PORT@CONSOLE-IP. Type the PASSWORD and then hit Return twice. In the above example, one would ssh RS-77777:7099@127.127.127.127, type pass$$word at the password prompt, and hit Return twice.

update: If your USERNAME is in the RS-77777-1 format, regardless of what the instructions say, you need to ignore the -1 suffix.

If this doesn’t work hit Reactivate and try again after a few minutes before contacting the lousy EV1Servers support.


^