Install Ubuntu and configure a website in DigitalOcean droplet – Basic

You can run the below code after login using the command-line/putty

sudo apt-get update
sudo apt-get install apache2
sudo apt-get update
sudo apt-get install mysql-server
sudo mysql_secure_installation
sudo apt-get install phpmyadmin php-mbstring php-gettext
sudo phpenmod mcrypt
sudo phpenmod mbstring
sudo systemctl restart apache2
sudo apt-get install curl
sudo a2enmod rewrite
service apache2 restart

sudo nano /etc/apache2/sites-available/000-default.conf

Inside that file, you will find a <VirtualHost *:80> block starting on the first line. Inside of that block, add the following new block so your configuration file looks like the following. Make sure that all blocks are properly indented.

/etc/apache2/sites-available/000-default.conf

<VirtualHost *:80>
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
. . .
</VirtualHost>

Save and close the file. To put these changes into effect, restart Apache.

sudo systemctl restart apache2

After uploading the wordpress files run below command

chown -R www-data /var/www/html

Create rounded imageview in Android

There is a simple way to create rounded image view in Android. We can use a CardView and ImageView together for this. See the below code

<android.support.v7.widget.CardView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:cardCornerRadius="50dp"
    app:cardPreventCornerOverlap="true">

    <ImageView
        android:layout_width="100dp"
        android:layout_height="wrap_content"
        android:adjustViewBounds="true"
        android:src="@drawable/profile_image" />

</android.support.v7.widget.CardView>

Use the app:cardCornerRadius value exactly half of the image.

rounded_imageview_android
This is how it looks like

Thank you.

How to detect and apply window size to a div using jQuery

In some case we need to apply the window width and height to a div or something like that. Here is a solution for that.

You can detect and insert the screen width to a variable using the following jQuery code,

var screen_width = $(window).width();

Also you can detect and insert the screen height to a variable using the following jQuery code,

var screen_height = $(window).height();

If you want to apply the width or to a div, you can use the following code,

//do something with the width or height value here!
    $("div").width(screen_width);
    $("div").height(screen_height);

If you want to customize your value (example: you want to reduce 10pixels from the screen width), you can use the following code,

var screen_width = $(window).width();
var screen_height = $(window).height();
var reduced_width = parseInt(current_width)- parseInt(10);
var reduced_height = parseInt(current_height)- parseInt(10);
     
//do something with the width or height value here!
    $("div").width(reduced_width);
    $("div").height(reduced_height);

If you liked the script, leave a comment here. 🙂
Enjoy…

How to make rounded corner div using css

In many sites we found rounded corner divs without using images. We can make it in simple way using css. But it will not work in IE up to IE 8. We can use this css on everything, like table, text inputs, buttons, images, etc.

for deferent browsers, the css are,

IE9+ = border-radius: Value;

Mozilla Firefox = -moz-border-radius: Value;

Opera = -o-border-radius: Value;

Crome, safari = -webkit-border-radius: Value;

Konqueror = -khtml-border-radius: Value;

Radius value 10px.

Here is the example for radius value 10px applied for a div

Continue reading How to make rounded corner div using css

How to make Twitter type textfield glow effect using CSS

Twitter have good attractive interface to impress the users. one of them is the textfield. Here I am talking about how we can create that thing.

Its is simple. We can make it using CSS. There used some simple css steps.

But it will not work in explorer. The new version of explorer(IE 9) supports this.

Continue reading How to make Twitter type textfield glow effect using CSS