You are on page 1of 6

tcpdump

tcpdump
tcpdump
tcpdump
tcpdump
tcpdump
tcpdump
tcpdump
tcpdump
tcpdump

-i
-i
-i
-i
-i
-i
-i
-i
-i
-i

lo
lo
lo
lo
lo
lo
lo
lo
lo
lo

udp port 7781 -A


udp port 7780 -A
udp port 7779 -A
udp port 7778 -A
udp port 14448 -A
udp port 14447 -A
udp port 14446 -A
udp port 14445 -A
udp port 13337 -A
udp port 13345 -A

//L4 to DB UMTS
//L4 to DB CDMA
//L4 to DB GSM
//L4 to DB LTE
//DB to L5 UMTS
//DB to L5 CDMA
//DB to L5 GSM
//DB tx side to L5 LTE
//L5 rx side from DB LTE
//PTT Alert output to the brain

//To access another machine use this command (as user not root)
ssh user@192.168.25.148
Once logged onto the other machine as user you can sudo su
//To
find
//To
find
//To
find

delete files of type *.tif smaller than 160k


-name "*.tif" -size -160k -delete
delete files greater than 160k use
-name "*.tif" -size +160k -delete
delete files exactly 160k use
-name "*.tif" -size 160k -delete

//Save make output to a file so you can grep for errors also displays it to std
out
make clean all install 2>&1 | tee output.log
//To reset the dhcpd leases remove the following file. This allows you to change
tuners connected to a backend
rm /var/lib/dhcp/dhcpd.leases
Then issue this command to restart the dhcp service
//back end dhcp server restart
/etc/init.d/isc-dhcp-server restart
//To run the reset script
mysql -uroot -ppassword < tableCreationText.sql
mysql -uroot -ppassword mrtDB
mysql> SHOW COLUMNS FROM mytable FROM mydb;
//restart udev rules variation 1 which didnt work for the gps
sudo service udev restart
//dmesg human readable timestamps
dmesg -T
//Use this to reload the udev rules
udevadm control --reload
//To watch what happens when devices
udevadm monitor
//or try
unbuffer udevadm monitor --environment
//To increase the logging of udev rules use this command
//The default log level for udev rules is "err" see file /etc/udev/udev.conf
//Then you will see all logs in your system log via syslog
udevadm control --log-priority=info
//display info about the port
stty -a -F /dev/gps

//set the port speed to 4800


stty -F /dev/gps ispeed 4800
//ouputs gps data
cat /dev/gps
//set 115200 8N1 for dev gps for the firefly gps
stty -F /dev/gps ispeed 115200 cs8 -cstopb -parenb
//gpsd commands (on my laptop)
lsof | grep ttyUSB0 // to see who owns this port
//To set the gps in nmea mode and 4800 baud and use gpsctl in low level mode
gpsctl -f /dev/ttyUSB0 -n -s 4800
gpsmon /dev/ttyUSB0
//serial port dump with timestamps
jpnevulator --ascii --timing-print --read --tty /dev/gps
//To see info about the serial ports
setserial -ga /dev/ttyS*
setserial -g /dev/ttyS*
//recursive searches that skip svn and cscope and tags files
grep -ri --exclude=*.{tags,svn} --exclude=tags --exclude=tt getGps *
grep -r --exclude=*.{tags,svn*} --exclude=tags --exclude=cscope* l3parse *
//Build stand alone gps
gcc CEventHandler.cpp NMEA.c NmeaParser.cpp SGPS.cpp -o sgpsTest2 -L . -l G3_Com
pat_2 -lpthread -lm -lrt
gdb --args commandname args for command name
//this command will set multiple delimeters for -F in this case ( and )
awk -F'[()]' '{ print $2 }'
//This command skips the Rover header lines and then takes the timestamp and con
verts it to seconds
awk -F [T,:' '] 'NR>6 { secs=$3*3600+$4*60+$5; print secs " " $0; }' | head
//This command will convert a hex string to into a c array format
//testMsgs holds the hex string
cat testMsgs | fold -2 | awk -F, 'BEGIN { print "\nunsigned char arrayName[]= {"
} { printf "0x%s, ", $0 } END { print "\n};"}'
//Use this command to extract the mib from a gns file
cat TSR_UMTS_2-4-5-20141015T112614.gns | awk -F, '{print $21 }'
//This is the folder where the l3parse is launched
/home/user/workspace/trunk/wcdma/UmtsDecoder/
//Subtract prev row from curr row in a file to get running offset
grep "Time update" nmeaParser.log | awk -F: '{ x[NR]=$NF } END { for(i=1; i<NR;
i++) {print x[i] ":" x[i-1] " delta=" x[i]-x[i-1]'}}
//Filters out wrap around near 59-0 then saves results to a file called tt which
gets cat into xgraph
//We also store the entire command in y[] array
grep "Time update" nmeaParser.log | awk -F: '{ y[NR]=$0; x[NR]=$NF; } END { for(
i=1; i<NR; i++) { if(x[i] > x[i-1]) {temp=x[i]-x[i-1]; print x[i] ":" x[i-1] " d
elta=" temp; print i " " temp > "tt"; } if(temp>2){print y[i]} } '}

//to see directories in svn


svn list https://subversion.g3np.org/
//to see total search/scan/decode tasks awaiting L4/L3 processing after the grab
is completed
//Note that this is assuming the log file is tech specific
grep push_q2 tsControl-umts.log | grep search | wc -l
grep push_q2 tsControl-umts.log | grep scan | wc -l
grep push_q2 tsControl-umts.log | grep decode | wc -l
//Verifies how often we write to Rover (Should be every second)
cat LteBrain.log | grep -i "Wrote to rover" | awk -F [T:' '] '{ x[NR]=$3*3600+$4
*60+$5;} END { for(i=1; i<NR; i++) { temp=x[i]-x[i-1]; print temp} }'
//Creates an xgraph file of the above command
cat LteBrain.log | grep -i "Wrote to rover" | awk -F [T:' '] '{ x[NR]=$3*3600+$4
*60+$5;} END { for(i=2; i<NR; i++) { temp=x[i]-x[i-1]; print i " " temp} }' > t
t.xg
//Setting the y axis min and max same pattern for x axis
xgraph -ly 0,5 tt.xg
//To see a specific users commits and files changed
svn log -v -l50 | sed -n '/agambardella/,/-----$/ p'
//To see all changes over a data range
svn log https://subversion.g3np.org/MRT/trunk -r {2014-10-30}:{2014-10-31}
//To see what will be updated prior to updating
svn status -u
//To verify if a backend has the larger buffer settings should see 1000000 if th
e change has been made
cat /proc/sys/net/ipv4/udp_rmem_min
//To debug the UMTS L3 SFN Gaps and verify SIB reception
///trunk/wcdma/UmtsDecoder/umts_decode_proc_308.sh is the script that starts the
se processes
tail -f chDecoder.log | grep "CRC fail"
tail -f v49umts.log | grep missed
tail -f umtsL3.10213.log | grep "Block11\|INVALID"
grep 7FC80A731700 dblog.log | grep 00:28:30
bwm-ng
//Get the unique thread ids of a Brain program from the Brain log
cat LteBrain.log | awk '{ print $3 }' | sort | uniq
//visual folder and file disk usage
k4dirstat
//Calc gns file time stamp gaps between rows and prints entire line where gap is
larger than 2 seconds
cat *LTE*.gns | awk -F [T,:' '] '{ x[NR]=$3*3600+$4*60+$5; y[NR]=$0 } END { fo
r(i=1; i<NR; i++) { temp=x[i]-x[i-1]; if(temp >= 3) print temp "---" y[i-1]; }
}' > tt
//To mount the g3 vault network folder to get to it via the command line
//Step 1: goto the /mnt folder and create the following folder
mkdir vault
//Step 2: issue this command and use your domain password
root@tsdev-777:/mnt# smbmount //s20-dc001/g3\ vault /mnt/vault/ -o user=agambard

ella
//vi command to delete blank lines in the file being edited
:g/^$/d
//Find 10 largest
du -hsx * | sort -rh | head -10
//This command removes duplicates from an existing command history file
//note that there are 2 history files one is in /root and the other in /home/use
r
cat .bash_history | awk '!x[$0]++' > ttt
//To calc just the avg task times in dblog over entire test
grep "LTE Processing time for taskType=0" dblog.log | awk '{ sum += $NF; n++; pr
int $NF } END { if (n > 0) print sum / n; }'
//Does max and avg
grep "LTE Processing time for taskType=2" dblog.log | awk 'BEGIN {max = 0} { if
($NF>max) max=$NF; sum += $NF; n++; } END { if (n > 0) print "AVG="sum / n; pri
nt "MAX=" max }'
//To
grep
//To
grep

grep for a floating point number 1935.0


-w "1935[\.]0" LteBrain_2014_1119_230005.log | grep LTE_search
grep for a negative floating point value -98.6
-w "\-98[\.]6" LteBrain_2014_1119_230005.log | grep LTE_search

//removes carls colorcodes


sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" output.log > output.log2
mysqldump -uroot -ppassword --no-create-info --complete-insert mrtDB MissionHist
ory > /tmp/missionHistorySave.sql
mysql -uroot -ppassword < /var/www/ts/data/tableCreationText.sql
mysql -uroot -ppassword mrtDB < /tmp/missionHistorySave.sql
mysql -uroot -ppassword < /var/www/ts/data/fillMccMncTableText.sql
mysql -uroot -ppassword < /var/www/ts/data/TSAK.sql
mysql -uroot -ppassword < /var/www/ts/data/TSAK_SID.sql
mysql -uroot -ppassword < /var/www/ts/data/fillBandsTable.sql
//To see how many times a cell was dropped from the brain issue the following gr
ep command:
grep -i badfscount=5 LteBrain.log
//For new jackson labs firefly gps
KERNEL=="ttyUSB*", ATTRS{idVendor}=="050d", ATTRS{idProduct}=="0109", NAME="gps"
, RUN+="/Virtuoso/master/kickGPS.sh", OPTIONS+="last_rule"
//Mike D's incomplete and lame way to do a grab at some unknown freq
trunk/NDR308# ./bps.308 eth2 //channelizer per data stream
trunk/NDR308# ./bps.308 eth3 //all IF data
trunk/NDR308# ./ndr308_grab --port 14001 -n 20000 //does an lte grab and saves a
xxx.v49 file to same folder
//Agam way that works to do a grab at a known freq
//Step 1 start ndr308 server
ndr308_Server -host 192.168.1.20 -cfg /usr/local/bin/ndr308.cfg
//Step 2 do the grab
/wcdma/CellSearch/udpTunerCmdClient 'grab tech=lte to=10000 freq='$FREQ' blocks=
85 name='outputfilename bw=1.4'
//To run the g3lte proc as a udp server issue the following command

g3lte -l 1
//Then run udp_send --portnum and hit return
//Then in the udp_send terminal paste the following command
"id=2408 type=decode f=1935.0000 name=/public/mrt/logs/mikedbag4 out=/public/mrt
/logs/mikedout pci=291"
//The g3lte logging goes to file mikedout
//To grep whole words use the -w option
//To pretty print shell output pipe the output through
command bla bla bla | column -t
//Counts the number of commas in each sendTask line which is used to count the n
umber of brain sendTasks that
//are multiple scans or decodes
grep sendTask CdmaBrain.log | awk -F, '/,/{sum+=(NF-1); print NR,NF-1,sum $0}'
//just the sum
grep sendTask CdmaBrain.log | awk -F, '/,/{sum+=(NF-1);} END {print sum} '
//Start ndr308 server. This is in usr/local/bin and doesnt require the ./
ndr308_Server -host 192.168.1.20 -snapwait 3000 &> /public/mrt/logs/ndr308_Serve
r.log &
//Start tsControl for EVDO
tsControl --evdo --num_proc 2 --q1-depth 30 --q2-depth 20 --grab-depth 4 &> /pub
lic/mrt/logs/tsControl-evdo.log &
//Start db
mrtdbProxy -d DEBUG4 &
//Switch to vim, and use :set hlsearch
//You can then use :highlight Search ctermfg=yellow to customize; where:
cterm is for formating
ctermfg is for foreground color
ctermbg is for background color
//see :help highlight link
//You can then use :noh to temporarily hide the last search highlight.
//to close the quickfix list
:ccl
//This is a line from the tsControl log for CDMA. This is how you determine if P
N 0 is a problem. The value in parenthesis (0.018s) is what you need to focus on
.
//If its bigger than 10 seconds than PN0 will be unreliable because searches are
not occurring often enough to keep it updated.
***WARNING***: G3NJ_ERR: cdma_cell_search: samp_num= 1309991452 pn0_samp_num= 13
09969948 diff= 21504 (0.018s) PN= 244 peakIndex= 6582 Ec/Io= -5.06 PN0= 16082 PN
0_avg= 16084.73 stream_id= 6
//Use this command to awk out that PN0 related time value. This command will sor
t the values from smallest to largest.
//NOTE THAT THE FIRST VALUE in the beginning of the log should be ignored. It wi
ll be a very large value.
grep -i pn0 tsControl-cdma.log | awk -F'[()]' '{ print $2 }' | sort -n
//to see how many channelizers are being used use this command (CDMA example)
grep CDMA- ndr308_Server.log
//to use non promiscuous mode
tcpdump -p -i eth2
If you want the app to always run as root

1) Pin the application to the launcher as normal.


2) Locate the applications .desktop file which will be in either:
/usr/share/applications/APPNAME.desktop
~/.local/share/applications/APPNAME.desktop
or somewhere else, use locate .desktop|grep APPAME
3) Open with gedit:
gksudo gedit /usr/share/applications/APPNAME.desktop
4) Change then line
Exec=APP_COMMAND
to
Exec=gksudo -k -u root APP_COMMAND
5) Save
This command will also keep your environment which is very usefull if you need t
o connect to others servers and use your private key.
To add a quicklist option to 'Run as root'
Follow steps 1, 2 and 3 above
If the launcher currently doesn't have any other quicklist options, just append
this to the end of the document
X-Ayatana-Desktop-Shortcuts=Runroot
[Runroot Shortcut Group]
Name=Run as root
Exec=gksudo -k -u root APP_COMMAND
TargetEnvironment=Unity
PTT compile steps
----------------cd /home/user/workspace/ptt/G3_Core;
make clean all install
cd /home/user/workspace/ptt/NDR308;
make clean all v49_ndr308.o # need this .o
cd /home/user/workspace/ptt/ptt;
make v49_main ptt_scan
cd /home/user/workspace/ptt/ptt/WF;
make all
PTT run these programs
---------------------cd /home/user/workspace/ptt/NDR308;
./lab.dip;
ndr308_Server -host tunerCtrl
# from another terminal do a grab at 145MHz to set tuner freq. If it works y
ou will see "uuusnd(): resp is ok"
fn=/tmp/xx-lte.v49; rm $fn; uuusnd -p 5555 "grab tech=lte freq=145 blocks=90
0 name=$fn bw=20" OK
cd /home/user/workspace/ptt/ptt;
./v49_main -p 14001 # 14001-4 or 14023
./ptt_scan -T 15 -N 2048 -F 0.00 -C -S 30.72 # thresh, fftLen, fC, conj, sR
cd /home/ptt/ptt/WF;
./pumpit.sh

You might also like