Skip to content

kgyang/script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

USER GUIDE FOR SCRIPTS

(Note: This document is generated by common/genreadme)

clearcase/co-restore

restore/merge the checkouts in CO_SAVE_FILE to current view.
The CO_SAVE_FILE MUST be created by 'co-save'.
The results are saved in /tmp/$LOGNAME/co-restore/result.diff.

Usage: co-restore <CO_SAVE_FILE>

clearcase/co-save

save all clearcase checkout files along with their version info in a tar file.

Usage: co-save [CO_SAVE_FILE]
if CO_SAVE_FILE is not specifed, 'co-VIEWNAME-DATETIME.tar' is named.
The CO_SAVE_FILE is used by 'co-restore' to restore the checkout files to another view.

clearcase/updateco

synchronize checked out files in current clearcase view from FTP SERVER to local Linux machine

clearcase/updateremoteco.py

update source code from local PC to specified clearcase view in remote machine
Usage:
export HOST_PASSWORD=xxxxxx
updateremoteco.py HOST VIEW

clearcase/whoci.py

Find who added/deleted CODE in FILE in BRANCH (main branch by default)
Usage: whoci.py <add|del> <CODE|LINERANGE> <FILE> [BRANCH]
CODE: code piece, LINERANGE: startline,endline
BRANCH example:
main - main branch
Example:
whoci.py add 'int v = 1;' a.cc
whoci.py add 22,25 a.cc

common/bcscope

build cscope files for source files in specified directory
Usage: bcscope <dirname>

common/bid.py

automatic bid for shanghai license (for fun)

common/codestat

./codestat <file1> <file2>
identical to "diff -u diff1 diff2 | diffstat

common/codesync

sync source code between two git repositories
Usage: codesync <to|from> <remote>

common/download_cs143

download cs143(compilers design) pdf documents listed in the page

common/gdb_stack

run gdb to analyse corrupted stack
./gdb_stack <exefile> <coredump>

common/genreadme

generate README.md

common/itoa

translate hex integer to string
Usage:
1) echo '31 be' | itoa
2) ./itoa 32 be

common/itoa.py

translate hex integer to string.
Usage:
1) echo '31 be' | ./itoa.py
2) ./itoa.py 32 be

common/prune_binary

remove unprintable in files
Usage: prune_binary <file...>

common/rm_trailing_space

remove trailing white space in file
Usage: ./rm_trailing_space <file...>

common/rmcomments

remove C/C++ comments
Usage: rmcomments [<file...>]

common/sendmail.py

sendmail utility

cpu/cpu_usage_monitor

cpu usage monitor

cpu/process_cpu_usage

print process cpu usage
Usage: ./process_cpu_usage <processname>

git/git-cppcheck

This script prints out cppcheck results of code changes.
The code changes could be uncommitted (by default) or commit specified.
It returns 1 if there're error or warning reports.

Usage: git-cppcheck [<commit|file>...]

Examples:
git-cppcheck -- check uncommitted code changes
git-cppcheck HEAD -- check code changes in latest commit
git-cppcheck 03c58d -- check code changes in commit
git-cppcheck *.cc -- check files

git/git_ls

list all changed/new files in a commit
Usage: ./git_ls [commit]

git/gt_whoci

find out the commit which made the given code change
Usage: gt_whoci <text> <file>

logger/logvisualizer.py

plot realtime PTP timestamp information by reading log or connecting MACHINE
Usage: logvisualizer.py [-l sync|dlyr|tod|offset|freqoffset] [-v] [-f logfile] [-t <hours>]
-l: specify type of log to be parsed and shown
-f: specify logfile to be played back
-v: verbose mode, in which script will print received log

logger/rlogger

This script is used to read log from fifo in remote machine
Usage: rlogger -n <IP> [-t <HOURS>]
-m: master mode, in which script will close fifo before exit

logger/rlogger_ssh

This script is used to read log from fifo on remote machine
Usage: rlogger_ssh [-t <HOURS>] -n <IP>
-t: specify run time (hours), 24 hours by default

logger/rlogger_ssh_simple

This script is used to read log from remote machine without time limitation
Usage: rlogger_ssh_simple <IP>

network/atelnet

automatic telnet by using KSH's two-way FIFO
Usage: atelnet <MACHINE>

network/atelnet.py

Telnet client class.
Usage: atelnet.py [-v] <IP>
-v: enable verbose

Example 1):
>>> from atelnet import ATelnet
>>> with ATelnet('135.252.212.251') as tn:
>>> rc, res = tn.run('ls /')
>>> if rc:
>>> for ln in res: print(ln)

Example 2):
-> { echo 'ls /'; echo 'ls /tmp'; } | ./atelnet.py 1.2.3.4

Example 3):
-> ./atelnet.py 1.2.3.4

network/atelnet_fifo

automatic telnet by making temp fifo
Usage: atelnet_fifo <NE>

network/cli.py

CLI client class.
Usage: cli.py [-v] <MACHINE>
-v: enable verbose'
Example 1):
>>> from cli import Cli
>>> with Cli('1.2.3.4') as cli:
>>> rc, res = cli.run('help')
>>> if rc:
>>> for ln in res: print(ln)

Example 2):
-> { echo 'help'; } | ./cli.py 1.2.3.4

Example 3):
-> ./cli.py 1.2.3.4

network/itelnet.py

Telnet client class for innet.
Usage: itelnet.py [-v] <IP> <INNETC> <INNETD> [<LOGIN> <PASSWORD>]
-v: enable verbose

Example 1):
>>> from itelnet import ITelnet
>>> lc = ITelnet('1.2.3.4', 1, 19)
>>> rc, res = lc.run('ls /')
>>> if rc:
>>> for ln in res: print(ln)

Example 2):
-> { echo 'ls /'; echo 'ls /tmp'; } | ./itelnet.py 1.2.3.4 1 19

Example 3):
-> ./itelnet.py 1.2.3.4 1 19
-> ./itelnet.py 1.2.3.4 1 2 username password

network/pdir

upload directory specified to ftp server
Usage: pdir <ldir> <rdir>

network/rftp

get/put files from/to peer server
Usage: rftp <get|put> <filename>...

network/rsftp

get/put files from/to peer server via sftp
Usage: rsftp <get|put> <filename>...

trustanchor/buildpem.py

build trust anchor
Usage: buildpem.py <csvfile> <pemfile>
- Input: <csvile>, Output: <pemfile>

trustanchor/verifypem

verfiy trust anchor via SHA-256 calculation
Usage: verifypem <pemfile>

vps/blockip.sh

use iptables to block ip in secure/auth log and ips_deny.txt
Usage: ./blockip.sh <start|stop>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published