Skip to content

Instantly share code, notes, and snippets.

View pawelnapierala's full-sized avatar

Paweł Napierała pawelnapierala

  • Szczecin
View GitHub Profile
@pawelnapierala
pawelnapierala / test-memory-limit.php
Created March 29, 2022 15:32 — forked from thonixx/test-memory-limit.php
Test PHPs memory limit
<pre>
<?php
$megabyte = 1528; // define the max megabytes which should be tested
function tryAlloc($megabyte){
echo "try allocating {$megabyte} megabyte...";
$mb = $megabyte;
$dummy = str_repeat("-",1048576*$mb);
echo "pass.";
echo "Usage: " . memory_get_usage(true)/1048576;
@pawelnapierala
pawelnapierala / scaling.sh
Created September 10, 2019 11:24
Fractional 150% scaling on an external 27'' 4K monitor and 200% on Dell XPS 9750 with 15'' 4K internal display on Ubuntu 18.4 with Xorg
# Uses xrandr to scale the 15'' 4K internal laptop display by 200% and the 27'' 4K external monitor by 150% without
# any blurring. Assumes the laptop is positioned below the monitor.
# Replace the output names (e.g "DP-1-3") with your own ones. Use the xrandr command with no arguments to find out
# the names.
xrandr --output DP-1-3 --scale 1.5x1.5 --mode 3840x2160 --fb 5760x5400 --pos 0x0 && xrandr --output eDP-1-1 --scale 1x1 --pos 1024x3240