Friday, February 28, 2020

centOS CORS on Apache


cpanel, top right corner, click setting, make sure show hidden files.


go to The folder you wish CORS, in our case, it is /data/ 

add .htaccess file

add one line at   .htaccess  file.

done
 Header set Access-Control-Allow-Origin "*"

Monday, January 6, 2020

adsense



/includes/qa-theme-base.php
1 file, 2 place need add adsense, 


header_script add adsense for home page, 
public function head_script()
    {
        if (isset($this->content['script'])) {
            foreach ($this->content['script'] as $scriptline) {
                $this->output_raw($scriptline);
            }
        }



/* header
google adsense added
*/
        $this->output('');



    }




Do not need this one, if add this one, every post will have error duplicate tag, second tag will be ignored.

this is for each post add adsense




public function q_view_main($q_view)
    {
        $this->output('
'
);

        if (isset($q_view['main_form_tags'])) {
            $this->output('
. $q_view['main_form_tags'] . '>'); // form for buttons on question
        }

        $this->view_count($q_view);
        $this->q_view_content($q_view);


/**
google adsense added
*/
        $this->output('');


        $this->q_view_extra($q_view);






https://www.question2answer.org/qa/14080/where-to-insert-custom-html-code-adsense-etc


Ok. I got it. Open includes/qa-theme-base.php and go down find see code under function q_view_main($q_view) on or around line # 1672. I wanted to put the adsense banner direcly below the question text/content and before the tags. So I inserted a new line $this->output('my adsense code
');
 right under the line that says $this->q_view_content($q_view);   . It worked great. Now I'll probably go about learning how to implement this using advanced themes by creating a custom q_view_main($q_view) function to override the default code. Any tips/example for newbies for creating function overrides would be appreciated from more experienced users. Thanks.

Monday, September 2, 2019

delete OEM system partition win 10

Windows Disk Management tool will not let you delete/merge the OEM partition. You will have to use the built-in command line tool called Diskpart.
Be careful before you decide to run the commands, lest you mess up – you should know what you are doing:
  • Open the Run prompt, type diskpart, and hit Enter.
  • Type, and enter list disk to list the disks.
  • Select the disk you want to manage – say it is Disk Z
  • Then type select disk z and hit Enter.
  • Enter list partition and hit Enter to display all the volumes.
  • Type select partition x and hit Enter. Here x stands for the partition you want to delete.
  • Finally, type delete partition override and hit Enter to delete it.
  • Now type Extend to merge the OEM partition with the adjoining value.
If you want only to merge part of the partition, then use extend [size=]  command. To extend size by 5GB, type-
Extend size=5000
Here size is the size you choose from the OEM partition.  It will extend the selected volume by size in megabytes (MB). So like you can see, delete and merge partition commands work hand to hand. You need first to delete it and then merge it existing partition.

Tuesday, August 6, 2019

siteSucker setting



https://github.com/microsoft/USBuildingFootprints

download zip file only, all default, except path constraint, setting customzied path.

file type choose zip archive not works

centos transfer file use winSCP

centos transfer file use winSCP

Friday, August 2, 2019

add user to admin group windows

https://superuser.com/questions/171917/force-a-program-to-run-without-administrator-privileges-or-uac



Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\forcerunasinvoker]
@="Run without privilege elevation"

[HKEY_CLASSES_ROOT\*\shell\forcerunasinvoker\command]
@="cmd /min /C \"set __COMPAT_LAYER=RUNASINVOKER && start \"\" \"%1\"\""
Save this text in .reg and add it to the Windows Registry. (Double-clicking on it should do the trick.)
Afterwards, right-click the app you'd like to run without administrative privileges and select "Run without privilege elevation".
In some cases - small amount 0.1% of programs may ask twice about UAC prompt.


========================================================


right click c:\apache2.4
properties ---- security,  ---- add user to full control


Monday, July 8, 2019

sqlite

mysql convert to sqlite

https://www.rebasedata.com/convert-mysql-to-sqlite-online

==================================



sql.js load sqlite file from server

https://stackoverflow.com/questions/28066570/read-sqlite-database-from-the-disk-using-sql-js








=================================


https://stackoverflow.com/questions/3890518/convert-mysql-to-sqlite

------------------

may not work, not try yet

https://gist.github.com/esperlu/943776


--------------------

convert tools

https://www2.sqlite.org/cvstrac/wiki?p=ConverterTools