Skip to content

Instantly share code, notes, and snippets.

View MarkGavalda's full-sized avatar

Mark Gavalda MarkGavalda

View GitHub Profile
@MarkGavalda
MarkGavalda / ubuntu-swap.sh
Last active June 9, 2016 19:28
Create a swap file on Ubuntu of 1GB with 15% swappiness
#!/bin/bash
# Creating a 1G swap file
sudo dd if=/dev/zero of=/swapfile bs=1M count=1024
# Changing the file permission
sudo chmod 600 /swapfile
sudo chown root:root /swapfile
@MarkGavalda
MarkGavalda / logstash-forwarder.init
Created February 26, 2015 16:48
logstash-forwarder ubuntu init script
#! /bin/sh
# From The Logstash Book
# The original of this file can be found at: http://logstashbook.com/code/index.html
#
### BEGIN INIT INFO
# Provides: logstash-forwarder
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
@MarkGavalda
MarkGavalda / convert-myisam-to-innodb.php
Created April 3, 2016 14:58
PHP conversion script from MyISAM to InnoDB for a WordPress site
<?php
require_once( 'wp-config.php' );
$db = array();
$db['host'] = DB_HOST;
$db['user'] = DB_USER;
$db['password'] = DB_PASSWORD;
$db['database'] = DB_NAME;