Script to recursively check a folder and delete files older



#!/bin/bash
Dir="/backup/backup/"
days="30"

find $Dir -type f -mtime +$days -exec rm {} \;




modify days value according to requirement. How old files you want to delete.

How to reduce size of tablespace

 If temp is the tablespace that need to be reduced
 
1. Create new temp1 tablespace
2. Make new temp1 tablespace as default
3. Drop the temp tablespace
4. create  temp tablespace
5. Make the temp tablepsace as default
6. Drop  temp1  tablespace..

Oracle architecture and its categories

Oracle architecture is described in three categories:

* User related process
* Instance(Logical memory structure) and
* Physical file structure

Instance + Database= Oracle server

User Process : Whenever a user wants to connect to the oracle server for extraction of the data or to insert any data using sql statement. The user process then initiates a connection and hence a session is established for the user in the instance. After establishing a session, each user then starts a server process which will actually allow the user to interact to the database and retrieve the data or insert it. To be precise, Server process communicates with the oracle instance on behalf of the user. An additional memory structure called PGA (Program Global Area) is also created during this process. It stores the user session variables and bind variables.

Oracle Instance: Oracle instance is made up of SGA (System Global Area) and Background process. SGA further divided into three main components.

* Shared Pool: Caches the recently used sql statements.
Database Buffer cache: Cashes the data that has been most recently used by the user.
Redo log buffer: Stores transaction information.

Oracle uses LRU (Least Recently Used) algorithm.

It will caches the most recently used sql statements in shared pool and data in buffer cache. If for example we as a user1 are entering a sql statement (select * from emp). This statement will be cached by the shared pool and the data which is extracted will be cached in Database buffer cache. Now if any other user wants the same data, obviously he is going to use the same sql statement, so the data will be presented to the user directly from the database buffer thus improving the performance.

SGA size can be allocated manually or automatically. This is determined by the settings in a configuration file called parameter initialization file.

find vmware vmx files and copy to specific directory



find /vmfs -name \*.vmx -exec cp {} backup/ \;

this command will find all the vmx files in /vmfs directory to /backup folder

Bridge networking configuration

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual

auto br0
iface br0 inet static
        address 192.168.155.xxx
        network 192.168.155.0
        netmask 255.255.255.0
        gateway 192.168.155.1
        bridge_ports eth0
        bridge_stp off
        bridge_fd 0
        bridge_maxwait 0

Install Mac on any PC

To ensure you don't lose any files, use a blank hard drive.

1. Download the Rebel EFI file, available here.
2. Burn the file to a CD.
3. Insert the Rebel EFI disc into your CD drive.
4. Start or restart your computer.
5. As computer boots up select, Boot Options or Boot Menu Key
**Boot Options or Boot Menu Key differ by motherboard manufacturer.
6. Select CD ROM
7. After CD loads press enter to run the CD
8. When prompted, Eject the CD and it will ask for the Snow Leopard DVD
9. Insert the Snow Leopard DVD
10. Select Main Language
11. Click Continue, if you want to continue with the installation of Snow Leopard.
12. Click Agree, if you agree.
13. Select the disk that you want to install Snow Leopard on.
a. If no disk shows, Click on Utilities on the tool bar, then select Disk Utilities.
b. On the left you should see your hard drive.
c. If not, a disk is not connected or cannot be read by your computer.
d. After selecting your hard drive click on Partition.
e. Under Volume Scheme, click current and select 1 partition.
f. Under Volume Information, name your hard drive.
g. Format: Mac OS Extended (Journaled)
h. At the bottom of the window Click on the Options Button.
i. Select the GUID Partition Table
j. Click OK
k. Click Apply
l. Click Partition
m. Quit Disk Utilities
14. Select the disk that you want to install Snow Leopard on.
15. Click Install.
16. When Installation completes. restart the computer
17. As the computer starts up, insert the Rebel EFI CD
18. As computer boots up select Boot Options or Boot Menu Key
**Boot Options or Boot Menu Key differ by motherboard manufacturer.
19. Select CD ROM
20. Once CD loads you will see both the Hard Disk and the Rebel EFI CD
21. Use the arrow keys to highlight the Hard Drive
22. Press Enter to boot Hard drive.
23. Launch the Rebel EFI application from the CD.
24. Follow the on-screen authentication procedure.
25. Click Continue
26. Select your Keyboard
27. Click Continue
28. Select, Do not transfer my information now.
29. Click Continue
30. If, you have and Apple ID enter it now
31. If not, Click Continue
32. Enter your Registration Information
33. Click Continue
34. Create your Account Information
35. Click Continue
36. Select Time Zone
37. Click Continue
38. Click Done

How to disable Ubuntu apparmor


sudo /etc/init.d/apparmor kill


sudo update-rc.d -f apparmor remove



apparmor_status will show the current status of apparmor