Showing posts with label Kernel. Show all posts
Showing posts with label Kernel. Show all posts

Monday 11 July 2016

Kali Linux - VMware Workstation 12 Error Kernel 4.6.0-amd64 Not Found Error

After update my Kali Linux - I wanted to carry on working on my VM labs using VMware Workstation, the problem is that I could not longer loud. VMware Workstation 12

Every time I tried to load - this error was loading up. ERROR Kernel 4.6.0-amd64 not found 


What I tried this approach from Kali Linux forum but it didn't help

e.g 1 from https://forums.kali.org/showthread.php?31734-Vmware-Kernel-Module-Updater-Issues-with-latest-Kernel-version-4-6-0-kali1-amd64&highlight=Vmware+kernel+issues :

Solution or Workaround: Modify 2 files in /usr/lib/vmware/modules/source/vmmon.tar and /usr/lib/vmware/modules/source/vmnet.tar
Steps:
1- Extract /usr/lib/vmware/modules/source/vmmon.tar
2- Modify /vmmon-only/linux/hostif.c
3- Replace "get_user_pages" to "get_user_pages_remote" 
4- tar and replace original
5- Extract /usr/lib/vmware/modules/source/vmnet.tar
6- Modify ./vmnet-only/userif.c
7- Replace "get_user_pages" to "get_user_pages_remote" 
8- tar and replace original
Now you should be able to compile the modules successfully.
Tested on Kali Linux 2016 with kernel 4.6.

It was still failing ..

Then - I removed VMware completely from my system and clean dkpg ..



The Edited the /etc/apt/source.list file with this two repositories ..

e.g 2:

Edit your sources.list

The easiest way is to edit the /etc/apt/sources.list
root@kali:~# vi /etc/apt/sources.list
(or)
root@kali:~# leafpad /etc/apt/sources.list

Add official repo’s only:

Copy paste the following repositories (remove existing lines or you can comment them out – your take). Following repo list was taken from official Kali sources.list Repositories page:
# Regular repositories
deb http://http.kali.org/kali sana main non-free contrib
deb http://security.kali.org/kali-security sana/updates main contrib non-free
# Source repositories

Then ...

Clean your apt-get

apt-get clean

Do an apt-get update

apt-get update

Do an upgrade

apt-get upgrade

Finally do a distribution upgrade

apt-get dist-upgrade
That’s it, you’re set.

Then, Install the Kernel headers  ...



Then ...

Install VMware Workstation 12 on Kali 



And That's all done ...

Tuesday 10 September 2013

Linux Containers on Virtualbox - Disposal Boxes by Michal Migurski's

Hey look, a month went by and I stopped blogging because I have a new job. Great.
One of my responsibilities is keeping an eye on our sprawling Github account, currently at 326 repositories and 151 members. The current fellows are working on a huge number of projects and I frequently need to be able to quickly install, test and run projects with a weirdly-large variety of backend and server technologies. So, it’s become incredibly important to me to be able to rapidly spin up disposable Linux web servers to test with. Seth clued me in to Linux Containers (LXC) for this:
LXC provides operating system-level virtualization not via a full blown virtual machine, but rather provides a virtual environment that has its own process and network space. LXC relies on the Linux kernel cgroups functionality that became available in version 2.6.24, developed as part of LXC. … It is used by Heroku to provide separation between their “dynos.”
I use a Mac, so I’m running these under Virtualbox. I move around between a number of different networks, so each server container had to have a no-hassle network connection. I’m also impatient, so I really needed to be able to clone these in seconds and have them ready to use.
This is a guide for creating an Ubuntu Linux virtual machine under Virtualbox to host individual containers with simple two-way network connectivity. You’ll be able to clone a container with a single command, and connect to it using a simple <container>.local host name.

The Linux Host

First, download an Ubuntu ISO. I try to stick to the long-term support releases, so I’m using Ubuntu 12.04 here. Get a copy of Virtualbox, also free.
Create a new Virtualbox virtual machine to boot from the Ubuntu installation ISO. For a root volume, I selected the VDI format with a size of 32GB. The disk image will expand as it’s allocated, so it won’t take up all that space right away. I manually created three partitions on the volume:
  1. 4.0 GB ext4 primary.
  2. 512 MB swap, matching RAM size. Could use more.
  3. All remaining space btrfs, mounted at /var/lib/lxc.
Btrfs (B-tree file system, pronounced “Butter F S”, “Butterfuss”, “Better F S”, or “B-tree F S") is a GPL-licensed experimental copy-on-write file system. It will allow our cloned containers to occupy only as much disk space as is changed, which will decrease the overall file size of the virtual machine.
During the OS installation process, you’ll need to select a host name. I used “ubuntu-demo” for this demonstration.

Host Linux Networking

Boot into Linux. I started by installing some basics, for me: git, vim, tcsh, screen, htop, and etckeeper.
Set up /etc/network/interfaces with two bridges for eth0 and eth1, both DHCP. Note that eth0 and eth1 must be commented-out, as in this sample part of my /etc/network/interfaces:
## The primary network interface
#auto eth0
#iface eth0 inet dhcp

auto br0
iface br0 inet dhcp
        dns-nameservers 8.8.8.8
        bridge_ports eth0
        bridge_fd 0
        bridge_maxwait 0

auto br1
iface br1 inet dhcp
        bridge_ports eth1
        bridge_fd 0
        bridge_maxwait 0
Back in Virtualbox preferencese, create a new network adapter and call it “vboxnet0”. My settings are 10.1.0.1, 255.255.255.0, with DHCP turned on.


Shut down the Linux host, and add the secondary interface in Virtual box. Choose host-only networking, the vboxnet0 adapter, and “Allow All” promiscuous mode so that the containers can see inbound network traffic.

The primary interface will be NAT by default, which will carry normal out-bound internet traffic.
  1. Adapter 1: NAT (default)
  2. Adapter 2: Host-Only vboxnet0
Start up the Linux host again, and you should now be able to ping the outside world.
% ping 8.8.8.8

PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_req=1 ttl=63 time=340 ms
…
Use ifconfig to find your Linux IP address (mine is 10.1.0.2), and try ssh’ing to that address from your Mac command line with the username you chose during initial Ubuntu installation.
% ifconfig br1

br1       Link encap:Ethernet  HWaddr 08:00:27:94:df:ed  
          inet addr:10.1.0.2  Bcast:10.1.0.255  Mask:255.255.255.0
          inet6 addr: …
Next, we’ll set up Avahi to broadcast host names so we don’t need to remember DHCP-assigned IP addresses. On the Linux host, install avahi-daemon:
% apt-get install avahi-daemon
In the configuration file /etc/avahi/avahi-daemon.conf, change these lines to clarify that our host names need only work on the second, host-only network adapter:
allow-interfaces=br1,eth1
deny-interfaces=br0,eth0,lxcbr0
Then restart Avahi.
% sudo service avahi-daemon restart
Now, you should be able to ping and ssh to ubuntu-demo.local from within the virtual machine and your Mac command line.

No Guest Containers

So far, we have a Linux virtual machine with a reliable two-way network connection that’s resilient to external network failures, available via a meaningful host name, and with a slightly funny disk setup. You could stop here, skipping the LXC steps and use Virtualbox’s built-in cloning functionality or something like Vagrant to set up fresh development environments. I’m going to keep going and set up LXC.

Linux Guest Containers

Install LXC.
% sudo apt-get lxc
Initial LXC setup uses templates, and on Ubuntu there are several useful ones that come with the package. You can find them under /usr/lib/lxc/templates; I have templates for ubuntu, fedora, debian, opensuse, and other popular Linux distributions. To create a new container called “base” use lxc-create with a chosen template.
% sudo lxc-create -n base -t ubuntu
This takes a few minutes, because it needs retrieve a bunch of packages for a minimal Ubuntu system. You’ll see this message at some point:
##
# The default user is 'ubuntu' with password 'ubuntu'!
# Use the 'sudo' command to run tasks as root in the container.
##
Without starting the container, modify its network adapters to match the two we set up earlier. Edit the top of /var/lib/lxc/base/config to look something like this:
lxc.network.type=veth
lxc.network.link=br0
lxc.network.flags=up
lxc.network.hwaddr = 00:16:3e:c2:9d:71

lxc.network.type=veth
lxc.network.link=br1
lxc.network.flags=up
lxc.network.hwaddr = 00:16:3e:c2:9d:72
An initial MAC address will be randomly generated for you under lxc.network.hwaddr, just make sure that the second one is different.
Modify the container’s network interfaces by editing /var/lib/lxc/base/rootfs/etc/network/interfaces (/var/lib/lxc/base/rootfs is the root filesystem of the new container) to look like this:
auto eth0
iface eth0 inet dhcp
        dns-nameservers 8.8.8.8

auto eth1
iface eth1 inet dhcp
Now your container knows about two network adapters, and they have been bridged to the Linux host OS virtual machine NAT and host-only adapters. Start your new container:
% sudo lxc-start -n base
You’ll see a normal Linux login screen at first, use the default username and password “ubuntu” and “ubuntu” from above. The system starts out with minimal packages. Install a few so you can get around, and include language-pack-en so you don’t get a bunch of annoying character set warnings:
% sudo apt-get install language-pack-en
% sudo apt-get install git vim tcsh screen htop etckeeper
% sudo apt-get install avahi-daemon
Make a similar change to the /etc/avahi/avahi-daemon.conf as above:
allow-interfaces=eth1
deny-interfaces=eth0
Shut down to return to the Linux host OS.
% sudo shutdown -h now
Now, restart the container with all the above modifications, in daemon mode.
% sudo lxc-start -d -n base
After it’s started up, you should be able to ping and ssh to base.local from your Linux host OS and your Mac.
% ssh ubuntu@base.local

Cloning a Container

Finally, we will clone the base container. If you’re curious about the effects of Btrfs, check the overall disk usage of the /var/lib/lxc volume where the containers are stored:
% df -h /var/lib/lxc

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        28G  572M   26G   3% /var/lib/lxc
Clone the base container to a new one, called “clone”.
% sudo lxc-clone  -o base -n clone
Look at the disk usage again, and you will see that it’s not grown by much.
% df -h /var/lib/lxc

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        28G  573M   26G   3% /var/lib/lxc
If you actually look at the disk usage of the individual container directories, you’ll see that Btrfs is allowing 1.1GB of files to live in just 573MB of space, representing the repeating base files between the two containers.
% sudo du -sch /var/lib/lxc/*

560M /var/lib/lxc/base
560M /var/lib/lxc/clone
1.1G total
You can now start the new clone container, connect to it and begin making changes.
% sudo lxc-start -d -n clone
% ssh ubuntu@clone.local

Conclusion

I have been using this setup for the past few weeks, currently with a half-dozen containers that I use for a variety of jobs: testing TileStache, installing Rails applications with RVM, serving Postgres data, and checking out new packages. One drawback that I have encountered is that as the disk image grows, my nightly time machine backups grow considerably. The Mac host OS can only see the Linux disk image as a single file.
On the other hand, having ready access to a variety of local Linux environments has been a boon to my ability to quickly try out ideas. Special thanks again to Seth for helping me work through some of the networking ugliness.

Further Reading

Tao of Mac has an article on a similar, but slightly different Virtualbox and LXC setup. They don’t include the promiscuous mode setting for the second network adapter, which I think is why they advise using Avahi and port forwarding to connect to the machine. I believe my way here might be easier.
Shift describes a Vagrant and LXC setup that skips Avahi and uses a plain hostnames for internal connectivity.

The Owner of this post is Michal Migurski
Find is Blog here http://mike.teczno.com/notes/disposable-virtualbox-lxc-environments.html 

Monday 19 August 2013

How To Install VMWare Tools v4 on Ubuntu 12.04 LTS Server



How To Install VMWare Tools v4 on Ubuntu 12.04 LTS Server and 12.10 Server

Written: March 13, 2012
Originally posted by: Justin Schier
Last Updated: October 24, 2012
Tested With: Ubuntu 12.10 Server, Ubuntu 12.04 LTS Server, Ubuntu 12.04.1 LTS Server, Ubuntu 11.10 Server

All the guides I found on the Internet, including VMWare’s website were outdated in some way, so I decided to write a guide of my own. I just went through these steps from start to finish on a fresh server and had no problems. In about 5 minutes, you will be able to install VMWare Tools on Ubuntu Server.
  1. Use Install VMWare Tools option in VMWare Client to attach media
    ubuntu vmware tools install 12.10 
  2. Update the server
  3. Create the mount point
  4. Mount the ISO

    You should see the message: mount: block device /dev/sr0 is write-protected, mounting read-only
  5. Change Directory
  6. Copy the tar file to your /tmp directory
  7. Install Build tools if necessary
  8. Change Directory
  9. Unmount the ISO
  10. Expand the tar
  11. Change Directory
  12. To prevent a potential error in the install script on Ubuntu 11.10+, create a special directory
    Unable to create symlink “/usr/lib64/libvmcf.so” pointing to file ”/usr/lib/vmware-tools/lib64/libvmcf.so/libvmcf.so”.
  13. Run the Install Script. The -d flag automatically answers the default to all questions. To customize it, just omit the -d.
  14. Reboot
Let me know if this worked for you!
Also, please follow me on Twitter: @justinschier

This is "How to do Computing" for everyday usage ...

Tuesday 30 July 2013

Issues with VMware 8 wont run Kernel 3.8 wont let VMware 8 & 9 work



When I try to launch VMware workstation, I get the following error:
Before you can run VMware, several modules must be compiled and loaded into the kernel CANCEL / INSTALL

No errors, when I select INSTALL nothing happens just closes.
I install manually:
sudo apt-get install open-vm-tools open-vm-tools-dev open-vm-dkms open-vm-toolbox open-vm-tools-dev
But already installed to the latest versions.
I will start a bounty to fix this.
Ubuntu 13.04 64bit

pst007x@pst007x-Serval-Professional:~$ uname -a
Linux pst007x-Serval-Professional 3.9.0-030900-generic #201304291257 SMP Mon Apr 29 16:58:15 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

I have uninstalled and reinstalled all components, but same problem.
I have tried a different Kernel, but end up with the same problem.

Tried this as suggested: here

#!/bin/bash
cd
cp -prn /usr/lib/vmware/modules/source /usr/lib/vmware/modules/source-backup
mkdir fixed
cd fixed
find /usr/lib/vmware/modules/source -name "*.tar" -exec tar xf '{}' \;

## add missing header on kernels
sed -i '/#include "compat_wait.h"/a\#include "compat_sched.h"' vmnet-only/vnetUserListener.c
sed -i '/#include "compat_page.h"/a\#include "compat_sched.h"' vmci-only/include/pgtbl.h
## comment out an invalid definition
sed -i 's|\(extern void poll_initwait(compat_poll_wqueues \*);\)|//\1|' *-only/include/compat_wait.h

tar cf vmblock.tar vmblock-only
tar cf vmci.tar vmci-only
tar cf vmmon.tar vmmon-only
tar cf vmnet.tar vmnet-only
tar cf vmppuser.tar vmppuser-only
tar cf vsock.tar vsock-only

cp -p *.tar /usr/lib/vmware/modules/source

cd /lib/modules/`uname -r`/build/include/linux
ln -s ../generated/autoconf.h
ln -s ../generated/utsrelease.h
cd

vmware-modconfig --console --install-all

# clean up
cd
rm -rf fixed
cd /lib/modules/`uname -r`/build/include/linux
rm autoconf.h utsrelease.h
cd /usr/lib/vmware/modules/
rm -rf source-backup
cd

Didn't work, results of script in terminal:

pst007x@pst007x-Serval-Professional:~/Desktop$ sudo ./run
[sudo] password for pst007x: 
sed: can't read vmci-only/include/pgtbl.h: No such file or directory
sed: can't read *-only/include/compat_wait.h: No such file or directory
tar: vmppuser-only: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors
ln: failed to create symbolic link ‘./autoconf.h’: File exists
ln: failed to create symbolic link ‘./utsrelease.h’: 

File exists
Stopping VMware services:
   VMware Authentication Daemon                                        done
   VM communication interface socket family                            done
   Virtual machine communication interface                             done
   Virtual machine monitor                                             done
   Blocking file system                                                done
Using 2.6.x kernel build system.

make: Entering directory `/tmp/modconfig-tGleah/vmmon-only'
/usr/bin/make -C /lib/modules/3.9.0-030900-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
      MODULEBUILDDIR= modules
make[1]: Entering directory `/usr/src/linux-headers-3.9.0-030900-generic'
  CC [M]  /tmp/modconfig-tGleah/vmmon-only/linux/driver.o
  CC [M]  /tmp/modconfig-tGleah/vmmon-only/linux/driverLog.o
  CC [M]  /tmp/modconfig-tGleah/vmmon-only/linux/hostif.o
  CC [M]  /tmp/modconfig-tGleah/vmmon-only/common/apic.o
  CC [M]  /tmp/modconfig-tGleah/vmmon-only/common/comport.o
  CC [M]  /tmp/modconfig-tGleah/vmmon-only/common/cpuid.o
  CC [M]  /tmp/modconfig-tGleah/vmmon-only/common/hashFunc.o
  CC [M]  /tmp/modconfig-tGleah/vmmon-only/common/memtrack.o
  CC [M]  /tmp/modconfig-tGleah/vmmon-only/common/phystrack.o
  CC [M]  /tmp/modconfig-tGleah/vmmon-only/common/task.o
  CC [M]  /tmp/modconfig-tGleah/vmmon-only/common/vmx86.o
  CC [M]  /tmp/modconfig-tGleah/vmmon-only/vmcore/moduleloop.o
  LD [M]  /tmp/modconfig-tGleah/vmmon-only/vmmon.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /tmp/modconfig-tGleah/vmmon-only/vmmon.mod.o
  LD [M]  /tmp/modconfig-tGleah/vmmon-only/vmmon.ko
make[1]: Leaving directory `/usr/src/linux-headers-3.9.0-030900-generic'
/usr/bin/make -C $PWD SRCROOT=$PWD/. \
      MODULEBUILDDIR= postbuild
make[1]: Entering directory `/tmp/modconfig-tGleah/vmmon-only'
make[1]: `postbuild' is up to date.
make[1]: Leaving directory `/tmp/modconfig-tGleah/vmmon-only'
cp -f vmmon.ko ./../vmmon.o
make: Leaving directory `/tmp/modconfig-tGleah/vmmon-only'
Using 2.6.x kernel build system.
make: Entering directory `/tmp/modconfig-tGleah/vmnet-only'
/usr/bin/make -C /lib/modules/3.9.0-030900-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
      MODULEBUILDDIR= modules
make[1]: Entering directory `/usr/src/linux-headers-3.9.0-030900-generic'
  CC [M]  /tmp/modconfig-tGleah/vmnet-only/driver.o
  CC [M]  /tmp/modconfig-tGleah/vmnet-only/hub.o
  CC [M]  /tmp/modconfig-tGleah/vmnet-only/userif.o
  CC [M]  /tmp/modconfig-tGleah/vmnet-only/netif.o
  CC [M]  /tmp/modconfig-tGleah/vmnet-only/bridge.o
  CC [M]  /tmp/modconfig-tGleah/vmnet-only/filter.o
  CC [M]  /tmp/modconfig-tGleah/vmnet-only/procfs.o
  CC [M]  /tmp/modconfig-tGleah/vmnet-only/smac_compat.o
  CC [M]  /tmp/modconfig-tGleah/vmnet-only/smac.o
  CC [M]  /tmp/modconfig-tGleah/vmnet-only/vnetEvent.o
  CC [M]  /tmp/modconfig-tGleah/vmnet-only/vnetUserListener.o
  LD [M]  /tmp/modconfig-tGleah/vmnet-only/vmnet.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /tmp/modconfig-tGleah/vmnet-only/vmnet.mod.o
  LD [M]  /tmp/modconfig-tGleah/vmnet-only/vmnet.ko
make[1]: Leaving directory `/usr/src/linux-headers-3.9.0-030900-generic'
/usr/bin/make -C $PWD SRCROOT=$PWD/. \
      MODULEBUILDDIR= postbuild
make[1]: Entering directory `/tmp/modconfig-tGleah/vmnet-only'
make[1]: `postbuild' is up to date.
make[1]: Leaving directory `/tmp/modconfig-tGleah/vmnet-only'
cp -f vmnet.ko ./../vmnet.o
make: Leaving directory `/tmp/modconfig-tGleah/vmnet-only'
Using 2.6.x kernel build system.
make: Entering directory `/tmp/modconfig-tGleah/vmblock-only'
/usr/bin/make -C /lib/modules/3.9.0-030900-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
      MODULEBUILDDIR= modules
make[1]: Entering directory `/usr/src/linux-headers-3.9.0-030900-generic'
  CC [M]  /tmp/modconfig-tGleah/vmblock-only/linux/block.o
  CC [M]  /tmp/modconfig-tGleah/vmblock-only/linux/control.o
  CC [M]  /tmp/modconfig-tGleah/vmblock-only/linux/dentry.o
  CC [M]  /tmp/modconfig-tGleah/vmblock-only/linux/file.o
  CC [M]  /tmp/modconfig-tGleah/vmblock-only/linux/filesystem.o
  CC [M]  /tmp/modconfig-tGleah/vmblock-only/linux/inode.o
  CC [M]  /tmp/modconfig-tGleah/vmblock-only/linux/module.o
  CC [M]  /tmp/modconfig-tGleah/vmblock-only/linux/stubs.o
/tmp/modconfig-tGleah/vmblock-only/linux/dentry.c:38:4: warning: initialisation from incompatible pointer type [enabled by default]
/tmp/modconfig-tGleah/vmblock-only/linux/dentry.c:38:4: warning: (near initialisation for ‘LinkDentryOps.d_revalidate’) [enabled by default]
/tmp/modconfig-tGleah/vmblock-only/linux/dentry.c: In function ‘DentryOpRevalidate’:
/tmp/modconfig-tGleah/vmblock-only/linux/dentry.c:104:7: warning: passing argument 2 of ‘actualDentry->d_op->d_revalidate’ makes integer from pointer without a cast [enabled by default]
/tmp/modconfig-tGleah/vmblock-only/linux/dentry.c:104:7: note: expected ‘unsigned int’ but argument is of type ‘struct nameidata *’
  CC [M]  /tmp/modconfig-tGleah/vmblock-only/linux/super.o
/tmp/modconfig-tGleah/vmblock-only/linux/control.c: In function ‘ExecuteBlockOp’:
/tmp/modconfig-tGleah/vmblock-only/linux/control.c:285:9: warning: assignment from incompatible pointer type [enabled by default]
/tmp/modconfig-tGleah/vmblock-only/linux/control.c:296:4: warning: passing argument 1 of ‘putname’ from incompatible pointer type [enabled by default]
In file included from include/linux/proc_fs.h:5:0,
                 from /tmp/modconfig-tGleah/vmblock-only/linux/control.c:28:
include/linux/fs.h:2040:13: note: expected ‘struct filename *’ but argument is of type ‘char *’
/tmp/modconfig-tGleah/vmblock-only/linux/inode.c:49:4: warning: initialisation from incompatible pointer type [enabled by default]
/tmp/modconfig-tGleah/vmblock-only/linux/inode.c:49:4: warning: (near initialisation for ‘RootInodeOps.lookup’) [enabled by default]
  LD [M]  /tmp/modconfig-tGleah/vmblock-only/vmblock.o
  Building modules, stage 2.
  MODPOST 1 modules
WARNING: "putname" [/tmp/modconfig-tGleah/vmblock-only/vmblock.ko] undefined!
  CC      /tmp/modconfig-tGleah/vmblock-only/vmblock.mod.o
  LD [M]  /tmp/modconfig-tGleah/vmblock-only/vmblock.ko
make[1]: Leaving directory `/usr/src/linux-headers-3.9.0-030900-generic'
/usr/bin/make -C $PWD SRCROOT=$PWD/. \
      MODULEBUILDDIR= postbuild
make[1]: Entering directory `/tmp/modconfig-tGleah/vmblock-only'
make[1]: `postbuild' is up to date.
make[1]: Leaving directory `/tmp/modconfig-tGleah/vmblock-only'
cp -f vmblock.ko ./../vmblock.o
make: Leaving directory `/tmp/modconfig-tGleah/vmblock-only'
Using 2.6.x kernel build system.
make: Entering directory `/tmp/modconfig-tGleah/vmci-only'
/usr/bin/make -C /lib/modules/3.9.0-030900-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
      MODULEBUILDDIR= modules
make[1]: Entering directory `/usr/src/linux-headers-3.9.0-030900-generic'
  CC [M]  /tmp/modconfig-tGleah/vmci-only/linux/driver.o
  CC [M]  /tmp/modconfig-tGleah/vmci-only/linux/vmciKernelIf.o
  CC [M]  /tmp/modconfig-tGleah/vmci-only/common/vmciContext.o
  CC [M]  /tmp/modconfig-tGleah/vmci-only/common/vmciDoorbell.o
  CC [M]  /tmp/modconfig-tGleah/vmci-only/common/vmciDriver.o
  CC [M]  /tmp/modconfig-tGleah/vmci-only/common/vmciDatagram.o
  CC [M]  /tmp/modconfig-tGleah/vmci-only/common/vmciEvent.o
  CC [M]  /tmp/modconfig-tGleah/vmci-only/common/vmciHashtable.o
/tmp/modconfig-tGleah/vmci-only/linux/driver.c:127:4: error: implicit declaration of function ‘__devexit_p’ [-Werror=implicit-function-declaration]
/tmp/modconfig-tGleah/vmci-only/linux/driver.c:127:4: error: initialiser element is not constant
/tmp/modconfig-tGleah/vmci-only/linux/driver.c:127:4: error: (near initialisation for ‘vmci_driver.remove’)
/tmp/modconfig-tGleah/vmci-only/linux/driver.c:1754:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘vmci_probe_device’
/tmp/modconfig-tGleah/vmci-only/linux/driver.c:1982:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘vmci_remove_device’
/tmp/modconfig-tGleah/vmci-only/linux/driver.c:119:12: warning: ‘vmci_probe_device’ used but never defined [enabled by default]
/tmp/modconfig-tGleah/vmci-only/linux/driver.c:121:13: warning: ‘vmci_remove_device’ used but never defined [enabled by default]
/tmp/modconfig-tGleah/vmci-only/linux/driver.c:2063:1: warning: ‘vmci_interrupt’ defined but not used [-Wunused-function]
/tmp/modconfig-tGleah/vmci-only/linux/driver.c:2137:1: warning: ‘vmci_interrupt_bm’ defined but not used [-Wunused-function]
/tmp/modconfig-tGleah/vmci-only/linux/driver.c:1717:1: warning: ‘vmci_enable_msix’ defined but not used [-Wunused-function]
cc1: some warnings being treated as errors
make[2]: *** [/tmp/modconfig-tGleah/vmci-only/linux/driver.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [_module_/tmp/modconfig-tGleah/vmci-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.9.0-030900-generic'
make: *** [vmci.ko] Error 2
make: Leaving directory `/tmp/modconfig-tGleah/vmci-only'
Unable to install all modules.  See log for details.

pst007x@pst007x-Serval-Professional:~/Desktop$ 


Tried as suggested below, but same issue:

pst007x@pst007x-Serval-Professional:~$ sudo vmware-modconfig --console --install-all
[sudo] password for pst007x: 
Stopping VMware services:
   VMware Authentication Daemon                                        done
   VM communication interface socket family                            done
   Virtual machine communication interface                             done
   Virtual machine monitor                                             done
   Blocking file system                                                done
Using 2.6.x kernel build system.
make: Entering directory `/tmp/modconfig-IFjtiM/vmmon-only'
/usr/bin/make -C /lib/modules/3.9.0-030900-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
      MODULEBUILDDIR= modules
make[1]: Entering directory `/usr/src/linux-headers-3.9.0-030900-generic'
  CC [M]  /tmp/modconfig-IFjtiM/vmmon-only/linux/driver.o
  CC [M]  /tmp/modconfig-IFjtiM/vmmon-only/linux/driverLog.o
  CC [M]  /tmp/modconfig-IFjtiM/vmmon-only/linux/hostif.o
  CC [M]  /tmp/modconfig-IFjtiM/vmmon-only/common/apic.o
  CC [M]  /tmp/modconfig-IFjtiM/vmmon-only/common/comport.o
  CC [M]  /tmp/modconfig-IFjtiM/vmmon-only/common/cpuid.o
  CC [M]  /tmp/modconfig-IFjtiM/vmmon-only/common/hashFunc.o
  CC [M]  /tmp/modconfig-IFjtiM/vmmon-only/common/memtrack.o
  CC [M]  /tmp/modconfig-IFjtiM/vmmon-only/common/phystrack.o
  CC [M]  /tmp/modconfig-IFjtiM/vmmon-only/common/task.o
  CC [M]  /tmp/modconfig-IFjtiM/vmmon-only/common/vmx86.o
  CC [M]  /tmp/modconfig-IFjtiM/vmmon-only/vmcore/moduleloop.o
  LD [M]  /tmp/modconfig-IFjtiM/vmmon-only/vmmon.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /tmp/modconfig-IFjtiM/vmmon-only/vmmon.mod.o
  LD [M]  /tmp/modconfig-IFjtiM/vmmon-only/vmmon.ko
make[1]: Leaving directory `/usr/src/linux-headers-3.9.0-030900-generic'
/usr/bin/make -C $PWD SRCROOT=$PWD/. \
      MODULEBUILDDIR= postbuild
make[1]: Entering directory `/tmp/modconfig-IFjtiM/vmmon-only'
make[1]: `postbuild' is up to date.
make[1]: Leaving directory `/tmp/modconfig-IFjtiM/vmmon-only'
cp -f vmmon.ko ./../vmmon.o
make: Leaving directory `/tmp/modconfig-IFjtiM/vmmon-only'
Using 2.6.x kernel build system.
make: Entering directory `/tmp/modconfig-IFjtiM/vmnet-only'
/usr/bin/make -C /lib/modules/3.9.0-030900-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
      MODULEBUILDDIR= modules
make[1]: Entering directory `/usr/src/linux-headers-3.9.0-030900-generic'
  CC [M]  /tmp/modconfig-IFjtiM/vmnet-only/driver.o
  CC [M]  /tmp/modconfig-IFjtiM/vmnet-only/hub.o
  CC [M]  /tmp/modconfig-IFjtiM/vmnet-only/userif.o
  CC [M]  /tmp/modconfig-IFjtiM/vmnet-only/netif.o
  CC [M]  /tmp/modconfig-IFjtiM/vmnet-only/bridge.o
  CC [M]  /tmp/modconfig-IFjtiM/vmnet-only/filter.o
  CC [M]  /tmp/modconfig-IFjtiM/vmnet-only/procfs.o
  CC [M]  /tmp/modconfig-IFjtiM/vmnet-only/smac_compat.o
  CC [M]  /tmp/modconfig-IFjtiM/vmnet-only/smac.o
  CC [M]  /tmp/modconfig-IFjtiM/vmnet-only/vnetEvent.o
  CC [M]  /tmp/modconfig-IFjtiM/vmnet-only/vnetUserListener.o
  LD [M]  /tmp/modconfig-IFjtiM/vmnet-only/vmnet.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /tmp/modconfig-IFjtiM/vmnet-only/vmnet.mod.o
  LD [M]  /tmp/modconfig-IFjtiM/vmnet-only/vmnet.ko
make[1]: Leaving directory `/usr/src/linux-headers-3.9.0-030900-generic'
/usr/bin/make -C $PWD SRCROOT=$PWD/. \
      MODULEBUILDDIR= postbuild
make[1]: Entering directory `/tmp/modconfig-IFjtiM/vmnet-only'
make[1]: `postbuild' is up to date.
make[1]: Leaving directory `/tmp/modconfig-IFjtiM/vmnet-only'
cp -f vmnet.ko ./../vmnet.o
make: Leaving directory `/tmp/modconfig-IFjtiM/vmnet-only'
Using 2.6.x kernel build system.
make: Entering directory `/tmp/modconfig-IFjtiM/vmblock-only'
/usr/bin/make -C /lib/modules/3.9.0-030900-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
      MODULEBUILDDIR= modules
make[1]: Entering directory `/usr/src/linux-headers-3.9.0-030900-generic'
  CC [M]  /tmp/modconfig-IFjtiM/vmblock-only/linux/block.o
  CC [M]  /tmp/modconfig-IFjtiM/vmblock-only/linux/control.o
  CC [M]  /tmp/modconfig-IFjtiM/vmblock-only/linux/dentry.o
  CC [M]  /tmp/modconfig-IFjtiM/vmblock-only/linux/file.o
  CC [M]  /tmp/modconfig-IFjtiM/vmblock-only/linux/filesystem.o
  CC [M]  /tmp/modconfig-IFjtiM/vmblock-only/linux/inode.o
  CC [M]  /tmp/modconfig-IFjtiM/vmblock-only/linux/module.o
  CC [M]  /tmp/modconfig-IFjtiM/vmblock-only/linux/stubs.o
/tmp/modconfig-IFjtiM/vmblock-only/linux/control.c: In function ‘ExecuteBlockOp’:
/tmp/modconfig-IFjtiM/vmblock-only/linux/control.c:285:9: warning: assignment from incompatible pointer type [enabled by default]
/tmp/modconfig-IFjtiM/vmblock-only/linux/control.c:296:4: warning: passing argument 1 of ‘putname’ from incompatible pointer type [enabled by default]
In file included from include/linux/proc_fs.h:5:0,
                 from /tmp/modconfig-IFjtiM/vmblock-only/linux/control.c:28:
include/linux/fs.h:2040:13: note: expected ‘struct filename *’ but argument is of type ‘char *’
/tmp/modconfig-IFjtiM/vmblock-only/linux/dentry.c:38:4: warning: initialisation from incompatible pointer type [enabled by default]
/tmp/modconfig-IFjtiM/vmblock-only/linux/dentry.c:38:4: warning: (near initialisation for ‘LinkDentryOps.d_revalidate’) [enabled by default]
/tmp/modconfig-IFjtiM/vmblock-only/linux/dentry.c: In function ‘DentryOpRevalidate’:
/tmp/modconfig-IFjtiM/vmblock-only/linux/dentry.c:104:7: warning: passing argument 2 of ‘actualDentry->d_op->d_revalidate’ makes integer from pointer without a cast [enabled by default]
/tmp/modconfig-IFjtiM/vmblock-only/linux/dentry.c:104:7: note: expected ‘unsigned int’ but argument is of type ‘struct nameidata *’
/tmp/modconfig-IFjtiM/vmblock-only/linux/inode.c:49:4: warning: initialisation from incompatible pointer type [enabled by default]
/tmp/modconfig-IFjtiM/vmblock-only/linux/inode.c:49:4: warning: (near initialisation for ‘RootInodeOps.lookup’) [enabled by default]
  CC [M]  /tmp/modconfig-IFjtiM/vmblock-only/linux/super.o
  LD [M]  /tmp/modconfig-IFjtiM/vmblock-only/vmblock.o
  Building modules, stage 2.
  MODPOST 1 modules
WARNING: "putname" [/tmp/modconfig-IFjtiM/vmblock-only/vmblock.ko] undefined!
  CC      /tmp/modconfig-IFjtiM/vmblock-only/vmblock.mod.o
  LD [M]  /tmp/modconfig-IFjtiM/vmblock-only/vmblock.ko
make[1]: Leaving directory `/usr/src/linux-headers-3.9.0-030900-generic'
/usr/bin/make -C $PWD SRCROOT=$PWD/. \
      MODULEBUILDDIR= postbuild
make[1]: Entering directory `/tmp/modconfig-IFjtiM/vmblock-only'
make[1]: `postbuild' is up to date.
make[1]: Leaving directory `/tmp/modconfig-IFjtiM/vmblock-only'
cp -f vmblock.ko ./../vmblock.o
make: Leaving directory `/tmp/modconfig-IFjtiM/vmblock-only'
Using 2.6.x kernel build system.

make: Entering directory `/tmp/modconfig-IFjtiM/vmci-only'
/usr/bin/make -C /lib/modules/3.9.0-030900-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
      MODULEBUILDDIR= modules
make[1]: Entering directory `/usr/src/linux-headers-3.9.0-030900-generic'
  CC [M]  /tmp/modconfig-IFjtiM/vmci-only/linux/driver.o
  CC [M]  /tmp/modconfig-IFjtiM/vmci-only/linux/vmciKernelIf.o
  CC [M]  /tmp/modconfig-IFjtiM/vmci-only/common/vmciContext.o
  CC [M]  /tmp/modconfig-IFjtiM/vmci-only/common/vmciDatagram.o
  CC [M]  /tmp/modconfig-IFjtiM/vmci-only/common/vmciDoorbell.o
  CC [M]  /tmp/modconfig-IFjtiM/vmci-only/common/vmciDriver.o
  CC [M]  /tmp/modconfig-IFjtiM/vmci-only/common/vmciHashtable.o
  CC [M]  /tmp/modconfig-IFjtiM/vmci-only/common/vmciEvent.o
/tmp/modconfig-IFjtiM/vmci-only/linux/driver.c:127:4: error: implicit declaration of function ‘__devexit_p’ [-Werror=implicit-function-declaration]
/tmp/modconfig-IFjtiM/vmci-only/linux/driver.c:127:4: error: initialiser element is not constant
/tmp/modconfig-IFjtiM/vmci-only/linux/driver.c:127:4: error: (near initialisation for ‘vmci_driver.remove’)

/tmp/modconfig-IFjtiM/vmci-only/linux/driver.c:1754:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘vmci_probe_device’
/tmp/modconfig-IFjtiM/vmci-only/linux/driver.c:1982:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘vmci_remove_device’
/tmp/modconfig-IFjtiM/vmci-only/linux/driver.c:119:12: warning: ‘vmci_probe_device’ used but never defined [enabled by default]
/tmp/modconfig-IFjtiM/vmci-only/linux/driver.c:121:13: warning: ‘vmci_remove_device’ used but never defined [enabled by default]
/tmp/modconfig-IFjtiM/vmci-only/linux/driver.c:2063:1: warning: ‘vmci_interrupt’ defined but not used [-Wunused-function]
/tmp/modconfig-IFjtiM/vmci-only/linux/driver.c:2137:1: warning: ‘vmci_interrupt_bm’ defined but not used [-Wunused-function]
/tmp/modconfig-IFjtiM/vmci-only/linux/driver.c:1717:1: warning: ‘vmci_enable_msix’ defined but not used [-Wunused-function]
cc1: some warnings being treated as errors
make[2]: *** [/tmp/modconfig-IFjtiM/vmci-only/linux/driver.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [_module_/tmp/modconfig-IFjtiM/vmci-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.9.0-030900-generic'
make: *** [vmci.ko] Error 2
make: Leaving directory `/tmp/modconfig-IFjtiM/vmci-only'
Unable to install all modules.  See log for details.


pst007x@pst007x-Serval-Professional:~$ sudo apt-get install build-essential
Reading package lists... Done
Building dependency tree       
Reading state information... Done
build-essential is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
pst007x@pst007x-Serval-Professional:~$ 

Friday 21 June 2013

Thursday 4 April 2013

HOW TO Solve issue Nvidia & X.org Server Problems on Linux or BackTrack5


  1. I spent a week trying to resolve the error generated by X.org Server and Nvidia drivers, and I think I've finally solved.
    This is the solution for my Nvidia GT540M & Intel i7-2670QM (ASUS X53SV-SX598V)
    1. Download NVIDIA driver from here: http://www.nvidia.com/object/unix.html.
    I use Linux x86_64/AMD64/EM64T (NVIDIA-Linux-x86_64-285.05.09.run) for my system at 64bit
    2. Install system updates
    Code:
    sudo apt-get update && sudo apt-get upgrade
    3. Install linux-header to the upgraded kernel
    Code:
    sudo apt-get install linux-headers-$(uname -r)
    4. If dkms and build essential haven't been installed
    Code:
    sudo apt-get install dkms build-essential
    5. Open blacklist.conf file to add some lines (I use vi command)
    Code:
    vi /etc/modprobe.d/blacklist.conf
    6. Press i and after others “blacklist” list add this list
    Code:
    blacklist vga16fb
    blacklist nouveau
    blacklist rivafb
    blacklist nvidiafb
    blacklist rivatv
    7. After that, press ESC and type :wq (this write the file)
    8. Make grub.cfg writable
    Code:
    chmod +w /boot/grub/grub.cfg
    9. Open grub.cfg file
    Code:
    vi /boot/grub/grub.cfg
    10. Find text splash text inside the document and add nouveau.modeset=0 text like this
    Code:
    text splash nouveau.modeset=0 vga=791
    11. After that, press ESC and type :wq (this write the file)
    12. Disable writable mode to grub.cfg file
    Code:
    chmod -w /boot/grub/grub.cfg
    13. Update grub.cfg file
    Code:
    update-grub‎
    14. Reboot
    15. Login and don’t write startx
    16. Remove all previous Nvidia drivers
    Code:
    sudo apt-get --purge remove nvidia-*
    17. Remove default drivers
    Code:
    sudo apt-get --purge remove xserver-xorg-video-nouveau
    18. Chmod the nvidia driver file
    Code:
    chmod a+x NVIDIA-Linux-x86_64-285.05.09.run
    19. Run the nvidia driver*
    Code:
    sh ./NVIDIA-Linux-x86_64-285.05.09.run
    *If you use a 64bit system don’t install the OpenGL 32bit
    20. Reboot

    If you have a problem like this:
    Code:
     
    X.Org X Server 1.7.6
    Release Date: 2010-03-17
    X Protocol Version 11, Revision 0
    Build Operating System: Linux 2.6.24-28-server x86_64 Ubuntu
    [...]
    Fatal server error:
    no screens found

    It means that the automatic writing of xorg.conf (nvidia-xconfig command) during installation is not successful., but the driver has been installed correctly.
    To solve this problem just delete the xorg.conf file:

    Code:
    rm /etc/X11/xorg.conf
    When you restart the PC the file xorg.conf file will be created automatically.
    Reebot and type
    Code:
    startx
    I hope it helps

Thursday 21 March 2013

How to Disable Guest Account Login on Ubuntu



By default ubuntu 12.04 comes with guest account.You can disable this account using the following procedure.Guest account is a paswordless account which allow users to get access to Ubuntu machine


Open /etc/lightdm/lightdm.conf file from your terminal using the following command
gksudo gedit /etc/lightdm/lightdm.conf
Add the following line
allow-guest=false
Save and exit the file
After adding the above line you should see similar to the following in lightdm.conf file
[SeatDefaults]
user-session=ubuntu
greeter-session=unity-greeter
allow-guest=false
Finally you have to restart lightdm using the following command from your terminal
sudo restart lightdm
Note:- After executing above command all graphical programs running will be close

Wednesday 23 January 2013

All You Need To Know About Linux Commands



System Info


date – Show the current date and time
cal – Show this month's calendar
uptime – Show current uptime
w – Display who is online
whoami – Who you are logged in as
finger user – Display information about user
uname -a – Show kernel information
cat /proc/cpuinfo – CPU information
cat /proc/meminfo – Memory information
df – Show disk usage
du – Show directory space usage
free – Show memory and swap usage

Keyboard Shortcuts

Enter – Run the command
Up Arrow – Show the previous command
Ctrl + R – Allows you to type a part of the command you're looking for and finds it
Ctrl + Z – Stops the current command, resume with fg in the foreground or bg in the background
Ctrl + C – Halts the current command, cancel the current operation and/or start with a fresh new line
Ctrl + L – Clear the screen

command | less – Allows the scrolling of the bash command window using Shift + Up Arrow and Shift + Down Arrow
!! – Repeats the last command
command  !$ – Repeats the last argument of the previous command
Esc + . (a period) – Insert the last argument of the previous command on the fly, which enables you to edit it before executing the command

Ctrl + A – Return to the start of the command you're typing
Ctrl + E – Go to the end of the command you're typing
Ctrl + U – Cut everything before the cursor to a special clipboard, erases the whole line
Ctrl + K – Cut everything after the cursor to a special clipboard
Ctrl + Y – Paste from the special clipboard that Ctrl + U and Ctrl + K save their data to
Ctrl + T – Swap the two characters before the cursor (you can actually use this to transport a character from the left to the right, try it!)
Ctrl + W – Delete the word / argument left of the cursor in the current line
Ctrl + D – Log out of current session, similar to exit

Learn the Commands

apropos subject – List manual pages for subject
man -k keyword – Display man pages containing keyword
man command – Show the manual for command
man -t man | ps2pdf - > man.pdf  – Make a pdf of a manual page
which command – Show full path name of command
time command – See how long a command takes

whereis app – Show possible locations of app
which app – Show which app will be run by default; it shows the full path

Searching

grep pattern files – Search for pattern in files
grep -r pattern dir – Search recursively for pattern in dir
command | grep pattern – Search for pattern in the output of command
locate file – Find all instances of file
find / -name filename – Starting with the root directory, look for the file called filename
find / -name ”*filename*” – Starting with the root directory, look for the file containing the string 

filename

locate filename – Find a file called filename using the locate command; this assumes you have already used the command updatedb (see next)
updatedb – Create or update the database of files on all file systems attached to the Linux root directory
which filename – Show the subdirectory containing the executable file  called filename
grep TextStringToFind /dir – Starting with the directory called dir, look for and list all files containing TextStringToFind

File Permissions

chmod octal file – Change the permissions of file to octal, which can be found separately for user, group, and world by adding: 4 – read (r), 2 – write (w), 1 – execute (x)
Examples:
chmod 777 – read, write, execute for all
chmod 755 – rwx for owner, rx for group and world
For more options, see man chmod.

File Commands

ls – Directory listing
ls -l – List files in current directory using long format
ls -laC – List all files in current directory in long format and display in columns
ls -F – List files in current directory and indicate the file type
ls -al – Formatted listing with hidden files
cd dir – Change directory to dir
cd – Change to home
mkdir dir – Create a directory dir
pwd – Show current directory

rm name – Remove a file or directory called name
rm -r dir – Delete directory dir
rm -f file – Force remove file
rm -rf dir – Force remove an entire directory dir and all it’s included files and subdirectories (use with extreme caution)

cp file1 file2 – Copy file1 to file2
cp -r dir1 dir2 – Copy dir1 to dir2; create dir2 if it doesn't exist
cp file /home/dirname – Copy the file called filename to the /home/dirname directory

mv file /home/dirname – Move the file called filename to the /home/dirname directory
mv file1 file2 – Rename or move file1 to file2; if file2 is an existing directory, moves file1 into directory file2

ln -s file link – Create symbolic link link to file
touch file – Create or update file
cat > file – Places standard input into file
cat file – Display the file called file

more file – Display the file called file one page at a time, proceed to next page using the spacebar
head file – Output the first 10 lines of file
head -20 file – Display the first 20 lines of the file called file
tail file – Output the last 10 lines of file
tail -20 file – Display the last 20 lines of the file called file
tail -f file – Output the contents of file as it grows, starting with the last 10 lines

Compression

tar cf file.tar files – Create a tar named file.tar containing files
tar xf file.tar – Extract the files from file.tar
tar czf file.tar.gz files – Create a tar with Gzip compression
tar xzf file.tar.gz – Extract a tar using Gzip
tar cjf file.tar.bz2 – Create a tar with Bzip2 compression
tar xjf file.tar.bz2 – Extract a tar using Bzip2
gzip file – Compresses file and renames it to file.gz
gzip -d file.gz – Decompresses file.gz back to file

Printing

/etc/rc.d/init.d/lpd start – Start the print daemon
/etc/rc.d/init.d/lpd stop – Stop the print daemon
/etc/rc.d/init.d/lpd status – Display status of the print daemon
lpq – Display jobs in print queue
lprm – Remove jobs from queue
lpr – Print a file
lpc – Printer control tool
man subject | lpr – Print the manual page called subject as plain text
man -t subject | lpr – Print the manual page called subject as Postscript output
printtool – Start X printer setup interface

Network

ifconfig – List IP addresses for all devices on the local machine
ping host – Ping host and output results
whois domain – Get whois information for domain
dig domain – Get DNS information for domain
dig -x host – Reverse lookup host
wget file – Download file
wget -c file – Continue a stopped download

SSH

ssh user@host – Connect to host as user
ssh -p port user@host – Connect to host on port port as user
ssh-copy-id user@host – Add your key to host for user to enable a keyed or passwordless login

User Administration

adduser accountname – Create a new user call accountname
passwd accountname – Give accountname a new password
su – Log in as superuser from current login
exit – Stop being superuser and revert to normal user

Process Management

ps – Display your currently active processes
top – Display all running processes
kill pid – Kill process id pid
killall proc – Kill all processes named proc (use with extreme caution)
bg – Lists stopped or background jobs; resume a stopped job in the background
fg – Brings the most recent job to foreground
fg n – Brings job n to the foreground

Installation from source

./configure
make
make install
dpkg -i pkg.deb – install a DEB package (Debian / Ubuntu / Linux Mint)
rpm -Uvh pkg.rpm – install a RPM package (Red Hat / Fedora)

Stopping & Starting

shutdown -h now – Shutdown the system now and do not reboot
halt – Stop all processes - same as above
shutdown -r 5 – Shutdown the system in 5 minutes and reboot
shutdown -r now – Shutdown the system now and reboot
reboot – Stop all processes and then reboot - same as above
startx – Start the X system



Recommended reading:

Cheat-Sheets.org – All cheat sheets, round-ups, quick reference cards, quick reference guides and quick reference sheets in one page. The only one you need.

Tutorial: The best tips & tricks for bash, explained – Linux Tutorial Blog / Quality Linux tutorials without clutter

LinuxCommand.org – Learning the shell, Writing shell scripts, Script library, SuperMan pages, Who, What, Where, Why

LinuxManPages.com – General commands, System calls, Subroutines, Special files, File formats, Games, Macros and conventions, Maintenence commands, Most Popular Man Pages

Linux Newbie Guide: Shorcuts and Commands - Linux essential shortcuts and sanity commands; Common Linux commands - system info; Basic operations, network apps, file (de)compression; Process control; Basic administration commands, accessing drives/partitions; Network administration tools, music-related commands, graphics-related commands.


How to Hide and Unhide Hard Disk Volumes Using CMD on Windows 10 and Windows 11

I'd be glad to create a step-by-step guide on hiding and unhiding hard disk volumes using CMD commands for Windows 10 and 11 , incorpor...