snippets with tag 'windows'

Shell : Perfect django .bat dev startup scriptCréez un fichier run.bat qu'il vous suffira de double cliquer pour lancer Django dans une boucle 'infinie'. Faites Ctrl+C pour relancer le serveur si besoin. (uniquement pour le serveur de dev)
@ECHO OFF

SET PORT=9000

:BEGIN
cd %~dp0
c:\python25\python.exe manage.py runserver 192.168.1.31:%PORT%
GOTO BEGIN
 
tags : system, django, bat, windows

Python : cross platform library loader helperdrax's answer for loading a named or absolute library on any platform :)
import os, sys, ctypes

# Types reminder:
#!/usr/bin/python
# String  : ctypes.c_char_p
# Integer : ctypes.c_int
# Long    : c_ulonglong

def loadbinlib(libname="", libpath=""):
   if not libpath:
       if sys.platform in ['win32','win64']:
          libpath = '%s.dll' % libname
       elif sys.platform in ['mac']:
          libpath = '%s.dylib' % libname
       elif sys.platform in ['linux', 'linux2']:
          libpath = '%s.so' % libname
   return ctypes.CDLL(libpath)
tags : python, system, linux, windows

Python : Hide static files in FiddlerFiddler is very powerful ! Customise the rules to not be spammed with useless requests. see also : http://www.fiddlertool.com/fiddler/dev/scriptsamples.asp
// Click 'Customize rules'

// add in class Handlers

public static RulesOption("Hide Js,Css,jpg,gif,png files [200, 304]")
var m_HideStatics: boolean = false;

// add in OnBeforeResponse
if (m_HideStatics && (oSession.responseCode == 200 || oSession.responseCode == 304) && ( oSession.url.toLowerCase().indexOf(".js")>-1 || oSession.url.toLowerCase().indexOf(".css")>-1 || oSession.url.toLowerCase().indexOf(".jpg")>-1 ||  oSession.url.toLowerCase().indexOf(".gif")>-1 || oSession.url.toLowerCase().indexOf(".png")>-1))
        {
            oSession["ui-hide"]="true"; 
        }
tags : system, proxy, windows

Shell : Change windows default shell (replace explorer)This will change your windows default shell to your custom shell. (Ctrl+Alt+Del still active so you can reactivate explorer.exe if needed)
@echo off
REM create a .bat file with this command inside. execute then reboot.

reg add "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /V Shell /t REG_SZ /d  "FullPathToYourApp.exe" /f
tags : system, bat, windows

all tags : python, system, vlc, video, apache, proxy, linux, django, MySQL, .NET, XML, XSL, regexp, bat, windows, bash, git

back to snippets home
site réalisé et hébergé par revolunet © 2009 - informations légales