Skip to content

Instantly share code, notes, and snippets.

View hanafiah's full-sized avatar
🏠
Working from home

Muhamad Hanafiah Yahya hanafiah

🏠
Working from home
View GitHub Profile
<input name="sample[]" type="checkbox" value="1"> Test 1
<input name="sample[]" type="checkbox" value="2"> Test 2
<input name="sample[]" type="checkbox" value="4"> Test 3
<input name="sample[]" type="checkbox" value="8"> Test 4
<input name="sample[]" type="checkbox" value="16"> Test 5
===========
1. DB relationship
Andorra
United Arab Emirates
Afghanistan
Antigua and Barbuda
Anguilla
Albania
Armenia
Netherlands Antilles
Angola
Antarctica
export LANGUAGE='en_GB.UTF-8'
export LC_ALL="en_GB.UTF-8"
sudo dpkg-reconfigure locales
pi@raspberrypi:~ $ sudo apt-get update
pi@raspberrypi:~ $ sudo apt-get install apache2 -y
pi@raspberrypi:~ $ sudo apt-get install php5 libapache2-mod-php5 -y
pi@raspberrypi:~ $ sudo apt-get install mysql-server php5-mysql -y
sudo service apache2 restart
#password: raspberry
pi@raspberrypi:~ $ sudo apt-get install hostapd -y
pi@raspberrypi:~ $ sudo nano /etc/default/hostapd
#-----------
# add this to the end of line
DAEMON_CONF="/etc/hostapd/hostapd.conf"
#-----------
pi@raspberrypi:~ $ sudo nano /etc/hostapd/hostapd.conf
#-----------
export LANGUAGE='en_GB.UTF-8'
export LC_ALL="en_GB.UTF-8"
sudo dpkg-reconfigure locales
sudo apt-get update && sudo apt-get upgrade
pi@raspberrypi:~# cd /usr/src
pi@raspberrypi:/usr/src $ sudo wget https://github.com/coova/coova-chilli/archive/1.3.1.4.tar.gz
pi@raspberrypi:/usr/src $ sudo tar zxvf 1.3.1.4.tar.gz
pi@raspberrypi:/usr/src $ cd coova-chilli-1.3.1.4/
pi@raspberrypi:~ $ sudo apt-get install -y debconf-utils
Reading package lists... Done
Building dependency tree
Reading state information... Done
debconf-utils is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi:~ $ sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password raspbian'
pi@raspberrypi:~ $ sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password raspbian'
pi@raspberrypi:~ $ sudo nano /etc/network/interfaces
#--------------------------
iface wlan0 inet static
address 192.168.8.200
netmask 255.255.255.0
network 192.168.8.1
post-up echo 1 /proc/sys/net/ipv4/ip_forward
#--------------------------
pi@raspberrypi:~ $ iw list
Wiphy phy0
max # scan SSIDs: 10
max scan IEs length: 2048 bytes
Retry short limit: 7
Retry long limit: 4
Coverage class: 0 (up to 0m)
Device supports roaming.
Device supports T-DLS.
Supported Ciphers:
@hanafiah
hanafiah / raspberry pi digi huawei E5577s.sh
Created August 11, 2016 23:33
Setting up internet over usb on Raspberry Pi
pi@raspberrypi:~ $ lsusb
Bus 001 Device 004: ID 046d:c534 Logitech, Inc.
Bus 001 Device 006: ID 12d1:14dc Huawei Technologies Co., Ltd.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pi@raspberrypi:~ $ sudo nano /etc/usb_modeswitch.conf
#--------------------------
@hanafiah
hanafiah / roundup issue.php
Last active July 13, 2016 04:48
round up issue
<?php
/**
* problem solved.
* thanks
**/
$spp002 = 1.70;
$bizhubC360 = 1;
$InPage = 45;
$r = ($spp002 + $bizhubC360) / $InPage;