Posts

Showing posts from July, 2016

How To Make IoT Messaging with BashShell

Create new file with extension .sh ..
As you know the first line of Bash Script start with this
#!/bin/bashokay, let's say we want collect information of our IoT like Memory and IP Address etc..
so we can collect this information with Shell Script.
# Get Used Memory
um=$(free -h | grep Mem | awk ' { print $3 } ')
# Get Free Memory
fm=$(free -h | grep Mem | awk ' { print $2 } ')
# Get Local IP Address
ipadd=$(ifconfig wlp3s0b1 | grep 'inet ' | awk '{print $2}')
# Get Public IP Address
pip=$(curl iblo.esy.es)Okay We Are Done, We collect all information that we need to save, so we need name for our IoT, let's make it complex .
IoTName="rasp5289166"Now we put all Variables in one Variable
URL="http://www.iblo.esy.es/save/data/?iot=$IoTName&PuIp=$pip&ip=$ipadd&UsedMem=$um&FreeMem=$fm"Now let's Save our Data
output=$(curl -X POST $URL)the output variable should be like this :
New Name http://www.iblo.esy.es/load/data/?iot…

Compress JPEG or PNG Images in Fedora

Compress or Optimize JPEG Install Jpegoptim on your Fedora systems, run the following command from your terminal. dnf install epel-release
dnf install jpegoptimHow to Use Jpegoptim Image Optimizer jpegoptim filename.jpeg
jpegoptim --size=250k filename.jpegCompress or Optimize PNG Install Optipng on your Fedora systems, run the following command from your terminal. dnf install optipngHow to Use optipng Image Optimizer optipng filename.png

Starting to Use Cron

Cron is a system daemon used to execute desired tasks (in the background) at designated times.  Commands that normally run with administrative privileges (i.e. they are generally run using sudo) should be added to the root crontab. To edit the root crontab enter: sudo crontab -e
Starting to Use Cron To use cron for tasks meant to run only for your user profile, add entries to your own user's crontab file. To edit the crontab file enter: crontab -e Edit the crontab using the format described in the next sections. Save your changes. (Exiting without saving will leave your crontab unchanged.) To display the on-line help describing the format of the crontab file enter: man 5 crontab Commands that normally run with administrative privileges (i.e. they are generally run using sudo) should be added to the root crontab. To edit the root crontab enter: sudo crontab -e Crontab Lines
Each line has five time-and-date fields, followed by a command, followed by a newline character ('\n')…