We have all seen and used those URL shorting sites. It takes a very long link and converts it to a short link for emailing. When you click the short link it takes you to the link website address. Below I thought I would make my own. Feel free to use the below to make…
Tag: PHP
A Simple Load Balancer. Also Monitors Node Stats.
Below i document how to make a simple Load Balancer. This load balancer uses HAProxy and monitors the health of a server using a script. If the health of the server goes down, HAProxy Removes the Node from the “Cluster”. Below is the HAProxy Config. Below is the PHP Script running on the servers to…
Install Observium and PHP WeatherMaps on Debian 11.
Observium Installation You may need to install wget on bare installations Grab Observium installation script and run it. WeatherMap installation and configuration log on to gui “http://[IP_Address]/weathermap/editor.php” and make a new weather map “network.conf” click on “map properties. In “Output Image Filename” > “network.png”. In “Output HTML Filename” > “maps/network.html”. Once you have created a…
Simple PHP and Asterisk dialplan…
In This post I am just going to publish how to make a simple dial plan in asterisk by sending the call to PHP to process. The application is just going to be the standard asterisk Milliwatt application which answers a call and plays a continues tone. In asterisk (On an Ubuntu Server System), /etc/asterisk/extensions.con add [Milliwait] exten =>…
PHP… Simple Error Checking…
The below code is an example of providing some debug information by both email and logging the information to a file in “/var/logs/”. define(“CURRENT_FILE”, “thisfile.php”); define(“LOG_FILE_LOCATION”, “/var/log/”); function log_file($error1, $error2, $file) { $ok = true; // $file = “logile.txt”; if ($fh = fopen($file, ‘a’)) { $ok = true; $conf = “$error1 – $error2\n”; } else…
PHP… Do Not Run if running…
If you are creating an application that will be run in the terminal on a Linux machine and you don’t want it to run if its already running you can use the same code below to achieve this. class pid { protected $filename; public $already_running = false; function __construct($directory) { $this->filename = $directory . ‘/’ . basename($_SERVER[‘PHP_SELF’]) . ‘.pid’;…
Some Simple PHP code..
Below i am going to list some simple PHP code that makes up most of a PHP coded page. If..Elseif…Else… statments $something = “Cat”; if ($something==”Cat”) { print “Cat\n”; } elseif ($something==”Dog”) { print “Dog\n”; } else { print “Dont know\n”; Explode…foreach $ex = “cat:dog:mouse:goose”; $explode = explode(“:”, $ex); foreach ($explode as $exploded) { print…
CentOS 6 LAMP Install (Apache MySQL & PHP) via YUM
This tutorial will walk you through the process of installing a CentOS 6 LAMP server, LAMP stands for Linux Apache MySQL PHP and is often refereed to as a “LAMP Stack“. CentOS is a popular choice for web servers as it’s based on RHEL (Redhat Linux), this tutorial will use YUM to install the required packages. This…
Auto Provisioning of Phones (Snom/Polycom/YeaLink/Linksys)
Using PHP and MySQL to integrate with Hello Telecoms existing systems I created scripts to enable phones to be auto provisioned from there Hosted VoIP Portal, to enable plug’n’play of most phones for both the private network and phones out on the Internet using Snom’s redirection server and some custom XML RPC coding. This has…