Skip to content

Instantly share code, notes, and snippets.

View lennartvdd's full-sized avatar

Lennart van den Dool lennartvdd

  • Circular IT Group, DigitalDeploy
  • Utrecht
View GitHub Profile
@lennartvdd
lennartvdd / codeship-test-yii2-advanced.sh
Last active September 8, 2016 22:34
CodeShip - Yii 2.x (Advanced Template) test setup script
# Set php version through phpenv. 5.3, 5.4 and 5.5 available
phpenv local 5.4
# == install pecl extensions
yes yes | pecl install imagick
# == prepare composer
composer config -g github-oauth.github.com "$GITHUB_ACCESS_TOKEN" #make sure this env var is configured in your project settings. otherwise remove this line.
# update phpunit
composer global remove "phpunit/phpunit" --update-with-dependencies
@lennartvdd
lennartvdd / yii-1.x-javascript.php
Created April 28, 2015 10:42
How to use Javascript from a Yii 1.x view file.
<?php
//option 1: via asset (NOTE: Create file: ./assets/form.js relative to view file)
$url = Yii::app()->assetManager->publish(__DIR__.'/assets/form.js');
Yii::app()->clientScript->registerScriptFile($url);
//option 2: via php in view file
$script = <<<EOT
alert('hello world');
EOT;
@lennartvdd
lennartvdd / ubuntu-lemp-yii1-installer.sh
Last active January 16, 2018 06:04
Ubuntu LEMP installer (Yii 1.x)
#!/bin/bash
# This script does the following things
# - update apt respositories
# - Install:
# - nginx
# - memcaced
# - php5-fpm
# - php5-mysql
# - php5-curl
@lennartvdd
lennartvdd / ubuntu-mysql-installer.sh
Created May 22, 2015 08:17
Ubuntu MySQL Server installer
#!/bin/bash
#
# This script performs the following tasks:
#
# - Update APT repositories
# - Install mysql-server
# - Change MySQL config:
# - listen on internal IP address instead of localhost only for external communication
# - TODO: update MySQL config to update performance
# - Create a MySQL user & database
@lennartvdd
lennartvdd / install_newrelic_server.sh
Created June 10, 2015 09:01
Install NewRelic Server
#!/bin/sh
echo "This script will install NewRelic Server Monitoring"
read -p "License Key:" NEWRELIC_LICENSE_KEY
echo deb http://apt.newrelic.com/debian/ newrelic non-free >> /etc/apt/sources.list.d/newrelic.list
wget -O- https://download.newrelic.com/548C16BF.gpg | apt-key add -
apt-get update
apt-get install newrelic-sysmond
@lennartvdd
lennartvdd / transip-dyndns.php
Last active August 29, 2015 14:25
TransIP API DynDNS
<?php
// --- Settings
$login = '';
$domainName = '';
$subDomain = '@';
$keyFile = 'transip.key';
$publicIpApi = 'https://api.ipify.org';
@lennartvdd
lennartvdd / mock-process.sh
Created August 9, 2015 21:45
Simple Linux Mock process
#!/bin/bash
charlist=( "|" "/" "-" "\\" )
i=0
while [ TRUE ]
do
echo -en "Running mock process. Press CTRL+C to exit. ${charlist[i]} \r"
sleep 0.1
((i++))
if [ $i -gt 3 ]
@lennartvdd
lennartvdd / NAV Config Mode.bat
Created August 19, 2015 10:11
Microsoft Dynamics NAV - Configuration Mode
@echo off
setlocal
set /p profile_id=Enter the User Profile to configure:%=%
cd C:\Program Files (x86)\Microsoft Dynamics NAV\71\RoleTailored Client
Microsoft.Dynamics.Nav.Client.exe -configure -profile:%profile_id%
endlocal
@lennartvdd
lennartvdd / .bashrc
Created October 16, 2015 15:01
.bashrc file for GIT bash on Windows
# Note: ~/.ssh/environment should not be used, as it
# already has a different purpose in SSH.
env=~/.ssh/agent.env
# Note: Don't bother checking SSH_AGENT_PID. It's not used
# by SSH itself, and it might even be incorrect
# (for example, when using agent-forwarding over SSH).
agent_is_running() {
@lennartvdd
lennartvdd / ubuntu-nginx-installer.sh
Last active January 1, 2021 11:11
Ubuntu Nginx installer (Static files only)
#!/bin/bash
# This script does the following things
# - update apt respositories
# - Install:
# - nginx
# - git
# - Create a GIT User
# - Set up GIT bare repo
# - Set up GIT working directories for nginx