To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
- Homebrew
- Mountain Lion -> High Sierra
#!/bin/bash | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1 |
To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
November 29, 2011 developmentNginx
Few days ago I had to add a wordpress installation within the same environment where a Codeigniter app was already running happily and undisturbed.
It took me a while to figure out how to keep separate folders on the filesystem, and serve the blog from a subfolder of the main domain:
These steps should have been mentioned in the prerequisites of the Laravel Installation Guide, since I'm surely not the only person trying to get Laravel running on macOS.
Install Mcrypt using Homebrew and PECL (comes with PHP)
# PHP 7.3
[program:galaxy_test_uwsgi] | |
command = /usr/bin/sg G-803372 '/srv/galaxy/test/venv/bin/uwsgi --ini /srv/galaxy/test/config/uwsgi.ini' | |
directory = /srv/galaxy/test/server | |
umask = 022 | |
autostart = true | |
autorestart = true | |
startsecs = 15 | |
user = g2test | |
environment = PYTHON_EGG_CACHE=/srv/galaxy/test/var/python-egg-cache-test_uwsgi,GALAXY_EGGS_PATH=/srv/galaxy/test/eggs | |
numprocs = 1 |
Some useful commands and scripts for MySQL.
Update: All these commands and more at https://github.com/joseluisq/awesome-mysql-queries-commands
mysql -h host -u username -p password --default_character_set utf8 database_name < mysql_script.sql
Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.
You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.
Configure PHP Lumen 5 HTTP Exception Handlers with common JSON responses.
Copy (replace) only the attached files to their respective directories. app/Exceptions/Handler.php
and app/Http/Middleware/Authenticate.php
public function getBarcode($code, $type, $widthFactor = 2, $totalHeight = 30, $color = array(0, 0, 0)) | |
{ | |
$barcodeData = $this->getBarcodeData($code, $type); | |
// calculate image size | |
$width = ($barcodeData['maxWidth'] * $widthFactor); | |
$height = $totalHeight; | |
if (function_exists('imagecreate')) { | |
// GD library |