Categories
English

Saying Hello and Goodbye

Ways to say hello:

  • Hi
  • Hello
  • How are you doing?
  • How are you? (Formal in North America)
  • Hey man
  • How’s it hang’ in
  • What’s up

Response to hello:

  • I’m good (Used most of the time)
  • I’m fine (Formal)
  • I’m well (Formal)
  • Alright, how about yourself?
  • Not too bad

Ways to say Goodbye:

  • Goodbye (Formal)
  • Later
  • See ya

References:
https://www.engvid.com/english-speaking-saying-hello-and-goodbye
https://www.youtube.com/watch?v=KxyxqGnbcC8

Categories
DevOps

Vagrant Error on Windows: unknown encoding name – CP720

Solution:

chcp 1252

This is caused by your current terminal as it is using a codepage (encoding) that is not supported by Ruby. Codepage 720 is Arabic characters used by MS-DOS back in the day and seems Ruby do not have a translation table for it.

Reference: https://stackoverflow.com/questions/22815542/rails4-unknown-encoding-name-cp720

Categories
English

Polite English Expressions

  1. Would/Could you please …
  2. If you don’t mind, …
  3. if it’s not a problem, …
  4. When you have/get a moment/second, …
  5. If you get a chance, …
  6. By any chance, …
  7. I’d appreciate it if you would … [position of authority]
  8. What if …
  9. How about …
  10. What do you think about …
  11. You should probably …
  12. I don’t want to keep you, …

Refrences: https://www.youtube.com/watch?v=6kCTDhW9rqQ

Categories
DevOps

Install Mailparse extension on PHP 7.0 + Apache + Vagrant (Ubuntu)

1. SSH into your server (Vagrant, Whatever)

vagrant ssh

# or

ssh [email protected]

2. Follow the following instruction:

cd /tmp

apt-get install php7.0-dev

pecl download mailparse

tar xvzf mailparse-3.0.2.tgz

cd mailparse-3.0.2

phpize

./configure

sed -i \
  's/^\(#error .* the mbstring extension!\)/\/\/\1/' \
  mailparse.c

make

make install
echo "extension=mailparse.so" > \
  /etc/php/7.0/fpm/conf.d/30-mailparse.ini

service php7.0-fpm reload
echo "extension=mailparse.so" > \ /etc/php/7.0/mods-available/mailparse.ini 
ln -s /etc/php/7.0/mods-available/mailparse.ini /etc/php/7.0/cli/conf.d/30-mailparse.ini 
ln -s /etc/php/7.0/mods-available/mailparse.ini /etc/php/7.0/cli/conf.d/30-mailparse.ini

Source: https://stackoverflow.com/questions/35793216/installing-mailparse-php7-mbstring-error

Although I ended up adding manually (last step) maybe this can be a future reference for myself or any other developer.

Categories
Education

First Ph.D. proposal

I just wrote my very first Ph.D. proposal. It’s about making a new UI that corresponds to user personality and preferences by not just looking at his/her profile but by scraping all available data from him/her all over the web. I think the final result can be super exciting and useful.
Imagine a UI that understand you are at work and hide some games and application from your phone. Or on a website that assumes you are on you’re studying and not disrupt your focusing time (for example, Twitter not suggesting meme on that particular time). Or a website that from the moment you entered, for example, your email, understand that you prefer a cozy dark theme over a comfortable, light theme.
Moreover, think about Netflix or PlayStation Store where if they could understand that I am on my off day and they can offer their new release or suggest to continue watching or playing.
All of the above can be obtained with lots of available public data. Still, a system to aggregate all data with privacy in mind and let each user remove/add preference can be a considerable improvement to user experience.

Categories
DevOps

Certbot + Cloudflare

1. Install Certbot

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

more: https://certbot.eff.org/lets-encrypt/ubuntubionic-nginx

2. Make cloudflare.ini

Get your API key from: https://dash.cloudflare.com/profile

# In ~/cloudflare.ini
# Cloudflare API credentials used by Certbot
dns_cloudflare_email = [email protected]
dns_cloudflare_api_key = 0123456789abcdef0123456789abcdef01234567

Secure cloudflare.ini file:

chmod 600 cloudflare.ini

more: https://certbot-dns-cloudflare.readthedocs.io/en/stable/#credentials

3. Install Cloudflare plugin

sudo apt-get install certbot python3-certbot-dns-cloudflare

code: https://github.com/certbot/certbot/tree/master/certbot-dns-cloudflare
more:
https://certbot.eff.org/docs/using.html#plugins

4. Activate SSL

Change amirmasoud.me and www.amirmasoud.me to your domains:

certbot certonly \
  --dns-cloudflare \
  --dns-cloudflare-credentials ~/cloudflare.ini \
  -d amirmasoud.me \
  -d www.amirmasoud.me

more: https://certbot-dns-cloudflare.readthedocs.io/en/stable/#examples