skanc.com Linux, Microsoft, Raspberry Pi, Python, Android

28Aug/120

Raspberry Pi – Tips & Tricks 10 – Firmware Update

https://github.com/Hexxeh/rpi-update

wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update && chmod +x /usr/bin/rpi-update
sudo apt-get install ca-certificates
rpi-update
Filed under: Genel No Comments
22Aug/121

Raspberry Pi – Tips & Tricks 9 – Sending External IP To via Gmail

nano external_ip
------------------------------------------------------------------------------------------------------
import urllib
import smtplib
import re

#External IP Address
f = urllib.urlopen("http://www.canyouseeme.org/")
html_doc = f.read()
f.close()
m = re.search('(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-

5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)',html_doc)
#print m.group(0)
data=m.group()

#Mail send
fromaddr = 'youraccount@gmail.com'
toaddrs  = ['test@gmail.com']
msg = 'Raspberry Pi External IP Addreds is ' + data + ' ...!'

# Credentials (if needed)
username = 'youraccount@gmail.com'
password = 'yourpassword'

# The actual mail send
server = smtplib.SMTP('smtp.gmail.com:587')
server.starttls()
server.login(username,password)
for toad in toaddrs:
    server.sendmail(fromaddr, toad, msg)
server.quit()
------------------------------------------------------------------------------------------------------

chmod a+x external_ip

20Aug/120

Raspberry Pi – Tips & Tricks 8 – Install Chromium browser

sudo apt-get install chromium-browser

20Aug/120

Raspberry Pi – Tips & Tricks 7 – Full backup & restore of the image

If you are running linux then you can use the dd command to make a full backup of the image:

dd if=/dev/sdx of=/path/to/image

or for compression:

dd if=/dev/sdx | gzip > /path/to/image.gz

Where sdx is your SD card.

To restore the backup you reverse the commands:

dd if=/path/to/image of=/dev/sdx

or when compressed:

gzip -dc /path/to/image.gz | dd of=/dev/sdx

20Aug/120

Raspberry Pi – Tips & Tricks 6 – USB drives mount

sudo tail -f /var/log/syslog&

and re-insert the usb device

sudo mount /dev/sda1 /mnt

20Aug/120

Raspberry Pi – Tips & Tricks 5 – Create a new user with sudo-privileges

sudo adduser username

sudo visudo
------------------------------------------------------------------
Add following line under the "root ALL=(ALL) ALL" Line:

yourUsername ALL=(ALL) ALL

------------------------------------------------------------------

20Aug/120

Raspberry Pi – Tips & Tricks 4 – Updating Raspbian

sudo apt-get update && sudo apt-get upgrade

sudo aptitude update && sudo aptitude full-upgrade

Filed under: Genel No Comments
20Aug/122

Raspberry Pi – Tips & Tricks 3 – Static IP Address and DNS Settings

IP Address Settings

sudo nano /etc/network/interface

 -------------------------------------------------------

auto lo

iface lo inet loopback

iface eth0 inet static

address 192.168.1.X

netmask 255.255.255.0

network 192.168.1.0

broadcast 192.168.1.254

gateway 192.168.1.X

 -------------------------------------------------------

 

DNS Settings

sudo nano /etc/resolv.conf

-------------------------------------------------------

nameserver 192.168.1.1

-------------------------------------------------------

Restart networking

sudo /etc/init.d/networking restart

or

sudo /etc/init.d/networking stop
sudo /etc/init.d/networking start

or
sudo shutdown -r now

20Aug/120

Raspberry Pi – Tips & Tricks 2 – Keyboard Configuration

sudo raspi-config

or

sudo dpkg-reconfigure keyboard-configuration

or

sudo nano /etc/default/keyboard

XKBLAYOUT=”tr”

--------------------------------------------------------------
# KEYBOARD CONFIGURATION FILE

# Consult the keyboard(5) manual page.

XKBMODEL="pc102"
XKBLAYOUT="tr"
XKBVARIANT="intl"
XKBOPTIONS=""

BACKSPACE="guess"
--------------------------------------------------------------

20Aug/120

Raspberry Pi – Tips & Tricks 1 – Configuration

sudo raspi-config