Skip to content

Instantly share code, notes, and snippets.

@allebb
allebb / makefile
Created August 29, 2017 09:25
Laravel makefile for projects with Git and MySQL
# == Git repo ==
repo=my_awesome_repo
# === Artisan ====
p=8000
# ===== DB =======
db_username=user
db_password=password
db_name=laravel
db_file=my_db.sql
# === Server connection =====
@allebb
allebb / mssqlbackup
Last active January 16, 2024 11:17
Shell script to backup Microsoft SQL Server vNEXT databases on Linux.
#!/usr/bin/env bash
#
# Shell script to automate the backup of Microsoft SQL Server vNEXT backups on Linux.
# Written by Bobby Allen <ballen@bobbyallen.me>, 26/04/2017
#
# Download this script and put into your servers' /usr/bin directory (or symlink) then make it executable (chmod +x)
#
# Usage example (backup databases into /var/backups, keep backups for 5 days, connect to server "localhost" with the account "sa" and a password of "P455w0RD"):
# mssqlbackup "/var/dbbackups" 5 "localhost" "sa" "P455w0rD"
@allebb
allebb / compass-cardinal
Created August 16, 2016 15:21 — forked from adrianstevens/compass-cardinal
Compass heading to cardinal direction in c#
public static string DegreesToCardinal(double degrees)
{
string[] caridnals = { "N", "NE", "E", "SE", "S", "SW", "W", "NW", "N" };
return caridnals[ (int)Math.Round(((double)degrees % 360) / 45) ];
}
public static string DegreesToCardinalDetailed(double degrees)
{
string[] caridnals = { "N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW", "N" };
return caridnals[ (int)Math.Round(((double)degrees*10 % 3600) / 225) ];
@allebb
allebb / Jenkinsfile
Created February 15, 2020 12:20
A Jenkinsfile demonstating a build pipeline in Jenkins using Docker Agents for multiple PHP version testing.
pipeline {
agent any
stages {
stage('Checkout') {
steps {
git(url: 'https://github.com/allebb/jenkdock-demo.git', branch: 'master')
}
}
stage('Test') {
@allebb
allebb / sdt_install_ubuntu.sh
Last active September 24, 2022 00:45
Install SDT on Ubuntu
#/usr/bin/env bash
sudo apt-get update && sudo apt-get install -y dotnet-runtime-6.0 wget
sudo mkdir -p /opt/sdt
sudo wget -O /opt/sdt/sdt https://blog.bobbyallen.me/sdt_v107
sudo rm -f /usr/bin/sdt
sudo chmod +x /opt/sdt/sdt
@allebb
allebb / test_flighttrack_download.geojson
Created August 28, 2022 14:39
Test example of FsHub Downloaded Flight Track
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@allebb
allebb / web.config
Last active March 10, 2022 05:26
Laravel 5.x web.config file for Windows Azure hosting
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<urlCompression doDynamicCompression="true" doStaticCompression="true" dynamicCompressionBeforeCache="true"/>
<staticContent>
<remove fileExtension=".svg" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<mimeMap fileExtension=".woff" mimeType="application/font-woff" />
<clientCache httpExpires="Sun, 29 Mar 2020 00:00:00 GMT" cacheControlMode="UseExpires" />
</staticContent>
@allebb
allebb / create_php_site.sh
Created September 12, 2017 15:54 — forked from jun9/create_php_site.sh
Nginx and PHP-FPM, bash script for creating new vhost’s under separate fpm pools
#!/bin/bash
# @author: Seb Dangerfield
# http://www.sebdangerfield.me.uk/?p=513
# Created: 11/08/2011
# Modified: 07/01/2012
# Modified: 17/05/2012
# Modify the following to match your system
NGINX_CONFIG='/etc/nginx/sites-available'
NGINX_SITES_ENABLED='/etc/nginx/sites-enabled'
@allebb
allebb / pdns.conf
Last active May 1, 2019 01:28
An example of my master PowerDNS configuration file.
# Autogenerated configuration file template
#################################
# allow-axfr-ips If enabled, restrict zonetransfers to originate from these
# IP addresses
#
allow-axfr-ips=10.0.0.2
#################################
# allow-recursion List of netmasks that are allowed to recurse
#
@allebb
allebb / pdns.conf
Created February 16, 2014 16:02
An example of one of the slave PDNS configuration files found in /etc/powerdns/pdns.conf
# Autogenerated configuration file template
#################################
# allow-axfr-ips If enabled, restrict zonetransfers to originate from these
# IP addresses
#
# allow-axfr-ips=
#################################
# allow-recursion List of netmasks that are allowed to recurse
#