tcpdump -nqt -s 0 -A -i eth0 port 5060 -w /tmp/dump.pcap
tcpdump -qns 0 -A -r /tmp/dump.pcap
apt-get install ngrep sipgrep sngrep.
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
export default function Csv() {} | |
Csv.parse = function(data) {} | |
Csv.compose = function(data) { | |
let values = [] | |
let header = Object.keys(data[0]) | |
let csv = header.join(',') | |
// each object values |
on run {input, parameters} | |
set paths to "" | |
repeat with i from 1 to length of input | |
set cur to item i of input | |
set paths to paths & " " & quote & POSIX path of cur & quote | |
end repeat | |
set cmd to "vim -p" & paths | |
tell application "iTerm" | |
set created to false | |
if not (exists current window) then |
# Return a named route to current url requested | |
def route_name | |
Rails.application.routes.router.recognize(request) do |route, _| | |
return route.name.to_sym | |
end | |
end |
const race = (milliseconds, ...promises) => {
const timeout = new Promise((resolve, reject) => {
setTimeout(() => reject(`Limit operation excedded (limit: ${milliseconds} ms)`), milliseconds)
})
return Promise.race([timeout, ...promises])
}