Ubuntu

Use lspci tells me my VGA Memory Usage

“Drugs are a waste of time. They destroy your memory and your self-respect and everything that goes along with with your self-esteem. They’re no good at all.” – Kurt Cobain

Sitting here playing around with some cli I wanted to know how much memory my VGA card was using so to find out I did the following by typing:

root@websvr:~# lspci |grep “VGA

My results was the following
00:0f.0 VGA compatible controller: VMware SVGA II Adapter

I then typed the following lspci command to give me more details:

root@websvr:~# lspci -v -s 00:0f.0 |grep “Memory
Memory at d8000000 (32-bit, prefetchable) [size=64M]
Memory at d0800000 (32-bit, non-prefetchable) [size=8M]

And there I have it. I’m using 64M of memory.

–more info–

lspci is a command on Unix-like operating systems that prints detailed information about all PCI buses and devices in the system. It is based on a common portable library libpci which offers access to the PCI configuration space on a variety of operating systems.

Installing Open-VM Tools on Ubuntu Server

I have been using Ubuntu Server to host many of my projects here at home; everything from my media servers, testing systems and web/blog site. I have install the VMware tools in the past and ran into issues or just found them to break. At best I just need the minimal the tools offer, and this is where the opensource tools play a good substitution. Best of all, they are supported by VMware.

So all you need to do is use apt-get and your done. Here are my steps.

The “–no-install-recommends” disables the selection of all the X components; We wouldn’t want a desktop environment to be installed.

What are some of the things provideded with this? Well this package provides the vmxnet hardware, as well as the majority of the other VMware Tools functionality (Shutdown, Restart etc).

Enable root in Ubunut

Annoyed with using sudo, and su -i to elevate yourself to root to do things. I was so I just typed sudo passwd and set a new password and now I can log-on as root.

Cool Huh?

Boot Live Ubuntu CD/USB to Memory

I have been wanting to do this for the longest time. And for the first time I got it working with the simplest of ways. This is what I did, and what you can do.

Place your CD or USB into computer and start booting it.  Press F6 and then put “toram” (no quotes) into the boot parameters just before the “–“.

Once you are at the desktop you can remove the CD or USB Media.

Enjoy!

PS3 Media Server – Simplified

Hello Friends

This time around I will provide some details on setting up the PS3 Media Server software on your Linux/Ubuntu install. This time the steps have been simplified. So please follow my steps and you should be up and running in no time at all.

Step 1. – Install Ubuntu Server or Desktop (I prefer using server)

I first started with a fresh clean install of Ubuntu Server (Ubuntu 12.04 LTS). After the server was installed I set my network address to something static.

Step 2. – Installation of base software requirements
Find your way to a command line and follow the steps below

sudo apt-get update
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:happy-neko/ps3mediaserver
sudo apt-get update
sudo apt-get install ps3mediaserver

I normally have no need for the sudo command as I run my install from the root user account. Enable this account by typing sudo passwd and set a password; at this point you will be able to log on as root.

At this point your PS3 Media Server is installed. You now need to configure the software so that it know the location of your media files.

Step 3. – Configuration – Configuration options for PS3 Media Server

Logged in as the root user you will need to edit your PMS.conf file which is located here: /root/.config/ps3mediaserver/
Using the nano command: nano .config/ps3mediaserver/PMS.conf I open the configuration to set options such as the location of my media files.

There are many options that you can set, and that is based on your preference. If you need help feel free to reach out to me with any questions and I’ll do my best to assist.

Step 4. – Starting your PS3 Media Server

You can restart the service by issuing the following command: /etc/init.d/ps3mediaserver restart

Or you can reboot your server.  Oh your PS3 game console under video you should see your new PS3 Media Server in the list.  If all has been configured correctly you should be able to access your media.

— extended info —

My media is located on a file server here at home. I use the smbmount command to mount my storage. However doing this each time I restart my media server is a pain so I do the following:

First you need to have the smbmount tool installed. Type apt-get install smbfs to install this. Now that we have the tool installed you need to create a location on your system where you media will live. I suggest using /media/video for video /media/music for audio. The location and preference is up to you.

Now that the above is completed I change directory to /etc/init.d/ . I then create a new file that will be used as a start up script when my server boots.
Here is my setup steps:

cd etc/init.d/
nano ps3media – edit this file with something such as this:

#!/bin/bash
smbmount //server/video/ /media/video/ -o user=user,pass=password
exit

chmod + x ps3media – we are making the script executable
update-rc.d ps3media defaults – telling the system to run this script

*reboot* to test your setup

 — My Systems Requirements —

Ubuntu Server (Ubuntu 12.04 LTS)
2 CPU (1.8 GHz) — Single CPU or Dual Core
512MB to 1GB of RAM — 512MB is fine in most cases
8 GB Hard Drive — You can get away with 4GB if you like

Ubuntu: My day-to-day Linux commands

And now a bit of the day-to-day Linux commands I use in Ubuntu 

ls -l
This the most common command that all *nix users use to show the file(s) in list format.

rm -rf <filename(s)>
To delete a file, use this command. Be careful, no retrieval will help you to get your file.

/etc/init.d/networking restart
I use to do this just to restart my networking everytime I make some changes on /etc/network/interfaces or just to restart ethernet to get a new IP from DHCP server.

ping <hostname>
To make sure that you’re connected to the internet, use this command to test your connection to <hostname>. Example:

~# 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=251 time=14.4 ms
64 bytes from 8.8.8.8: icmp_req=2 ttl=251 time=14.9 ms
64 bytes from 8.8.8.8: icmp_req=3 ttl=251 time=15.4 ms
64 bytes from 8.8.8.8: icmp_req=4 ttl=251 time=17.7 ms

— 8.8.8.8 ping statistics —
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 14.487/15.655/17.796/1.280 ms

cat <filename>
To show the content of <filename>

dpkg-reconfigure <package_name>
Debian uses this command to configure some packages configuration.

apt-get install <package_name>

apt-get update && apt-get upgrade

To make sure you have the latest package list, use the command apt-get update and to upgrade your package to the latest version use command apt-get upgrade or you can just use both command in one single line.

apt-get remove <package>
To uninstall package, use the above command.

dpkg -P <package>
Sometime some configuration file(s) are not completely removed. Use this command to clean all the file(s) related to the package

dpkg -l | grep <>
To see what kind of package(s) is or are installed use the command

dpkg -l or if you need to know whether you have installed package X or not you can simply use dpkg -l | grep X

grep <word> <filename>
If you need to know whether in <filename> contains this <word> you can use this command.

:> <filename>
To empty or erase the content of <filename>

locate <filename>
This is for finding <filename> using file list database.

du -h
If you can’t see how big the size of your directory is using ls -l, use this command.

df -h
This is to list the mounted partition available on your computer.

traceroute <hostname|fqdn>
To check how ‘far’ your computer from <hostname|fqdn>

I have moved to Lighttpd

Looking for something with less weight I moved jermsmit.com over to Lighttpd. While not necessarily needed, I also rebuilt my server using the Ubuntu minimal install disk. By doing this I was able to cut out many things from the standard Ubuntu Server install and give me only want I need to run and host this site.  I am happy so far with the end results.

I will have a write up soon, so check back later

– jermal

How to remove an audio track from an mp4 video file

I recorded a mp4 video file and I would like to strip away the audio because i just don’t need it. Using ffmpeg in ubuntu made this task a very simple one. Simply run the following command:

ffmpeg -i file-in.mp4 -vcodec copy -an file-out.mp4

As you see, a very quick helpful solution.

 

Howto: Upgrade Ubuntu Version of Server

To upgrade from Ubuntu server system to the latest server:
1- install the update-manager-core package if it is not already installed:

sudo apt-get install update-manager-core

2- This is optional, you can update without doing this: Edit /etc/update-manager/release-upgrades and set Prompt=normal;
3- Launch the upgrade tool with the command

sudo do-release-upgrade -d

and follow the on-screen instructions.

Password Reset for Ubuntu System

Yes! I forgot my password to a fresh install of Ubuntu. Thankfully I can recover using the following steps:

1. Turn your computer on.
2. Press ESC at the GRUB prompt.
3. Press e for edit.
4. Highlight the line that begins “kernel ………”, press e
5. Go to the very end of the line, add rw init=/bin/bash
6. Press enter, then press b to boot your system.
The system will boot up to root shell without a password

7- Type in passwd “Username”
8- Type in reboot in order to reboot your system
9- Log-in with your new password set – done