Skip to content

Instantly share code, notes, and snippets.

View gnanet's full-sized avatar

Gergely Nagy gnanet

  • Self-Employed Freelancer
  • Hungary
  • X @gnanet
View GitHub Profile
#!/bin/bash
#
# Author: Andrea Lazzarotto
# http://andrealazzarotto.com
# andrea.lazzarotto@gmail.com
# Slideshare Downloader
# This script takes a slideshare presentation URL as an argument and
# carves all the slides in flash format, then they are converted to
# and finally merged as a PDF
@gnanet
gnanet / export.php
Created January 18, 2016 20:43 — forked from stefanbc/export.php
Export CSV from osCommerce and import it in Prestashop.Instructions:* Place the script in your osC root folder* Call the script in your browser* Save the file* Import it in Prestashop* Map the fields* Import!* You're awesome! Note: Tested with osC 2.2 rc 2a and Ps 1.5.4.1
<?php
require('includes/application_top.php');
// Output headers so that the file is downloaded rather than displayed
header('Content-Type: text/csv; charset=utf-8');
header('Content-Disposition: attachment; filename=data.csv');
// Create a file pointer connected to the output stream
$output = fopen('php://output', 'w');
@gnanet
gnanet / Contract Killer 3.md
Created March 28, 2016 00:12
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@gnanet
gnanet / Hosting contract killer
Created March 28, 2016 00:13 — forked from Abuwabu/Hosting contract killer
This is an additional paragraph for the excellent Contract Killer https://gist.github.com/malarkey/4031110
Hosting
We provide hosting for our own built websites on our preferred hosting provider <hosting provider name>.
Based on their SLA we endeavor to have 99.9% uptime on our servers measured annually.
There may of course be times when the server will not be available, this can be scheduled or unscheduled.
Scheduled downtime is when we know it is going to happen and tell you about it in advance. Scheduled downtime will wherever possible, almost certainly be outside of normal office hours. We’ll do our stuff in the evening or at weekend to minimize impact on your business.
There may be very rare occasions when we need to restart the server during normal office hours and it is not possible to inform you before hand. We don’t make these decisions lightly and if this does happen we apologise.
@gnanet
gnanet / xenserver_create_jessie_template_64bit.sh
Last active April 10, 2016 17:15 — forked from jniltinho/xenserver_create_jessie_template_64bit.sh
Script to install a Debian Jessie 8 template on Xenserver 6.5
#!/bin/bash
## Script to install a Debian Jessie 8 template on Xenserver 6.5
## https://gist.github.com/jniltinho/0455fb5f01cfd8bbdbff
# Check if we are running on XenServer 6.5
CHECK65=`cat /etc/redhat-release | grep "XenServer release 6.5"`
if [ "x${CHECK65}" == "x" ]; then echo "This script is intended to be run on XenServer 6.5"; exit 1; fi
# The redirector aims to solve the problem of choosing a Debian mirror.
# Read more at http://httpredir.debian.org/
@gnanet
gnanet / letsencrypt-hostname.sh
Created April 26, 2016 21:59 — 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
@gnanet
gnanet / custom-menu-items.php
Created July 8, 2016 23:58 — forked from daggerhart/custom-menu-items.php
WordPress class for easily adding custom menu items dynamically to a menu.
<?php
class custom_menu_items {
// only register with wp hooks once
protected $has_registered = false;
// internal list of menus affected
public $menus = array();
// internal list of new menu items
@gnanet
gnanet / save-last-bootstrap-tabs.js
Created August 24, 2016 21:20 — forked from vlepeule/save-last-bootstrap-tabs.js
Save last bootstrap tabs in localStorage
(function () {
// Simply add a data-save-tabs to your tablist e.g. <ul role="tablist" data-save-tabs="your-custom-slug">
$('[data-save-tabs] a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
var savedTabs = JSON.parse(localStorage.getItem('savedTabs'));
if (typeof savedTabs !== 'object' || !savedTabs){
savedTabs = {};
}
savedTabs[$(this).closest('[data-save-tabs]').data('save-tabs')] = $(this).attr('href');
localStorage.setItem('savedTabs', JSON.stringify(savedTabs));
@gnanet
gnanet / README.md
Last active November 7, 2016 22:55 — forked from Nks/create_host_php.sh
Automatically creating new virtual hosts for nginx with support of the php-fpm

How to use

  • Put create_host_php.sh everywhere where you want
  • Put nginx.vhost.conf.template to /etc/nginx/sites-available/
  • Put pool.conf.template to /etc/php-fpm.d/
  • Edit create_host_php.sh variables
@gnanet
gnanet / check_ssl_tls.sh
Last active December 17, 2016 07:15 — forked from albancrommer/gist:9255086
Single run test for TLS and SSL of all kind of services, with extra advices for letsencrypt
#!/bin/sh
# Released under CC0 licence cf. http://creativecommons.org/publicdomain/zero/1.0/
# In case of
# depth=1 C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3
# verify error:num=20:unable to get local issuer certificate
# download https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.pem to /etc/ssl/certs
# In case of Proftpd and 21 (unable to verify the first certificate) with letsencrypt the TLSCACertificateFile and TLSRSACertificateFile have to specified separately like in the article below
# https://medium.com/@dchesterton/using-let-s-encrypt-with-proftpd-on-ubuntu-53611157a344
# For the HTTP SNI test this article was used