Skip to content

Instantly share code, notes, and snippets.

View MathijsK93's full-sized avatar

Mathijs MathijsK93

  • 01:14 (UTC +02:00)
View GitHub Profile
@MathijsK93
MathijsK93 / typhoeus.rb
Created November 30, 2023 11:56
Typhoeus adapter
require "faraday"
require "typhoeus"
module Faraday # :nodoc:
class Adapter # :nodoc:
# Adapter to use Faraday with Typhoeus.
#
# @example Use Typhoeus.
# require 'faraday'
# require 'typhoeus'
@MathijsK93
MathijsK93 / install-wkhtmltopdf.sh
Last active April 3, 2018 12:51 — forked from yajra/install-wkhtmltopdf.sh
Install wkhtmltopdf 0.12.4 (with patched qt)
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.3/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
tar xvf wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
mv wkhtmltox/bin/wkhtmlto* /usr/bin/
ln -nfs /usr/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
@MathijsK93
MathijsK93 / update.sh
Created February 20, 2018 15:34 — forked from odlp/update.sh
Rbenv update Rubygems
#!/usr/bin/env sh
# Multiple vulnerabilities have been disclosed in RubyGems:
# https://www.ruby-lang.org/en/news/2018/02/17/multiple-vulnerabilities-in-rubygems/
#
# If you're an Rbenv user, here's any easy one-liner to upgrade to a
# safe version of Rubygems (2.7.6 or later) for each installed Ruby version:
for i in $( rbenv versions --bare ); do RBENV_VERSION=$i gem update --system && echo "\n$(ruby -v) using rubygems $(gem --version)\n"; done
@MathijsK93
MathijsK93 / RunAProxyOnAmazonEC2VPC.md
Created November 24, 2017 11:01 — forked from webinista/RunAProxyOnAmazonEC2VPC.md
Create a proxy server on an Amazon EC2 (VPC) instance

This will create a proxy server in whatever your availability zone your VPC is in. For me, that's us-east-1b. For you, that may be something different. Steps 10+ should more or less work regardless of your provider since those steps cover the setup and configuration of TinyProxy.

  1. Click the Launch Instance button.
  2. Choose Ubuntu Server 14.04 LTS (HVM), SSD Volume Type. This isn't strictly necessary. If you choose another OS, check its documentation for how to install new packages.
  3. On the Choose an Instance Type screen, select t2.micro. It's Free Tier eligible.
  4. Click the Next: ... buttons until you reach the Configure Security Group screen.
    • You may wish to reduce the amount of storage on the Add Storage screen. This is optional.
    • You may wish to add a tag on the Tag Instance screen. This is also optional.
  5. On the Configure Security Group screen:
  • Select Create a new security group.
@MathijsK93
MathijsK93 / nginx.conf
Created January 26, 2017 13:04 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
### Keybase proof
I hereby claim:
* I am mathijsk93 on github.
* I am mathijskingma (https://keybase.io/mathijskingma) on keybase.
* I have a public key whose fingerprint is 5DF5 C9E3 69D4 2680 BA93 BEC1 F691 B45D 02FF B139
To claim this, I am signing this object:
@MathijsK93
MathijsK93 / gist:a97210753afa4302ceb26f8f30ac7b8d
Created July 19, 2016 16:59 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@MathijsK93
MathijsK93 / migrate_s3.rake
Created February 29, 2016 14:58
rake task to migrate paperclip attachments to Amazon S3
namespace :attachments do
task :migrate_to_s3 => :environment do
require 'aws/s3'
# Load credentials
s3_options = YAML.load_file(File.join(Rails.root, 'config/s3.yml')).symbolize_keys
bucket = s3_options[:bucket_name]
# Establish S3 connection
@MathijsK93
MathijsK93 / Renew.sh
Created December 22, 2015 07:52
Automated Letsencrypt renewal on Cloud66
sudo service nginx stop && /home/{username}/letsencrypt/letsencrypt-auto --renew certonly --standalone -d domain.com -d www.domain.com && sudo service nginx start