Free SSL Certbot


Hits: 17  

Certbot, It was Let’s Encrypt Client previously. Automatically enable HTTPS on your website with EFF’s Certbot, deploying Let’s Encrypt certificates.

Server Support

– Apache
– Nginx
– Haproxy
– Plesk

OS Support

– Web Hosting Service
– Debian 7 (wheezy)
– Debian 8 (jessie)
– Debian 9 (stretch)
– Debian testing/unstable
– Debian (other)
– Ubuntu 17.04 (zesty)
– Ubuntu 16.10 (yakkety)
– Ubuntu 16.04 (xenial)
– Ubuntu 14.04 (trusty)
– Ubuntu (other)
– Gentoo
– Arch Linux
– Fedora 24+
– CentOS 6
– RHEL 6
– CentOS/RHEL 7
– FreeBSD
– OpenBSD 5.9
– OpenBSD 6.0+
– OpenBSD (other)
– macOS
– Devuan Jessie 1.0
– Devuan (other)
– Other UNIX
– Non-UNIX

Install on Ubuntu 17.04 (zesty) Apache

$ sudo apt-get update
$ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:certbot/certbot
$ sudo apt-get update
$ sudo apt-get install python-certbot-apache

Get Started https://certbot.eff.org/#ubuntutzesty-apache

$ sudo certbot --apache

$ sudo certbot --apache certonly

Automating renewal

$ sudo certbot renew --dry-run

$ sudo crontab -e

30 1 * * * /usr/bin/certbot renew --quiet

It will run renewal command at 1:30 am, every day.

Linux – Delete Files Or Directories Older Than x Days


Hits: 682  

First find files older than X Days

-mtime n => File was last modified n*24 hours ago.

-atime n => File was last accessed n*24 hours ago.

-ctime n => File status was last changed n*24 hours ago.

+n More than n.
n Exactly n.
-n Less than n.

# files modified greater than 24 hours ago
find /location/ -mtime +0

# files modified between now and 1 day ago
find /location/ -mtime 0

# files modified less than 1 day ago
find /location/ -mtime -1

# files modified between 24 and 48 hours ago
find /location/ -mtime 1

# files modified more than 48 hours ago
find /location/ -mtime +1

-type f => For Files
-type d => For Directories

Now delete all files modified time greater than 24 hours ago (keep today’s files)
# find /var/www/html/recorded/files/* -type f -mtime +0 -exec rm {} \;

Install Red5 Media Server on Ubuntu / Debian


Hits: 5701  

Red5 is free media server based on Java and other open source frameworks. It support FLV, F4V, MP4, 3GP, MP3, F4A, M4A, AAC and protocols like RTMP, RTMPT, RTMPS, RTMPE.

Install Red5 Media server
# apt-get install red5-server

Red5 Need below ports open in firewall / iptable
RTMP: 1935
Debug proxy: 1936
HTTP servlet: 5080
RTMPT: 8088

Red5 Installed location
/usr/share/red5/

Red5 application in the location
/usr/share/red5/webapps

Install demo Red5 Applications
# wget http://www.red5.org/downloads/red5/1_0_1/red5-1.0.1.zip
# mkdir red5/
# cd red5
# unzip ../red5-1.0.1.zip
# cd red5-server-1.0/
# cp -R webapps/root/demos /var/lib/red5/webapps/root/demos
# cp -R webapps/installer /var/lib/red5/webapps/installer
# find /var/lib/red5/webapps/ -type d -exec chown _red5 {} \;
# /etc/init.d/red5-server restart

Red5 Installer
http://server-ip-address:5080/installer/

Red5 Demo
http://server-ip-address:5080/demos/

Backup Disk Snapshot on Google Compute Engine


Hits: 8805  

Snapshots are stored in Google Cloud Storage, which is secure, incredibly large, and remarkably inexpensive. You might want to think about whether the labor involved in saving snapshots on your local PC, with all the attendant risks of data loss.

For pricing, see
https://cloud.google.com/pricing/cloud-storage. For example, if you have a 10 GB snapshot, that’s going to cost you $0.85/ month.

Overview Google Compute Engine
Overview Google Compute Engine

You can read more about here ….

https://cloud.google.com/pricing/compute-engine

https://developers.google.com/compute/docs/disks

1) Create a snapshot with the gcutil getsnapshot command.

$ gcutil addsnapshot red5 –source_disk red5 –zone us-east1-a

Snapshot Google Compute Engine
Snapshot Google Compute Engine

2) Create a new persistent disk with that snapshot

Disk Google Compute Engine
Disk Google Compute Engine

3) Create an instance with that persistent disk

Instance on Google Compute Engine
Instance on Google Compute Engine

4) Create an image of that instance

Operations Google Compute Engine
Operations Google Compute Engine

5) Save the image on the instance

$ sudo python /usr/share/imagebundle/image_bundle.py -b red5 -o /tmp

6) Download the image of the instance

You can find archived image in current user folder i.e. /home/svnlabs/red5/096df5a918c746f965338bda6b4c886ac4097c08.image.tar.gz

 

PHP Run Background Process using Exec


Hits: 9053  

If you need to start process in background and get its PID to manage it later using PHP.

<?php

function runInBackground($command,$log,$priority=0)
{
if($priority)
   $PID=shell_exec("nohup nice -n $priority $command > $log 2>&1 & echo $!");
else
   $PID=shell_exec("nohup $command > $log 2>&1 & echo $!");
return($PID);
}

?>
PHP Process
PHP Process

echo $! will return process ID
# Command & echo $!

 

Check if process is running

<?php

function isProcessRunning($PID)
{

if($PID==0)return false;
if($PID=="")return false;

exec("ps -p $PID 2>&1",$state);
return(count($state)>=2);

}

?>

 

Display Process Logs

<?php

function displayProcessLog($logfile)
{

exec('cat $logfile 2>&1',$log);
return implode("\r\n",$log);

}

?>

 

Kill Process

<?php

function killProcess($PID)
{
 exec('kill '.$PID.' 2>&1',$status);
 return implode("\r\n",$status);
}

?>

 

Save Process ID to file

#!/bin/bash
Command &
echo $! >/path/to/pid.file

Install Apache, PHP, MySQL on Google Compute Engine


Hits: 13389  

I am so happy to get access for Google Compute Engine Limited Preview 🙂

Google Compute is a service that provides virtual machines on Google infrastructure. Google Compute (virtual machines with distributed computing power) provides some options that enable to configure, deploy, and manage multiple virtual machines in multiple data centers.

– Command-line tool called gcutil
– REST API
– SSH Keys

Instructions on Installing and using gcutil; the command-line tool that is used to manage your Google Compute resources.

Run virtual machines at Google Scale

Google Compute Engine offers scalable and flexible virtual machine in the cloud to solve large scale processing and analytic problems on Google’s computing, storage, and networking infrastructure.

Google Compute Engine
Google Compute Engine

You need to generate your keys using ssh-keygen.. check more details here

Google Compute Engine - Add ssh Keys
Google Compute Engine – Add ssh Keys

You SSH Keys looks something like ….

ssh-rsa DfgdfeDFDFdghGHg ……………………..

Then you can login to server using Google Compute Engine’s external IP and PPK (Private key for authentication) file..

SSH PPK File
SSH PPK File

If all goes well you will get nice screen 😉

SSH Google Compute Engine using SSH Keys
SSH Google Compute Engine using SSH Keys

This is typical Ubuntu server and you can easily install Apache, PHP, MySQL here

First I tried “Hello World” Application provided in instructions

Before installing Apache you need to add port 80 to firewall 😉

$ gcutil addfirewall http2 –description=”Incoming http allowed.” –allowed=”tcp:http”
INFO: Waiting for asynchronous operation to complete. Current status: RUNNING. Sleeping for 5s.

$ gcutil getfirewall http2

Install Apache HTTP Server

$ sudo apt-get update

$ sudo apt-get install apache2

Install PHP & MySQL

$ sudo apt-get install apache2 mysql-server php5 php-pear php5-suhosin php5-mysql

$ sudo apt-get install php5 libapache2-mod-php5

Restart Apache

$ sudo /etc/init.d/apache2 restart

Install PHPMyAdmin

$ sudo apt-get install phpmyadmin

Follow steps for phpmyadmin 😉

Set mysql root password

$ mysql -u root

mysql> SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(‘yourpassword’);

Your Apache, PHP, MYSQL and phpMyAdmin is ready in Ubuntu on Google Compute Engine, start clouding….

Free Cloud Storage Services


Hits: 5598  

Cloud Storage is really a buzz word for people who are facing troubles for backups and data loss. Cloud Storage can provide tension free management of data on the fly. You can choose any cloud program below as free storage. I really like Dropbox, it is available for all devices 😉

Dropbox – Free for Windows, Mac, Linux, and Mobile

Free space : 2GB

Dropbox - Simplify your life
Dropbox – Simplify your life

Microsoft SkyDrive – SkyDrive on all your devices to access your photos and files from almost anywhere, store them, and securely share them.

Free space : 7GB

Files - SkyDrive
Files – SkyDrive

Amazon Cloud Drive – Amazon Cloud Drive makes storing your photos, videos, documents and other digital files in the Cloud quick and easy.

Free space : 5GB

Amazon Cloud Drive
Amazon Cloud Drive

Apple – iCloud – Your content. On all your devices

Free space : 5GB

Apple - iCloud - Your content. On all your devices
Apple – iCloud – Your content. On all your devices

Box – Secure content-sharing that users and IT love and adopt

Free space : 5GB

Box - Secure content-sharing that users and IT love and adopt
Box – Secure content-sharing that users and IT love and adopt

SugarSync – File Sync & Online Backup – Access and File Sharing from Any Device – Your Cloud

Free Space : 5 GB

File Sync & Online Backup - Access and File Sharing from Any Device - SugarSync - Your Cloud
File Sync & Online Backup – Access and File Sharing from Any Device – SugarSync – Your Cloud

Google Drive – Google Drive is everywhere you are—on the web, in your home, at the office and on the go. So wherever you are, your stuff is just…there. Ready to go, ready to share. Get started with 5 GB free.

Free space : 5GB

Google Drive
Google Drive

Ubuntu One – Keep your content safe, access it anywhere, and share it with friends, family and colleagues. Spread the word and earn up to 20GB extra free cloud storage with our referral program.

Free space : 5GB

Ubuntu One
Ubuntu One

SpiderOak.com – Zero-Knowledge data backup, sync, access, storage and share from any device

Free Space : 2 GB

Zero-Knowledge data backup, sync, access, storage and share from any device - SpiderOak.com
Zero-Knowledge data backup, sync, access, storage and share from any device – SpiderOak.com

Syncplicity – File Sync, Sharing & Collaboration Cloud Service – Mobile Document Sync – File Management

Free cloud storage : 2GB

File Sync, Sharing & Collaboration Cloud Service - Mobile Document Sync - File Management - Syncplicity
File Sync, Sharing & Collaboration Cloud Service – Mobile Document Sync – File Management – Syncplicity

Wuala – Backup. Sync. Share. Access Everywhere. All data encrypted on your computer.

Free Space : 5 GB

Wuala - Secure Cloud Storage - Backup. Sync. Share. Access Everywhere.
Wuala – Secure Cloud Storage – Backup. Sync. Share. Access Everywhere.

Cloud Storage From Just Cloud. Free Online Storage

Free Space : 15 MB

Cloud Storage From Just Cloud. Free Online Storage
Cloud Storage From Just Cloud. Free Online Storage

MegaCloud – Home – Your files wherever you are

Free Space : 8GB File Storage + 8GB Backup

MegaCloud - Home - Your files wherever you are
MegaCloud – Home – Your files wherever you are

MiMedia – Online Storage & Online Backup Solutions

Free Space : 7 GB

Online Storage & Online Backup Solutions - MiMedia
Online Storage & Online Backup Solutions – MiMedia

MediaFire – Free Online Storage

Free Space : 50 GB

Free Online Storage - MediaFire
Free Online Storage – MediaFire

Symform – Free Cloud Backup – Start with 10 GB

Free cloud storage: Up to 10GB

Free Cloud Backup – Start with 10 GB – Symform
Free Cloud Backup – Start with 10 GB – Symform

YouSendIt – File Sharing, Send Large Files, Access Files from Any Device

Free Storage : 2 GB

YouSendIt - File Sharing, Send Large Files, Access Files from Any Device
YouSendIt – File Sharing, Send Large Files, Access Files from Any Device

Cubby.com – Cloud storage, syncing and sharing, with a smile.

Free Space : 5 GB

Cubby.com - Cloud storage, syncing and sharing, with a smile.
Cubby.com – Cloud storage, syncing and sharing, with a smile.

ElephantDrive – Beyond Backup. Your files – Everywhere.

Free Space : 2 GB

ElephantDrive - Beyond Backup. Your files – Everywhere.
ElephantDrive – Beyond Backup. Your files – Everywhere.

OpenDrive – Online Storage, Backup & Cloud Content Management

Free Space : 5 GB

OpenDrive - Online Storage, Backup & Cloud Content Management
OpenDrive – Online Storage, Backup & Cloud Content Management

And Many More … Search Free Cloud Storage Services

Install cURL on Ubuntu


Hits: 6470  

Run the following command to enable curl package php5-curl.

$ sudo apt-get install php5-curl

Reading package lists… Done
Building dependency tree
Reading state information… Done
The following NEW packages will be installed:
php5-curl
0 upgraded, 1 newly installed, 0 to remove and 17 not upgraded.
Need to get 27.1kB of archives.
After this operation, 127kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ lucid-updates/main php5-curl 5.3.2-1ubuntu4.15 [27.1kB]
Fetched 27.1kB in 5s (4818B/s)
Selecting previously deselected package php5-curl.
(Reading database … 43188 files and directories currently installed.)
Unpacking php5-curl (from …/php5-curl_5.3.2-1ubuntu4.15_amd64.deb) …
Processing triggers for libapache2-mod-php5 …
* Reloading web server config apache2 [ OK ]
Setting up php5-curl (5.3.2-1ubuntu4.15) …

Restart apache

$ sudo /etc/init.d/apache2 restart
* Restarting web server apache2 … waiting [ OK ]

Hope this solution will help to enable curl in ubuntu system.