Pages

Thursday, November 21, 2013

Android dev setup


  1. Install Eclipse IDE for Java developer
    http://www.eclipse.org/downloads/
  2. Install Android SDK starter Package
    Windows installer version
    http://developer.android.com/sdk/index.html
    download for Existing IDE
    http://dl.google.com/android/installer_r22.3-windows.exe

    Install it in c:\AndroidSDK
  3. ADT for eclipse

    add repository

    ADT - https://dl-ssl.google.com/android/eclipse/

    to eclipse then install Development tools & NDK Plugins



    from Android SDK manager, Install tools and platforms that you wish to install

    ----------------------------

    To Run first Project via devise


    1-Enable debugging the device to run the app

    Settings -> Developer Options then select USB Debugging (Android 4+)Enable debugging the device to run the app

    2-Install Samsung Kies for Samsung devices
    3-ADB (Android Debug Bridge)
    If running the app in real device, sometimes Eclipse cannot find the device. Then ADB needs to be restarted.
    Useful ADB commands (to be run from Command Prompt)
    Stop ADB Server: adb kill-server
    Start ADB Server: adb start-server
    See all the devices attached through USB: adb devices

Sunday, June 23, 2013

Mapping network resources, with impersonation


net use [drive:] [sharedfolder] password /user[domain\username]

like:
net use e: \\usrsvr002\smithmark Ue345Ii /user:pdc01

legends: password full user name


disconnect


net use e: /d


Stopping automatic login with different account

start-->run--> rundll32.exe keymgr.dll, KRShowKeyMgr


Wednesday, May 29, 2013

AD commands

Get user by display name
http://technet.microsoft.com/en-us/library/cc754525(v=ws.10).aspx


  • DSQUERY USER -name "Wahib, Refky"
  • DSQUERY USER -name "W*"
  • DSQUERY group  -name "PS_NSW - Learning_and_Business_Systems - LS"




Monday, May 20, 2013

Useful scripts for database migration




 DECLARE @name nvarchar(50);
   DECLARE tableCursor CURSOR FOR
       SELECT name
FROM sys.Tables

  OPEN tableCursor

  FETCH NEXT FROM tableCursor into @name

  WHILE @@FETCH_STATUS = 0
  BEGIN
 
 

         PRINT @name

     --exec( 'drop table ['+@name+']');

        exec( 'select top 1000 * from  "'+@name+'"');

    FETCH NEXT FROM tableCursor into @name

  end  
  CLOSE tableCursor;
  DEALLOCATE tableCursor;
  go

Tuesday, May 7, 2013

Cursor, drop all tables,views, procedures



USE LRRV6Portal
GO



--SELECT name
--FROM sys.Tables
--GO




  DECLARE @name nvarchar(50); 
   DECLARE tableCursor CURSOR FOR
       SELECT name
FROM sys.Tables
 
  OPEN tableCursor
 
  FETCH NEXT FROM tableCursor into @name
 
  WHILE @@FETCH_STATUS = 0
  BEGIN
  
  
 
         PRINT @name
        
        exec( 'drop table "'+@name+'"');

    FETCH NEXT FROM tableCursor into @name

  end   
  CLOSE tableCursor;
  DEALLOCATE tableCursor;
  go

------------

 DECLARE @name nvarchar(50);
   DECLARE viewCursor CURSOR FOR
       SELECT name
FROM sys.views

  OPEN viewCursor

  FETCH NEXT FROM viewCursor into @name

  WHILE @@FETCH_STATUS = 0
  BEGIN
 
 

         PRINT @name
       
        exec( 'drop view "'+@name+'"');

    FETCH NEXT FROM viewCursor into @name

  end  
  CLOSE viewCursor;
  DEALLOCATE viewCursor;
  go

----------

 DECLARE @name nvarchar(50);
   DECLARE procedCursor CURSOR FOR
       SELECT name
FROM sys.procedures

  OPEN procedCursor

  FETCH NEXT FROM procedCursor into @name

  WHILE @@FETCH_STATUS = 0
  BEGIN
 
 

         PRINT @name
       
        exec( 'drop procedure "'+@name+'"');

    FETCH NEXT FROM procedCursor into @name

  end  
  CLOSE procedCursor;
  DEALLOCATE procedCursor;
  go