Posts

docker usage tips

Docker is really a smart way to hold projects with different environment settings. Below are some basic but must know cmds when using docker: docker-compose is the name of the .yml file that used as the setting file for an app implemented in docker: 1. Start an app: sudo docker-compose up Notice when using like this, there is only one app info in the docker-compose file.  And then you will have the log console window keep running, means get the real time log info. sudo docker-compose up -d Notice -d option will run the docker container as a background app, and will not have server log info be displayed. 2. Stop an app: sudo docker-compose stop If any modification of the code, then need to "stop" and "up" the app.   3. Show the running containers: sudo docker ps Can get "CONTAINER ID", "IMAGE NAMES" and other basic info for all the running containers. 4. Show the server log file: sudo docker logs CONTAINER_ID Or use the docke...

timestamp with 16, 13 and 10 digits to Qlik date

Sometimes, we need to convert the Linux timestamps to Qlik date, it can be done in the SQL script, and can also be done in the Qlik Load/expression. Linux timestamps with 16 digits are microseconds timestamps, and 13 digits are milliseconds, and 10 digits are second timestamps. To convert to a Qlik date, hour or time as following: As the timestamps starts from "19700101 00:00:00",  then this start timestamps needs be added: For 16 digits: Date(Date#('19700101', 'YYYYMMDD')+(SynchronousQuery_ Event_Time/1000000/86400) or  Date(25569+Round(SynchronousQuery_ Event_Time/1000000/86400),'YYYYMMDD') 25569 is the number format for date '19700101' For 13 digits: Date(Date#('19700101', 'YYYYMMDD')+(SynchronousQuery_ Event_Time/1000/86400) or  Date(25569+Round(SynchronousQuery_ Event_Time/1000/86400),'YYYYMMDD') For 10 digits: Date(Date#('19700101', 'YYYYMMDD')+(SynchronousQuery_ Event_T...

Downgrade firefox using .deb file

Downgrade firefox using .deb file System: Ubuntu 14.04.5 Problems: I use firefox version 47 for a screenshot solution using selenium in python. After a system update, the firefox updated to latest version 48 (2016, Aug, 02), and raises a error: WebDriverException: Message: Requested size exceeds screen size There is a discussion about talking this bug here . Solution: Before he new bug -fix version is available, I decide to first down grade it to version 47. Steps: 1.  sudo apt-get purge firefox   sudo apt-get autoremove        This first will remove firefox, and the second will move all the dependencies that is not used anymore. I got this recommended by ubuntu after run  the first cmd. List the autoremoved packages below, in case any dependency is missed from other cmd : The following packages were automatically installed and are no longer required:   acl at-spi2-core colord dconf-gsettings-backend dconf-service fontconfig ...

run batch in task Scheduler rise problem in server 2008 R2

For a long time, I sometimes got (0x1) error from task scheduler in Windows server 2008 R2. Finally solve it by separating all the cmds in the batch file and add them one by one in the "Actions" in Task Scheduler. It seems that the task scheduler can not run a batch file correctly for some reason. But have no idea why.

jqgrid "form editing" example in Python-Django

It tooks me  a lot of time to figure out jqgrid form editing add/edit/del the jqgrid table in Django/Python structure, as the similar topics I found in the internet always only discussed part of it, or half-way solution.  So after several days painful time, I finally have most part works. Now  summary it. I use array from python to display in jqgrid. Html: <table id="list"></table> <div id="pager"></div> The javascript : //This is correct way to get the array from python, even with syntax //error highlighted in javascript var sitedata = {{ siteArray }} jQuery ( "#list" ). jqGrid ({ datatype: local mtype : 'POST' , //height: 450, autowidth: true , shrinkToFit: true, colNames :[ 'Website' , 'Year' , 'Website Id' , 'Create Date' , 'Comment' ], colModel :[ { name : 'site_name',index:...