Sunday, October 30, 2016

php function curl


function curlku($urls){
$data = curl_init();
curl_setopt($data, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0');
curl_setopt($data, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($data, CURLOPT_URL, $urls);
$result = curl_exec($data);
curl_close($data);
return $result;
}


///test call
curlku('http://usmanfauzi.blogspot.co.id');
?>

lupa judul -_-

http://blog.matt-swarts.com/2015/09/29/browsers-for-the-rpi2/
http://laurenthinoul.com/how-to-install-tp-link-tl-wn725n-on-raspberry-pi/wifi
https://www.raspberrypi.org/forums/viewtopic.php?p=462982#p462982

wget https://dl.dropboxusercontent.com/u/80256631/install-wifi.tar.gz
tar xzf install-wifi.tar.gz
./install-wifi -u


sudo apt-get install -y apt-transport-https
sudo echo "deb https://twolife.be/raspbian/ jessie main qt" | sudo tee -a /etc/apt/sources.list.d/twolife.list
sudo echo "deb-src https://twolife.be/raspbian/ jessie main qt" | sudo tee -a /etc/apt/sources.list.d/twolife.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 2578B775
sudo apt-get update
sudo apt-get install libqt5webkit5-dev qtdeclarative5-dev qt5-default qt5-qmake
git clone https://github.com/Topguy/mlbrowser.git
cd mlbrowser
mkdir build
cd build
qmake DEFINES+=_BROWSER_ DEFINES+=_MOUSE_ DEFINES+=_PROPERTYCHANGER_ ../src/mlbrowser.pro

############
nano makefile

LIBS = $(SUBLIBS) -L/opt/vc/lib -lQt5WebKitWidgets -pthread -lrt -L/usr/lib/arm-linux-gnueabihf -lQt5Sql -lQt5Quick -lQt5OpenGL -lQt5PrintSupport -lQt5WebKit -lQt5Qml -lQt5Widgets -lQt5Network -lQt5Gui -lQt5Core -lGLESv2 -lpthread
#############

sudo ln -fs /opt/vc/lib/libEGL.so /usr/lib/arm-linux-gnueabihf/libEGL.so.1
sudo ln -fs /opt/vc/lib/libGLESv2.so /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2
make clean
make -j4

sudo make install

mlbrowser -platform eglfs http://www.google.com

wget https://dl.dropboxusercontent.com/u/80256631/install-wifi.tar.gz
tar xzf install-wifi.tar.gz
./install-wifi -u


wget https://dl.dropboxusercontent.com/u/87113035/chromium-browser-l10n_48.0.2564.82-0ubuntu0.15.04.1.1193_all.deb
wget https://dl.dropboxusercontent.com/u/87113035/chromium-browser_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb 
wget https://dl.dropboxusercontent.com/u/87113035/chromium-codecs-ffmpeg-extra_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb
sudo dpkg -i chromium-codecs-ffmpeg-extra_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb
sudo dpkg -i chromium-browser-l10n_48.0.2564.82-0ubuntu0.15.04.1.1193_all.deb chromium-browser_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb

wget http://192.168.2.4:50/x/promotv/install-wifi.tar.gz
tar xzf install-wifi.tar.gz
./install-wifi -u
sudo reboot
wget http://192.168.2.4:50/x/promotv/cr.sh
wget http://192.168.2.4:50/x/promotv/chromium-browser-l10n_48.0.2564.82-0ubuntu0.15.04.1.1193_all.deb
wget http://192.168.2.4:50/x/promotv/chromium-browser_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb 
wget http://192.168.2.4:50/x/promotv/chromium-codecs-ffmpeg-extra_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb
sudo dpkg -i chromium-codecs-ffmpeg-extra_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb
sudo dpkg -i chromium-browser-l10n_48.0.2564.82-0ubuntu0.15.04.1.1193_all.deb chromium-browser_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb
sudo apt-get install x11-xserver-utils
sudo apt-get install unclutter
sudo apt-get install matchbox

#sudo ln -s /home/pi/cr /etc/profile.d/cr



#!/bin/sh
@xscreensaver -no-splash
@xset s off
@xset -dpms
@xset s noblank

unclutter &
matchbox-window-manager &
#chromium-browser --noerrdialogs --kiosk http://192.168.2.4:50/x/promotv/ok/ --incognito
chromium-browser  --kiosk --enable-kiosk-mode --disabled --touch-events --touch-events-ui --disable-ipv6 --allow-file-access-from-files --disable-java --disable-restore-session-state --disable-sync --disable-translate -http://192.168.2.4:50/x/promotv/ok/ --incognito

xinit ./cr 



sudo nano /boot/config.txt

sed -i 's/"exited_cleanly": false/"exited_cleanly": true/' ~/.config/chromium/Default/Preferences

https://www.raspberrypi.org/blog/another-new-raspbian-release/
Disable text terminals from blanking:
Edit this file: /etc/kbd/config
Find these 2 lines and change them as shown (Default was 30):
BLANK_TIME=0
POWERDOWN_TIME=0


Disable Xsession from blanking:
Add these lines to /etc/xdg/lxsession/LXDE/autostart
@xset s noblank
@xset s off
@xset -dpms

sudo nano /etc/X11/xorg.conf (i've created this file)


Section "ServerFlags"
    Option         "blank time" "0"
    Option         "standby time" "0"
    Option         "suspend time" "0"
    Option         "off time" "0"
EndSection

php function rupiah

function RP($n) {
    return number_format($n,0, ',', '.');
}


///test call
echo RP(1200000000000000);
?>