Skip to content

Instantly share code, notes, and snippets.

View dwilkie's full-sized avatar

David Wilkie dwilkie

View GitHub Profile
@dwilkie
dwilkie / cgrates.md
Last active January 24, 2026 08:09
CGRateS commands

Useful CGrateS commands

Run ngrep on the cgrates container with JSON formatting

docker compose exec -it rating-engine sh -c \
'ngrep -d any -W byline port 2021 or 2013 or 2014 or 2080 or 2060 or 2012 | \
while read line; do
  echo "$line" | jq . 2>/dev/null || echo "$line"
done'
@dwilkie
dwilkie / tcpdump.sh
Last active October 15, 2025 09:32
Docker tcpdump
sudo docker run -it --rm --net container:59da80a76475 nicolaka/netshoot # Replace 59da80a76475 with the running container ID
tcpdump -Xvv -i eth0 -s0 -w capture.pcap
curl --upload-file capture.pcap https://uppy.sh/somleng.pcap
curl -F "file=@capture.pcap" https://0x0.st
curl --upload-file capture.pcap https://sgfile.io
@dwilkie
dwilkie / ubuntu_unattended_upgrades_gmail.markdown
Created July 2, 2015 10:28
Setup unattended upgrades on Ubuntu with Gmail

Install the unattended-upgrades package

$ sudo apt-get install unattended-upgrades 

Edit the periodic configuration

$ sudo nano /etc/apt/apt.conf.d/10periodic
@dwilkie
dwilkie / README.md
Last active February 28, 2025 09:10
Lao EWS Test Message

Lao EWS Test Message

<Response>
<Say voice="Polly.Aditi">Hello</Say>
</Response>
@dwilkie
dwilkie / .gitignore
Last active May 21, 2024 17:17
Bulk Download all Invoices from Wave
*.csv
*.pdf
.DS_Store
@dwilkie
dwilkie / docker-cheat-sheat.md
Last active May 12, 2024 14:08
Docker Cheat Sheet

Build docker image

$ cd /path/to/Dockerfile
$ sudo docker build .

View running processes

@dwilkie
dwilkie / record.xml
Created April 3, 2024 15:25
TwiML record
<Response>
<Say voice="Polly.Russell">Hi Jen please leave a message after the beep</Say>
<Record action="https://somleng-recordings.free.beeceptor.com"/>
</Response>
@dwilkie
dwilkie / rayo.md
Created January 30, 2024 07:16
Rayo Commands

Rayo Commands

Start FreeSWITCH Console

$ fs_cli -p secret

Get Rayo Status

@dwilkie
dwilkie / migrate_from_refile_to_activestorage.rb
Last active May 17, 2023 20:26
Migrate from Refile to ActiveStorage
CallDataRecord.find_each do |cdr|
next if cdr.file.attached?
cdr_url = "https://s3-ap-southeast-1.amazonaws.com/cdr.somleng.org/store/#{cdr.file_id}"
cdr.file.attach(
io: open(cdr_url),
filename: cdr.file_filename,
content_type: cdr.file_content_type
)
end