Posts

Integrating Firefox and Selenium Webdriver

I am posting this on my blog to remind me what to do if I have to integrate firefox, and selenium webdriver.

firstly, install selenium using pip.

and then, download the geckodriver that should be compatible / working with selenium webdriver.

In your code, if your python/django app is in virtualbox (headless mode),

it should be something like this:

-------------------------------------------------------------------------
#!/srv/onlinesystem/env/bin/python

from selenium import webdriver
from selenium.webdriver import FirefoxOptions

opts = FirefoxOptions()
opts.add_argument("--headless")
browser = webdriver.Firefox(firefox_options=opts)
browser.get('http://google.com')


Screen Recording with Cam Studio (Open Source)

I tried to use cam studio for the first time to do a screen recording with my colleague while he was showing me something.

After our conversation, I quickly checked if the recording was successful.

The video was there. OK.

When I played it, it was not playing.

And then it said, the file was corrupted.

I googled for an explanation and realized that it's better to record a specific region and not the whole screen because the video would become very large. My screen recording video was 4GB. Look here for more details.

Learning TensorFlow

Just recently, I am so inspired to learn Tensorflow and DeepSpeech by Mozilla to work on a personal project.

I learned that to install and use DeepSpeech, it is best to use Mozilla's version of Tensorflow and compile it from source. Link to github is here. Link to DeepSpeech is here.

I would suggest to install them by compiling from source, rather than installing it using pip.
I encountered error messages like,

>>> tf.Session()
2018-01-05 17:19:01.747275: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX
<tensorflow.python.client.session.Session object at 0x7f02a0b3ae48> I was following a youtube video of a tutorial about Tensorflow and this error message showed up.

Another error message also showed up when I installed DeepSpeech:

 (env) $ deepspeech
2018-01-05 17:58:21.092975: F tensorflow/core/platform/cpu_feature_guard.cc:35] The TensorFlow library was compile…

Popper is not defined

I was studying how to integrate webpack to my personal project which is a Django App. I was able to install bootstrap, and then JQuery, but it also requires Popper. I encountered an error from npm saying,
unmet Dependency Popper^@1.12.9  I googled for a solution but I wasn't able to find one. Until I read this answer from StackOverflow, saying that you need to specify
npm install Popper.js --save  It seems that Popper and Popper.js are not the same.

Working on a python / django project

I am blogging about what I learned while working in a python/django project.

Using `pdb` is best to debug in real-time your python/django project.
To run pdb on a python file,

python -m pdb <python file> To run pdb on django project,
python -m pdb manage.py runserver this will initialize pdb on your django project.
Place this one line of python code to put pdb to work in that line of your code:
pdb.set_trace() when you start interacting with your django project, either GET/POST requests,
pdb will start to work when the execution reaches the part of your code where you put
the pdb.set_trace(). you can execute one line of python code to check for values of the variables.

If you want to execute multiple lines of python code while in pdb mode, type this code:
import code and
code.interact()
This will make you go to interactive python debugger.
and then when you think you are done and you want to go back to pdb mode,
press

Ctrl + D and you will be back to pdb mode.

Setting up a Wordpress Site NGINX and MySQL

I am writing this blog post to remind myself how I was able to set up a wordpress site running on VirtualBox, Ubuntu 16.04, NGINX and MySQL as its database server.

Firstly, I forgot my root's password to access MySQL, so I googled for a way to reset the password.
I realized that there is a difference in resetting the password depending on the version of the mysql server.  URL: http://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html

When I was able to recover access in MySQL, I proceeded on to setup PHP 7 FPM to run with NGINX.  I already installed PHP 7 before, so I only need to setup PHP7-FPM. To set up a socket connection with NGINX, you must have a pool for every site.
Important to modify in a pool config are:
user, group, listen. the listen config must be the same socket file in absolute path in the NGINX config.
user and group (I don't know why) is a linux user and group.


Masteral Degree in Information Technology at AMAOEd

Hi everyone! I am back. No, I just had no ideas in mind what to blog about. I am thinking about setting up new blog for movie reviews, so watch out for it.

I currently applied for the Masteral Degree in Information Technology at AMAOEd, and I got accepted. I am excited to finish this program and I hope to learn so many things from this program. I need to manage my time very well now, because I also work full-time as a web developer.

Did you also take a masteral degree? Can you share your experience? Please post your experience as comment below. I want to know more about how you manage to finish the program.