Tagged: Scripting Toggle Comment Threads | Keyboard Shortcuts

  • Tushar Neupaney 6:30 am on January 14, 2010 Permalink | Reply
    Tags: .vimrc, Configuration, Editor, , Scripting, , Vim   

    My .vimrc file 

    Vim is the editor of my choice for my linux box. I have configured my .vimrc file in my ubuntu.


    ” Tushar Neupaney’s VIMRC File
    ” Followme twitter.com/tneupaney
    ” linuxfanatic.posterous.com

    ” (sw)shiftwidth: how many columns text is indented with reindent operations
    ” (sts)softtabstop: how many columns vim uses when you hit tab
    ” (ts)tabstop: how many columns a tab counts for
    set ts=4 sw=4 sts=2

    expandtab: appropriate number of spaces in insert mode
    set expandtab

    ” Make gvim colorscheme as evening
    if v:progname =~? “gvim”
    colorscheme evening

    ” Prevents keeping of backup after overwriting the file
    set nobk

    ” To see line numbers on the left
    set number

    autocomplete parenthesis, brackets and braces
    inoremap ( ()<Left>
    inoremap [ []<Left>
    inoremap { {}<Left>

    Syntax highlighting on
    syntax on

    share windows clipboard
    set clipboard+=unnamed

    Hightlight the curent column
    set cursorcolumn

    Hightlight the current line
    set cursorline


    Here is the Screenshot!

  • Tushar Neupaney 8:06 am on August 27, 2009 Permalink | Reply
    Tags: Administration, Monitoring, Programming, Scripting, System, ,   

    Examples of WMIC a hidden secret 

    WMIC stands for windows management instrumentation command-line, a well kept secret which has been silently being featured in Windows based Operating system actively after windows 2000. The tool is not only robust, powerful and flexible, it can also be used over the network seamlessly.

    To access this tool, you have to enter wmic in the command line of windows, which will end up in it’s own shell. Mostly, you should have wmic installed as it is the default in windows, you may also see a message saying wmic installing which happens for the first time only. It basically works after the WMI service starts to run. WMIC also has an easy API structure. To use the api you will have to use the WQL or Windows Query Language which is quite similar to SQL or Structed Query Language.

    The format of WMIC is:

    WMIC [Credentials] [area] [QueryString]

    Some Examples and usage of WMIC:

    1.  To get the process list – wmic process list
    2.  To get the group list – wmic group list
    3.  To get the NIC Card Configuration – wmic nicconfig list
    4.  To get user account list – wmic useraccount list
    5.  To get the built in System account list – wmic sysaccount list
    6.  To get the Environment list – wmic environment list
    7.  To get the information of all shares (including hidden) – wmic share list
    8.  To get the list of services – wmic services list
    9.  To get the computer system details – wmic computersystem list
    10. To get the volume information – wmic volume list
    11. To get full startup list – wmic startup list full
    12. To get Information of logical disks – wmic logicaldisk get description, filesystem, name, size
    13. To get screensaver information – wmic desktop get screensaversecure, screensavertimeout
    14. To get logon information – wmic logon get authenticationpackage
    15. To get information about the OS – wmic os get name, servicepackmajorversion
    16. To get information about QFE (Quick Fix Engineering) – wmic qfe get description,installedOn
    17. To get information about the computer – wmic csproduct get name,vendor,identifyingNumber
    18. To get the toal ram – wmic computersystem get TOTALPhysicalMemory,caption
    19. To get the macaddress of nic card – wmic nic get macaddress,description

    Note: In all the above you can use “brief” command to get a brief list of information and “full” to get the full list of information, for example use wmic process list brief, wmic process list full.

    Doing some niche tasks from wmic:

    1. Updage static ip address
    wmic nicconfig where index=9 call enablestatic(“”),(“”)

    2. To Change the network gateway
    wmic nicconfig where index=9 call setgateways(“″,””),(1,2)

    3. To start an application
    wmic process call create “paint.exe”

    4. To enable dhcp
    wmic nicconfig where index=9 call enabledhcp

    5. To kill an application
    wmic process where name=”paint.exe” call terminate

    6. To change the process priority
    wmic process where name=”iexplorer.exe” call setpriority 64

    7. To get name and process id of a process
    wmic process where (Name=’svchost.exe’) get name,processid

    • Tawattetres 5:47 pm on December 9, 2009 Permalink | Reply

      Good article, amazing looking website, added it to my favorites.

    • Roshan 6:45 am on July 26, 2012 Permalink | Reply

      Can we use wmic command to fetch logs from devices with IPv6 addresses ??

    • Bart 2:54 pm on May 29, 2013 Permalink | Reply

      using WMIC …. /format:htable > file.html – output to file.htm as html table layout
      using WMIC …. /format:hform > file.html – output to file.htm as html form layout

      get information of multiple system thru 1 command

      create text file server.txt:

      using WMIC /node:@server.txt ….. – enumerates for servers A B C

Compose new post
Next post/Next comment
Previous post/Previous comment
Show/Hide comments
Go to top
Go to login
Show/Hide help
shift + esc