Thursday, December 1, 2011

Firefox 8 in Ubuntu 10.10


http://news.softpedia.com/news/How-to-Install-Firefox-8-in-Ubuntu-10-04-and-10-10-232859.shtml

P.S. There is also very interesting add-on for the Firefox, that helps to solve the problems with incorrect flash player installations. It's called "Flash-aid".

Wednesday, September 21, 2011

Tuning Vmware Workstation 8 performance

In effort to squeeze a little bit more performance from my vSphere 5 whitebox, I tried to tune some settings of my VMware Workstation 8. Recently, I've found disk activity concerning .vmem files (From vmware.com: vmem is the virtual machine's paging file, which backs up the guest main memory on the host file system. This file exists only when the virtual machine is running, or if the virtual machine has crashed.). I don't think that I do need this files because I don't want suspend my virtual machines etc. I need pure performance, so I decided to tweak some Workstation settings. First of all find "config.ini" (In my Windows 7 it's located in "C:\ProgramData\VMware\VMware Workstation") and add/modify the following parameters:

mainMem.useNamedFile = "no"  - tells not to use .vmem files

prefvmx.minVmMemPct = "100"  - fit all virtual machine memory into reserved host RAM. Swapping won't be occurring so the host machine must have enough memory to accommodate  the sum of all memory reserved for every single virtual machine.


prefvmx.allVMMemoryLimit = "15000" - this parameter tells how much host memory can be used for the virtual machine memory allocation.

prefvmx.useRecommendedLockedMemSize = "yes" - well, to be honest I don't really need what this parameter do, but I've seen suggestion to enable it :)

Tuesday, September 6, 2011

vCenter error while trying to delete NAS storage

Today I've faced another interesting problem. I've added the NFS storage to the ESXi host, then I've added the same storage to the cluster. After a while I've noticed that one of the hosts had 2 storages attached with different names, but pointing to the same NFS target. When I've tried to delete the wrong one, I've got the foloowing error: "The object has already been deleted or has not been completely created". To make the things even more complicated, the virtual machines that were vMotion'ed to that ESXi host in a cluster, somehow changed their datastores to the wrong one (like background Storage vMotion). Thanks God that was testing environment :).

However the solution is very simple:
Just restart the management agents on the ESXi host. This will force the update at the vCenter Server.

Friday, August 12, 2011

Nice PDF cropping tool

By using this tool you can easily crop pdf files to help them match the screen of your e-reader or smartphone http://www.pdfscissors.com/

Wednesday, July 20, 2011

Moving WSUS content and Windows Internal Database to another drive

Today I had to create a RAID massive from the disk, where WSUS content was stored. Also there was database file of Windows Internal Database (that's how I store the information about my WSUS).
Moving WSUS content is a really easy task involving just a few steps.
It requires just one command.
wsusutil movecontent [path to new location] [path to log file]
(Location of wsusutil command is %drive%\Program Files\Update Services\Tools)
It's a bit strange, but the command couldn't run successfully and terminated with error "access to log file path is denied" nevertheless it had "everyone full access, network service full access, etc." permissions. The solution I found, was to create a simple txt file and point the command to it rather than to the folder. That's funny that the file has to be created manually.

To move database files, I had to install SQL Server Management Studio Express.
Fill the following parameters In the connection dialogue box:
Server Type: Database Engine
Servername: \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query
Authentication: Windows Authentication

In the "Databases" find "SUSDB", click on "Tasks" and then "Detach". In the dialogue box select "Drop connections".
Then we have to simply copy the folders using explorer or anything else.
When folders are in the right place, open SQL  Server Management Studio Express and right click on "Databases". Select "Attach" and choose the .mdb file.

Done!

Wednesday, July 6, 2011

Dual-boot Windows XP and Linux Ubuntu time problem

If you are using both Windows and Linux at your PC, then chances are that you will face a problem of time difference between operating systems. To solve this problem:
gksudo gedit /etc/default/rcS
Change UTC=yes to UTC=no

Wednesday, April 20, 2011

Recovery of lost partitions and files in Ubuntu

There is really nothing to say about it but one word: TestDisk.

Tuesday, April 19, 2011

Making a Video DVD from VIDEO_TS folder in Ubuntu

This task turned out to be easy to accomplish. Just 2 simple commands and voila.

1. mkisofs -dvd-video -o image.iso /dvd

where /dvd - the folder that contains VIDEO_TS folder.
This command will create iso file to burn to dvd disc.

2. growisofs -dvd-compat -Z /dev/scd0=image.iso

The second command burnes iso image to the dvd disc.

Tuesday, March 1, 2011

Root user and password in Ubuntu

By default, Ubuntu has a root password set as a hash. Sometimes, you can make a mistake, for example, remove your account from the group that allowed to use sudo. In a such cases, it's useful to have an access to the root user itself.
To set root password manually we should type in the shell:
sudo passwd

Monday, February 28, 2011

Using SCP to copy files between hosts

To copy remote file to your filesystem use the following syntax:
scp your_username@remotehost.edu:foobar.txt /some/local/directory

To copy local file to remote filesystem use the following syntax:
scp foobar.txt your_username@remotehost.edu:/some/remote/directory

To copy folder to a remote filesystem use
scp -r foo your_username@remotehost.edu:/some/remote/directory/bar

Thursday, February 24, 2011

Procmon - little handy tool

Recently, I've faced a problem, when wrong GPO from old misconfigured Windows Server 2003 DC applied to newly installed Windows Server 2008. There was a lot of issues related to wrong registry and file system permissions (the only things that doesn't restore to a previous state after removing GPO), so different services, such as Terminal services, couldn't start and produced a lot of errors. The only tool that helped me was Procmon. It allows to see real-time operations of operating system, check all "Access denied" errors and much more. Now everything works just fine.

Assigning restrictions to logon locally, accessing computers from the network and other interesting user permissions on Windows

Today's task was to secure access to the Microsoft Windows 2008 server using GPO. That's an interesting topic to play with because there is a lot of different combinations exists to accomplish this. A combination of local and domain policies, NTFS permissions can be used. Here I will try to post a conclusions that arised after this work.
First of all I would like to talk about NTFS permission named "Traverse Folder". That's a very interesting permission because it allows us to tighten security to a highest level. Let's make an example. Let's say we want to access a folder under the following path: "C:\lala\dada\KEY". For user "Tony" to access folder "KEY" he has to have NTFS permissions for it, but not only for it. What about parent folders? In fact, he has to have a "Traverse Folder" permission on all the parent folders to access "KEY" folder. So we should modify all the parent folders permissions to give "Tony" access to "KEY"? Not at all. By default, GPO assign the following "User Right": "Bypass Traverse Checking" to "Administrators, Backup Operators, Users, Everyone, Local Service and Network Service" on workstations and servers and "Administrators, Authenticated Users, Everyone, Local Service, Network Service and Pre-Windows 2000 Compatible Access" on Domain Controllers.
This is the link to Microsoft support article that describes different incompatibilities that may appear after wrong modification of critical user rights like "Allow logon locally", "Access this computer from the network" etc.

Friday, January 28, 2011

Making a router with NAT from Windows XP without enabling ICS

I've always wanted to know how to enable routing and NAT on XP box without enabling ICS (Internet Connection Sharing). Today it's time to write some lines about it. Let's begin.
1. We should enable service "Routing and Remote Access"
2. Open registry editor and navigate to "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" and set IPEnableRouter to "1"

Then, open a command prompt and type the following commands:
3. netsh routing ip nat install
4. netsh routing ip nat add interface "WAN Interface Name" full
5. netsh routing ip nat add interface "LAN Interface Name" private

I'm not sure whether computer has to be restarted after this setup, but the answer is probably "yes".
Anyway, if something doesn't agree to work - just restart the computer before panic :D

P.S. One more thing to add:  
To check configured interfaces type netsh routing ip nat show interface

Friday, January 21, 2011

Cloning Virtual Machine from snapshot in virtualbox

Today I've faced an interesting task to make a new virtual machine from a snapshot of existing one in virtual box. After a little research, I've found nice guide how to do it:

To clonehd the Current State of a disk:
  • Open the Virtual Media Manager (Menu: File>Virtual Media Manager).
  • Navigate to the hard disk you want to clone and fully expand the tree (use * key on numeric keypad).
  • Find the {hexUUID}.vdi file that is attached to the VM you want to clone the Current State of.
  • Click the filename to the right of the 'Location:' displayed at the bottom of the window.
  • Ctrl+C / Copy to copy the text to the clipboard, which will be something like:
    (path){b6441469-5ccb-418c-8fdd-73c5e1a17314}.vdi
  • Ctrl+V / Paste and extract the hexUUID value (removing the {} brackets) and run clonehd to clone it!
    C:> VBoxManage clonehd b6441469-5ccb-418c-8fdd-73c5e1a17314 CloneDisk.vdi


To clonehd a snapshot of a disk:
  • Open the Virtual Media Manager (Menu: File>Virtual Media Manager).
  • Navigate to the hard disk you want to clone and fully expand the tree (use * key on numeric keypad).
  • Find the {hexUUID}.vdi file that is attached to the VM (and Snapshot) you want to clone.
  • Click the filename to the right of the 'Location:' displayed at the bottom of the window.
  • Ctrl+C / Copy to copy the text to the clipboard, which will be something like:
    (path){75bd6ab1-ce25-4b56-aa39-7826c9ebcc93}.vdi
  • Ctrl+V / Paste and extract the hexUUID value (removing the {} brackets) and run clonehd to clone it!
    C:> VBoxManage clonehd 75bd6ab1-ce25-4b56-aa39-7826c9ebcc93 CloneDisk.vdi


There is no GUI at the moment, but it could be easily done in command line.

Swap in Ubuntu

Swap can a dedicated partition or just a file on your hard disk, mounted as a swap partition. I don't think, that anyone could have a problem marking partition as a swap, but creating swap as a file could be more interesting task to do.
Here is quotations from official Ubuntu documentation:
"
For Adding a 512 MB swap
  • Creating a file for 512 MB size you want:
We will create a /mnt/512Mb.swap swap file.
sudo dd if=/dev/zero of=/mnt/512Mb.swap bs=1M count=512

Here count=512, means we want our file to contain 512 blocks of bs=1M, which means block size = 1 mebibyte (1 048 576 bytes). Be careful *not* to do this dd of=/mnt/512Mb.swap bs=1M seek=512 count=0 Though the file grows to 512Mb immediately, it will have holes that makes it unusable.
  • Formatting that file to create a swapping device:
sudo mkswap /mnt/512Mb.swap

  • Adding the swap to the running system:
sudo swapon /mnt/512Mb.swap

The additional swap is now available and can be seen by "cat /proc/meminfo"
  • Making the change permanent:
Edit the /etc/fstab: 
gksudo gedit /etc/fstab

Add this line at the end of the file:
/mnt/512Mb.swap  none  swap  sw  0 0
Save. After the next reboot the swap will be used automatically.
Here we go! 

What is swappiness and how do I change it?


The swappiness parameter controls the tendency of the kernel to move processes out of physical memory and onto the swap disk. Because disks are much slower than RAM, this can lead to slower response times for system and applications if processes are too aggressively moved out of memory.
  • swappiness can have a value of between 0 and 100
  • swappiness=0 tells the kernel to avoid swapping processes out of physical memory for as long as possible
  • swappiness=100 tells the kernel to aggressively swap processes out of physical memory and move them to swap cache
The default setting in Ubuntu is swappiness=60. Reducing the default value of swappiness will probably improve overall performance for a typical Ubuntu desktop installation. A value of swappiness=10 is recommended, but feel free to experiment. Note: Ubuntu server installations have different performance requirements to desktop systems, and the default value of 60 is likely more suitable.
To check the swappiness value
cat /proc/sys/vm/swappiness

To change the swappiness value A temporary change (lost on reboot) with a swappiness value of 10 can be made with
sudo sysctl vm.swappiness=10

To make a change permanent, edit the configuration file with your favorite editor:
gksudo gedit /etc/sysctl.conf

Search for vm.swappiness and change its value as desired. If vm.swappiness does not exist, add it to the end of the file like so:
vm.swappiness=10
Save the file and reboot.

We can check swap with the following commands:
  • sudo fdisk -l
  • cat /proc/swaps