Skip to content

Instantly share code, notes, and snippets.

@xserveraws
xserveraws / letsencrypt-hostname.sh
Created March 26, 2018 14:08 — forked from xgin/letsencrypt-hostname.sh
Secure plesk clean installation with hostname certificate by Let's Encrypt
#!/bin/bash -e
### Copyright 1999-2015. Parallels IP Holdings GmbH. All Rights Reserved.
### Secure plesk clean installation with hostname certificate by Let's Encrypt
export PYTHONWARNINGS="ignore:Non-standard path"
LE_HOME=${LE_HOME:-"/usr/local/psa/var/modules/letsencrypt"}
HOSTNAME=$(hostname)
# Use staging server for testing
# --server https://acme-staging.api.letsencrypt.org/directory
@xserveraws
xserveraws / nginx.conf
Created May 28, 2018 05:26
WordPress+Plesk+Nginx Config
# Source: https://www.websavers.org/how-to-speed-up-wordpress/
rewrite !\.(js|ico|gif|jpg|png|css|pdf|mov|mp3|eot|svg|ttf|woff|otf|txt|swf)$ /index.php break;
rewrite /wp-admin/$ /wp-admin/index.php break;
rewrite /$ /index.php break;
# enable gzip compression
gzip on;
gzip_min_length 1100;
gzip_buffers 4 32k;
gzip_types text/plain application/x-javascript text/xml text/css;
@xserveraws
xserveraws / gist:2622e92ddc2a5cdeb0ab852e8d82d3f9
Created July 12, 2018 17:09
Windows 7 All Online/Offline [Retail-MAK] Activation Keys
Windows 7 All Online/Offline [Retail-MAK] Activation Keys
=================================================================================
. Run "Command Prompt" as Administrator
. slmgr.vbs -ipk Product Key
. slui4
=================================================================================
Windows 7 Ultimate Retail Phone Activation Keys
RHTBY-VWY6D-QJRJ9-JGQ3X-Q2289
V77DJ-CT8WB-Y3GXT-X3FBP-6F987
JC7BV-94FD2-D86PH-XRMHR-BXKDG
@xserveraws
xserveraws / security.conf
Created July 26, 2018 07:41 — forked from ambroisemaupate/security.conf
Nginx CSP example
# config to don't allow the browser to render the page inside an frame or iframe
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri
# https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options
add_header X-Frame-Options SAMEORIGIN;
# when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,
# to disable content-type sniffing on some browsers.
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers
# currently suppoorted in IE > 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx
add_header Content-Security-Policy "default-src 'self' data: https: https://*.anticapitalist.party https://*.github.com; form-action 'self'; child-src 'self'; script-src 'self' 'unsafe-eval' https://maxcdn.bootstrapcdn.com https://code.jquery.com; connect-src 'self' https: wss:; img-src 'self' data:; style-src 'self' 'unsafe-inline' https://fonts.gstatic.com https://fonts.googleapis.com https://code.jquery.com https://maxcdn.bootstrapcdn.com; font-src 'self' https://maxcdn.bootstrapcdn.com https://fonts.gstatic.com https://fonts.googleapis.com; object-src 'none';"
@xserveraws
xserveraws / dell-os-recovery-linux-mini-howto.md
Created December 16, 2018 09:24 — forked from roman-yepishev/dell-os-recovery-linux-mini-howto.md
Dell OS Recovery Tool under Linux Mini-HOWTO

Dell OS Recovery Tool Under Linux Mini-HOWTO

Since I was unable to find a specific answer to how can one create a Dell recovery disk from within Linux, I decided to write the steps here.

If you write the CD image directly to the USB drive (or create a new partition and write it there), the laptop will not boot. You need your USB media to be in FAT32 format with the contents of the recovery ISO.

  1. Download the recovery ISO from the support section of Dell website.
  2. Insert a USB Drive with enough capacity to hold the contents of the ISO image.
  3. Format the drive and create a filesystem where $USB_DEVICE is your USB drive (check with fdisk -l, it may be
@xserveraws
xserveraws / Documentation.md
Created January 18, 2019 09:09 — forked from KartikTalwar/Documentation.md
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@xserveraws
xserveraws / ready-for.sh
Created September 5, 2019 17:08 — forked from dturnergs/ready-for.sh
check if machine is ready for a lab
#!/bin/bash
#
# Setup development system for Linux Foundation courses
#
# Copyright (c) 2013 Chris Simmonds <chris@2net.co.uk>
# 2013-2018 Behan Webster <behanw@converseincode.com>
# 2014-2016 Jan-Simon Möller <dl9pf@gmx.de>
#
# Licensed under GPL
#
@xserveraws
xserveraws / ready-for.sh
Created September 5, 2019 17:08 — forked from dturnergs/ready-for.sh
check if machine is ready for a lab
#!/bin/bash
#
# Setup development system for Linux Foundation courses
#
# Copyright (c) 2013 Chris Simmonds <chris@2net.co.uk>
# 2013-2018 Behan Webster <behanw@converseincode.com>
# 2014-2016 Jan-Simon Möller <dl9pf@gmx.de>
#
# Licensed under GPL
#
@xserveraws
xserveraws / ready-for.sh
Created September 5, 2019 17:08 — forked from dturnergs/ready-for.sh
check if machine is ready for a lab
#!/bin/bash
#
# Setup development system for Linux Foundation courses
#
# Copyright (c) 2013 Chris Simmonds <chris@2net.co.uk>
# 2013-2018 Behan Webster <behanw@converseincode.com>
# 2014-2016 Jan-Simon Möller <dl9pf@gmx.de>
#
# Licensed under GPL
#