samedi 3 février 2018

How to access to RaspberryPi from your computer?

  Aucun commentaire


I'm going to show you "How to access to RaspberryPi from your computer", using VNC, that stands for Virtual Network Computing : which is a graphical desktop sharing system that uses the Remote Frame Buffer protocol (RFB) to remotely control another computer.

Note : Your RaspberryPi and your computer must be connected to the same network.

First we must enable VNC, by running the commands below in the terminal:
sudo apt-get update
sudo apt-get install realvnc-vnc-server realvnc-vnc-viewer

After executing the second command:

Select Menu > Preferences > Raspberry Pi Configuration > Interfaces.

Once the VNC is enabled, in your computer ( Windows, Linux or Mac), download and install VNC Viewer :

After downloading and installing VNC Viewer on your computer, go and click on "New Connection", and enter the local IP address of your RaspberryPi, and your RaspberryPi login, then click on OK to start your session.

If you don't know your raspberryPi local IP adresse, open the RaspberryPi terminal and type the command below:
Then, you will see an address that starts with "192.168...".

Read More

dimanche 28 janvier 2018

How to connect BlueStacks to Android Studio ?

  Aucun commentaire


Todays question is

"How to connect BlueStacks to Android Studio ?".

The question is very simple, just follow these steps:

  1. Close Android Studio.
  2. Open BlueStacks
  3. Open Android Studio and Run.

Optional: If you want to check if the Android Studio
  1. Open the Terminal
  2. Navigate to sdk/platform-tools folder
  3. Run the command : ./adb devices

Read More

samedi 23 décembre 2017

Android - How to disable the case clock screen?

  Aucun commentaire

How to disable the clock screen when the case is covering phone?

Go to your phone Settings -> Accessibility -> Leather case function
Then disable the option "Leather case function".

That's it!

Read More

vendredi 21 juillet 2017

How to generate a C# entity of an SQL Server table

  Aucun commentaire

Hey, wassuuuuuuup 😆😆😝😝

Here is a trick for generating a C# entity of an SQL Server table.

For doing this, just execute the following SQL script... Don't forget to replace TableName in red with the name of the table...

declare @TableName sysname = 'TableName'
declare @Result varchar(max) = 'public class ' + @TableName + '
select @Result = @Result + '
    public ' + ColumnType + NullableSign + ' ' + ColumnName + ' { get; set; }
        replace(, ' ', '_') ColumnName,
        column_id ColumnId,
            when 'bigint' then 'long'
            when 'binary' then 'byte[]'
            when 'bit' then 'bool'
            when 'char' then 'string'
            when 'date' then 'DateTime'
            when 'datetime' then 'DateTime'
            when 'datetime2' then 'DateTime'
            when 'datetimeoffset' then 'DateTimeOffset'
            when 'decimal' then 'decimal'
            when 'float' then 'float'
            when 'image' then 'byte[]'
            when 'int' then 'int'
            when 'money' then 'decimal'
            when 'nchar' then 'string'
            when 'ntext' then 'string'
            when 'numeric' then 'decimal'
            when 'nvarchar' then 'string'
            when 'real' then 'double'
            when 'smalldatetime' then 'DateTime'
            when 'smallint' then 'short'
            when 'smallmoney' then 'decimal'
            when 'text' then 'string'
            when 'time' then 'TimeSpan'
            when 'timestamp' then 'DateTime'
            when 'tinyint' then 'byte'
            when 'uniqueidentifier' then 'Guid'
            when 'varbinary' then 'byte[]'
            when 'varchar' then 'string'
            else 'UNKNOWN_' +
        end ColumnType,
            when col.is_nullable = 1 and in ('bigint', 'bit', 'date', 'datetime', 'datetime2', 'datetimeoffset', 'decimal', 'float', 'int', 'money', 'numeric', 'real', 'smalldatetime', 'smallint', 'smallmoney', 'time', 'tinyint', 'uniqueidentifier')
            then '?'
            else ''
        end NullableSign
    from sys.columns col
        join sys.types typ on
            col.system_type_id = typ.system_type_id AND col.user_type_id = typ.user_type_id
    where object_id = object_id(@TableName)
) t
order by ColumnId
set @Result = @Result  + '
print @Result

Original Source :

Read More

vendredi 14 juillet 2017

[06/2017] Bookmark of the Month

  Aucun commentaire
Read More

jeudi 8 juin 2017

How to setup a Cron Job on Ubuntu?

  Aucun commentaire

Hey, Wasuuuuuuup 😝

Today we will learn how to setup / start a Cron Job on Ubuntu.

What is a cron job ?

The software utility Cron is a time-based job scheduler in Unix-like computer operating systems. People who set up and maintain software environments use cron to schedule jobs (commands or shell scripts) to run periodically at fixed times, dates, or intervals. It typically automates system maintenance or administration—though its general-purpose nature makes it useful for things like downloading files from the Internet and downloading email at regular intervals.[1] The origin of the name cron is from the Greek word for time, χρόνος (chronos).[2] (Ken Thompson, author of cron, has confirmed this in a private communication with Brian Kernighan.)  [By Wikipedia - Read more ...]
We understand now that a cron is a task executed each and every [time interval].

 How to setup my own cron job?

To setup your own cron, you should run the following command :
crontab -e
Then add your task line. Let's take as example this line:
* * * * * /path/to/command 
The task above executes a command each and every minute...

Cron jobs time interval can be customized, read more ...

Hope this article helps you to setup your first cron 😉

Read More

[FIX] Why the "< ?" tag is not working on php ?

  Aucun commentaire

Heeey, Wassuuuuuuuuuup....

Today we will fix the "<?" tag problem in PHP.

If you are one of those that faced that problem, you probably didn't enabled the "short_open_tag" in your php.ini file by setting the value of the option "short_open_tag" to "On"

To fix the problem you should follow these step.
  1. Locate the php.ini file

    In order to enable the "short_open_tag" option, you must find the php.ini file in your server.
    If you know the location of php.ini file in your server, you an skip this step.
    To locate, create a new file (infos.php) in your html directory:
    nano infos.php
    And parse this line :
    <?php phpinfo(); ?>
    Open your navigator and go to your infos.php page :
    Now you can see the path of the php.ini file, for me it's : /etc/php5/fpm/php.ini
  2. Change the short_open_tag option

    Now as you are able to locate the php.ini file, you can open it with your preferred editor, I use "nano" .
    nano (your php.ini path)
    Then you will see the "short_open_tag = Off", fix the problem  by setting it to :
    short_open_tag = On
Note : You must restart your php service (apache or php-fpm) in order to apply changes.

That's it! hope it works for you 😉

Read More