This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // add this code to the onCreate method of your MainActivity.java File | |
| String url ="URL" ; // Replace URL with your website address like this "http://google.com" | |
| WebView view = (WebView) this.findViewById(R.id.webView); | |
| view.getSettings().setJavaScriptEnabled(true); | |
| view.loadUrl(url); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| * Redirect Attachment Pages | |
| */ | |
| add_action( 'template_redirect', 'wpse27119_template_redirect' ); | |
| function wpse27119_template_redirect() | |
| { | |
| // Get out of here if not headed to an attachment page | |
| if( ! is_attachment() ) return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| user web; | |
| # One worker process per CPU core. | |
| worker_processes 8; | |
| # Also set | |
| # /etc/security/limits.conf | |
| # web soft nofile 65535 | |
| # web hard nofile 65535 | |
| # /etc/default/nginx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 80 default_server; | |
| server_name _; | |
| deny all; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Author: Kaspars Dambis <[email protected]> | |
| // Usage: php ms-cron-runner.php --domain=example.com [--path=/path/to/wordpress] | |
| // We can't run this reliably from CLI because of how WordPress | |
| // relies on $_SERVER for loading functions.php | |
| if ( php_sapi_name() !== 'cli' ) | |
| die; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Schedule the CRON Job to purge all expired transients | |
| if (!wp_next_scheduled('purge_popup_transients_cron')) { | |
| /** | |
| * wp_schedule_event | |
| * | |
| * @param - When to start the CRON job |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Secure adminer setup | |
| # Author Taras Kozlov | |
| # download adminer to separate directory | |
| mkdir -p /var/www/admin | |
| cd /var/www/admin | |
| wget http://www.adminer.org/latest.php -O adminer.php | |
| echo '<?php phpinfo(); >' > info.php | |
| sudo -i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Unit] | |
| Description=Redis Datastore Server | |
| After=network.target | |
| [Service] | |
| Type=forking | |
| PIDFile=/var/run/redis/redis.pid | |
| ExecStartPre=/bin/mkdir -p /var/run/redis | |
| ExecStartPre=/bin/chown redis:redis /var/run/redis |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| checkIfMySQLTableExists() { | |
| table=$1; | |
| if [ $(mysql -N -s -u root -p -e \ | |
| "select count(*) from information_schema.tables where \ | |
| table_schema='${table}' and table_name='${DB}';") -eq 1 ]; then | |
| echo "Table ${table} exists! ..."; | |
| else | |
| echo "Table ${table} does not exist! ..." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### KERNEL TUNING ### | |
| # Increase size of file handles and inode cache | |
| fs.file-max = 2097152 | |
| # Do less swapping | |
| vm.swappiness = 10 | |
| vm.dirty_ratio = 60 | |
| vm.dirty_background_ratio = 2 |