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]
Sunday, May 22, 2016
Port Forwarding no router da MEO – Thomson TG787
Nos últimos tempos temos trazido até vocês um conjunto de artigos com o objectivo de tirar o melhor partido do router Thomson TG787, normalmente distribuído com o serviço MEO.
Hoje, a pedido de alguns leitores, vou ensinar como configurar Port Forwarding de forma a que os serviços instalados numa máquina local estejam acessíveis a partir do exterior (ex. servidor Web, FTP, SSH, etc).
PORT FORWARDING… O QUE É?
Explicando de forma muito simples pensem no seguinte, imaginem que na vossa máquina (ex. PC portátil) têm a correr um servidor Web (Apache, IIS, TomCat, etc) e pretendem que esse serviço esteja disponível a partir de qualquer lugar da Internet. Uma vez que associado ao nosso serviço MEO temos um um IP público disponível , então só temos que redireccionar todos os pedidos que chegam ao vosso router para a porta 80, para a vossa máquina local.
Para a explicação de como configurar Port Forwarding num router da Meo, vamos considerar que o PC Pedro possui um servidor Web (a funcionar na porta 80) e que os utilizadores externos à rede pretendem aceder ao mesmo.
Nesse sentido vamos redireccionar que todos os pedidos que chegam ao router MEO para a porta 80, de forma a serem encaminhados para o PC Pedro que possui um apache a correr.
Para proceder a essa configuração, abrirmos a página de administração do nosso router da MEO através do url: http://192.168.1.254 e usamos as seguintes credenciais:
Utilizador: AdministratorPassword: 3!play
Em seguida vamos ao menu Ferramentas –> Partilha de jogos e aplicações e em seguida escolhemosAtribuir jogo ou aplicação a um dispositivo de rede local
Nota: Nesta página temos a possibilidade de usar um “perfil/serviço” já definido ou então Configurar novo jogo ou aplicação. Para este exemplo vamos considerar a primeira opção.Em seguida no campo Jogo ou Aplicação devem escolher HTTP Server (World Wide Web) e no Dispositivodevem indicar qual o máquina local que tem esse serviço a correr. Para finalizar carreguem em Adicionar.
Depois de realizada a configuração anterior, deverá aparecer a referência da mesma conforma mostra a figura seguinte:
Feito isto, só têm de saber qual o endereço público (endereço conhecido a partir de qualquer da Internet) associado ao vosso router Meo. Para saberem qual o vosso endereço do exterior podem visitar por exemplo a página: http://www.ip-adress.com/
Para testarem basta introduzirem no vosso browser o endereço que foi fornecido pela página anterior e verificar se os pedidos estão a chegar a vossa máquina local ou seja, se conseguem ver por exemplo a página Web que está na máquina 192.168.1.3.
Com este tipo de serviço podem por exemplo fazer Remote Desktop a vossa máquina bastando para isso redireccionar os pedidos à porta 3389, ou VNC, SSH, Telnet, etc etc. Só têm de saber em que porta está a correr um determinado serviço e reencaminhar os pedidos para a máquina/porto que pretendam.
Espero que este tutorial seja útil.
Tuesday, May 03, 2016
What is the 'whoopsie' process and how can I remove it?
How do I disable it on a server or via the command-line?
- Just change the
report_crashes
parameter tofalse
in the/etc/default/whoopsie
file. - Then bid farewell to whoopsie with
sudo service whoopsie stop
.
https://wiki.ubuntu.com/Tracker
Comments and Discussion
How to disable tracker globally :
- Disabling tracker for globally (for all users)
- Edit /etc/xdg/autostart/trackerd.desktop file with root priviledges (sudo vim, gksudo gedit ...)
- Add "Hidden=true" to the end of the file
- Do the same for /etc/xdg/autostart/tracker-applet.desktop if you want
- Disabling tracker for your user only
- Enter the directory "~/.config/autostart", create it if it does not exist
- Create a file named trackerd.desktop
- Paste the following into the file, save and exit
[Desktop Entry] Encoding=UTF-8 Name=Tracker Hidden=true- Gokdeniz Karadag
Friday, February 19, 2016
non-existent service “fos_user.doctrine_registry”
in your app/config/config.yml, you have to alias fos_user.doctrine_registry to doctrine
services:
fos_user.doctrine_registry:
alias: doctrine
services:
fos_user.doctrine_registry:
alias: doctrine
Subscribe to:
Posts (Atom)
Git get all remote branches
git branch -r \ | grep -v '\->' \ | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" \ | while read remote; do \ git branc...
-
sh -c 'xfce4-screenshooter --fullscreen --save "$HOME/Pictures/Screenshots/Screenshot_$(date +%Y-%m-%d_%H:%M:%S).png"' s...
-
Known Issues Firefox 3.5 will only support color profiles as specified by ICC v2, later versions will add su...