We'll install MSOffice using the PlayOnLinux wizard. Additionally, MSOffice requires samba and winbind to properly work.
So, if not installed, install them:
sudo apt-get install playonlinux samba winbind
| //ham xoa tat tan tat | |
| function delete_files($target) { | |
| if(is_dir($target)){ | |
| $files = glob( $target . '*', GLOB_MARK ); //GLOB_MARK adds a slash to directories returned | |
| foreach( $files as $file ) | |
| { | |
| delete_files( $file ); | |
| } | |
| //get URL cua file hien tai; | |
| $baseUrl = $_SERVER['PHP_SELF']; | |
| //kiem tra thong tin request den | |
| if (isset($_POST['getMember']) && $_POST['getMember'] == 'view') | |
| { | |
| //wating 1s truoc khi thuc thi | |
| sleep(1); | |
| //tao mang member |
| $(document).ready(function(){ | |
| // Gắn sự kiện onclick vào #viewbtn | |
| $('#viewbtn').click(function() { | |
| $('#loading').html('Loading...'); | |
| var strURL = $('#base_url').val(); | |
| $.ajax({ | |
| url: strURL, | |
| type: 'POST', | |
| cache: false, | |
| data: 'getMember=view', |
| # export mysql database into shapefile | |
| ogr2ogr out_shapes MYSQL:gis,user=root,password=password | |
| # import shapefile into mysql | |
| ogr2ogr -f MySQL MySQL:database_name,user=root,password=password my_shapefile.shp -nln table_name -a_srs EPSG:4326 -update -overwrite -lco engine=MYISAM | |
| # reproject spatial reference from WGS 84 UTM 48S to Geographic Lattitide/Longitude Coordinate System | |
| ogr2ogr -f "ESRI Shapefile" target_file.shp source_file.shp -s_srs EPSG:32748 -t_srs EPSG:4326 |
| import numpy as np | |
| from osgeo import gdal, gdal_array, osr | |
| def npmatrix_to_geotiff (filepath, matrices, gdal_type, transform = None, projection = None, nodata = None): | |
| (y_res, x_res) = matrices[0].shape | |
| driver = gdal.GetDriverByName('GTiff') | |
| image = driver.Create(filepath, x_res, y_res, len(matrices), gdal_type) | |
| if transform is not None: | |
| image.SetGeoTransform(transform) | |
| if projection is not None: |
| <iframe width="1263" height="695" src="https://www.youtube.com/embed/-SFcIUEvNOQ?rel=0&autoplay=1" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> |
| SELECT hientrang_cong.name, | |
| replace(replace(replace((''::text || box2d(st_transform(hientrang_cong.geom, 4326))), 'BOX('::text, ''::text), ')'::text, ''::text), ' '::text, ','::text) AS bbox | |
| FROM hientrang_cong | |
| UNION ALL | |
| SELECT hientrang_dap.name, | |
| replace(replace(replace((''::text || box2d(st_transform(hientrang_dap.geom, 4326))), 'BOX('::text, ''::text), ')'::text, ''::text), ' '::text, ','::text) AS bbox | |
| FROM hientrang_dap | |
| UNION ALL | |
| SELECT hientrang_debao.name, | |
| replace(replace(replace((''::text || box2d(st_transform(hientrang_debao.geom, 4326))), 'BOX('::text, ''::text), ')'::text, ''::text), ' '::text, ','::text) AS bbox |
| /* KILL ALL EXISTING CONNECTION FROM ORIGINAL DB (sourcedb)*/ | |
| SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity | |
| WHERE pg_stat_activity.datname = 'SOURCE_DB' AND pid <> pg_backend_pid(); | |
| /* CLONE DATABASE TO NEW ONE(TARGET_DB) */ | |
| CREATE DATABASE TARGET_DB WITH TEMPLATE SOURCE_DB OWNER USER_DB; | |
| --https://stackoverflow.com/questions/876522/creating-a-copy-of-a-database-in-postgresql |
| -- Get Max ID from table | |
| SELECT MAX(id) FROM table; | |
| -- Get Next ID from table | |
| SELECT nextval('table_id_seq'); | |
| -- Set Next ID Value to MAX ID | |
| SELECT setval('table_id_seq', (SELECT MAX(id) FROM table)); |