This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Run as : osascript browser_url.scpt "Browser Name" | |
on run argv | |
set browser_name to item 1 of argv | |
tell application "System Events" | |
if browser_name is "Google Chrome" then | |
tell application "Google Chrome" to set theURL to URL of active tab of front window | |
else if browser_name is "Safari" then | |
tell application "Safari" to set theURL to URL of front document | |
else if browser_name is "Firefox" then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### Run as root (or with sudo) | |
/usr/bin/defaults write /Library/Preferences/com.apple.loginwindow autoLoginUser testuser | |
/usr/bin/defaults write /Library/Preferences/com.apple.loginwindow autoLoginUID 504 | |
cp -v kcpassword /private/etc/kcpassword |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows Registry Editor Version 5.00 | |
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies] | |
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\ActiveDesktop] | |
"NoChangingWallPaper"=dword:00000001 | |
"NoAddingComponents"=dword:00000001 | |
"NoClosingComponents"=dword:00000001 | |
"NoDeletingComponents"=dword:00000001 | |
"NoEditingComponents"=dword:00000001 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
REM Usage - restart-process.bat calc.exe | |
:LOOPING | |
REM check is process is running | |
set proc= | |
ECHO "Getting process list" | |
for /f "delims=" %%a in ('"tasklist | findstr %1"') do @set proc=%%a | |
ECHO %proc% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AutoItSetOption ("WinTitleMatchMode", 2 ) | |
$window = "[CLASS:MozillaWindowClass]" | |
If not WinExists($window)=1 then; | |
MsgBox(64, "Not Running", "Firefox is not running") | |
Else | |
WinActivate($window) | |
Send("^l");; selects the address bar contents | |
Send("^c");; copies it to the clipboard | |
$fullurl = ClipGet() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AutoItSetOption ("WinTitleMatchMode", 2 ) | |
$window = "[CLASS:IEFrame]" | |
If not WinExists($window)=1 then; | |
MsgBox(64, "Not Running", "Internet Explorer is not running") | |
Else | |
WinActivate($window) | |
Send("!D");; selects the address bar contents | |
Send("^c");; copies it to the clipboard | |
$fullurl = ClipGet() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
:LOOPING | |
set proc= | |
ECHO "Getting process list" | |
for /f "delims=" %%a in ('"tasklist | findstr %1"') do @set proc=%%a | |
ECHO %proc% | |
IF "%proc%" == "" GOTO START | |
TIMEOUT 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Copyright 2011 Domen Kozar. All rights reserved. | |
Redistribution and use in source and binary forms, with or without modification, are | |
permitted provided that the following conditions are met: | |
1. Redistributions of source code must retain the above copyright notice, this list of | |
conditions and the following disclaimer. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
# At this point we may be running as root or as another user | |
# Check the parameters are valid - show an error if not | |
# Show the help message if requested | |
if os.geteuid() != 0: | |
os.execvp("sudo", ["sudo"] + sys.argv) | |
NewerOlder