A 1 Cool Commands
A 1 Cool Commands
//L4 to DB UMTS
tcpdump -i lo udp port 7780 -A
//L4 to DB CDMA
tcpdump -i lo udp port 7779 -A
//L4 to DB GSM
tcpdump -i lo udp port 7778 -A
//L4 to DB LTE
tcpdump -i lo udp port 14448 -A
//DB to L5 UMTS
tcpdump -i lo udp port 14447 -A
//DB to L5 CDMA
tcpdump -i lo udp port 14446 -A
//DB to L5 GSM
tcpdump -i lo udp port 14445 -A
//DB tx side to L5 LTE
tcpdump -i lo udp port 13337 -A
//L5 rx side from DB LTE
tcpdump -i lo udp port 13345 -A
//ptt_scan output to the alertHandler
tcpdump -i lo udp port 13346 -A
//PTT alertHandler output to the Brain
tcpdump -i eth0 tcp port 8617 -w /tmp/ndr308.pcap //talking to the ndr308 tunerC
trl from the ndr308srvr backend
//ubuntu command line image viewer
eog image-filename
//pdf viewer
eveince pdf-filename
//gdb attach to running process
gdb -pid 23067
//or just issue the gdb command and once you are at the gdb prompt type
attach pid
//note that this stops the program and you will need to type co
ntinue to keep running
info threads
//to see all threads (the * is the current thread being monitor
ed
thread n
//to switch to a specified thread
cntrl x cntr a //to see a source window in gdb, use this to also to toggle it
off
directory "path to source files" //to let gdb know where the code to debug is
b filename:linum //to set a break point also look into watch points
//to parse rover csv and get all the uniq decoded cells use
cat TSR_GSM_8-14-20150827T103606.gns | awk -F, '{ print $9 " " $10 " " $11 " " $
12 }' | sort | uniq -d
//To see database performance use, then use the ? menu to set the meas interval
and
//watch the qps queries per second
innotop -uroot -ppassword
//to see device info for usb devices use
lsusb
//To see what ports and files the ptt_scan program is using
lsof -p `pgrep ptt_scan`
//To see what ports and files the ptt_scan program is using
lsof -p `pgrep alertHandler`
//list only hidden files
ls -ld .?*
//To see the send and the return of a brain task in the brain log
tail -f UmtsBrain.log | grep 'Buff=UMTS_\|Completed taskType'
//to see cpu info
lscpu
//to list only files that are 2 chars long
//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
//networking restart
/etc/init.d/networking restart
//To get an address via dhcp issue
dhclient eth1
//to toggle an interface up or down (ifup ifdown)
ifconfig eth1 up
//To see the bridge info issue pan1 pan0
brctl show
//path to the interfaces file
/etc/network/interfaces
//path to the usb network udev rule
/etc/udev.rules.d/70-persistent-net.rules
//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
mkdir vault
//Step 2: issue this command and use your domain password
//This is the correct username and the password is still the @ based one
smbmount //s20-dc001/g3_vault /mnt/vault/ -o user=albert.gambardella
smbmount //s20-dc001/public\ public /mnt/public/ -o user=albert.gambardella
//use dtrx to uncompress or extract tar files and .gz
//Or my alias
targz tarfilename.gz //to extract all files
targz tarfilename.gz specificfilename //to only extract a specific file
tar xvzf --wildcards tarfilename regexpr //to extract mult files matching regexp
r
//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
//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 using appropriate ip address
ndr308_Server -host 192.168.1.20 -cfg /usr/local/bin/ndr308.cfg
ndr308_Server -host 10.211.160.20 -cfg /usr/local/bin/ndr308.cfg
//Step 2 do the grab note the path name trunk vs trunkNew etc ...
//The v49 grab file is put in public/mrt/logs. Below are some examples
/home/user/workspace/trunkNew/wcdma/CellSearch/udpTunerCmdClient 'grab tech=lte
to=10000 freq='$FREQ' blocks=85 name='outputfilename bw=1.4'
/home/user/workspace/trunkNew/wcdma/CellSearch/udpTunerCmdClient 'grab tech=cdma
to=10000 freq=1951.25 blocks=10000 name=tttEvdo.v49 bw=1.2288'
/home/user/workspace/trunk/wcdma/CellSearch/udpTunerCmdClient 'snapshot freq=212
0 blocks=1024 name=/public/rssi/iq/snap.2120.v49'
udpTunerCmdClient 'snapshot freq=1950 blocks=10000 name=/public/rssi/iq/snapshot
_1950M_308_qam16d_n100.v49'
udpTunerCmdClient 'grab tech=evdo to=10000 freq=1951.25 blocks=10000 name=EvdoGr
ab1951-25-n60.v49'
//Step 3 if necessary convert v49 to 16 bit iq
cat evdoGrab.v49 | v49_ndr308 -bin16 > evdoGrab.iq
//Step 4 evdo decode must be run from cdma2/evdo folder
./evdoTestMain -f /home/user/tttEvdo.iq -t 16 --decode --flip_iq 2>&1 | grep -i
-A10 "CC hdr" > badSectorParamsParse
//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
cd /home/user/workspace/ptt/ptt;
make v49_main ptt_scan
cd /home/user/workspace/ptt/ptt/WF;
make all
PTT run these programs (see /root/bin/setupPtt.sh )
---------------------cd /home/user/workspace/ptt/NDR308;
./lab.dip; //You may have to run this from the trunk locally
ndr308_Server -host tunerCtrl //You may have to run this from the trunk loca
lly
# 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
run seahorse to delete gnome keyring passwords like default
or...
rm ~/.gnome2/keyrings/login.keyring
To fix errors about dbus when opening vi or coolcommands via cool use this comma
nd
eval `dbus-launch`
ps aux | grep -e "ndr\|v49\|ptt\|PttBrain\|tsControl\^Crtdb\|alertHandler" | awk
'{ print $2 }' | xargs -I{} kill -9 {}
//This will change your ip scheme without changing your tuners ip address
//Use it if your back end is 192.168. based but the tuner is 10.211 based.
//To see this comand issue: ifedit -h
ifedit oldTuner=192.168.1.20 newTuner=10.211.160.20 oldWifiSubnet=10.42.43 newWi
fiSubnet=10.211.43 \
oldList="192.168.1.10 192.168.150.3 192.168.140.3 192.168.1.20 192.168.
150.2 192.168.140.2" \
newList="10.211.160.10 10.211.150.3 10.211.140.3 10.211.160.20 10.211.1
50.2 10.211.140.2" -noTunerChange
//Start TS, then start process monitoring like this ...
nohup atop -p 60 6000 &> atop.out &
//where 60 = interval in sec, 6000 = num intervals, Option "-p" accumulates proc
ess activity per program (i.e. process name).
... then run
mkplot-atop. Work files are written to "/dev/shm/mkplot-atop".
cat evdoGapsQxdm.txt | awk '{if($1=="LOG") {time=$8;} if(substr($0,1,26)=="Activ
e Set\[0\]\.Pilot Energy") print time " " $5 }' > plot1
cat plot1 | awk -F'[:. ]' '{print $1*3600000 + $2*60000 + $3*1000 + $4 " " $5 }'
> plot2
cat plot2 | sort -unk1 > plot3
grep -n 'Active Set\[0\]\.Pilot Energy
= 0' evdoGapsQxdm.txt
//Counting multple PN jobs
//First save the output of the 2 lines below to a file tt
grep 'UMTS_decode\|UMTS_scan\|UMTS_decode' UmtsBrain.log | awk -Fsc '{ print $NF
//byte buffer printing use this printf format otherwise the print doesnt show 0f
it shows f but memory actually contains a 0f
for(unsigned int i=0; i<len; i++) {
LOG_OUT("%02x", msg[i] );
}