Raspberry Pi3

By , March 13, 2016 7:56 PM

CHANGE PASSWORD
passwd

TIME ZONE
sudo dpkg-reconfigure tzdata

UPDATE FIRMWARE
sudo rpi-update

UPDATE SOURCES
sudo apt-get update

UPDATE SOFTWARE
sudo apt-get upgrade

DISTRO UPGRADES
sudo apt-get dist-upgrade

INSTALL MIDNIGHT COMMANDER
sudo apt-get install mc -y

INSTALL RDP SERVER
sudo apt-get install xrdp y

VNC INSTALL
sudo apt-get install tightvncserver -y
tightvncserver
vncserver :1 -geometry 1920×1080 -depth 24
sudo service lightdm stop

APACHE AND PHP5
sudo apt-get install apache2 php5 libapache2-mod-php5 php5-mysql php5-fpm php5-curl php5-gd php5-cli php5-mcrypt php-apc libssh2-php -y

INSTALL MARIADB
apt-get install mariadb-server
need to # the my.cnf file 127.0.0.1

PHPMYADMIN
sudo apt-get install phpmyadmin -y

WEBMIN
sudo nano /etc/apt/sources.list
deb http://download.webmin.com/download/repository sarge contrib
deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib

cd ~

wget http://www.webmin.com/jcameron-key.asc
sudo apt-key add jcameron-key.asc
sudo apt-get update
sudo apt-get install webmin -y

SAMBA
sudo apt-get install samba samba-common-bin -y
sudo apt-get install ntfs-3g -y

sudo nano /etc/samba/smb.conf
workgroup = your_workgroup_name
wins support = yes

[pihome]

comment= Pi Home
path=/home/pi
browseable=Yes
writeable=Yes
only guest=no
create mask=0777
directory mask=0777
public=no

sudo smbpasswd -a pi

FTP SERVER
sudo apt-get install proftpd -y
sudo nano /etc/proftpd/proftpd.conf

DefaultRoot ~
AuthOrder mod_auth_file.c mod_auth_unix.c
AuthUserFile /etc/proftpd/ftpd.passwd
AuthPAM off
RequireValidShell off

sudo chmod g+s /var/www
sudo chmod 775 /var/www
sudo chown -R www-data:www-data /var/www

sudo /etc/init.d/proftpd restart

OTHERS

sudo apt-get install openssl ssl-cert php5-cli php5-sqlite php5-gd php5-common php5-cgi sqlite3 php-pear php-apc curl libapr1 libtool curl libcurl4-openssl-dev php-xml-parser php5 php5-dev php5-gd php5-fpm memcached php5-memcache varnish -y

sudo apt-get install apache2-doc apache2-utils

sudo apt-get install libapache2-mod-php5 php5 php-pear php5-xcache -y

PHP7
sudo nano /etc/apt/sources.list
deb http://repozytorium.mati75.eu/raspbian jessie-backports main contrib non-free
#deb-src http://repozytorium.mati75.eu/raspbian jessie-backports

gpg –keyserver pgpkeys.mit.edu –recv-key CCD91D6111A06851
gpg –armor –export CCD91D6111A06851 | sudo apt-key add –

 

sudo apt install php7.0 php7.0-cli php7.0-common php7.0-fpm php7.0-gd php7.0-json php7.0-mcrypt php7.0-mysql php7.0-readline -y
sudo apt-get install php7.0 php7.0-opcache
sudo apt-get install php7.0-cli php7.0-curl php7.0-dev php7.0-fpm php7.0-gd php7.0-mysql php7.0-mcrypt php7.0-opcache -y

sudo service php7.0-fpm stop|
sudo service php7.0-fpm start

OTHER INSTALLS
sudo apt-get install fail2ban

DD-WRT VPN PIA

By , January 14, 2016 11:54 PM
I’ve read many users have trouble setting up the OpenVPN client on some DD-WRT flashed routers. There are DD-WRT builds that lack the ADVANCED OPTIONS button, here’s my solution:

1- Go to SETUP – BASIC SETUP – NETWORK ADDRESS SERVER SETTINGS (DHCP)
Set Static DNS 1 to: 8.8.8.8
Set Static DNS 2 to: 8.8.4.4
or any other DNS servers you want.
2- Set TIME SETTINGS to match your current location.
Click SAVE – Click APPLY SETTINGS
3- Go to SERVICES – VPN
Enable OpenVPN Server (Just click the enable button, do nothing else). This step you can skip. It only serves the purpose of enabling OPENVPN STATUS so that you can see the current state and log of PIA OPENVPN CLIENT.
Click APPLY SETTINGS
4- Go to ADMINISTRATION – COMMANDS
Copy – Paste the text from link below to commands, don’t forget to edit Your_PIA_Username and Your_PIA_Password with your own credentials, if you want you can change the remote regional-gateway (us-west…) too:
Click SAVE STARTUP
5- Go to ADMINISTRATION – MANAGEMENT
Click REBOOT ROUTER
6- That should do it, from now on every device that gets a IP address from your router will go through PIA’s VPN tunnel.
As you can see, we did nothing to the OpenVPN client in SERVICES – VPN. The script takes care of that for us.
ENJOY!!
PICK A LOCATION
#!/bin/sh

USERNAME="Your_PIA_Username"
PASSWORD="Your_PIA_Password"
PROTOCOL="udp"
# Add - delete - edit servers between ##BB## and ##EE##
REMOTE_SERVERS="
##BB##
# US - WEST
remote us-west.privateinternetaccess.com 1194
##EE##
"

#### DO NOT CHANGE below this line unless you know exactly what you're doing ####

CA_CRT='-----BEGIN CERTIFICATE-----
MIID2jCCA0OgAwIBAgIJAOtqMkR2JSXrMA0GCSqGSIb3DQEBBQUAMIGlMQswCQYD
VQQGEwJVUzELMAkGA1UECBMCT0gxETAPBgNVBAcTCENvbHVtYnVzMSAwHgYDVQQK
ExdQcml2YXRlIEludGVybmV0IEFjY2VzczEjMCEGA1UEAxMaUHJpdmF0ZSBJbnRl
cm5ldCBBY2Nlc3MgQ0ExLzAtBgkqhkiG9w0BCQEWIHNlY3VyZUBwcml2YXRlaW50
ZXJuZXRhY2Nlc3MuY29tMB4XDTEwMDgyMTE4MjU1NFoXDTIwMDgxODE4MjU1NFow
gaUxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJPSDERMA8GA1UEBxMIQ29sdW1idXMx
IDAeBgNVBAoTF1ByaXZhdGUgSW50ZXJuZXQgQWNjZXNzMSMwIQYDVQQDExpQcml2
YXRlIEludGVybmV0IEFjY2VzcyBDQTEvMC0GCSqGSIb3DQEJARYgc2VjdXJlQHBy
aXZhdGVpbnRlcm5ldGFjY2Vzcy5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJ
AoGBAOlVlkHcxfN5HAswpryG7AN9CvcvVzcXvSEo91qAl/IE8H0knKZkIAhe/z3m
hz0t91dBHh5yfqwrXlGiyilplVB9tfZohvcikGF3G6FFC9j40GKP0/d22JfR2vJt
4/5JKRBlQc9wllswHZGmPVidQbU0YgoZl00bAySvkX/u1005AgMBAAGjggEOMIIB
CjAdBgNVHQ4EFgQUl8qwY2t+GN0pa/wfq+YODsxgVQkwgdoGA1UdIwSB0jCBz4AU
l8qwY2t+GN0pa/wfq+YODsxgVQmhgaukgagwgaUxCzAJBgNVBAYTAlVTMQswCQYD
VQQIEwJPSDERMA8GA1UEBxMIQ29sdW1idXMxIDAeBgNVBAoTF1ByaXZhdGUgSW50
ZXJuZXQgQWNjZXNzMSMwIQYDVQQDExpQcml2YXRlIEludGVybmV0IEFjY2VzcyBD
QTEvMC0GCSqGSIb3DQEJARYgc2VjdXJlQHByaXZhdGVpbnRlcm5ldGFjY2Vzcy5j
b22CCQDrajJEdiUl6zAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAByH
atXgZzjFO6qctQWwV31P4qLelZzYndoZ7olY8ANPxl7jlP3YmbE1RzSnWtID9Gge
fsKHi1jAS9tNP2E+DCZiWcM/5Y7/XKS/6KvrPQT90nM5klK9LfNvS+kFabMmMBe2
llQlzAzFiIfabACTQn84QLeLOActKhK8hFJy2Gy6
-----END CERTIFICATE-----'

OPVPNENABLE=`nvram get openvpncl_enable | awk '$1 == "0" {print $1}'`

if [ "$OPVPNENABLE" != 0 ]; then
   nvram set openvpncl_enable=0
   nvram commit
fi

sleep 10
mkdir /tmp/pia; cd /tmp/pia
echo -e "$USERNAME\n$PASSWORD" > userpass.conf
echo "$CA_CRT" > ca.crt
echo "#!/bin/sh
iptables -t nat -I POSTROUTING -o tun0 -j MASQUERADE" > route-up.sh
echo "#!/bin/sh
iptables -t nat -D POSTROUTING -o tun0 -j MASQUERADE" > route-down.sh
chmod 644 ca.crt; chmod 600 userpass.conf; chmod 700 route-up.sh route-down.sh
sleep 10
echo "client
auth-user-pass /tmp/pia/userpass.conf
management 127.0.0.1 5001
management-log-cache 50
dev tun0
proto $PROTOCOL
comp-lzo adaptive
fast-io
script-security 2
mtu-disc yes
verb 4
mute 5
cipher bf-cbc
auth sha1
tun-mtu 1500
resolv-retry infinite
nobind
persist-key
persist-tun
tls-client
remote-cert-tls server
log-append piavpn.log
ca ca.crt
status-version 3
status status
daemon
$REMOTE_SERVERS" > pia.conf
ln -s /tmp/pia/piavpn.log /tmp/piavpn.log
ln -s /tmp/pia/status /tmp/status
(killall openvpn; openvpn --config /tmp/pia/pia.conf --route-up /tmp/pia/route-up.sh --down /tmp/pia/route-down.sh) &
exit 0

5 Great Ideas for NFC Tags – NFC Advice

By , October 13, 2014 4:43 AM

5 Great Ideas for NFC Tags – NFC Advice

1. NFC Task Launcher
Launch your favourite apps and update your phones settings with a simple tap of your mobile phone. Using free mobile apps such as NFC Task Launcher for Android you can easily programme your NFC tags to trigger tasks on your NFC-enabled mobile phone. Examples include tapping an NFC tag on your car dashboard to launch a navigation app and enable GPS or tapping an NFC tag by your bedside to turn your phone to silent and set an alarm for the morning. The options are endless ! Click here for the RapidNFC step-by-step guide for NFC Task Launcher.
2. Out of Home Advertising
Enhance traditional printed media with the interactivity of NFC. NFC Smart Posters allow customers to download mobile vouchers, access local information, ‘like’ and ‘follow’ on social media or even purchase products by simply tapping their phone ! NFC Smart Posters are created by attaching a visible NFC tag to the front of the poster or applying a hidden NFC tag to the reverse of the poster, aligned to an NFC graphic or call to action.
3. Interactive Events
Supply each guest with an individually programmed NFC tag and offer a seamless experience. Each NFC tag acts as an ID chip and can be used for access control, registering interest and creating unique experiences. Better still each interaction can be logged via a mobile app so there is no need for expensive hardware or infrastructure. NFC tags are available in a range of event friendly formats such as NFC wristbands, access cards and badges.
4. Tourist Trails and Treasure Hunts
Place NFC tags at different points of interest, providing location specific information and content when they are scanned. A great example is the South Downs Way National Park, who have used NFC enabled sign posts to help visitors better explore their surroundings. This same logic can also be applied to treasure hunts, simply place an NFC tag at each location and log each ‘find’ via a mobile or web app.
5. Keep Customers Engaged with Dynamic Content

Just because an NFC tag is encoded to the same web address it doesn’t mean your content has to stay the same ! Regularly update promotions and information to encourage repeat scans of your NFC marketing. NFC tags are available in a large range of promotional products and include everything from NFC fridge magnets and window stickers through to NFC pens and even beer mats.

The Difference Between NFC and RFID – Explained

By , October 13, 2014 4:42 AM

The Difference Between NFC and RFID – Explained

RFID and NFC are two closely related wireless communication technologies that are used globally for a vast number of applications such as access control, asset tracking and contactless payments. RFID was first patented in 1983 and is the precursor to NFC, so we will begin there.
Radio Frequency Identification (RFID)
RFID enables a one way wireless communication, typically between an unpowered RFID tag and a powered RFID reader. RFID tags can be scanned at distances of up to 100 meters without a direct line of sight to the reader and as such RFID is used globally for asset tracking in warehousing, airport baggage handling, livestock identification and much more. RFID operates at a range of radio frequencies each with their own set standards and protocols.
RFID Frequency Band
Scan Distance
120-150 kHz (Low Frequency, LF)
Up to 10 cm
13.56 MHz (High Frequency, HF)
Up to 1 m
433 MHz (Ultra High Frequency, UHF)
1-100 m
865-868 MHz & 902-928 MHz (Ultralight High Frequency, UHF)
1-2 m
2450-5800 MHz (Microwave)
1-2 m
3.1-10 GHz (Microwave)
Up to 200 m
Near Field Communication (NFC)
NFC operates at 13.56 MHz and is an extension of High Frequency (HF) RFID standards. NFC therefore shares many physical properties with RFID such as one way communication and the ability to communicate without a direct line of sight. There are however three key differences.

1. NFC is capable of two way communication and can therefore be used for more complex interactions such as card emulation and peer-to-peer (P2P) sharing.

2. NFC is limited to communication at close proximity, typically 5cm or less.

3. Only a single NFC tag can be scanned at one time.

These properties were developed primarily to enable secure mobile payments and it is for this reason NFC is limited to singular and close proximity interactions. An important by-product is that NFC is now available in the majority of mobile phones and this is perhaps the most important difference between NFC and RFID.

NFC-enabled phones offer both businesses and day-to-day users slick and intuitive communication between mobile phones and between a mobile phone and an NFC tag. Examples include file sharing via Android Beam, instant connection setups between electronic devices and the ability to link everyday objects such as posters to online content. For more great NFC ideas – click here.

HF RFID
NFC
Operating Frequency
13.56 MHz
13.56 MHz
Communication
One way
Two way
Standards
ISO 14443, 15693, 18000
ISO 14443
Scan Distance
Up to 1 m
Up to 10 cm
Scan Tags Simultaneously
Yes
No

WAVECOM CLONE SERIAL SETTINGS

By , September 3, 2014 12:21 PM

 

to connect to the serial port use putty

select the COM port and settings can be

When the port is selected click Ok, to get to the Port configuration form

On this form specify the port settings.

The most common port speeds for GSM phones and modems are 9600, 19200, 57600 and 115200.

The Data bits should be set to 8. The Parity to none the Stop bits to 1 and the flow control should be hardware.

Set the appropriate serial port (usually COM1)
Baud rate (speed) = 9600
Data bits = 8
Stop bits = 1
Parity = N

 

ENTER

AT
Will give you a response OK if you are connected

THEN
I can check in PuTTY GSM modem information using commands:
Manufacturer: AT+CGMI -> “WAYECOM MODULE”
Model: AT+CGMM -> “MULTIBAND G850/900E/1800/1900MHz”
Revision: AT+CGMR -> “652B09gg.Q2406B 1961548 103107 17:50”
IMEI: AT+CGSN

Thomas Challenger Thomas Challenger