R command prompt with current time
Posted by on 2013.01.28
updatePrompt <- function(...) {options(prompt=paste(Sys.time(),"> ")); return(TRUE)}
addTaskCallback(updatePrompt)
list ps pids
Posted by on 2013.01.26
ps -eaf | grep oracle | grep bash | tr -s ' ' | cut -d ' ' -f 3
mvs installation
Posted by on 2012.12.09
-
Copy CD dir into you HDD, and modify setup script – apply a patch:
--- /Users/egor/010.Soft/MVS/setup 2012-12-05 19:28:28.000000000 +0400 +++ /Volumes/CDROM/setup 2002-08-01 05:00:00.000000000 +0400 @@ -301,7 +301,7 @@ FILENAME=${FULLNAME##*/} FULLPATH=${FULLNAME%/*} TARGET=${FULLPATH##*/} - sed -f conf.sed ${FULLNAME} >${TARGET}/${FILENAME} + sed ${FULLNAME} -f conf.sed >${TARGET}/${FILENAME} done } @@ -1275,7 +1275,7 @@ fi echo -e "\n\n${RED}" mkdir -p ${TARGET_PATH} >/dev/null 2>&1 -TMPFILE=`date -u +T%Y%m%d-%H%M%S` +TMPFILE=`date --utc +T%Y%m%d-%H%M%S` cat >${TARGET_PATH}/${TMPFILE} <setup 2>/dev/null cat >${TARGET_PATH}/${TMPFILE} <setup if [ $? = 0 ] ; then @@ -1748,9 +1748,9 @@ SPATH=${RESULT} echo "s%_CDROM%"${SPATH}%g >>conf.sed echo "s%_CDDIR%"${SOURCE_PATH}%g >>conf.sed - sed -f conf.sed ${SOURCE_PATH}/conf/_startterm.bat >startterm.bat + sed ${SOURCE_PATH}/conf/_startterm.bat -f conf.sed >startterm.bat if [ ${A_HERCGUI} = ${TRUE} ] ; then - sed -f conf.sed ${SOURCE_PATH}/conf/_startgui.bat >startgui.bat + sed ${SOURCE_PATH}/conf/_startgui.bat -f conf.sed >startgui.bat fi if [ ${A_C3270} = ${TRUE} ] ; then mkdir -p /usr/share/terminfo/c @@ -1760,21 +1760,21 @@ *) echo "s%_MYDIR%"${TARGET_PATH}%g >>conf.sed echo "s%_CDROM%"${SOURCE_PATH}%g >>conf.sed echo "s%_CDDIR%"${SOURCE_PATH}%g >>conf.sed - sed -f conf.sed ${SOURCE_PATH}/conf/_startterm >startterm + sed ${SOURCE_PATH}/conf/_startterm -f conf.sed >startterm chmod 777 startterm ;; esac cpsed ${SOURCE_PATH}/conf/* cpsed ${SOURCE_PATH}/conf/*.conf - chmod -R 666 ./conf/*.conf + chmod --recursive 666 ./conf/*.conf cpsed ${SOURCE_PATH}/conf/*.rc - chmod -R 666 ./conf/*.rc + chmod --recursive 666 ./conf/*.rc cpsed ${SOURCE_PATH}/conf/*.ctl - chmod -R 666 ./conf/*.ctl + chmod --recursive 666 ./conf/*.ctl cp ${SOURCE_PATH}/conf/*.sed ./conf - chmod -R 666 ./conf/*.sed + chmod --recursive 666 ./conf/*.sed cp ${SOURCE_PATH}/conf/fse* ./conf - chmod -R 666 ./conf/fse* + chmod --recursive 666 ./conf/fse* chmod +x ./conf echo -e "${TURQ}Building ${WHITE}./standalone${TURQ} directory" @@ -1792,7 +1792,7 @@ cpsed ${SOURCE_PATH}/jcl/* #chmod --silent --recursive 666 jcl/* - chmod -R 666 jcl/* + chmod --silent --recursive 666 jcl/* chmod a+rwx ./jcl echo -e "${TURQ}Building ${WHITE}./scripts${TURQ} directory" if test ! -d scripts @@ -1800,7 +1800,7 @@ mkdir scripts fi cpsed ${SOURCE_PATH}/scripts/* - chmod -R 777 ./scripts + chmod --recursive 777 ./scripts cp ./scripts/sub ./jcl/sub cd ./scripts ln -s ins0030 startstarter @@ -1812,25 +1812,25 @@ cpsed ${SOURCE_PATH}/scripts/*.bat cp ./scripts/sub.bat ./jcl/sub.bat cp ${SOURCE_PATH}/windows/qws3270/qws3270.ini ./scripts - chmod -R 777 ./scripts + chmod --recursive 777 ./scripts chmod +w ./scripts/qws3270.ini else rm -rf ./scripts/*.bat - chmod -R 777 ./scripts + chmod --recursive 777 ./scripts chmod +x ./scripts fi if [ "${CHOICE}" = "turnkey" ] ; then - sed -f conf.sed ${SOURCE_PATH}/conf/turnkey${TURNCONF}_mvs.conf >conf/turnkey_mvs.conf - sed -f conf.sed ${SOURCE_PATH}/conf/turnkey${TURNCONF}_zzsa.conf >conf/turnkey_zzsa.conf + sed ${SOURCE_PATH}/conf/turnkey${TURNCONF}_mvs.conf -f conf.sed >conf/turnkey_mvs.conf + sed ${SOURCE_PATH}/conf/turnkey${TURNCONF}_zzsa.conf -f conf.sed >conf/turnkey_zzsa.conf case "${THEOS}" in linux) echo -e "${TURQ}Installing startup scripts for linux" - sed -f conf.sed ${SOURCE_PATH}/conf/_setterm >setterm - sed -f conf.sed ${SOURCE_PATH}/conf/_startmvs >startmvs - sed -f conf.sed ${SOURCE_PATH}/conf/_saclip >saclip - sed -f conf.sed ${SOURCE_PATH}/conf/_xstartmvs >xstartmvs - sed -f conf.sed ${SOURCE_PATH}/conf/_kstartmvs >kstartmvs - sed -f conf.sed ${SOURCE_PATH}/conf/_startzzsa >startzzsa + sed ${SOURCE_PATH}/conf/_setterm -f conf.sed >setterm + sed ${SOURCE_PATH}/conf/_startmvs -f conf.sed >startmvs + sed ${SOURCE_PATH}/conf/_saclip -f conf.sed >saclip + sed ${SOURCE_PATH}/conf/_xstartmvs -f conf.sed >xstartmvs + sed ${SOURCE_PATH}/conf/_kstartmvs -f conf.sed >kstartmvs + sed ${SOURCE_PATH}/conf/_startzzsa -f conf.sed >startzzsa chmod 777 * ;; linux-gnu) echo -e "${TURQ}Installing startup scripts for linux-gnu" @@ -1853,15 +1853,15 @@ chmod +w qws3270.ini ;; *) echo -e "${TURQ}Installing startup scripts" ${THEOS} - sed -f conf.sed ${SOURCE_PATH}/conf/_startmvs.bat >startmvs.bat - sed -f conf.sed ${SOURCE_PATH}/conf/_setterm >setterm - sed -f conf.sed ${SOURCE_PATH}/conf/_startzzsa.bat >startzzsa.bat - sed -f conf.sed ${SOURCE_PATH}/conf/_saclip >saclip - sed -f conf.sed ${SOURCE_PATH}/conf/_saclip.bat >saclip.bat - sed -f conf.sed ${SOURCE_PATH}/conf/_startmvs >startmvs - sed -f conf.sed ${SOURCE_PATH}/conf/_xstartmvs >xstartmvs - sed -f conf.sed ${SOURCE_PATH}/conf/_kstartmvs >kstartmvs - sed -f conf.sed ${SOURCE_PATH}/conf/_startzzsa >startzzsa + sed ${SOURCE_PATH}/conf/_startmvs.bat -f conf.sed >startmvs.bat + sed ${SOURCE_PATH}/conf/_setterm -f conf.sed >setterm + sed ${SOURCE_PATH}/conf/_startzzsa.bat -f conf.sed >startzzsa.bat + sed ${SOURCE_PATH}/conf/_saclip -f conf.sed >saclip + sed ${SOURCE_PATH}/conf/_saclip.bat -f conf.sed >saclip.bat + sed ${SOURCE_PATH}/conf/_startmvs -f conf.sed >startmvs + sed ${SOURCE_PATH}/conf/_xstartmvs -f conf.sed >xstartmvs + sed ${SOURCE_PATH}/conf/_kstartmvs -f conf.sed >kstartmvs + sed ${SOURCE_PATH}/conf/_startzzsa -f conf.sed >startzzsa ;; esac if test ! -d dasd @@ -1906,22 +1906,22 @@ fi fi if [ ${STARTER_INST} = ${TRUE} ] ; then - sed -f conf.sed ${SOURCE_PATH}/conf/turnkey${TURNCONF}_starter.conf >>conf/turnkey_mvs.conf - sed -f conf.sed ${SOURCE_PATH}/conf/turnkey${TURNCONF}_starter.conf >>conf/turnkey_zzsa.conf + sed ${SOURCE_PATH}/conf/turnkey${TURNCONF}_starter.conf -f conf.sed >>conf/turnkey_mvs.conf + sed ${SOURCE_PATH}/conf/turnkey${TURNCONF}_starter.conf -f conf.sed >>conf/turnkey_zzsa.conf fi if [ ${CBT_INST} = ${TRUE} ] ; then - sed -f conf.sed ${SOURCE_PATH}/conf/turnkey${TURNCONF}_cbt.conf >>conf/turnkey_mvs.conf - sed -f conf.sed ${SOURCE_PATH}/conf/turnkey${TURNCONF}_cbt.conf >>conf/turnkey_zzsa.conf + sed ${SOURCE_PATH}/conf/turnkey${TURNCONF}_cbt.conf -f conf.sed >>conf/turnkey_mvs.conf + sed ${SOURCE_PATH}/conf/turnkey${TURNCONF}_cbt.conf -f conf.sed >>conf/turnkey_zzsa.conf fi if [ ${SRC_INST} = ${TRUE} ] ; then - sed -f conf.sed ${SOURCE_PATH}/conf/turnkey${TURNCONF}_src.conf >>conf/turnkey_mvs.conf - sed -f conf.sed ${SOURCE_PATH}/conf/turnkey${TURNCONF}_src.conf >>conf/turnkey_zzsa.conf + sed ${SOURCE_PATH}/conf/turnkey${TURNCONF}_src.conf -f conf.sed >>conf/turnkey_mvs.conf + sed ${SOURCE_PATH}/conf/turnkey${TURNCONF}_src.conf -f conf.sed >>conf/turnkey_zzsa.conf fi if [ ${SMP_INST} = ${TRUE} ] ; then - sed -f conf.sed ${SOURCE_PATH}/conf/turnkey${TURNCONF}_smp.conf >>conf/turnkey_mvs.conf - sed -f conf.sed ${SOURCE_PATH}/conf/turnkey${TURNCONF}_smp.conf >>conf/turnkey_zzsa.conf + sed ${SOURCE_PATH}/conf/turnkey${TURNCONF}_smp.conf -f conf.sed >>conf/turnkey_mvs.conf + sed ${SOURCE_PATH}/conf/turnkey${TURNCONF}_smp.conf -f conf.sed >>conf/turnkey_zzsa.conf fi - chmod -R 666 ${TARGET_PATH}/dasd/* + chmod --recursive 666 ${TARGET_PATH}/dasd/* chmod a+x ${TARGET_PATH}/dasd if [ "${DASDLOC}" = "HDSHADOW" ] ; then chmod -w ${TARGET_PATH}/dasd/* -
After installing mvs you may generate some files following the instructions on http://www.bsp-gmbh.com/turnkey/cookbook/genmvs.html: on step INS0010 you must change
scripts/makeadisk:# ckd2cckd -compress 1 -quiet $1 $1.$2 >>../log/mak$1.log 2>&1 ckd2cckd -q $1 $1.$2 >>../log/mak$1.log 2>&1
-
Изменить файл
scripts/ins0050,0080:# ckd2cckd -compress 1 -quiet ... ckd2cckd -q ...
-
Изменить файл
scripts/sub:#netcat -w1 -vv $HOST $PORT < $1 netcat -w1 -vv $HOST $PORT < $1
Be a Professional
Posted by on 2012.12.08
- ‘owning the problem’ – when someone brings a problem to you, you make sure that it is solved and the person with the problem knows when it is solved, even if you need to ask someone else to solve it.
- admitting mistakes, putting them right as far as you can, and implementing measures to stop them happening again
- ensuring that anyone who might be adversely affected by what you are doing is consulted or at least informed – what they are doing might be a lot more important to the organisation than what you are doing!
- ensuring that you use methods which maximise the quality of your work and minimise any adverse consequences for your users. The rest of this section is devoted to a discussion of some of these ‘professional methods’.
http://web.archive.org/web/20060711085731/http://www.mvsbook.fsnet.co.uk/chap01.htm#Section4
use git work-tree to update production/live site
Posted by on 2012.11.22
#!/bin/bash
while read oldrev newrev ref
do
branch=`echo $ref | cut -d/ -f3`
if [ "master" == "$branch" ]; then
git --work-tree=/path/under/root/dir/live-site/ checkout -f $branch
echo 'Changes pushed live.'
fi
if [ "dev" == "$branch" ]; then
git --work-tree=/path/under/root/dir/dev-site/ checkout -f $branch
echo 'Changes pushed to dev.'
fi
done
latex paper-writing
Posted by on 2012.11.15
Use visual-line-mode instead of longlines-mode for better reverse search. Because the line numbers remains the same in visual-line-mode only.
git sparse checkout
Posted by on 2012.08.26
You can use the following script to checkout the only or the specified dirs from git remote repo:
REMOTE_PATH="git@<remote_url>:<folder_name.git>"
LOCAL_PATH=<folder_name>.git
TRUNC=sub/folder/* # list of subfolders; the `*' is very
# impotant for Windows
BRANCH=master # suppose that actual branch is `master'
REMOTE_NAME=R # I don't like standard name `origin'
# -- Wait for the user confirmation
echo -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
echo DO YOU REALLY WANT TO PULL THE "$TRUNC" FROM "$REMOTE_PATH" ?
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo !!! REMOTE_PATH : "$REMOTE_PATH"
echo !!! LOCAL_PATH : "./$LOCAL_PATH"
echo !!! TRUNC : "$TRUNC"
echo !!! BRANCH : "$BRANCH"
echo !!! REMOTE_NAME : "$REMOTE_NAME"
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo Press Ctrl-C to abort git pull.
echo Press Enter to continue...
echo -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
read answer
# Create and initialize your new repository
mkdir $LOCAL_PATH
cd $LOCAL_PATH
git init
git remote add $REMOTE_NAME $REMOTE_PATH
git fetch $REMOTE_NAME
# Enable sparse-checkout
git config core.sparsecheckout true
# Configure sparse-checkout by listing your desired
# sub-trees in .git/info/sparse-checkout
echo $TRUNC >> .git/info/sparse-checkout
# Checkout from the remote
git pull $REMOTE_NAME $BRANCH
#
# NOTE:
# For existing project use the following commangs:
#
# git read-tree -m -u HEAD
# git sparse $TRUNC
#