Sunday, December 04, 2016
How to run composer as www-data
sudo -u www-data /usr/local/bin/composer install --no-ansi --no-dev --no-interaction --no-progress --no-scripts --optimize-autoloader
Tuesday, October 18, 2016
Brightness is reset to Maximum on every Restart in ubuntu
sudo apt-get install xbacklight
xbacklight -set 50
xbacklight -set 50
Friday, September 16, 2016
How to SSH to a VirtualBox guest externally through a host?
Network in NAT port forward Host port 2222, guest port 22, name ssh, other left blank
Thursday, September 15, 2016
VirtualBox Static ip
Virtualbox network in BridgeMode sudo vi /etc/network/interfaces auto eth0 iface eth0 inet static address 192.168.Y.X netmask 255.255.255.0 network 192.168.Y.0 gateway 192.168.Y.1 sudo service networking restart
Thursday, September 08, 2016
Whats is the best way to generate uuidv4 in php?
Whats is the best way to generate uuidv4 in php?
Some people use this: https://github.com/ramsey/uuid
Others can user a system call like file_get_contents('/proc/sys/kernel/random/uuid');
And others just a simple function.
What's the best way? Depending on your needs, of course.
I can use all the option, so I decide to make a benchmark, and I was surprised...
<?php require __DIR__.'/../vendor/autoload.php'; function gen_uuidv4(){ return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', // 32 bits for "time_low" mt_rand(0,0xffff),mt_rand(0,0xffff), // 16 bits for "time_mid" mt_rand(0,0xffff), // 16 bits for "time_hi_and_version", // four most significant bits holds version number 4 mt_rand(0,0x0fff)|0x4000, // 16 bits, 8 bits for "clk_seq_hi_res", // 8 bits for "clk_seq_low", // two most significant bits holds zero and one for variant DCE1.1 mt_rand(0,0x3fff)|0x8000, // 48 bits for "node" mt_rand(0,0xffff),mt_rand(0,0xffff),mt_rand(0,0xffff)); } // ##################################### $i=microtime(true); for($a=0;$a<1000000;$a++){ file_get_contents('/proc/sys/kernel/random/uuid'); } $f=microtime(true); $t1=$f-$i; echo $t1; echo '<br>'; // ##################################### $i=microtime(true); for($a=0;$a<1000000;$a++){ gen_uuidv4(true); } $f=microtime(true); $t2=$f-$i; echo $t2; echo '<br>'; // ##################################### $i=microtime(true); for($a=0;$a<1000000;$a++){ \Ramsey\Uuid\Uuid::uuid4(); } $f=microtime(true); $t3=$f-$i; echo $t3; T1: 10.762820005417(s) System Call in Ubuntu 14.04 T2: 6.3450520038605(s) simple function T3: 30.962769985199(s) blotted library Choose wisely :)
Friday, August 26, 2016
IBus prior to 1.5.11 may cause input problems. See IDEA-78860 for details.
echo "export IBUS_ENABLE_SYNC_MODE=1" >> ~/.bashrc
source ~/.bashrc
Monday, August 22, 2016
Previously prefixed properties now standard
List of deprecated css
Remove it all, they are unnecessary
-moz-animation [Prefixed version still accepted]
-moz-animation-delay [Prefixed version still accepted]
-moz-animation-direction [Prefixed version still accepted]
-moz-animation-duration [Prefixed version still accepted]
-moz-animation-fill-mode [Prefixed version still accepted]
-moz-animation-iteration-count [Prefixed version still accepted]
-moz-animation-name [Prefixed version still accepted]
-moz-animation-play-state [Prefixed version still accepted]
-moz-animation-timing-function [Prefixed version still accepted]
-moz-backface-visibility [Prefixed version still accepted]
-moz-background-clip
-moz-background-origin
-moz-background-inline-policy [Superseded by the standard version box-decoration-break]
-moz-background-size
-moz-border-end [Superseded by the standard version border-inline-end]
-moz-border-end-color [Superseded by the standard version border-inline-end-color]
-moz-border-end-style [Superseded by the standard version border-inline-end-style]
-moz-border-end-width [Superseded by the standard version border-inline-end-width]
-moz-border-image
-moz-border-start [Superseded by the standard version border-inline-start]
-moz-border-start-color [Superseded by the standard version border-inline-start-color]
-moz-border-start-style [Superseded by the standard version border-inline-start-style]
-moz-border-start-width [Superseded by the standard version border-inline-start-width]
-moz-box-sizing [Prefixed version still accepted]
-moz-font-feature-settings [Prefixed version still accepted]
-moz-font-language-override [Prefixed version still accepted]
-moz-margin-end [Superseded by the standard version margin-inline-end]
-moz-margin-start [Superseded by the standard version margin-inline-start]
-moz-opacity
-moz-outline
-moz-outline-color
-moz-outline-offset
-moz-outline-style
-moz-outline-width
-moz-padding-end [Superseded by the standard version padding-inline-end]
-moz-padding-start [Superseded by the standard version padding-inline-start]
-moz-perspective [Prefixed version still accepted]
-moz-perspective-origin [Prefixed version still accepted]
-moz-text-decoration-color
-moz-text-decoration-line
-moz-text-decoration-style
-moz-transform [Prefixed version still accepted]
-moz-transform-origin [Prefixed version still accepted]
-moz-transform-style [Prefixed version still accepted]
-moz-transition [Prefixed version still accepted]
-moz-transition-delay [Prefixed version still accepted]
-moz-transition-duration [Prefixed version still accepted]
-moz-transition-property [Prefixed version still accepted]
-moz-transition-timing-function [Prefixed version still accepted]
Remove it all, they are unnecessary
-moz-animation [Prefixed version still accepted]
-moz-animation-delay [Prefixed version still accepted]
-moz-animation-direction [Prefixed version still accepted]
-moz-animation-duration [Prefixed version still accepted]
-moz-animation-fill-mode [Prefixed version still accepted]
-moz-animation-iteration-count [Prefixed version still accepted]
-moz-animation-name [Prefixed version still accepted]
-moz-animation-play-state [Prefixed version still accepted]
-moz-animation-timing-function [Prefixed version still accepted]
-moz-backface-visibility [Prefixed version still accepted]
-moz-background-clip
-moz-background-origin
-moz-background-inline-policy [Superseded by the standard version box-decoration-break]
-moz-background-size
-moz-border-end [Superseded by the standard version border-inline-end]
-moz-border-end-color [Superseded by the standard version border-inline-end-color]
-moz-border-end-style [Superseded by the standard version border-inline-end-style]
-moz-border-end-width [Superseded by the standard version border-inline-end-width]
-moz-border-image
-moz-border-start [Superseded by the standard version border-inline-start]
-moz-border-start-color [Superseded by the standard version border-inline-start-color]
-moz-border-start-style [Superseded by the standard version border-inline-start-style]
-moz-border-start-width [Superseded by the standard version border-inline-start-width]
-moz-box-sizing [Prefixed version still accepted]
-moz-font-feature-settings [Prefixed version still accepted]
-moz-font-language-override [Prefixed version still accepted]
-moz-margin-end [Superseded by the standard version margin-inline-end]
-moz-margin-start [Superseded by the standard version margin-inline-start]
-moz-opacity
-moz-outline
-moz-outline-color
-moz-outline-offset
-moz-outline-style
-moz-outline-width
-moz-padding-end [Superseded by the standard version padding-inline-end]
-moz-padding-start [Superseded by the standard version padding-inline-start]
-moz-perspective [Prefixed version still accepted]
-moz-perspective-origin [Prefixed version still accepted]
-moz-text-decoration-color
-moz-text-decoration-line
-moz-text-decoration-style
-moz-transform [Prefixed version still accepted]
-moz-transform-origin [Prefixed version still accepted]
-moz-transform-style [Prefixed version still accepted]
-moz-transition [Prefixed version still accepted]
-moz-transition-delay [Prefixed version still accepted]
-moz-transition-duration [Prefixed version still accepted]
-moz-transition-property [Prefixed version still accepted]
-moz-transition-timing-function [Prefixed version still accepted]
Subscribe to:
Posts (Atom)
systemd-timesyncd
sudo apt update && sudo apt install systemd-timesyncd && sudo systemctl enable --now systemd-timesyncd
-
sudo -u www-data /usr/local/bin/composer install --no-ansi --no-dev --no-interaction --no-progress --no-scripts --optimize-autoloader
-
sudo apt update && sudo apt install systemd-timesyncd && sudo systemctl enable --now systemd-timesyncd