Archive for the ‘Tutorials’ Category

How to change the hostname in Ubuntu

We are going to use nano to edit the file.
as always sudo if you’re not root

Lets update;

apt-get update

apt-get upgrade

Now install nano

apt-get install nano

how to use nano?
CTRL+o: this will save the file
CTRL+x: this will exit the file
CTRL+w: this will allow you to enter a phrase to search the file
CTRL+k: this will allow you to cut 1 or more lines of text
CTRL+u: this will allow you to uncut lines of text that were cut using CTRL k (similar to pasting text)
CTRL+v: this will advance the file to the next page
CTRL+y: this will move the file to the previous page
CTRL+t: this will run spellcheck on the file

Now change hostname in Ubuntu or any Debian variant Linux, modify the /etc/hostname and /etc/hosts.

sudo nano /etc/hostname

Change the old hostname to a new hostname.

sudo nano /etc/hosts

Change the oldhostname to a new hostname,

000.00.0.00             newhostname

After changing the /etc/hostname and /etc/hosts, you need to restart the hostname service duh..

sudo /etc/init.d/hostname.sh stop

sudo /etc/init.d/hostname.sh start

Is it working? why not find out;log out,login, SSH and type

hostname

Best of luck!
www.mrvinux.com

VN:F [1.8.5_1061]
Rating: 0 (from 0 votes)

Howto Show Visitors IP Address in a Image

Hello!
This is what you will get after you are done

this is (((easy)))

What you need

  1. index.php
  2. new directory (folder)
  3. .png image

Ok so start off with a index.php and here is the code that you will need..

 <?
header("Content-type: image/png");
$im = imagecreatefrompng ("yourip.png");
$colour = imagecolorallocate($im, 255, 255, 255);
$ip = "$_SERVER[REMOTE_ADDR]";
imagestring($im, 3, 71, 2, $ip, $colour);
imagepng($im);
?>

Now you need the a image here one for the tut..(duh)
(save it)

Now you need to make a folder via FTP mine is called yourip but you can call it what you want.

Then all you gota do is upload it..

VN:F [1.8.5_1061]
Rating: +1 (from 1 vote)