Check These Out
http://vim.wikia.com/wiki/Search_and_replace
github anda limando feo ....: https://groups.google.com/forum/?fromgroups#!topic/symfony2/YL1mo_cz4Ms
Find recursively all files in ~/Notes with the extension '.md' and pipe that via xargs to rename command, which will replace every '.md' to '.txt' in this example (existing files will not be overwritten).
Replace 'SHOWNAME' with the name of the TV show.
Add -n to test the command without renaming files.
Check the 'sample output'.
Use flag "--" to stop switch parsing
If you enable multiuser, then you can permit others to share your screen session. The following conditions apply:
1. screen must be suid root;
2. "multiuser on" must be configured in ~/.screenrc;
3. control the others user(s) access with "aclchg":
# ----- from ~/.screenrc-users -----
aclchg someuser +rx "#?" #enable r/o access to "someuser"
aclchg someuser -x "#,at,aclchg,acladd,acldel,quit" # don't allow these
aclchg otheruser +rwx "#?" # enable r/w access to "otheruser"
aclchg otheruser -x "#,at,aclchg,acladd,acldel,quit" # don't allow them to use these commands
# -----
After doing this (once), you start your session with:
$ screen
Then, the other user can join your terminal session(s) with youruserid:
$ screen -r youruserid/
Note: the trailing "/" is required.
Multiple users can share the same screen simultaneously, each with independent access controlled precisely with "aclchg" in the ~/.screenrc file.
I use the following setup:
# ~/.screenrc-base
# default screenrc on any host
source $HOME/.screenrc-base
source $HOME/.screenrc-$HOST
source $HOME/.screenrc-users
# -----
Then, the base configurations are in ~/.screenrc-base; the host-specific configurations are in ~/.screenrc-$HOST, and the user configurations are in ~/.screenrc-users.
The host-specific .screenrc file might contain some host-specific screen commands; e.g.:
# ~/.screen-myhost
# -----
screen -t 'anywhere' /bin/tcsh
screen -t 'anywhere1' /bin/tcsh
# ----
The .screenrc-base contains:
# ~/.screenrc-base
## I find typing ^a (Control-a) awkward. So I set the escape key to CTRL-j instead of a.
escape ^Jj
termcapinfo xterm*
[email protected]:
[email protected]:
autodetach on
zombie kr
verbose on
multiuser on
Alternative of OJM snippet :
This one show the IP too, where ports bind. It's very important, because if there's only 127.0.0.1 instead of 0.0.0.0, connections from internet are rejected.
This command gives you the charset of a text file, which would be handy if you have no idea of the encoding.
Benchmark a SQL query against MySQL Server.
The example runs the query 10 times, and you get the average runtime in the output. To ensure that the query does not get cached, use `RESET QUERY CACHE;` on top in the query file.
The execution of this command will install a LAMP server (Linux, Apache, MySQL and PHP) in a Debian based distribution. For example, in Ubuntu.