Skip to content

Instantly share code, notes, and snippets.

@anpel
anpel / originate_call.php
Last active December 12, 2022 17:54
Originate a call from Asterisk using PHP and Asterisk Manager Interface
/**
* Once this scipt is executed it will connect to the local port you have assigned to
* Asterisk (default: 5038) and send an authentication request. If successfull, it will
* send a second request to originate your call.
*
* The internal SIP line $internalPhoneline will be dialed, and when picked up the
* $target phone will be dialed using your outbound calls context ($context).
*
* Of course, you can modify the commands sent to the asterisk manager interface to suit your needs.
* you can find more about the available options at:
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@mondain
mondain / public-stun-list.txt
Last active May 3, 2024 06:59
Public STUN server list
23.21.150.121:3478
iphone-stun.strato-iphone.de:3478
numb.viagenie.ca:3478
s1.taraba.net:3478
s2.taraba.net:3478
stun.12connect.com:3478
stun.12voip.com:3478
stun.1und1.de:3478
stun.2talk.co.nz:3478
stun.2talk.com:3478
@emmajane
emmajane / gist:59321345a81a4f5837c0
Last active February 28, 2024 16:35
JQL Syntax for the Impatient

JQL Syntax for the Impatient

There are a few JQL syntax bits to get you started:

  • AND --- allows you to add qualifiers to a list
  • != Thing --- target one thing
  • is in (List, Of, Things) --- target a bunch of things (Done, Closed, Resolved) typically
  • not in (List, of, Things) --- do not include a bunch of things
  • -1w --- relative time. You can also use -1d for day
  • "2015/3/15" --- specific dates
@soheilhy
soheilhy / nginxproxy.md
Last active March 22, 2024 08:54
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@aogilvie
aogilvie / gist:5625088
Last active December 17, 2015 14:29
HttpUriRequest and HttpPut, sending a payload String with multilingual characters.

A Java String doesn't have an encoding but it can easily be forced into UTF-16 on conversions. ALWAYS specify UTF-8 when creating a new StringEntity from String!

Add payload to HttpPut
HttpPut hp = (HttpPut) this.request;
hp.setEntity(new StringEntity(yourStringPayload, "UTF-8"));
hp.setHeader("Content-Type", "application/json");
// ... then execute
@qubyte
qubyte / humanJshintReporter.js
Last active August 2, 2016 12:41
The default JSHint output is somewhat wasteful, and very bland, making it hard for a human to parse. The following does IMO a better job and colours the output for you. This requires the `colors` package, available via npm. If you don't want the dependency, just remove the color commands from strings. MIT licence.
/**
* The default JSHint output is somewhat wasteful, and very bland, making it hard for a human to
* parse. The following does IMO a better job and colours the output for you. This requires the
* `colors` package, available via npm. If you don't want the dependency, just remove the color
* commands from strings.
*
* Usage: When invoking jshint from the command line, point it to this file with the --reporter
* flag. e.g.
*
* jshint someFile.js --config /path/to/config.cfg --reporter /path/to/jshintReporter.js