Linux Notes

Command Line
  • Image Capture
  • Use xwininfo to obtain the window id and then pipe it to the imagemagic tool convert specifying xwd as the input and using the - to represent standard input. Then give the output file a name with appropriate suffix to get the disired output type.
    xwininfo      
    xwd -id 0xe00001 | convert xwd:- outputfile.png
    
  • Postgres
  • Initialize postgres after install
    pg_ctl initdb -D /var/lib/pgsql/data
    
    Initialize postgres after install
    pg_ctl initdb -D /var/lib/pgsql/data
    
  • MySql
    • Startup/Shutdown
    • # Centos7 as root 
      systemctl start mysql
      systemctl stop mysql
      # Or as user with mysqladmin permissions  
      mysqladmin shutdown -p
      mysqladmin start -p
      
    • Reset root password
    • /usr/sbin/mysqld --user=root --skip-grant-tables
      mysql> use mysql
      Reading table information for completion of table and column names
      You can turn off this feature to get a quicker startup with -A
      
      Database changed
      
      mysql> FLUSH PRIVILEGES;
      Query OK, 0 rows affected (0.00 sec)
      
      mysql> SET PASSWORD FOR root@'localhost' = PASSWORD('password');
      Query OK, 0 rows affected (0.00 sec)
      
      mysql> commit;
      Query OK, 0 rows affected (0.00 sec)
      
  • Oracle WebLogic
  • After install find and copy DemoIdentity.jks
    find ./ -name DemoIdentity.* -print
    cp ./Middleware/Oracle_Home/user_projects/domains/wl_server/security/DemoIdentity.jks /opt2/webservers/Oracle/Middleware/Oracle_Home/oracle_common/common/nodemanager/security/DemoIdentity.jks
    
    Change directory to user_projects and set environment and start and stop WebLogic
    setWLSEnv.sh
    startNodeManager.sh
    stopNodeManager.sh