list directories and their total sizes in linux

want to list directories and their sized in linux d’ya??
shazam! here you go:

du -sh *

For example:

[dnumtwo@yomamasvm targets]$ ls -al
total 65
drwxr----- 16 dnumtwo dnumtwo 16 Aug  7  2013 .
drwx------  3 dnumtwo dnumtwo 57 Apr  1 09:22 ..
drwxr-----  3 dnumtwo dnumtwo  3 Aug  7  2013 host
drwxr-----  6 dnumtwo dnumtwo  6 Aug  7  2013 application
drwxr-----  4 dnumtwo dnumtwo  4 Aug  7  2013 repository
drwxr-----  3 dnumtwo dnumtwo  3 Aug  7  2013 dnumtwo_apache
drwxr-----  3 dnumtwo dnumtwo  3 Aug  7  2013 dnumtwo_console
drwxr-----  3 dnumtwo dnumtwo  3 Aug  7  2013 weblogic_domains

[dnumtwo@yomamasvm targets]$ du -sh *
23K     host
893K    application
49K     repository
232K    dnumtwo_apache
256K    dnumtwo_console
17K     weblogic_domains

Permanent link to this article: http://devnumbertwo.com/list-directories-total-sizes-linux/

linux: remove files older than a certain number of days

want the command to remove files (on linux) that are older than a certain number of days? shazam! here you go:

the below command will:

  • remove files (note the rm in the command)
  • located in the current directory (note the ./ in the command)
  • that are older than 30 days (note the +30 in the command)
find ./ -mtime +30 -exec rm {} \;

here’s another example, the below command will:

  • remove files (note the rm in the command)
  • located in any directory in /home whose name starts with oracle (note the /home/oracle* in the command)
  • that are older than 5 days (note the +5 in the command)
find /home/oracle* -mtime +5 -exec rm {} \;

Permanent link to this article: http://devnumbertwo.com/linux-remove-files-older-certain-number-days/

create a java web service client from a wsdl

you want to create a java client from a wsdl online?

boom! here you go:

  1. Ensure you have the JDK installed
  2. Create a new eclipse java project
    eclipse_java_project
  3. Add wsimport (located in the JDK bin) to your path
    Example:

    set PATH=%PATH%;C:\Program Files\Java\jdk1.6.0_41\bin
  4. Use wsimport to generate the Java files from the WSDL
    Change directory to your Eclipse project directory, run wsimport:

    C:\Users\devnumbertwo\Desktop\Projects\workspace\WSClient>wsimport -s src -d bin http://devnumbertwo.com/webservice-server/server/soap?wsdl
    parsing WSDL...
    
    generating code...
    
    compiling code...
    
    C:\Users\devnumbertwo\Desktop\Projects\workspace\WSClient>
  5. Refresh your Eclipse project then create a class file using the generated code to hit the web service. Something like:
    public class MainContainer {
    
    	public static void main(String args[]) {
    		MainContainer main = new MainContainer();
    			main.run();
    	}
    
    	public void run() {
    		System.out.println("--- start ----");
    
    		WSServer os = new WSServer();
    		WSServerType osType = os.getWSServer();
    
    		// ======= Get Server Info =======
    		GetServerInfoRequest srvrInfoReq = new GetServerInfoRequest();
    
    		GetServerInfoResponse srvrInfoResp = osType.getServerInfo(srvrInfoReq);
    
    		String timez = srvrInfoResp.getWSEngineTimezone();
    		String engVersion = srvrInfoResp.getWSEngineVersion();
    		String srvrVersion = srvrInfoResp.getWSServerVersion();
    
    		StringBuffer strPrint = new StringBuffer("Listing Server Info: \n");
    		strPrint.append("\tTimezone: " + timez + "\n");
    		strPrint.append("\tEngine Version: " + engVersion + "\n");
    		strPrint.append("\tServer Version: " + srvrVersion + "\n");
    
    		System.out.println(strPrint.toString());
    
    	}
    }

Permanent link to this article: http://devnumbertwo.com/create-java-web-service-client-wsdl/

SBL-SVR-00026: Unable to allocate shared memory

Siebel server complaining?

SBL-SVR-00026: Unable to allocate shared memory

This can be seen in the log files when the Siebel server fails to start up.

In most cases, one or more additional error messages also accompany this one, for example SBL-SVR-00005.

There is a shared memory file that is maintained by each Siebel server under the “admin” directory of its root installation ($SIEBEL_ROOT\admin on both UNIX and windows). This file follows the naming convention [<$EnterpriseName>.<$ServerName>.shm]. It is built upon server startup, and destroyed upon shutdown. If this file cannot be created successfully upon server startup, the above error message can be reported.

After verifying that you have adequate disk space and permissions for this file to be created, Try this:

  1. Make sure the Siebel Server service(s) are shutdown completely before shutting down the Siebel Gateway Server service.
  2. Check if the above .shm file is still present in spite of a successful Siebel server shutdown.
  3. Make a copy of the *.shm file (if it was left behind after a server shutdown) or delete it
  4. Restart the siebel server, and verify whether a new *.shm file is created and if that allowed the server to start up properly.

Permanent link to this article: http://devnumbertwo.com/sbl-svr-00026-unable-allocate-shared-memory/

Error: CLUSTER_NODES doesn’t contain the LOCAL_NODE. Correct the CLUSTER_NODES and start the DeInstall tool again

trying to deinstall clusterware and getting the following error?

Caused by: oracle.ops.util.FatalException: Exited from Program.
[ Error: CLUSTER_NODES doesn't contain the LOCAL_NODE. Correct the CLUSTER_NODES and start the DeInstall tool again ]
        at oracle.install.db.deinstall.core.NodeLivlinessCheck.setRemoteNodes(NodeLivlinessCheck.java:242)
        at oracle.install.db.deinstall.core.CheckInstall.checkConfig(CheckInstall.java:414)
        ... 6 more

deinstall clusterware manually:

n all remote nodes, as root execute:

  $GRID_HOME/crs/install/rootcrs.pl -deconfig -force -verbose

Once the above command finishes on all remote nodes, on local node, as root execute:

  $GRID_HOME/crs/install/rootcrs.pl -deconfig -force -verbose -lastnode

reference: How to Deinstall Oracle Clusterware Home Manually [ID 1364419.1]

Permanent link to this article: http://devnumbertwo.com/error-cluster_nodes-doesnt-contain-local_node-correct-cluster_nodes-start-deinstall-tool/

SEVERE: This repository requires DAC Server running in Web Server mode!

the issue: when trying to start the dac server (startserver.sh) you get:

Feb 8, 2013 9:03:09 PM com.siebel.analytics.etl.conf.RepositoryPropertiesManager refresh
INFO: Reading repository properties
Feb 8, 2013 9:03:09 PM com.siebel.etl.net.QServer 
SEVERE: This repository requires DAC Server running in Web Server mode!

fix it: you probably forgot to change the settings in the dac client. you don’t need the dac server running in order to make the following changes in the dac client:

Tools -> DAC Server Management -> Repository Configuration -> Select standalone mode -> Set the host & port

on the dac server:

execute StandaloneServersetup.sh in DAC Server and set the correct information (if you haven’t don so already)
shutdown and restart the dac Server (startserver.sh) — it should start fine now

Permanent link to this article: http://devnumbertwo.com/severe-repository-requires-dac-server-running-web-server-mode/

update or reset the dac admin password for the dac client

how to reset the dac admin password for the oracle dac client:

  1. Log into the DAC repository database (using sql)
  2. Locate the table W_ETL_USER and delete all records
  3. Log on DAC client with default user/password as Administrator/Administrator

Re-create the dac admin user again by performing the following:

  1. modifying the existing connection by clicking on Configure in the dac client login screen
  2. Modify Connection -> Test Connection (just to test to see if you need to change the table owner login)
  3. Go back to the dac client login screen, login as the table owner
  4. Confirm the login on the Creating default Administrator account… screen
  5. Create the dac admin account on the next screen
    dacadmin

Permanent link to this article: http://devnumbertwo.com/update-dac-admin-password-dac-client/

weblogic error: Could not read or create index on log file… persistent store record id could not be found

the problem:  getting “Could not read or create index on log file… persistent store record id could not be found” error in weblogic:

<Jan 27, 2014 12:46:04 PM HST> <Error> <Diagnostics> <BEA-320055> <Could not read or create index on log file /u01/app/oracle/domains/testdomain/servers/AdminServer/logs/testdomain.log
weblogic.store.PersistentStoreException: [Store:280029]The persistent store record 3,431 could not be found
at weblogic.store.io.file.FileStoreIO$TypeRecord.getSlot(FileStoreIO.java:1097)
at weblogic.store.io.file.FileStoreIO.deleteInternal(FileStoreIO.java:422)
at weblogic.store.io.file.FileStoreIO.delete(FileStoreIO.java:314)
at weblogic.store.internal.DeleteRequest.run(DeleteRequest.java:28)
at weblogic.store.internal.StoreRequest.doTheIO(StoreRequest.java:64)
Truncated. see log file for complete stacktrace

fix it by:

  • shutting down the server
  • removing the .DAT file in the <server>/data/store/diagnostics directory
  • start the server up again

Permanent link to this article: http://devnumbertwo.com/843/

wordpress plugin temporary home page

need a temporary home (or ‘under construction’) page for wordpress while you work on your site? no problemo! this plugin is so easy — WP Maintenance Mode

just install it, enable the “Plugin Activate” to true and set the title, header and text you want to appear on your page.

Permanent link to this article: http://devnumbertwo.com/wordpress-plugin-temporary-home-page/

unable to delete comments from wordpress

the problem: unable to delete comments from wordpress (even though the wp-admin)

the solution: go into the database and run this query to delete

DELETE FROM wp_comments WHERE comment_approved = 0

optionally, if you’d like to delete all spam marked comments:

DELETE FROM wp_comments WHERE comment_approved = 'spam'

Permanent link to this article: http://devnumbertwo.com/unable-delete-comments-wordpress/

Older posts «

» Newer posts