NathanFriend.co.uk

Developers notebook

Docker Live 2020

After watching some of the Docker Live 2020 talks https://docker.events.cube365.net/docker/dockercon I was inspired to take another look at using Docker for some PHP development work.

How to Create PHP Development Environments with Docker Compose

Become a Docker Power User With Microsoft Visual Studio Code

With the following docker-compose.yml you can stand up a PHP/MySQL environment with docker-compose up

version: '3'

services:
db:
container_name: DB
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: pw
MYSQL_DATABASE: MyDB
MYSQL_USER: MyDBUser
MYSQL_PASSWORD: pw
ports:
- "9906:3306"
web:
container_name: App
image: php:7.2.2-apache
depends_on:
- db
volumes:
- ./php/:/var/www/html/
ports:
- "8100:80"
stdin_open: true
tty: true


NetDISCO Active Directory Authentication

~/environments/deployment.yml


ldap:
servers:
- 'DOMAIN_CONTROLLER_HERE'
base: 'OU=Accounts,DC=domain,DC=com'
proxy_user: 'LDAP_BIND_USER'
proxy_pass: 'LDAP_BIND_PASSWORD'
user_string: 'DOMAIN_HERE\%USER%'
opts:
debug: 0

Xcode Code signing fails, detritus not allowed

When running a build in Xcode results in the error ‘Code signing fails with error ‘resource fork, Finder information, or similar detritus not allowed’

Use xattr -cr /app_directory to fix

Source: https://developer.apple.com/library/content/qa/qa1940/_index.html

Join Ubuntu Mate 16.04 to an MS Active Directory Domain

Bash script to prepare an Ubuntu Mate 16.04 host for joining to a MS Active Directory Domain. https://github.com/nathanfriend/domain_join

Stop WordPress asking for an FTP server on upgrade

Add define(‘FS_METHOD’, ‘direct’); to wp-config.php

Fix OS X slow populating file picker

rm ~/Library/Caches/CloudKit/CloudKitMetadata*;killall cloudd

Orignal source: http://osxdaily.com/2015/04/17/fix-slow-folder-populating-cloudkit-macosx/

tail -f /var/log/mail.log journalctl equivalent

journalctl -f -l SYSLOG_FACILITY=2

Send a program to run in the background and close shell

./some_long_running_process
ctrl+z
bg
disown -h
exit

Source: http://www.kossboss.com/linux—move-running-to-process-nohup

Pull files from a remote server over ssh with sudo privilege escalation

rsync -a -e “ssh” –bwlimit=10000 –rsync-path=”sudo rsync” remoteuser@remoteserver:/remotepath .

Original source: https://crashingdaily.wordpress.com/2007/06/29/rsync-and-sudo-over-ssh/

Scan a network for MS SQL servers

nmap -p T:1433 -sV 192.168.1.2-254 -oG tcp_scan_results.txt

Source: https://www.mssqltips.com/sqlservertip/2753/using-nmap-to-scan-for-sql-servers-on-a-network/

« Older posts