Copyright (C) 2012 by Steve Litt, All rights reserved. Material provided as-is, use at your own risk.
CONTENTS: |
ifconfig wlan0 list scanThe preceding should give you a list of Wifi transmitters, with their SSID names.
network={The line saying key_mgmt=NONE says it's wide open, and not to use a password.
ssid="Bates_Motel_Wifi"
key_mgmt=NONE
priority=5
}
#include <stdio.h> #include <stdlib.h> /* Required for system() */ #include <unistd.h> /* Required for setuid() */ #include <string.h> /* Required for strcasecmp() */ /* NOTE: if strcasecmp() isn't supported, try stricmp() or strcmpi() Otherwise, write your own with a for(;;) loop. NOTE: To function properly, the executable made from this C program must be set setuid root (chmod 4755 a.out). SECURITY NOTE: Don't you dare allow user input to get run as a command, but instead make it like this program, where user input is used to determine which of several predetermined commands is run! */ int main(int argc, char *argv[]){ char *thearg; if(argc != 2){ printf("Error, must have exactly 1 arg, either enable or disable\n"); return(1); } thearg = argv[1]; if (!strcasecmp(thearg, "disable")){ setuid(0); system("ps ax | grep psm0 | grep -v grep | cut -b 1-5 | xargs kill"); } else if (!strcasecmp(thearg, "enable")){ setuid(0); system("/usr/sbin/moused -p /dev/psm0 -t auto"); } else { printf("Error, argument must be either enable or disable\n"); return(1); } return 0; } |
pad_asroot.bin disableAnd when you want to turn the mousepad back on, do this:
pad_asroot.bin enableThis solution is a security risk, because when you did chmod 4755 pad_asroot.bin, you did setuid root on this program. Now a badguy can come along, change the LD_PRELOAD environment variable to a directory with his special version of printf() or other library function that installs a program that's really a setuid root shell, and the next time he logs in as a normal user he can escallate himself to root.
ps ax | grep psm0 | grep -v grep | cut -b 1-5 | xargs kill |
/usr/sbin/moused -p /dev/psm0 -t auto |
slitt ALL = (root) NOPASSWD: /usr/local/bin/pad_disable.shObviously, substitute your own login name for slitt.
slitt ALL = (root) NOPASSWD: /usr/local/bin/pad_enable.sh
sudo pad_disable.shTo reenable the mouse, do this:
sudo pad_enable.shThis method works both in CLI and in X.
/usr/ports/x11-drivers/xf86-input-synapticsIf you install that package, you get the synclient executable and the syndaemon daemon. Theoretically you can get those to shut off the touchpad every time you type, and have it remain shut off for a certain period after your last keystroke, which minimizes problems where your touchpad first selects text from your document, and then your next keystroke replaces it.
X11 connection rejected because of wrong authentication.One way to eliminate that error is to use the -Y parameter instead of -X, which enables trusted X forwarding and thus eliminates the X11 security extension controls. In other words, use ssh -Y instead of ssh -X. That's good for a quick and dirty test. If you're going to be sshing between these two machines a lot, you should probably solve the problem in ssh_config and sshd_config, if possible.
xterm Xt error: Can't open display: localhost:10.0