Kalanand's January 2015 Log
January 7th
How to manually sync clock on vm
To manually sync clock on my virtual machine I had to do
sudo apt-get install ntp
date
sudo service ntp stop
sudo ntpdate -s time.apple.com #(or alternatively from 'time.nist.gov')
sudo service ntp start
date
January 8th
Converting integer address to IP address and vice versa
$python
>>> from struct import pack
>>> from socket import inet_ntoa
>>> inet_ntoa(pack('>I', 2818768998))
'168.3.0.102'
>>> inet_ntoa(pack('I', 2818768998))
'102.0.3.168'
>>> unpack('I', inet_aton('1.1.18.18'))
(303169793,)
>>> unpack('I', inet_aton('255.255.18.18'))
(303235071,)
>>> unpack('I', inet_aton('1.0.18.18'))
(303169537,)
January 12th
How to convert a running job to nohup
- Step 1: ctr^z (to suspend the job)
- Step 2: bg (to run the job in background)
- Step 3: disown -h %1 (assuming this is the first running job in the list, check the screen message after ctr^z to make sure)
After step 3 I can log out and the job will keep running.
January 15th
To attach a running process to gdb
I need to know the process id. Then
gdb -p <process_id>
If I don't know the process id I can still grep by the process name
gdb -p `pgrep col`
January 20th
In wireshark we can filter on the host name using the command:
http.host contains <host_name>
http.host contains marvel.com
January 26th
Relative occurrence of HTTP status codes in web data
200−299 0.85 ± 0.20 (Abnormal if below a few %)
300−399 except 301,302,304 0 ± 0.001 (Abnormal above 1%)
301, 302 0.13 ± 0.05 (Abnormal above 35%)
304 0.02 ± 0.04 (Abnormal above 20%)
400−499 0 ± 0.001 (Abnormal above 1%)
0−199, 500−above 0 ± 0.001 (Abnormal above 1%)
Go to December's log
Last modified: Mon Jan 26 14:07:16 PST 2015