156 Suara Hewan / binatang
Saturday, December 24, 2016
Monday, December 19, 2016
install samba ubuntu
1.sudo apt-get update
2.sudo apt-get install samba
3.edit smb.conf on /etc/samba
[kodi]
comment = kodi Files
path = /movie/Movie/kodi
guest ok = yes
browsable = yes
read only = no
hosts allow = 192.168.2.4
[Movie]
comment = Movie Files
path = /movie/Movie
guest ok = yes
browsable = no
read only = yes
check
root@ubuntu:~# testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[printers]"
Processing section "[print$]"
Processing section "[Shares]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
restart
4.service smbd restart
5.test open address bar
\\192.168.3.2
2.sudo apt-get install samba
3.edit smb.conf on /etc/samba
[kodi]
comment = kodi Files
path = /movie/Movie/kodi
guest ok = yes
browsable = yes
read only = no
hosts allow = 192.168.2.4
[Movie]
comment = Movie Files
path = /movie/Movie
guest ok = yes
browsable = no
read only = yes
check
root@ubuntu:~# testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[printers]"
Processing section "[print$]"
Processing section "[Shares]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
restart
4.service smbd restart
5.test open address bar
\\192.168.3.2
install mysql ubuntu
- sudo apt-get update
- sudo apt-get install mysql-server
- service mysql status
mysql start/running, process 6394
ubuntu mount Fat32 hdd fstab
detect hdd
lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
root@ubuntu:~# lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
NAME FSTYPE SIZE MOUNTPOINT LABEL
sda 232.9G
├─sda1 ext4 487M /boot
├─sda2 ext4 37.3G /
├─sda3 swap 7.5G [SWAP]
└─sda4 reiserfs 187.7G /cache
sdb 465.8G
├─sdb1 1K
└─sdb5 vfat 465.8G /movie MOVIE
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 37G 5.9G 29G 17% /
udev 1.9G 4.0K 1.9G 1% /dev
tmpfs 389M 560K 389M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 1.9G 2.1M 1.9G 1% /run/shm
/dev/sda4 188G 133G 56G 71% /cache
/dev/sda1 464M 16M 420M 4% /boot
root@ubuntu:~# chgrp plugdev /movie
root@ubuntu:~# chmod 777 /movie
root@ubuntu:~# chmod +t /movie
check manual mount
mount -t vfat /dev/sdb5 /movie
if(no_error)
lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
root@ubuntu:~# lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
NAME FSTYPE SIZE MOUNTPOINT LABEL
sda 232.9G
├─sda1 ext4 487M /boot
├─sda2 ext4 37.3G /
├─sda3 swap 7.5G [SWAP]
└─sda4 reiserfs 187.7G /cache
sdb 465.8G
├─sdb1 1K
└─sdb5 vfat 465.8G /movie MOVIE
chek mount
df -h
root@ubuntu:~# df -hFilesystem Size Used Avail Use% Mounted on
/dev/sda2 37G 5.9G 29G 17% /
udev 1.9G 4.0K 1.9G 1% /dev
tmpfs 389M 560K 389M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 1.9G 2.1M 1.9G 1% /run/shm
/dev/sda4 188G 133G 56G 71% /cache
/dev/sda1 464M 16M 420M 4% /boot
create dir n permision
root@ubuntu:~# mkdir /movieroot@ubuntu:~# chgrp plugdev /movie
root@ubuntu:~# chmod 777 /movie
root@ubuntu:~# chmod +t /movie
check manual mount
mount -t vfat /dev/sdb5 /movie
if(no_error)
umount -t vfat /dev/sdb5 /movie
edit fstab
/dev/sdb5 /movie vfat defaults 0 0
save
test
mount -a
if(no_error)
df -h
if (error) do not restart pc :D
check your fstab
check your fstab
root@ubuntu:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 37G 5.9G 29G 17% /
udev 1.9G 4.0K 1.9G 1% /dev
tmpfs 389M 560K 389M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 1.9G 2.1M 1.9G 1% /run/shm
/dev/sda4 188G 133G 56G 71% /cache
/dev/sda1 464M 16M 420M 4% /boot
/dev/sdb5 466G 363G 104G 78% /movie
if ok now restart your pc
taraaa
root@ubuntu:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 37G 5.9G 29G 17% /
udev 1.9G 4.0K 1.9G 1% /dev
tmpfs 389M 452K 389M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 1.9G 2.1M 1.9G 1% /run/shm
/dev/sda4 188G 133G 56G 71% /cache
/dev/sdb5 466G 363G 104G 78% /movie
/dev/sda1 464M 16M 420M 4% /boot
How do I view all available HDD's/partitions?
sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
root@ubuntu:~# sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
NAME FSTYPE SIZE MOUNTPOINT LABEL
sda 232.9G
├─sda1 ext4 487M /boot
├─sda2 ext4 37.3G /
├─sda3 swap 7.5G [SWAP]
└─sda4 reiserfs 187.7G /cache
sdb 465.8G
├─sdb1 1K
└─sdb5 vfat 465.8G MOVIE
root@ubuntu:~#
root@ubuntu:~# sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
NAME FSTYPE SIZE MOUNTPOINT LABEL
sda 232.9G
├─sda1 ext4 487M /boot
├─sda2 ext4 37.3G /
├─sda3 swap 7.5G [SWAP]
└─sda4 reiserfs 187.7G /cache
sdb 465.8G
├─sdb1 1K
└─sdb5 vfat 465.8G MOVIE
root@ubuntu:~#
Wednesday, November 2, 2016
javascript suffle
function shuffle(array) {
var m = array.length, t, i;
while (m) {
i = Math.floor(Math.random() * m--);
t = array[m];
array[m] = array[i];
array[i] = t;
}
return array;
}
// test call
var letter= ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
var random = shuffle(letter.slice());
console.log(random)
console.log(letter)
shuffle(letter)
console.log(letter)
javascript random array
function randcol() {
var ac =["red","orange","yellow","green","blue","purple","brown","pink","magenta","cyan","olive","maroon","navy","aquamarine","turquoise","silver","lime","teal","indigo","violet"]
return ac[Math.floor(Math.random() * ac.length)]
}
//test call
console.log( randcol())
var ac =["red","orange","yellow","green","blue","purple","brown","pink","magenta","cyan","olive","maroon","navy","aquamarine","turquoise","silver","lime","teal","indigo","violet"]
return ac[Math.floor(Math.random() * ac.length)]
}
//test call
console.log( randcol())
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);
?>
return number_format($n,0, ',', '.');
}
///test call
echo RP(1200000000000000);
?>
Subscribe to:
Posts (Atom)