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
@gnanet
gnanet / split-pem.sh
Created October 18, 2015 02:42
Split combined PEM file the smart way (tested on debian, requires openssl)
#!/bin/bash
if [ $1 ]
then
if [ -f $1 ]
then
pemfile=$1
fi
else
echo "Usage: split-pem.sh COMBINED-PEMFILE"
@gnanet
gnanet / burn-xiso.sh
Created January 17, 2016 19:51
Burn XBOX360 ISO to DVD+R 8GB disc with proper layer break point
#!/bin/bash
if ! $(which lsblk > /dev/null); then echo "lsblk missing"; exit 1; fi
if ! $(which dvd+rw-mediainfo > /dev/null); then echo "dvd+rw-mediainfo missing"; exit 1; fi
if ! $(which awk > /dev/null); then echo "awk missing"; exit 1; fi
if ! $(which bc > /dev/null); then echo "bc missing"; exit 1; fi
if ! $(which growisofs > /dev/null); then echo "growisofs missing"; exit 1; fi
if [ $1 ]
then
testdvd=`echo "$1" | grep -c ".dvd$"`
@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 / .screenrc
Created February 14, 2016 03:56
My generic screenrc
setenv CUSTOMER 'ONECUSTOMER'
termcapinfo xterm 'bc@:bs@'
startup_message off
vbell off
altscreen on
defscrollback 100000
screen -t bash 1
screen -t main 0
@gnanet
gnanet / diff-nonbinary.sh
Created March 4, 2016 19:22
diff nonbinary oneliner recursive
#!/bin/bash
#
# diff two folders located in the same parent-folder
# look for binary files in both, exclude txt|css|tpl|php if they contain binary stings (like foreign language)
oldpath=old/
newpath=new/
if [ ! -d ${oldpath} ]; then echo "${oldpath} is not a folder"; exit ; fi
if [ ! -d ${newpath} ]; then echo "${newpath} is not a folder"; exit ; fi
@gnanet
gnanet / Contract Killer 3.md
Created March 28, 2016 00:12 — forked from malarkey/Contract Killer 3.md
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 / bash_history.txt
Created April 4, 2016 22:03
How to install mc and nano as user on CentOS7 core
mkdir ~/bin
echo 'if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH"; fi' >> ~/.profile
mkdir -p ~/.local/share
mkdir ~/src
cd ~/src
wget http://mirror.met.hu/centos/7.2.1511/os/x86_64/Packages/mc-4.8.7-8.el7.x86_64.rpm
rpm2cpio mc-4.8.7-8.el7.x86_64.rpm | cpio -idmv
wget http://mirror.met.hu/centos/7.2.1511/os/x86_64/Packages/gpm-libs-1.20.7-5.el7.x86_64.rpm
rpm2cpio gpm-libs-1.20.7-5.el7.x86_64.rpm | cpio -idmv
wget http://mirror.met.hu/centos/7.2.1511/os/x86_64/Packages/nano-2.3.1-10.el7.x86_64.rpm
@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 / xen65_postinstall_script.sh
Last active May 16, 2018 20:39
First steps after installed XenServer 6.5 (HUNGARIAN)
#!/bin/bash
exit 0
# Frissítésekhez partíció innen http://wiki.hetzner.de/index.php/Citrix_XenServer#Lokale_ISO_Libary_einbinden
# vgscan
# Reading all physical volumes. This may take a while...
# Found volume group "VG_XenStorage-NNNNNNNN-NNNN-NNNN-NNNN-NNNNNNNNNNNN" using metadata type lvm2
export xenvg=`vgscan | grep VG_XenStorage | awk -F'"' {' print $2 '}`