Skip to content

Tools and utilities

ferng edited this page Nov 18, 2020 · 24 revisions

Tools and utilities, no longer can you get away with a line editor (actually I don't know if you ever could), so here are a few bits and bobs you'll be needing.

Environment

Conemu / Gitbash

HOME = C:\Users\ferng\Documents
  • install gitbash
  • install conemu

Configure conemu shells

Shells::cmd
hotkey	ALT + 1

Bash::Git bash
hotkey  ALT + 2
task parameters  /dir C:\Users\ferng\Documents
  • Startup | Specified named task : Bash::Git bash
  • Configure Work PC/Proxy and clone remote repository down
  • Solarized theme
  • Change conemu startup directory to the same directory

Configure gitbash home directory

  • Goto C:\Program Files\Git\etc.profile
  • Edit .profile to point to the desired home directory
  • Move existing .gitconfig to new home directory

Comms

TcpMon

#as fern
cd ~/bin
cp ~/Downloads/tcpmon-1.0-bin.zip .
unzip tcpmon-1.0-bin.zip
rm tcpmon-1.0-bin.zip

#run it
java -cp /home/fern/bin/tcpmon-1.0-bin/build/tcpmon-1.0.jar org.apache.ws.commons.tcpmon.TCPMon $*

Putty

Installation

#<Windows>+R
C:\Users\Fernando\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

#new shortcut for pageant (used for remote authentication by putty)
C:\Users\Fernando\Documents\bin\putty\PAGEANT.EXE C:\Users\Fernando\Documents\admin\keys\private.ppk

Sessions

  • Tunnels from remotes through staging onto PC:
    • window | Lines of scrollback: 20000
      • appearance: [cursor: vertical line, cursor blinks] [font: lucida console 10pt]
      • colours: [foerground: 91, 186, 255]
    • connection
      • data: autologin username
      • ssh | auth: [attempt authentication using pageant, allow agent forwarding] *allow agent forwarding
#direct connection from command line
putty -load ref13 root@gfds-ref13-web-01

#with a single tunnel
putty -load scd11 relmgmt@dfsfd-scd11-web-01.stag.mine.net -L 20180:localhost:4848

#remote tunnel (tunnel to tunnel)
putty -load scd11 relmgmt@fdsfsd-scd11-web-01.stag.mine.net -L 20064:localhost:20064
ssh -f fern@dsadsa-cd01-int-01-avip -L20064:localhost:4848 -N

Unix

bash environment

shell type environment settings in this order
interactive login shell (or non-interactive --login shell) /etc/profile
~/.bash_profile
~/.bash_login
~/.profile
/etc/profile.d/*
interactive non-login shell (bash) ~/.bashrc
shell scripts check BASH_ENV
interactive non-login shell check ENV
as posix - interactive non-login shell check ENV
connected via rshd or sshd ~/.bashrc
started with group id not equal to real user group id No start up files

home directory config

# pull down config from git and set up home
git clone git@github.com:ferng/config.git
cp -R config/unixHome/.ackrc ~
cp -R config/unixHome/.vim* ~

sync config from PC to git

# find changes
vimdiff .ackrc ~/prog/config/unixHome/.ackrc
vimdiff .vimrc ~/prog/config/unixHome/.vimrc

#copy from home directory to config's git directory
:diffput

#copy from config's git directory to home directory
:diffget

curl

# test an endpoint (if telnet is not available)
curl -G srv999.xxx.xx.int:1571
curl test-cp-xxxx-scan.xxx.xx.int:1570

# get some big file to view
curl -G http://logs-xxx.xxxx.xx.int/logs_uv999/cdp-xx/cdp-xx_1.log | less

#ping an endpoint to do something
curl -X POST http://localhost:7822/app/xxxxx/xxxxx/
curl -v -X GET http://localhost:7822/app/logs/automated?page=0&size=20000&lastRefresh=2018-10-16T16:06:25

scp

# copy a remote file to local
scp user@xxxx23.xxx.xx.int:/u01/upload/remote_file.war local_file.war

openssl

# test an endpoint
openssl s_client -connect xx29-3v.xxxxxxx.eu:443 -key 3v_it.key

snoop

# listen to traffic
snoop -digb1376002 -o noUrlActivitity.cap  -x tcp port 8443

files

# update dates
touch -t 201303111152 integrationserver-billdesk-server-1.29
find ./ -exec touch -t 201303111152 {} \;

Clone this wiki locally