Skip to content

Instantly share code, notes, and snippets.

View kevin39's full-sized avatar

Kevin LABECOT kevin39

View GitHub Profile
@kevin39
kevin39 / HAPROXY LDAP SETTINGS - WINDOWS COMPATIBLE
Last active March 14, 2022 21:29
HAProxy ldap-check compatible with Windows Server / Active Directory
# Note : Found somewhere on internet... Source lost
backend ldap_balancer
mode tcp
balance roundrobin
server SERVER_NAME SERVER_ADDR:389 maxconn 100 check
option tcpka
timeout server 2s
timeout connect 1s
# Below, ldap check procedure :
option tcp-check
@kevin39
kevin39 / PfSense DNS Batch Creation
Last active September 20, 2016 12:25 — forked from brycied00d/gist:13483a1d8363e457f963
pfSense DNS Forwarder Batch Host Creation
<?php
// pfSense PHP script to generate a range of DNS forwarder hosts based on
// "dot${lastoctet}", eg. 192.0.2.100 == dot100.example.com
// Open terminal, run "php" copy/paste script with the following defines tweaked
// Ctrl-D, wait a moment until you see "Content-type: text/html"
// Open the DNS config in the web UI and click Apply Changes
define('DOT_DOMAIN', 'example.com');
define('DOT_SUBNET', '192.0.2.'); // Leave off the final octet, include the dot
define('DOT_RANGE_START', 100);
@kevin39
kevin39 / DEBIAN_PACKAGE_SIGNATURE
Created September 20, 2016 12:22
Debian Package - "The following signatures couldn't be verified because the public key is not available"
gpg --keyserver pgp.mit.edu --recv-keys <LA_CLE>
gpg --armor --export <LA_CLE> | apt-key add -
@kevin39
kevin39 / Identify a disk by its UUID
Last active September 21, 2016 09:28
DISK BY UUID
$ blkid /dev/sdg1
/dev/sdg1: LABEL="IPBXRECORDS" UUID="C4CD-C4FA" TYPE="exfat
$ ls /dev/disk/by-uuid -l
total 0
lrwxrwxrwx 1 root root 10 Jun 25 13:10 2d2fdee8-1307-4df4-b3d9-7e69c4e05bfc -> ../../sde1
lrwxrwxrwx 1 root root 10 Sep 21 05:18 2e21785b-b370-4e13-8449-6a5729ae3387 -> ../../dm-2
lrwxrwxrwx 1 root root 10 Jun 25 13:10 3655492c-fe05-4e5d-bd41-f9b85c86e884 -> ../../sdd1
lrwxrwxrwx 1 root root 10 Jun 25 13:11 36e9fd6f-bec6-4957-888c-c2d24b64f084 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jun 25 13:10 5122218b-1688-4412-b6c5-e72e79c68180 -> ../../sdc1
@kevin39
kevin39 / Ping reply on off using icmp_echo_ignore_all
Created September 21, 2016 08:39
Enable or Disable ping reply temporarily
Disable ping reply Temporarily
You can temporarily disable the ping reply using the following method.
# echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_all
Please note that this setting will be erased after the reboot. To disable ping reply permanently (even after the reboot), follow the step mentioned below.
Also, to enable the ping reply back, set the value to “0” as shown below.
# echo "0" > /proc/sys/net/ipv4/icmp_echo_ignore_all
@kevin39
kevin39 / Proxmox reload services
Last active March 5, 2024 20:13
Proxmox reload services properly (services order is important)
service pve-cluster restart && service pvedaemon restart && service pvestatd restart && service pveproxy restart
@kevin39
kevin39 / spotify.ips.sh
Created September 23, 2016 06:38
Export Spotify servers IPs
#!/bin/sh
curl -A "http://bgp.he.net/search?search%5Bsearch%5D=spotify&commit=Search" -o /tmp/ips.raw "http://bgp.he.net/search?search%5Bsearch%5D=spotify&commit=Search"
grep -aoEw -e "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?/[0-9]{2})" -e "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" /tmp/ips.raw | sort -t . -k 1,1n -k 2,2n -k 3,3n -k 4,4n | uniq
@kevin39
kevin39 / ChanSpy Direct agent
Last active March 25, 2020 14:19
Asterisk - ChanSpy Direct agent
http://jonathanmanning.com/2009/10/29/monitoring-agents-in-asterisk-with-chanspy/
Example 3: This example will give the ability to dial directly into an agents phone to listen to them.
[internal] ;Chanspy Direct SIP Extension
exten => _88XXXX,1,Chanspy(SIP/${EXTEN:2}|b)
Here you can dial directly into any agents 4 digit phone extension and listen to them, for example if you wanted to listen to sip extension 5400 then dial 88+5400. That would dial directly into monitoring phone extension number 5400. If your phones only have 3 digits remove one of the “X”‘s from the exten line.
@kevin39
kevin39 / Click2Call.php
Created September 23, 2016 06:42
Asterisk Click2Call using PHP
<?php
$from = $_GET[from];
$to = $_GET[to];
$fromext = $_GET[fromext];
$socket = fsockopen("localhost","5038", $errno, $errstr, $timeout);
fputs($socket, "Action: Login\r\n");
fputs($socket, "UserName: USERNAME\r\n");
@kevin39
kevin39 / Click2Spy.php
Last active September 23, 2016 06:49
Asterisk - Click2Spy One click to spy an agent using a PHP script
<?php
$from = $_GET[from];
$to = $_GET[to];
$socket = fsockopen("localhost","5038", $errno, $errstr, $timeout);
fputs($socket, "Action: Login\r\n");
fputs($socket, "UserName: USERNAME\r\n");
fputs($socket, "Secret: PASSWORD\r\n\r\n");
$wrets=fgets($socket,128);