1.
while
(
true
);
do
wc
-l 92_OQ1_maillog.txt;
mv
92_OQ1_maillog.txt 92_OQ1_maillog.txt.`
echo
$(
date
'+%m%d%y%N')`;
sleep
5400;
done
;
1.
while
(
true
);
do
wc
-l 92_OQ1_maillog.txt;
mv
92_OQ1_maillog.txt 92_OQ1_maillog.txt.`
echo
$(
date
'+%m%d%y%N')`;
sleep
5400;
done
;
1.
wget --wait=5 --limit-rate=200K -m -k -E -U 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36' --no-check-certificate https://www.47thmain.com/
1.
UPDATE
products_staging
LEFT
JOIN
published
ON
products_staging.SKUID=published.skuid
SET
products_staging.PUBLISH =
'0'
WHERE
published.skuid
IS
NULL
1.
for
file
in
*;
do
myfile=`
echo
$
file
|
sed
-e 's/ //g'`; first=`
echo
$myfile |
sed
's/^\(.*\)\.\(.*\)/\1/'|
tr
'[a-z]' '[A-Z]'`; ext=`
echo
$myfile |
sed
's/^\(.*\)\.\(.*\)/\2/'|
tr
'[A-Z]' '[a-z]'`;
mv
"$file"
`
echo
"$first.$ext"
`;
done
1.
find
. -name
"*.html"
-mtime -35 -
exec
cp
{} ~/Sites/site/
cat
/templates/includes/ \;
001.
#!/bin/bash
002.
003.
# encrypts or decrypts files or directories with GPG
004.
ACTION=
""
;
005.
FILEORDIR=
""
;
006.
FILE=
""
;
007.
OUTPUTFILE=
"${HOME}/gpgout"
;
008.
MYOUTFILE=
""
;
009.
RECIPIENT=
""
;
010.
PASSWORD=
""
;
011.
FILEBASE=
""
;
012.
TEMPFILE=
""
;
013.
OUTFILE=
""
;
014.
GPGOUT=
""
;
015.
016.
# ask if this is an encrypt or a decrypt
017.
echo
"encrypt or decrypt? (encrypt) : "
;
018.
read
ACTION;
019.
if
[ -z $ACTION ];
then
020.
ACTION=encrypt;
021.
fi
022.
023.
# ask if this is a file or a directory
024.
echo
"is this a file or directory? (file) : "
;
025.
read
FILEORDIR;
026.
if
[ -z $FILEORDIR ];
then
027.
FILEORDIR=
file
;
028.
fi
029.
030.
# ask for full path to the file
031.
echo
"enter full path to the $FILEORDIR (no trailing slash) : "
;
032.
read
FILE;
033.
if
[ -z $FILE ];
then
034.
echo
"no $FILEORDIR entered, exiting."
;
035.
exit
;
036.
fi
037.
038.
# if directory, check it exists
039.
if
[ $FILEORDIR = 'directory' ];
then
040.
if
[ -d $FILE ];
then
041.
echo
"directory $FILE exists..."
042.
else
043.
echo
"$FILE does not exist, exiting."
044.
exit
;
045.
fi
046.
fi
047.
048.
# if file, check it exists
049.
if
[ $FILEORDIR = '
file
' ];
then
050.
if
[ -f $FILE ];
then
051.
echo
"file $FILE exists..."
;
052.
FILEBASE=`basename $FILE`;
053.
else
054.
echo
"$FILE does not exist, exiting."
;
055.
exit
;
056.
fi
057.
fi
058.
059.
# ask for output location
060.
echo
"Enter output directory with no trailing slash ($OUTPUTFILE) :"
;
061.
read
MYOUTFILE;
062.
if
[ -z $MYOUTFILE ];
then
063.
MYOUTFILE=$OUTPUTFILE;
064.
fi
065.
066.
# check that the output dir exists, if not, create it
067.
if
[ -d $MYOUTFILE ];
068.
then
069.
echo
""
;
070.
else
071.
mkdir
$MYOUTFILE;
072.
fi
073.
074.
# ask for the gpg recipient
075.
echo
"Enter the GPG recipient :"
;
076.
read
RECIPIENT;
077.
if
[ -z $RECIPIENT ];
then
078.
echo
"no GPG recipient entered, exiting."
;
079.
exit
;
080.
fi
081.
082.
if
[ $ACTION = 'decrypt' ]
083.
then
084.
085.
# Ask for their GPG passphrase silently
086.
echo
"Enter GPG passphrase : "
;
087.
stty -
echo
088.
read
PASSWORD;
089.
stty
echo
090.
091.
fi
092.
093.
############# BEGIN MEAT ###############
094.
095.
# if it's an encrypt job
096.
if
[ $ACTION = 'encrypt' ];
then
097.
098.
if
[ $FILEORDIR = '
file
' ];
099.
100.
then
# if it's a file
101.
gpg --encrypt --recipient
"$RECIPIENT"
--output
"${MYOUTFILE}/${FILEBASE}.gpg"
$FILE;
102.
else
# it's a directory - loop thru it and encrypt each file
103.
for
file
in
`
ls
$FILE |
tr
:
" "
`
104.
do
105.
gpg --encrypt --recipient
"$RECIPIENT"
--output
"${MYOUTFILE}/${file}.gpg"
${FILE}/${
file
};
106.
done
107.
108.
fi
# end if for file or directory
109.
110.
fi
# end action=encrypt
111.
112.
# if it's an decrypt job
113.
if
[ $ACTION = 'decrypt' ];
then
114.
115.
if
[ $FILEORDIR = '
file
' ];
116.
117.
then
# if it's a file
118.
OUTFILE=`
echo
$FILEBASE |
sed
's/\.gpg//g'`;
119.
GPGOUT=`gpg --decrypt --recipient
"$RECIPIENT"
--output ${MYOUTFILE}/${OUTFILE} --passphrase
"$PASSWORD"
$FILE &&
gt
; /dev/null`;
120.
else
# it's a directory - loop thru it and encrypt each file
121.
for
file
in
`
ls
$FILE |
tr
:
" "
`
122.
do
123.
OUTFILE=`
echo
$
file
|
sed
's/\.gpg//g'`;
124.
GPGOUT=`gpg --decrypt --recipient
"$RECIPIENT"
--output ${MYOUTFILE}/${OUTFILE} --passphrase
"$PASSWORD"
${FILE}/${
file
} &&
gt
; /dev/null`;
125.
done
126.
127.
fi
# end if for file or directory
128.
129.
echo
""
;
130.
echo
"BE SURE TO DELETE THE DECRYPTED FILES!"
;
131.
132.
fi
# end action=decrypt
1.
find / -amin -10 # find files accessed in last 10 minutes
2.
find / -atime -2 # find files accessed in last 48 hours
3.
find / -empty # find empty files and directories
4.
find / -group cat # find files owned by group cat
5.
find / -mmin -5 # find files modified in last 5 minutes
6.
find / -mtime -1 # find files modified in last 24 hours
7.
find / -nouser # find files owned by an invalid user
8.
find / -user fred # find files owned by fred
1.
zip -r myzip .
2.
unzip -l myzip.zip