In Linux Ubuntu mount the card
Check which one is the mounted SD Card:
lsblk
Then go to the directory you want to have backup in and run:
sudo dd if=/dev/sdb of=./raspberry_backup.img bs=4M status=progress
In Linux Ubuntu mount the card
Check which one is the mounted SD Card:
lsblk
Then go to the directory you want to have backup in and run:
sudo dd if=/dev/sdb of=./raspberry_backup.img bs=4M status=progress
To make sure you can step debug run: export PHP_IDE_CONFIG="serverName=dev.portal.local"
in your terminal before running tests.
Also make sure you have this server configured in the PHPStorm Settings -> PHP -> Servers.
To disable warnings when IDE is not listening for connections do this, for example:
export XDEBUG_MODE=off && vendor/bin/phpunit tests/Feature/Test.php
To turn it on again do this, for example:
<?php | |
use Illuminate\Support\Facades\Request; | |
use Mockery as m; | |
use Tests\TestCase; | |
// this is solving the static calls for the route like: | |
// @if(Request::route()->getName() == 'admin.report') ........ | |
// <li class="{{Request::is('*/admin/conversion*') ? 'active' : null }}"> ......... | |
// | |
// one can mock those and test the view content only with data |
# /etc/udev/rules.d/99-usb-mount.rules | |
# --property=KillMode=none important to NOT kill the veracrypt service when action finishes | |
ACTION=="add", KERNEL=="sd[a-z]*", SUBSYSTEM=="block", ENV{UDISKS_IGNORE}="1", \ | |
RUN+="/usr/bin/systemd-run --property=KillMode=none /home/dominik/mountDisks.sh" |
docker run --rm -v $(pwd):/app -w /app php:7.3-cli bash -c " | |
apt-get update && \ | |
apt-get install -y libzip-dev libpng-dev libjpeg-dev sendmail-bin && \ | |
apt-get install -y autoconf bison re2c libxml2-dev && \ | |
pecl install mailparse && \ | |
docker-php-ext-enable mailparse && \ | |
docker-php-ext-install gd zip && \ | |
curl -sS https://getcomposer.org/installer | php && \ | |
php composer.phar install --no-scripts && \ | |
php composer.phar require laravel/sail --dev --no-scripts" |
This example demonstrates how to use Traefik as a reverse proxy for a web service defined in a Docker Compose file. Traefik routes incoming requests based on specified rules and forwards the traffic to the web service.
<?php | |
use PhpCsFixer\Config; | |
use PhpCsFixer\Finder; | |
$finder = Finder::create() | |
->in(__DIR__) | |
->name('*.php') | |
->ignoreDotFiles(true) | |
->ignoreVCS(true) |
import ctypes | |
import time | |
class CPUUsageMonitor: | |
""" | |
A class to monitor CPU usage using the Windows PDH (Performance Data Helper) API via ctypes. | |
""" | |
# PDH constants | |
PDH_FMT_DOUBLE = 0x00000200 |
<?php | |
$roleIds = Role::whereIn('name', ['admin', 'moderator'])->pluck('id')->toArray(); | |
// if pivot table relies on some additional value like in the example 'brand_slug' => 'some-slug' | |
// we need to use syncWithPivotValues() where we're gonna update pivot records with 'brand_slug' values | |
$user->brandRoles($brandSlug)->syncWithPivotValues( | |
$roleIds, | |
[ | |
'brand_slug' => $brandSlug |