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
| #!/usr/bin/perl | |
| # Copyright Erik Jacobson - erik@underhanded.org | |
| use warnings; use strict; | |
| use Statistics::Descriptive; | |
| my $webuser = 'www-data'; # The user your apache children run as. I ignore the root process. | |
| my $command = 'apache2'; # The name of your processes as they appear to the "top" command. | |
| my @top = `top -bn1`; |
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
| class IndexController extends Zend_Controller_Action { | |
| public function init() { | |
| $this->_em = Zend_Registry::get('entitymanager'); | |
| } | |
| public function indexAction() { | |
| $test = new Application_Model_Test(); | |
| $test->name = 'Test'; | |
| $this->_em->persist($test); |
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
| sudo trimforce enable |
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
| rds-modify-db-parameter-group {param-group-name} \ | |
| --parameters="name=character_set_server, value=utf8, method=pending-reboot" \ | |
| --parameters="name=collation_server, value=utf8_general_ci, method=pending-reboot" \ | |
| --parameters="name=tmp_table_size, value={DBInstanceClassMemory/16}, method=pending-reboot" \ | |
| --parameters="name=max_heap_table_size, value={DBInstanceClassMemory/16}, method=pending-reboot" \ | |
| --parameters="name=query_cache_type, value=1, method=pending-reboot" \ | |
| --parameters="name=query_cache_size, value=131072, method=pending-reboot" \ | |
| --parameters="name=table_open_cache, value=2500, method=pending-reboot" \ | |
| --parameters="name=join_buffer_size, value={DBInstanceClassMemory/64}, method=pending-reboot" \ | |
| --parameters="name=thread_cache_size, value={DBInstanceClassMemory/12582880}, method=pending-reboot" \ |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> | |
| <CORSRule> | |
| <AllowedOrigin>*</AllowedOrigin> | |
| <AllowedMethod>GET</AllowedMethod> | |
| <MaxAgeSeconds>3000</MaxAgeSeconds> | |
| <AllowedHeader>Content-*</AllowedHeader> | |
| <AllowedHeader>Host</AllowedHeader> | |
| </CORSRule> | |
| </CORSConfiguration> |
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
| # from https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-14-04 | |
| # add to nginx server config | |
| location ~ /.well-known { | |
| root /usr/share/nginx/html; | |
| allow all; | |
| } | |
| ssl_certificate_key /etc/letsencrypt/live/www.domain.com/privkey.pem; | |
| ssl_certificate /etc/letsencrypt/live/www.domain.co/fullchain.pem; |
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
| //auto-resizing ad-banners | |
| var resizeInterval = window.setInterval(function () { | |
| $iframe = $('#bigbanner iframe'); | |
| $iframe.attr('width', '100%').attr('height', '100%'); //reset | |
| $doc = $($iframe.get(0).contentWindow.document); | |
| $iframe.attr('width', $doc.width()).attr('height', $doc.height()); | |
| }, 1000); |
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
| gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf |
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
| @app.route("/gif") | |
| def gif(): | |
| gif = 'R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' | |
| gif_str = base64.b64decode(gif) | |
| return send_file(io.BytesIO(gif_str), mimetype='image/gif') |
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
| # install openssl 1.1 next to current openssl@3 | |
| brew install openssl@1.1 | |
| # install python 2.7 with openssl 1.1 | |
| LDFLAGS="-L/opt/homebrew/opt/openssl@1.1/lib" CPPFLAGS="-I/opt/homebrew/opt/openssl@1.1/include" pyenv install 2.7.18 | |
| # install package which needs openssl libs | |
| LDFLAGS="-L/opt/homebrew/opt/openssl@1.1/lib" CPPFLAGS="-I/opt/homebrew/opt/openssl@1.1/include" pip install -r requirements.txt | |
OlderNewer