Skip to content

Instantly share code, notes, and snippets.

Dominique Lederer return1

Block or report user

Report or block return1

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@return1
return1 / letsencrypt-nginx.txt
Last active Aug 9, 2016
Letsencrypt Certbot New Certificate for Nginx
View letsencrypt-nginx.txt
# 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;
@return1
return1 / gist:e957dbbe01218bcad677
Created Oct 20, 2015 — forked from douglasjarquin/gist:2208690
Amazon RDS Performance Tuning Settings
View gist:e957dbbe01218bcad677
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" \
@return1
return1 / trim_enabler.sh
Last active Oct 16, 2015
TRIM Enabler for OS X Yosemite 10.10.4+
View trim_enabler.sh
sudo trimforce enable
@return1
return1 / gist:5916637
Created Jul 3, 2013
return a 1px transparent gif with flask
View gist:5916637
@app.route("/gif")
def gif():
gif = 'R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=='
gif_str = base64.b64decode(gif)
return send_file(io.BytesIO(gif_str), mimetype='image/gif')
@return1
return1 / bitcoin-cpuminer.sh
Last active Sep 5, 2019
install a bitcoin cpuminer on ubuntu/debian
View bitcoin-cpuminer.sh
# install dependencies
sudo apt-get install libcurl4-openssl-dev libncurses5-dev pkg-config automake yasm
# clone cpuminer
git clone https://github.com/pooler/cpuminer.git
# compile
cd cpuminer
./autogen.sh
./configure CFLAGS="-O3"
@return1
return1 / Vagrantfile
Created Apr 4, 2013
"Vagrant 1.1.5 breaks shared folder" example, reported here: https://github.com/mitchellh/vagrant/issues/1538
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.network :forwarded_port, guest: 80, host: 8080, auto_correct: true
config.vm.network :private_network, ip: "10.79.34.6"
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "1024"]
end
@return1
return1 / gist:5059418
Created Feb 28, 2013
S3/Cloudfront CORS (Cross-Origin Resource Sharing) Configuration for Webfonts in Firefox. make sure to redistribute Cloudfront after applying this config to the S3 bucket. Also you should restrict the origin to you domain, just to be safe.
View gist:5059418
<?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>
@return1
return1 / trim_enabler.txt
Last active Jul 5, 2019
TRIM Enabler for OS X Yosemite 10.10.3
View trim_enabler.txt
#
# UPDATE for 10.10.4+: please consider this patch obsolete, as apple provides a tool called "trimforce" to enable trim support for 3rd party SSDs
# just run "sudo trimforce enable" to activate the trim support from now on!
#
# Original version by Grant Parnell is offline (http://digitaldj.net/2011/07/21/trim-enabler-for-lion/)
# Update July 2014: no longer offline, see https://digitaldj.net/blog/2011/11/17/trim-enabler-for-os-x-lion-mountain-lion-mavericks/
#
# Looks for "Apple" string in HD kext, changes it to a wildcard match for anything
#
# Alternative to http://www.groths.org/trim-enabler-3-0-released/
@return1
return1 / Controller.php
Created Nov 7, 2012
Integration of Doctrine2 and Zend Framework
View Controller.php
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);
@return1
return1 / jquery-ad-iframe-resize.js
Created Nov 7, 2012
resize ad iframes by its content (ugly)
View jquery-ad-iframe-resize.js
//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);
You can’t perform that action at this time.