Powershell, Skriptování

How to create large dummy files

For example, to create ten dummy files c:\temp\file* with the size of 1GiB :

Hardware, Powershell

Watchdog of free space

This script will check a disk’s free space and send a warning if the server has dropped below the limit you have specified.
The settings are in a XML file. The main entity is the filesystem – let’s say a drive letter or disk. Each disk must be defined as an element, which includes values such as the hostname, limit, and list of recipents.
Both files for this solution must be in the same folder.

Here is an overview:

Hardware, Powershell, Skriptování

Determine partitions offset via PowerShell

source:
http://pctuning.tyden.cz/software/ladeni-windows/17030-optimalizace-windows-7-pro-ssd-co-funguje-a-co-ne?start=2
http://lifehacker.com/5837769/make-sure-your-partitions-are-correctly-aligned-for-optimal-solid-state-drive-performance

UNIX

HP-UX reset root password without old password

A real example:
- restart server using the management console
- boot into single user mode
- mount /var and /usr filesystems
- edit /tcb/files/auth/r/root
- set a new root’s password
- restart server

Powershell, Skriptování

Optimize PowerShell Performance

I often need to retrieve data from Active Directory in many iterations which is very demanding and consumes all the RAM. Processing gradually slows down as well. Off course, a reduced amount of data could help (http://dmitrysotnikov.wordpress.com/2007/07/24/optimize-powershell-performance-and-memory-consumption/). But sometimes it could be better to use a multi-dimensional hash table to temporarily store data from AD rather than reading the data in each iteration. Reading data from a local variable is more effective.

How to add a few attributes to our hash table called ‘ADUsersCache’ in example below:

Than i can work with…

Batch, Skriptování, Windows

Changing the prompt in a win cmd

The default Linux prompt gives you additional helpful information while working through a session instead of Windows.
The example below displays a user who is logged in along with the hostname in a windows command line.

Digitální fotografie

Led

08.12.2012 15:00
Canon EOS 500D, Canon EF 100mm f/2.8 L IS USM, F2,8, 1/500s, ISO 100

Powershell, Skriptování

Check JPG file header

 

Networking, Skriptování

IP Address

 

Hardware, Powershell

Get List of Printers