For example, if you are running Xibo for digital signage and don't want anyone to be able to close the program (or do anything on the computer).
Using AutoIT, the following script (which can be compiled to an .exe file) will block user input until a Notepad window is detected, which is just my way of saying BlockInput forever.
BlockInput(1)
WinWaitActive("Untitled - Notepad")
Unfortunately this does not block the "three finger salute" (Alt Ctrl Delete). Using AutoHotkey, which I am somewhat more familiar with, you can disable the task manager. Again this can be compiled into an executable.
; This script disables the task manager, and re-enables it with the key combination Windows + 1
Regwrite, REG_SZ, HKEY_LOCAL_MACHINE,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskmgr.exe, Debugger, Hotkey Disabled
return
#1::
gosub Enable
return
Enable:
RegDelete,HKEY_LOCAL_MACHINE,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskmgr.exe
return
ExitSub:
RegDelete,HKEY_LOCAL_MACHINE,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskmgr.exe
ExitApp
return
And to call this compiled script from the AutoIt script that we first talked about:
BlockInput(1)
RunAs(username, @ComputerName, password, 2, DisableTaskManager.exe)
WinWaitActive("Untitled - Notepad")
Edit:
It seems that AutoIT has RegWrite and RegDelete functions, of course. I rewrite the script(s) accordingly.
Friday, April 8, 2011
Saturday, April 2, 2011
transferring videos to my 5th generation iPod (with video) on Ubuntu
This is more for my own notes, so that I remember if I have to do this again.
- HandBrake to transcode the videos to a format appropriate for playback on the iPod
- install gtkpod
- sudo apt-get install gtkpod
- install support for m4v files in gtkpod
- sudo apt-get install libmp4v2-0
- transfer the files by drag and drop onto the iPod in gtkpod
Monday, March 14, 2011
ideas of things to build
I have a number of projects on the back burner, or in most cases still in the cupboard, so I wanted to write some of them down here. You know, in case anyone is interested in helping or can point me to where these have already been constructed. Some are software, some are hardware, most are related to education.
I'm no Ben Heck, so I'd appreciate any help or direction with any of these.
- web app for bulk deleting users from Google Apps for Education (using Google App Engine)
- application allowing users to automatically add anyone who uses a particular hash tag to a Twitter list, similar to blastfollow (using Oauth, and perhaps Google App Engine or Chrome Web Store)
- something similar to Blippy for automatic sharing of which library books you have signed out
- an Android tablet app similar to Proloquo2Go for augmentative and alternative communication
- interfacing Vernier probes and sensors with a LaunchPad or Teensy
- locking shelf for securing (and syncing) multiple iPods in a classroom (using just a 2x4, a door hinge, and a lock plate)
- iPad cart or shelf similar to the Bretford Mobility Cart
- locking carrying case for six netbooks (for WISEST)
- real time control of a Mitsubishi Movemaster RM-101 robot arm using a keyboard or joystick (in BASIC)
I'm no Ben Heck, so I'd appreciate any help or direction with any of these.
Friday, March 11, 2011
iPad Guitar version 3
On episode 1422 of Buzz Out Loud, JC from San Diego suggested an iPad guitar with iPhones as frets. I only had one iPhone lying around, so I had to use my Android phone and my old iPod Touch. I used Lego for the neck, since Mega Bloks are a little bit big.
I think the next step will be to carve something like this out of a 2x4.
Monday, March 7, 2011
iPad Guitar from Mega Bloks version 2
I built a better version of my original iPad Guitar with Mega Bloks.
I'm learning how to drive a CNC router, so a wooden version may be forthcoming.
(Dis)Assembly video
Friday, March 4, 2011
iPad Guitar with Mega Bloks
Playing with Mega Bloks tonight with my kids, I remembered Brian Tong mentioned on Buzz Out Loud about iPad GarageBand needing a guitar-shaped case. So we built something.
(Dis)Assembly video
Maybe I'll build something out of wood after GarageBand comes out. With pegs for a guitar strap.
---
Update I've built a better version.
Thursday, March 3, 2011
Moving photos from a camera card with AutoHotkey
Just wanted to share a somewhat rough script I wrote using AutoHotkey (since my Python skills are weak and Windows-only is fine) for moving files from a camera SD card to folders organized by month.
I also set up an AutoRun.inf to run the compiled script when the card is inserted, similar to these instructions.
I also set up an AutoRun.inf to run the compiled script when the card is inserted, similar to these instructions.
; AutoHotkey Version: 1.x
; Language: English
;
; Script Function:
; Moving files from camera card (E:\DCIM\{etc}) to photos folder (H:\Photos\{date}) and then deleting them
; You may want to change H:\Photos\ throughout the code to something that actually exists on your computer.
; Language: English
;
; Script Function:
; Moving files from camera card (E:\DCIM\{etc}) to photos folder (H:\Photos\{date}) and then deleting them
; You may want to change H:\Photos\ throughout the code to something that actually exists on your computer.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
; Since the script is running from the camera card, we can use the variable A_ScriptDir to tell which drive letter the card got mounted as
SetWorkingDir %A_ScriptDir%\DCIM\
IfNotExist %DriveLetter%:\DCIM\
{
MsgBox, 1, PhotoMover, Something is wrong, perhaps the camera card is not in the card reader.
IfMsgBox, Cancel
Return
}
; show a (sort of fake) progress bar and set the initial variables to zero
Progress, b,, Moving Photos, Moving Photos
Progress, 0
PhotoProgress = 0
VideoProgress = 0
; move the JPG files
; the 0 means don't include folder names, the 1 means recurse into subdirectories
Loop, *.JPG, 0, 1
{
; trim the date variable to the format YYYY-MM
StringLeft, FileDateYear, A_LoopFileTimeCreated, 4
FileDateMonth := SubStr(A_LoopFileTimeCreated, 5, 2)
FileDateYearDashMonth = %FileDateYear%-%FileDateMonth%
; make a month folder, if it doesn't already exist
IfNotExist H:\Photos\%FileDateYearDashMonth%\
FileCreateDir H:\Photos\%FileDateYearDashMonth%\
; move the file to the appropriate folder in H:\Photos
FileMove, %A_LoopFileFullPath%, H:\Photos\%FileDateYearDashMonth%\
; Show (and increment) a progress bar
PhotoProgress+=1 ; increment the PhotoProgress variable
Progress, %PhotoProgress%
}
Progress, Off
if ErrorLevel
MsgBox, Well that didn't work... %ErrorCount% photos were not moved.
; and now move the MOV files
; first the progress bar
Progress, b,, Moving Videos, Moving Videos
Progress, 0
; the 0 means don't include folder names, the 1 means recurse into subdirectories
; we should probably do this for *.AVI files too
Loop, *.MOV, 0, 1
{
; trim the date variable to the format YYYY-MM
StringLeft, FileDateYear, A_LoopFileTimeCreated, 4
FileDateMonth := SubStr(A_LoopFileTimeCreated, 5, 2)
FileDateYearDashMonth = %FileDateYear%-%FileDateMonth%
; move the file to the appropriate folder in H:\Photos
FileMove, %A_LoopFileFullPath%, H:\Photos\%FileDateYearDashMonth%\
; Show (and increment) an approximate progress bar
VideoProgress+=1 ; increment the VideoProgress variable
Progress, %VideoProgress%
}
Progress, Off
if ErrorLevel
MsgBox, Well that didn't work... %ErrorCount% movies were not moved.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
; Since the script is running from the camera card, we can use the variable A_ScriptDir to tell which drive letter the card got mounted as
SetWorkingDir %A_ScriptDir%\DCIM\
IfNotExist %DriveLetter%:\DCIM\
{
MsgBox, 1, PhotoMover, Something is wrong, perhaps the camera card is not in the card reader.
IfMsgBox, Cancel
Return
}
; show a (sort of fake) progress bar and set the initial variables to zero
Progress, b,, Moving Photos, Moving Photos
Progress, 0
PhotoProgress = 0
VideoProgress = 0
; move the JPG files
; the 0 means don't include folder names, the 1 means recurse into subdirectories
Loop, *.JPG, 0, 1
{
; trim the date variable to the format YYYY-MM
StringLeft, FileDateYear, A_LoopFileTimeCreated, 4
FileDateMonth := SubStr(A_LoopFileTimeCreated, 5, 2)
FileDateYearDashMonth = %FileDateYear%-%FileDateMonth%
; make a month folder, if it doesn't already exist
IfNotExist H:\Photos\%FileDateYearDashMonth%\
FileCreateDir H:\Photos\%FileDateYearDashMonth%\
; move the file to the appropriate folder in H:\Photos
FileMove, %A_LoopFileFullPath%, H:\Photos\%FileDateYearDashMonth%\
; Show (and increment) a progress bar
PhotoProgress+=1 ; increment the PhotoProgress variable
Progress, %PhotoProgress%
}
Progress, Off
if ErrorLevel
MsgBox, Well that didn't work... %ErrorCount% photos were not moved.
; and now move the MOV files
; first the progress bar
Progress, b,, Moving Videos, Moving Videos
Progress, 0
; the 0 means don't include folder names, the 1 means recurse into subdirectories
; we should probably do this for *.AVI files too
Loop, *.MOV, 0, 1
{
; trim the date variable to the format YYYY-MM
StringLeft, FileDateYear, A_LoopFileTimeCreated, 4
FileDateMonth := SubStr(A_LoopFileTimeCreated, 5, 2)
FileDateYearDashMonth = %FileDateYear%-%FileDateMonth%
; move the file to the appropriate folder in H:\Photos
FileMove, %A_LoopFileFullPath%, H:\Photos\%FileDateYearDashMonth%\
; Show (and increment) an approximate progress bar
VideoProgress+=1 ; increment the VideoProgress variable
Progress, %VideoProgress%
}
Progress, Off
if ErrorLevel
MsgBox, Well that didn't work... %ErrorCount% movies were not moved.
Subscribe to:
Posts (Atom)