Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Sunday, May 9, 2021

How to make your Own SD Raspberry Image

Why Do I need This ? 

Here is the problem. Raspberry Pi SD image is less than 4GBs and you copy it on SD memory card of size 8, 16, 32 GB. It expands and you can install and customize your raspberry pi.

Now you have your own SD card with your own software that you want to reproduce. If you use dd command only for your 16GB SD card you will get a 16 GB image file. You need a 16 GB SD card to restore it again. Although the software itself can be restored in 8GB card -assuming the card is not full- and the remaining size is unused space !!! 


Here are the steps to produce a compressed raspberry pi image version:


Steps:

1- Insert SD-Card you want to clone into your laptop.

2- Run lsblk

you should see something like:

    sdb\sdb1  \media\$USER\boot

    sdb\sdb2  \media\$USER\rootfs


3- Unmount partitions

    sudo umount \media\$USER\boot

    sudo umount \media\$USER\rootfs


4- Now copy the full sd-card:

    sudo dd if=/dev/sdX   of=~/my_large_image.img

  

5- Now Compress Image using pishrink

    pishrink.sh ~/my_large_image.img  ~/my_compressed_image.img


Further more  you can compress it to zip file.


How to Get pishrink


1- Download:

wget https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh


2- Change Permission:

chmod +x pishrink.sh


3- Move it: 

sudo mv pishrink.sh /usr/local/bin

Tuesday, September 15, 2015

Linux Experience

This Year I was very busy with developing Andruav.com an RC related android application. This September  2015 I finish 1 year working on it. It is a sophisticated app to develop, however I hope it is alot easier to be used.

I have been a Windows developer for more than +15 years, a C++ anti-java person. Well I regret that, I do love windows, however Java is a very nice language, especially when it comes to Android. Also Linux is an excellent platform that I was away from. Now my Laptop is Ubuntu :)

Anyway when I was looking for an inexpensive server for Andruav.com I had to go to Linux, at first I thought buying a VPS Ubuntu means a remote desktop with GUI, but I found my self lonely in front of back screen and all I have is ssh to connect :(.  That was horrible at the beginning, but later I was very comfort with it. I had to go through alot of issues that I will summaries here for other people who want to use Linux easily.


The platform I use is Ubuntu 12.04


Steps of installing LAMP on Ubuntu 14.04


1. Install Apache

sudo apt-get install apache2

2. Install MySQL

sudo apt-get install mysql-server
* reconfig
/usr/sbin/dpkg-reconfigure: mysql-server-5.5

3. Install PHP

sudo apt-get install php5 libapache2-mod-php5

4. Restart Server

sudo /etc/init.d/apache2 restart

5. Check Apache

http://localhost/.



7. Installing MySQLAdmin

apt-get install php5-mysql http://www.thetechrepo.com/main-articles/488.html
sudo apt-get install phpmyadmin

*reconfig phpmyadmin database:
sudo dpkg-reconfigure phpmyadmin

Add extension=mysqli.so (near other 'extension=' lines) line to your php.ini


8. Restart Server

sudo /etc/init.d/apache2 restart


If you execute these commands in order you will have LAMP on your Ubuntu