Tuesday, October 6, 2009

Howto: Delete Rows in wx.Grid

def fm_bDeleteServerDetails(self, event):

lst = self.m_gdServerDetails.GetNumberRows()

selected = []

for r in range(lst):

if self.m_gdServerDetails.IsInSelection(r, 0) == True:

selected.append(r)

selected.reverse()

for r in selected:

self.m_gdServerDetails.DeleteRows(r,1)

	def fm_bDeleteServerDetails(self, event):
lst = self.m_gdServerDetails.GetNumberRows()
selected = []
for r in range(lst):
if self.m_gdServerDetails.IsInSelection(r, 0) == True:
selected.append(r)
selected.reverse()
for r in selected:
self.m_gdServerDetails.DeleteRows(r,1)

Wednesday, September 30, 2009

processTame


import os
import sys
import win32process
import win32api
import subprocess
import win32con
def setpriority(pid=None,priority=1):
priorityclasses = [win32process.IDLE_PRIORITY_CLASS,
win32process.BELOW_NORMAL_PRIORITY_CLASS,
win32process.NORMAL_PRIORITY_CLASS,
win32process.ABOVE_NORMAL_PRIORITY_CLASS,
win32process.HIGH_PRIORITY_CLASS,
win32process.REALTIME_PRIORITY_CLASS]
if pid == None:
        pid = win32api.GetCurrentProcessId()
        handle = win32api.OpenProcess(win32con.PROCESS_ALL_ACCESS, True, pid)
        win32process.SetPriorityClass(handle, priorityclasses[priority])
if (len(sys.argv) == 0):
    print("usage: processtame.exe ")
else:
    if (os.path.exists(sys.argv[1])):
    app = subprocess.Popen(sys.argv[1])
    pid = app.pid
    setpriority(pid, 0)
    app.wait()

Thursday, September 10, 2009

Searching Machine & User in OU

users: dsquery user -name "username"
Computers: dsquery computer -name "computername"

Friday, August 7, 2009

MultiBoot WinXP and Linux using Grub.

If winxp is installed on second drive and linux is installed on first drive then add/update the following entries in the /boot/grup/menu.lst file

title Windows
map (hd0) (hd1)
map (hd1) (hd0)
root (hd1,0)
chainloader +1

Tuesday, February 3, 2009

Bug: PCLinuxOS 2007: LiveCD fails to boot on System's with SATA Harddrive

Error:

LiveCD fails to boot with the following error:
Searching for the loop image [DONE]

ERROR: Unable to mount the livecd
Dropping you to a limited shell
................

Resolution
Add the following word on grub menu

all-generic-ide

Tuesday, December 16, 2008

FAQ: AppV : Can I stream application if it was sequenced on other OS

Short Answer is Yes & No.

Long Answer: If the application was sequenced on WinXP and streamed on Vista then there is more chances for the application to work but reverse is not recommended.

Sunday, December 14, 2008

TIPS: Python: How to convert python script to executable

Python script can be converted in a standalone executable using one of the exe builder like
* py2exe (Windows)
* py2app (Mac OS)
* PyInstaller (all platforms)
* cx_Freeze (Windows and Linux)
* bbFreeze (Windows and Linux)

Wednesday, December 10, 2008

TIPS: Linux : Compress a directory

The following command can be used to compress entire directory in a file :
tar cjf <FileName>.tar.bz2 <DirectoryPath>

Monday, December 1, 2008

Tips: Convert flv to mpg or avi

Following converts video.flv into video.mpg file:

CODE

ffmpeg -i video.flv -ab 56 -ar 22050 -b 500 -s 320x240 video.mpg


and following converts  video.flv into video.AVI with MP3 Audio:
CODE

ffmpeg -i I_test.flv -ab 56 -ar 22050 -b 500 -s 320x240 -vcodec xvid -acodec mp3 video.avi

Tuesday, November 11, 2008

TIPS: DELTREE in Windows XP

deltree can be simulated using the following .cmd file:

  1. Create an empty file deltree.cmd in %windir%\system32 folder
  2. Add the following content to the file, and save the file.

@echo off
del /S /F /Q %1
rd /S /Q %1

Thursday, November 6, 2008

My Virtual Applications Repository

SVS Virtual packages for many OpenSource applications can be downloaded from
http://sourceforge.net/projects/appvrepo/