I'm a full stack web developer and here is the place, where I collect useful information about developing cool web services and sites.
My favorite technologies are:
- PHP: Drupal Content Management Framework, Symfony Framework.
- System administration: Debian/Ubuntu Linux, SaltStack, Docker.
Very often there is a need to execute via
drush eval command the PHP code with both single and double quotes, something like this:
<?php echo "Hello, '$username'!"; ?>
This can be quickly done without manually adding slashes to each quote in PHP code via this bash trick:
PHP=`cat <<'EOF' echo "Hello, '$username'!"; EOF`; drush ev "$PHP"
Instead of single line of PHP code, you can insert long multi-line part of code, without carrying about escaping quotes.
Here are steps for quick configure fresh-installed Ubuntu Server to manage Nginx Virtualhosts with PHP (using PHP-FPM) and Proxy to Node.JS apps.
Here is bash commands to quickly install salt-minion to Ubuntu / Debian systems:
hook_update_N functions, Drupal stores last version of installed updates in his key-value storage, if update function executed without exceptions.
You can simply lookup installed version via command-line drush command:
drush ev "var_dump(drupal_get_installed_schema_version('my_module'))"
Sometimes you may need revert version to previous, for re-apply updates, or repeat updates, if they previously executed with problems.
You can set previous version of Drupal module schema version via this cli drush command:
If you use Bluetooth headset, you probably have bad quality of voice in VoIP calls via Skype and other apps. This happens on Linux and on Windows too.
This happens because when an application starts a call - it create a recording stream with property media.role=phone (telephony applications should set that property for their streams), and PulseAudio switch profile of your Bluetooth Headset from A2DP (Stereo high-quality one-way channel) to HSP/HFP (Mono low-quality 2-way channel for voice-only).