Dear all
I have a bunch of hosts which I need to run a common script. I need a sleep timee which will delay the execution based on the hostname. Usually the hostname of the servers are host01, host02 ..
I have several Amazon EC2 servers and I'm using Chef to manage the configuration. I'd like to set the hostname so that the default bash prompt is more helpful.
Right now after launching a new server it's just set as:
root@ip-10-123-123-123
Since I'm using Ubuntu 12 on these boxes I consulted the corresponding man page for hostname.
Hi,
I'm tryin to write a script that will collect information about a remote servers, put them into variables and print them to screen.
Code:
# /usr/bin/bash
ls $1 > /dev/null 2>/dev/null
if [ "$?" -eq 0 ]
then
echo "$1 is file"
for server in $(cat $1)
do
# echo $server
&
I have created this script from ubuntu wiki pages:
Quote:
#!/bin/bash
# Backup Script
#
#What to backup.
backup_files="/home/mrc/"
#Where to place backup.
dest="/home/mrc/backup/"
#Create archive filename.
day=$(date +%d%m%Y-%R)
hostname=$(hostname -s)
archive_file="$hostname-$day.tgz"
#Print start status message.
echo "Backing up $bac
I've already tried changing the hostname by editing both:
/etc/hostname
/etc/hosts
However when I try to use sudo it doesn't work. I have to restart the computer to make sudo work again.
Hello I want to find out my IP and i test this code from beej tutorial:
Code:
char hostname[128];
int i;
struct hostent *he;
struct in_addr **addr_list;
struct in_addr addr;
gethostname(hostname, sizeof hostname);
&n
Before the switch to systemd, I was able to ssh between my two machines via user@hostname but now I get a "could not resolve hostname" error and have to use the IP address instead.
i have a file that contains information such as this:
Code:
hostname.sky.net === 12.39.59.35
hostname.sky.net === 12.39.59.35
hostname.sky.net === 12.39.59.35
hostname-newyork.sky.net ==== 13.45.35.24
hostname-newyork.sky.net ====  
I have most of my home directory dot files shared across my home and work systems, each running a different version of Ubuntu.
I'm looking for a way to specify the default image viewer for each system in ~/.mailcap, so when it's invoked by mutt, the correct image viewer will start.
My current work-around is to put the following in ~/.mailcap ...
image/*; viewimage %s; test=test -n "$DISPLAY";