:%g/^sometext,/ dsearch range (all lines) : %
beginning with "sometext,
execute the Ex cmd "d" ; delete the line
A place for John to record his techy notes, both to refer back to when needed, and as a help for others...
:%g/^sometext,/ d
john@hostname:~/.ssh$ ssh user@hostname
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: POSSIBLE DNS SPOOFING DETECTED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The RSA host key for hostname has changed,
and the key for the according IP address 123.45.67.89
is unknown. This could either mean that
DNS SPOOFING is happening or the IP address for the host
and its host key have changed at the same time.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
01:23:45:67:89:ab:cd:ef:fe:dc:ba:98:76:54:32:10.
Please contact your system administrator.
Add correct host key in /home/john/.ssh/known_hosts to get rid of this message.
Offending key in /home/john/.ssh/known_hosts:9
RSA host key for hostname has changed and you have requested strict checking.
Host key verification failed.
Offending key in /home/john/.ssh/known_hosts:9
$ ssh-keygen -R hostname
$ ssh-keygent -F hostname
for FILE in $(find * -type f -exec grep -l "$STRING" {} \;)
do
echo -n "$FILE"
grep -n "$STRING" $FILE
done
$ find * -type f -exec grep -n $STRING {} /dev/null \;
path/to/the/FILE:12:I found $STRING on line 12!
grep -n $STRING {} /
grep -n $STRING {} .
grep -n $STRING {} *
$ find * -type f -exec grep STRING {} no_such_file \;
grep: no_such_file: No such file or directory
grep: no_such_file: No such file or directory
grep: no_such_file: No such file or directory
grep: no_such_file: No such file or directory
grep: no_such_file: No such file or directory
[ AA.jpg ][ AB.jpg ][ AC.jpg ]
convert +append AA.jpg AB.jpg AC.jpg row_A.png
+append becomes -append like so:
[ row_A.png ]
[ row_B.png ]
[ row_C.png ]
convert -append row_A.png row_B.png row_C.png all_rows.png
#!/usr/bin/perl
#
#
#
use warnings;
use strict;
my $time = time % 86400;
#
# http://www.perlmonks.org/?node_id=101511
#
printf "%02d:%02d:%02d\n",(gmtime $time)[2,1,0];
#
# http://www.perlmonks.org/?node_id=101548
#
printf "%02d:%02d:%02d\n", ($time/3600)%24, ($time/60)%60, $time%60;
#!/usr/bin/perl
use warnings;
use strict;
use POSIX qw(mktime);
my $day = "2008-05-28";
my ($d_year, $d_mon, $d_mday) = split /-/, $day;
my $secs = mktime(0, 0, 0, $d_mday, $d_mon-1, $d_year-1900);
$ typeset -f [FUNCTION_NAME]
$ vncpasswd .vnc/passwd
Password:
Verify:
$ ll .vnc/
total 12
drwxr-xr-x 2 john john 4096 Mar 20 15:28 .
drwxr-xr-x 52 john john 4096 Mar 20 15:28 ..
-rw------- 1 john john 8 Mar 20 15:28 passwd
$ x0vncserver PasswordFile=.vnc/passwd
Thu Mar 20 15:33:32 2008
main: XTest extension present - version 2.2
main: Listening on port 5900
$ x0vncserver Protocol3.3 PasswordFile=.vnc/passwd
$ x0vncserver .
/etc/powersave/battery
BATTERY_WARNING="10"
BATTERY_LOW="5"
BATTERY_CRITICAL="0"
/etc/powersave/events
EVENT_BATTERY_LOW="notify"
EVENT_BATTERY_CRITICAL="notify john_suspend_to_disk"
/usr/lib/powersave/scripts/john_suspend_to_disk
#!/bin/sh
#
#
#
sleep 10
/usr/sbin/s2disk
#
# You could use:
# echo -n disk > /sys/power/state
#
# type s2disk
s2disk is a function
s2disk ()
{
echo -e "Confirm you want to suspend: \c";
read OK;
if [ "$OK" = "y" ]; then
/usr/sbin/s2disk;
fi
}