Check These Out
I realize there's a few of these out there, but none exactly in this form, which seems the cleanest to me
I had problems in Ubuntu while trying to edit /etc/resolv.conf, even with sudo I couldn't make any change. After a 2 minutes search on google I found this command.
Hope someone finds it useful.
It works like chmod, with + and - to denote which attributes are being added and which are being removed.
See other attributes on man pages or on wikipedia http://en.wikipedia.org/wiki/Chattr
Using this command you can track a moment when usb device was attached.
Replace 'csv_file.csv' with your filename.
This is like ping -a, but it does the opposite. It alerts you if the network is down, not up. Note that the beep will be from the speaker on the server, not from your terminal.
Once a second, this script checks if the Internet is accessible and beeps if it is not. I define the Net as being "UP", if I can ping Google's public DNS server (8.8.8.8), but of course you could pick a different static IP address. I redirect the beep to /dev/console so that I can run this in the background from /etc/rc.local. Of course, doing that requires that the script is run by a UID or GID that has write permissions to /dev/console (usually only root).
Question: I am not sure if the -W1 flag works under BSD. I have only tested this under GNU/Linux using ping from iputils. If anybody knows how portable -W is, please post a comment.
This inserts timestamp instead of .bak extension.
This is a (last resort) way to automate applications that provide no other ways for automation, it would send 'Hello world' to the currently active window. See the manpage (and the -text and -window entries) for how to send special characters and target specific windows.
An example:
Using xwininfo, I get the id of my XPlanet background window:
alanceil@kvirasim:19:51:0:~> xwininfo
xwininfo: Please select the window about which you
would like information by clicking the
mouse in that window.
xwininfo: Window id: 0x3600001 "Xplanet 1.2.0"
Absolute upper-left X: 0
(..etc..)
Now I use xvkbd to tell it to close itself:
xvkbd -xsendevent -window 0x3600001 -text "Q"
Obviously, the best way is to put these commands in a shellscript - just make sure to include a short sleep (sleep .1 should suffice) after each xvkbd call, or some programs will become confused.
Easy way to see your real external IP