Saturday, July 14, 2012

PS Quick Tips: Create a directory in PowerShell

PS D:\> New-Item -ItemType directory -Path D:\tmp

PS Quick Tips: How to check if path exists in Powershell

PS D:\> Test-Path C:\Windows

PS Quick Tips: Loading Powershell add-on module

  1. Copy PowerShell module to $env:HOMEDRIVE + $env:HOMEPATH + "\Documents\WindowsPowerShell\Modules", create the folder if necessary.
  2. Load the module, e.g., 
PS D:\> Import-Module Pscx

Where Pscx is the module name.

PS Quick Tips: Check Powershell version installed

PS: D:> $host.version

Wednesday, July 04, 2012

Get IP address of the machine in Arch Linux

How to get IP address in Arch Linux? Well, it turns out to be easy:
#: ip addr

You should see something like:


1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:1f:c6:d5:32:4d brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.105/24 brd 192.168.0.255 scope global eth0
    inet6 fe80::21f:c6ff:fed5:324d/64 scope link
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 00:15:af:92:3e:8a brd ff:ff:ff:ff:ff:ff

!Enjoy ts