Fix, Temperature Error, Raspi

Fixing “VCHI Initialization failed” error

Add user www-data to video group. Below is the command,
sudo usermod -G video www-data
And then restart web server”

 

Changing Hostname

Edit below file and change the value to what you need.
/etc/hostname
Edit below file and replace the old hostname value against 127.0.1.1 to new name.
/etc/hosts

Fixing “VCHI Initialization failed” error

Add user www-data to video group. Below is the command,
sudo usermod -G video www-data
And then restart web server”

Measuring Raspberry Pi CPU Temperature

/opt/vc/bin/vcgencmd measure_temp

Removing a package using apt-get

sudo apt-get –purge remove

Banner

sudo nano /etc/ssh/sshd_config
uncomment Banner and make the line as below,
Banner /etc/ssh/banner
sudo nano /etc/ssh/banner
enter banner text here.
restart shh

Find Largest 20 files

sudo du -ah / | sort -n -r | head -n 20

Youtube command line program intslall

wget https://github.com/rg3/youtube-dl/raw/2012.02.27/youtube-dl
chmod +x youtube-dl
cp youtube-dl /usr/bin/youtube-dl
sudo apt-get install python-setuptools
wget http://pypi.python.org/packages/source/w/whitey/whitey-0.1.tar.gz
tar -zxvf whitey-0.1.tar.gz
wget https://dl.dropbox.com/u/33311875/__init__.py
cp __init__.py whitey-0.1/src/yt/__init__.py
cd whitey-0.1
sudo python setup.py install
sudo youtube-dl -U

Repeat the last command several times until you see youtube-dl is up-to-date (2012.12.11)

Check Wireless Signal Command Line

cat /proc/net/wireless
To continuously watch signal strenth,
watch -n 1 cat /proc/net/wireless
iwconfig wlan0

What application is using the port

netstat -tlnp | grep 8080

resizing sd card to fill up the size using the pi itself

do df -h to list your partions note down /dev/mmcblk0p1.
do fdisk -uc /dev/mmcblk0
p to print table note down the available partions and start number of second partion
d to delete all partions except 1st.
n to create new partion. p for primary partion. give 2 for creating second partion. use the start number saved as first sector. Simply enter on last sector.
w to write the changes
reboot
resize2fs -p /dev/mmcblk0p2

Tar and utar dir

tar -zcvf prog-1-jan-2005.tar.gz /home/jerry/prog
tar -zxvf prog-1-jan-2005.tar.gz

Forceful Unmount

sudo umount -l /mnt/usb-wd/

Check Apache bandwidth in MB

cat /var/log/apache2/access.log | awk ‘{SUM+=$10}END{print SUM/1024/1024}’
cat * | awk ‘{SUM+=$10}END{print SUM/1024/1024}’