Entity Framework in .NET and MySQL tinymce(1) problem

You know at tinymce(1) field in MySQL database will be converted to boolean type in C#. Sometimes you don’t want this because you just want to read the integer value from MySQL in this field (it can be any from 0-255 if unsigned or -127-127 if signed) – one byte.

In order to do so you need to do two things:

  1. Add TreatTinyAsBoolean=false to your connection string
  2. Edit the database edmx file and in SSDL content section change bool to tinyint, and in CSDL content section change Boolean into SByte.

Be careful if you update edmx file because changes you have made will be lost. This is the bad thing about this, but it is working solution.

How to free space on Disk C

There are a lot of system stuff that just eat important space in Windows on disk C (if you have SSD and smaller C partition you don’t want to run out of space).

The best way is to create a junction (symbolic link) and to move some big folder to another partition (you need to have one first).

By doing this Windows will be fooled because you will get the same path but it will be shortcut (pointer) to another real location.

To do this move completely chosen folder to another partition and create symbolic link like this:

mklink /j c:\windows\MyMovedFolder d:\MyMovedStuff\MyMovedFolde

Ever been to Corsica?

Summer vacation is coming in a few months. Ever been in Corsica? You should go to see it if you didn’t.

It is a beautiful island with amazing beaches, villages and mountains. Ajaccio, born place of Napoleon, has the best city beach I have seen in my life. Usually you try to avoid them.

The best beach on island is Capo di Feno. Don’t miss to visit Bonifacio.

Here are some photos…

04 07 23 01 02

Merry Christmas and Happy New Year 2016!

2016

Finding the passion

You need to be in the centre of these circles.
Ikigai is a Japanese concept meaning “a reason to get up in the morning”, that is, a reason to enjoy life.

ikigai-passion-mission

(Source: found somewhere in Facebook posts)

Remove annoying Get Windows 10 tray icon

  • Control Panel > Windows Update > Installed updates (at bottom left) -> find and remove KB3035583 (under Windows section) -> Restart computer
  • It can come again with next update so be careful and if you see it then right click on it (under Select the updates you want to install) and click Hide this update
  • As final check, see if you have a registry key HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Gwx and delete it.

‘Verify that the FunctionImport name is unique’ error

To solve this in your Entity database this is what you need to do:

  1. Double click on edmx file to open diagram
  2. Right mouse click > Model browser
  3. [Your database] > EntityContainer > Function Imports
  4. Delete problematic Function import

Creating virtual host aliases under Apache

Sometimes you want to create folder alias for your website like this: /images to be mapped to /home/your_account/public_html/images.

To do this, you need to edit Apache httpd.conf file which is located at /etc/httpd/conf

It is clever to put all aliases in one file in the same directory and name them aliases.conf and then only to reference this file from httpd.conf.

You will include aliases.conf in httpd.conf like this:

<IfModule mod_alias.c>
    Include /Applications/MAMP/conf/apache/alias
</IfModule>

You define alias in aliases.conf file like this:

Alias /images /home/your_account/public_html/images
<Directory "/home/your_account/public_html/images">
    Options Indexes FollowSymLinks ExecCGI Includes
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

Re-keying and Re-issuing MultiSAN SSL certificate in CPanel

I have lost 6 hours of my time when I was trying to add new MultiSAN SSL on server. We already used one and we just added one new SAN placeholder for one subdomain.

Server: CentOS Linux + CPanel

  1. Entered new SAN, using saved CSR and Re-issued the SSL certificate
  2. Went to http://panel.mydomain.com > SSL/TLS Manager and added the new SSL under SSL/TLS Manager > Certificates (CRT) > Generate, view, upload, or delete SSL certificates.
  3. Nothing helped because when I visited https://subdomain.mydomain.com it said that it is using old SSL certificate which has expired.
  4. Tried everything, Re-keying, generating new CSR, few times downloading newly prepared SSL certificate, editing Apache httpd.conf file but nothing help.
    install-ssl-certificate-in-cpanel
  5. After 6 hours I saw the last option: SSL/TLS Manager > Install and Manage SSL for your site (HTTPS) > Manage SSL sites. Uploaded there all three things:
    1. My SSL certificate
    2. Decoded private key
    3. My provider’s SSL certificate
  6. Restart Apache web server

Voila! It finally worked!

What unfriendly user interface where all 4 options are equal and it is not obvious what needs to be done. Or maybe, I am the exception. Tried 3rd option all the time.

Hate these things, but on the other side I learned something new and you will spare some time if you come to the similar problem. Hope, you will find this post quickly!

I definitely wrote this post also for myself, it was not the first time I was searching for some solution and Google listed me my blog post :-)

 

Follow

Get every new post delivered to your Inbox

Join other followers