Skip to content

Instantly share code, notes, and snippets.

View oviliz's full-sized avatar
🌳

Cristian O. Balan oviliz

🌳
View GitHub Profile
@technoweenie
technoweenie / gist:1072829
Created July 8, 2011 21:12
.netrc file so you can push/pull to https git repos without entering your creds all the time
machine github.com
login technoweenie
password SECRET
machine api.github.com
login technoweenie
password SECRET
@plentz
plentz / nginx.conf
Last active November 16, 2024 14:10
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@Stanback
Stanback / nginx.conf
Last active October 1, 2024 23:28 — forked from michiel/cors-nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@azet
azet / nginx.conf
Created January 24, 2014 12:45
nginx/nessus ssl config
server {
listen 80;
server_name nessus.gmi.oeaw.ac.at;
rewrite ^ https://$server_name$request_uri? permanent;
}
server {
listen 443;
server_name nessus.gmi.oeaw.ac.at;
client_max_body_size 100m;
@jasonruyle
jasonruyle / UFW_ban_country.md
Last active October 3, 2024 20:18
UFW to block countries
@zmwangx
zmwangx / Postfix: sender-dependent SASL authentication.md
Last active November 1, 2024 15:21
Postfix: sender-dependent SASL authentication — relay to multiple SMTP hosts, or relay to the same host but authenticate as different users (e.g., two Gmail accounts)

This is a sequel to "Postfix: relay to authenticated SMTP".

I would like to send mail from two different Gmail accounts using Postfix. Here is the relevant section in the Postfix documentation: Configuring Sender-Dependent SASL authentication.

As a concrete example, here's how to set up two Gmail accounts (only relevant sections of the config files are listed below):

/etc/postfix/main.cf:
    # sender-dependent sasl authentication
    smtp_sender_dependent_authentication = yes

sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay

@tegansnyder
tegansnyder / Magento Admin Backend.md
Last active January 15, 2021 12:51
Magento Custom Admin Backend

You can set your own custom Magento admin URL in:

System -> Configuration -> [ADVANCED] -> Admin -> Admin Base URL

NOTE: Make sure you have added a ServerAlias directive to your virtual host configuration for backend.domain.com and that you have a SSL cert or wildcart setup for HTTPS traffic on that subdomain or you will lock yourself out the admin.

Rules for your .htaccess file to prevent duplicate urls and redirect directly to admin dashboard:

@jareware
jareware / s3-curl-backups.md
Last active May 11, 2024 23:39
Simple, semi-anonymous backups with S3 and curl

⇐ back to the gist-blog at jrw.fi

Simple, semi-anonymous backups with S3 and curl

Backing stuff up is a bit of a hassle, to set up and to maintain. While full-blown backup suites such as duplicity or CrashPlan will do all kinds of clever things for you (and I'd recommend either for more complex setups), sometimes you just want to put that daily database dump somewhere off-site and be done with it. This is what I've done, with an Amazon S3 bucket and curl. Hold onto your hats, there's some Bucket Policy acrobatics ahead.

There's also a tl;dr at the very end if you just want the delicious copy-pasta.

Bucket setup

@djmaze
djmaze / instructions.sh
Last active January 31, 2017 00:01
Docker w/GlusterFS volume driver on Scaleway C1 servers
# 0. For the server, use the "Docker" base image from the ImageHub (https://www.scaleway.com/de/imagehub/docker/)
# 1. Install https://github.com/calavera/docker-volume-glusterfs
# Alternatively, just download the prebuilt executable from https://gobuilder.me/get/github.com/calavera/docker-volume-glusterfs/docker-volume-glusterfs_master_linux-arm.zip
apt-get -y install golang
export GOPATH=~/go
go get github.com/calavera/docker-volume-glusterfs
mv go/bin/docker-volume-glusterfs /usr/local/bin/
# 2. Install GlusterFS