Formatting a Partition in Ubuntu Server

sudo mkfs…

mkfs

SWAP

sudo mkswap /dev/sda5

EXT4

sudo mkfs.ext4 /dev/sda5
Posted in Linux, Ubuntu Server | Tagged , , | Leave a comment

Automount Partitions at startup in Ubuntu Server

1. sudo gedit /etc/fstab

2. now the fstab file is open in nano. you need to add an entry for the partition to automount it at startup.

the format of a new entry is like this:

file_system mount_point type options dump pass

you will see this in the file and you need to add your new entry under this line.

brief explanation of the above format:

  • file_system = your device id.

use this:

/dev/sdax ( you should check it with sudo fdisk -l)

it may be /dev/sdbx or /dev/sdcx if you have more than one disks connected.

  • mount_point =where you want to mount your partition.

use this:

/media/user/label

here user is your user name, label is “software”, “movies” or whatever label your partiton have.

  • type=fat32,ntfs, ntfs-3g,ext2,ext4 or whatever your partition type is.
  • options =mount options for the partition(explained later).
  • dump=Enable or disable backing up of the device/partition .usually set to 0, which disables it.
  • pass =Controls the order in which fsck checks the device/partition for errors at boot time. The root device should be 1. Other partitions should be 2, or 0 to disable checking.

so for auto mounting case the above format reduces to:

/dev/sdax /media/user/label type options 0 0

(you can check the type with sudo fdisk -l)

the options field:

sync/async – All I/O to the file system should be done synchronously/asynchronously.
auto/noauto – The filesystem will be mounted automatically at startup/The filesystem will NOT be automatically mounted at startup.
dev/nodev – Interpret/Do not interpret character or block special devices on the file system.
exec/noexec – Permit/Prevent the execution of binaries from the filesystem.
suid/nosuid – Permit/Block the operation of suid, and sgid bits.
ro/rw – Mount read-only/Mount read-write.
user/nouser – Permit any user to mount the filesystem. (This automatically implies noexec, nosuid,nodev unless overridden) / Only permit root to mount the filesystem. This is also a default setting.
defaults – Use default settings. Equivalent to rw, suid, dev, exec, auto, nouser, async.
_netdev – this is a network device, mount it after bringing up the network. Only valid with fstype nfs.

now the final format reduces to (for auto mount):

/dev/sdax /media/user/label type defaults 0 0

for ntfs

/dev/sdax /media/user/label ntfs defaults 0 0

for ext4

/dev/sdax /media/user/label ext4 defaults 0 0

etc…..

you can change defaults by your own configuration, like

/dev/sdax /media/user/label ext4 rw,suid,dev,noexec,auto,user,async 0 0

etc…

you need to add entry for each partiton you want to auto mount.

3. save and exit the file then restart

Posted in Linux, Ubuntu Server | Tagged , , , | Leave a comment

Install VMware tools on Ubuntu Server

apt-get install open-vm-tools
Posted in Linux, Ubuntu Server, VMware | Tagged , , | Leave a comment

Install Transmission on Ubuntu Server

add the apt-repository for Transmission:

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:transmissionbt/ppa
sudo apt-get update

command to install Transmission:

sudo apt-get install transmission-cli transmission-common transmission-daemon

create some folders in our home folder for Transmission to use:

mkdir ~/Downloads
mkdir ~/Downloads/Completed
mkdir ~/Downloads/Incomplete
mkdir ~/Downloads/Torrents

set the correct permissions on the Downloads folders:

sudo usermod -a -G debian-transmission username
sudo chgrp -R debian-transmission /home/username/Downloads
sudo chmod -R 775 /home/username/Downloads

editing Transmission settings:

sudo /etc/init.d/transmission-daemon stop

or

service transmission-daemon stop

edit our configuration file:

sudo nano /etc/transmission-daemon/settings.json

and than edit:

"download-dir": "/home/username/Downloads/Complete",
"incomplete-dir": "/home/username/Downloads/Incomplete",
"incomplete-dir-enabled": true,
"rpc-authentication-required": false,
"rpc-whitelist-enabled": false,

save the file.

start transmission again:

sudo /etc/init.d/transmission-daemon start

or

service transmission-daemon start

Now navigate to: 0.0.0.0:9091 (0.0.0.0 being the ip of your server).

Don’t forget to say THANX!!!

Posted in Linux, Ubuntu Server | Tagged , , | Leave a comment

Ubuntu Server – Add a new User as Sudoer

In SHELL

sudo useradd -d /home/testuser -m testuser
sudo passwd testuser


replace testuser with the required username.

sudo nano /etc/sudoers


add the user after the:

root ALL=(ALL) ALL


as:

testuser ALL=(ALL) ALL

Save the file.

Don’t forget to say THANX!!!

Posted in Linux, Ubuntu Server | Tagged , , , , , | Leave a comment

Vcenter time setup (command line)

date -s "31 Jan 2012 18:00:00"
Posted in VMware | Tagged | Leave a comment

Setting Up Network Interfaces in Ubuntu Server 12.04 LTS

In SHELL

 sudo nano /etc/network/interfaces

from :

auto eth0
iface eth0 inet dhcp

to :

auto eth0
iface eth0 inet static
   address 192.168.0.*
   network 192.168.0.0
   netmask 255.255.255.0
   broadcast 192.168.0.255
   gateway 192.168.0.1

Don’t forget to say THANX!!!

Posted in Linux | Tagged | Leave a comment

Add nameservers in Ubuntu Server 12.04 LTS

In SHELL

sudo nano /etc/resolvconf/resolv.conf.d/base

add :

 nameserver 8.8.8.8
 nameserver 8.8.4.4
sudo reboot

Don’t forget to say THANX!!!

Posted in Linux | Tagged | Leave a comment

FIX Ubuntu

Copy code. Open a terminal (Ctrl-Alt-T). Paste code, press enter. Type password. Enjoy your privacy.

V=`/usr/bin/lsb_release -rs`; if [ $V \< 12.10 ]; then echo "Good news! Your version of Ubuntu doesn't invade your privacy."; else gsettings set com.canonical.Unity.Lenses remote-content-search none; if [ $V \< 13.10 ]; then sudo apt-get remove -y unity-lens-shopping; else gsettings set com.canonical.Unity.Lenses disabled-scopes "['more_suggestions-amazon.scope', 'more_suggestions-u1ms.scope', 'more_suggestions-populartracks.scope', 'music-musicstore.scope', 'more_suggestions-ebay.scope', 'more_suggestions-ubuntushop.scope', 'more_suggestions-skimlinks.scope']"; fi; if ! grep -q productsearch.ubuntu.com /etc/hosts; then echo -e "\n127.0.0.1 productsearch.ubuntu.com" | sudo tee -a /etc/hosts >/dev/null; fi; echo “All done. Enjoy your privacy.”; fi


#!/bin/bash

# Figure out the version of Ubuntu that you're running
V=`/usr/bin/lsb_release -rs`

# The privacy problems started with 12.10, so earlier versions should do nothing
if [ $V \< 12.10 ]; then echo "Good news! Your version of Ubuntu doesn't invade your privacy." else # Turn off "Remote Search", so search terms in Dash don't get sent to the internet gsettings set com.canonical.Unity.Lenses remote-content-search none # If you're using earlier than 13.10, uninstall unity-lens-shopping if [ $V \< 13.10 ]; then sudo apt-get remove -y unity-lens-shopping # If you're using a later version, disable remote scopes else gsettings set com.canonical.Unity.Lenses disabled-scopes \ "['more_suggestions-amazon.scope', 'more_suggestions-u1ms.scope', 'more_suggestions-populartracks.scope', 'music-musicstore.scope', 'more_suggestions-ebay.scope', 'more_suggestions-ubuntushop.scope', 'more_suggestions-skimlinks.scope']" fi; # Block connections to Ubuntu's ad server, just in case if ! grep -q productsearch.ubuntu.com /etc/hosts; then echo -e "\n127.0.0.1 productsearch.ubuntu.com" | sudo tee -a /etc/hosts >/dev/null
fi

echo "All done. Enjoy your privacy."
fi

Posted in Linux | Tagged , , | Leave a comment

Failed to Retrieve Share List from Server


To get started, press Ctrl – Alt – T on your keyboard to open Terminal. When it opens, run the commands below to open the samba configuration file:

sudo gedit /etc/samba/smb.conf

Finally, scroll down a bit in the file and find : WORKGROUP = Workgroup_Name.

Right below that, type the line shown below and save the file.

name resolve order = bcast host

Note: You may or may not have to reboot in order for this to take effect. In my case it worked immediately.

Posted in Linux | Leave a comment

Install Webmin (ver.1)

sudo apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python
wget http://sourceforge.net/projects/webadmin/files/webmin/1.780/webmin_1.780_all.deb
sudo dpkg -i webmin_1.580_all.deb

*update webmin after you login https://server-ip:10000

Posted in Linux | Leave a comment

Update latest GIT

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git

Posted in Linux | Leave a comment

What Linux distribution am I running?


Here is how you can find out when logged in through SSH:

uname -a

This generally won’t tell you as much as you’d like.

cat /proc/version

This will generally tell you more than you’d like.

Once you know that you are running Red Hat for example, you can get to the point with:

cat /etc/redhat-release

Or on Debian:

cat /etc/debian_version

Posted in Linux | Leave a comment

Install uTorrent in Ubuntu 12.04 lts


1. install the dependency library

sudo apt-get install libssl0.9.8:i386

2. download utorrent

wget http://download.utorrent.com/linux/utorrent-server-3.0-25053.tar.gz

3. copy the file to opt directory

sudo cp utorrent-server-3.0-25053.tar.gz /opt/

4. go to opt directory

cd /opt/

5. extract the file

sudo tar -xvf utorrent-server-3.0-25053.tar.gz

6. remove the file

sudo rm -rf utorrent-server-3.0-25053.tar.gz

7. change the permission of the extracted folder

sudo chmod 777 -R utorrent-server-v3_0/

8. create a symbolic link so that you can run the torrent server from terminal

sudo ln -s /opt/utorrent-server-v3_0/utserver /usr/bin/utserver

9. start server

utserver -settingspath /opt/utorrent-server-v3_0/ &

10. access the webgui in any browser

http://localhost:8080/gui/

Posted in Ubuntu 12.04 lts | Leave a comment

Install X2Go Server


* this is from a basic ubuntu server install

1. the following command will fix the add-apt-repository command

sudo apt-get install python-software-properties

2. adding the x2go PPA for debian/ubuntu

sudo add-apt-repository ppa:x2go/stable

3. update

sudo apt-get update

4. install ubuntu-desktop (*option –no-install-recommends)

Gnome

sudo apt-get install ubuntu-desktop

or xfce

sudo apt-get install xubuntu-desktop

or KDE

sudo apt-get install kubuntu-desktop

5. install x2goserver

sudo apt-get install x2goserver

6. install gnome-session-fallback

sudo apt-get install gnome-session-fallback

7. install in windows or linux the client

http://www.x2go.org/doku.php

Posted in Ubuntu 12.04 lts | Leave a comment