Skip to content

Instantly share code, notes, and snippets.

View lukespragg's full-sized avatar

Luke Spragg lukespragg

View GitHub Profile
@esperlu
esperlu / mysql2sqlite.sh
Created April 27, 2011 05:46
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@MasterEx
MasterEx / output.rss
Created June 26, 2011 21:21
Shell RSS writer
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>yo</title>
<link>http://www.google.com</link>
<description>hello wold</description>
<language>en-us</language>
<generator>just a shell script rss writer</generator>
<item>
<title>AUEB FOSS COMMUNITY</title>
<?php
function ping($host, $port=25565, $timeout=30) {
//Set up our socket
$fp = fsockopen($host, $port, $errno, $errstr, $timeout);
if (!$fp) return false;
//Send 0xFE: Server list ping
fwrite($fp, "\xFE");
@zekesonxx
zekesonxx / mcping.php
Created October 1, 2011 06:01 — forked from barneygale/gist:1235274
Edit of barneygale's PHP Minecraft Server Pinger
<?php
$host = $_GET['ip'];
$port = $_GET['port'];
function pingserver($host, $port=25565, $timeout=30) {
//Set up our socket
$fp = fsockopen($host, $port, $errno, $errstr, $timeout);
if (!$fp) return false;
//Send 0xFE: Server list ping
fwrite($fp, "\xFE");
@jpravetz
jpravetz / product_generator.rb
Created December 2, 2011 21:24
Jekyll generator to read json data file and generate product and ingredient pages
#------------------------------------------------------------------------
# encoding: utf-8
# @(#)product_generator.rb 1.00 29-Nov-2011 16:38
#
# Copyright (c) 2011 Jim Pravetz. All Rights Reserved.
# Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
#
# Description: A generator that creates product, products and
# ingredients pages for jekyll sites. Uses a JSON data
# file as the database file from which to read and
@Jaliborc
Jaliborc / Upload to Curse.py
Created January 6, 2012 18:59
This is a simple script that will upload your zipfile to CurseForge. Also works on WoWAce.
import requests
headers = {
'User-Agent': 'CurseForge Uploader Script/1.0',
'X-API-Key': YOUR_KEY
}
files = {'file': ('MyFile.zip', open('MyFile.zip', 'r'))}
data = {
'name': 'Version Banana',
@tjstyle
tjstyle / makedmg.sh
Created May 17, 2012 00:41
DMG Creation Script
#!/bin/bash
# DMG Creation Script
# Usage: makedmg <imagename> <imagetitle> <imagesize (MB)> <contentdir>
#
# imagename: The output file name of the image, ie foo.dmg
# imagetitle: The title of the DMG File as displayed in OS X
# imagesize: The size of the DMG you're creating in MB (Blame Linux for the fixed size limitation!!)
# contentdir: The directory containing the content you want the DMG file to contain
#
@md-5
md-5 / LanBukkit.java
Created August 19, 2012 01:24
Shows your Bukkit server to the LAN
package com.md_5;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetSocketAddress;
import java.util.logging.Level;
import org.bukkit.plugin.java.JavaPlugin;
public class LanBukkit extends JavaPlugin implements Runnable {
@letmaik
letmaik / .travis.yml
Last active December 15, 2021 23:10
Deploy snapshots to Sonatype after Travis CI build
language: java
env:
global:
- SONATYPE_USERNAME=yourusername
- secure: "your encrypted SONATYPE_PASSWORD=pass"
after_success:
- python addServer.py
- mvn clean deploy --settings ~/.m2/mySettings.xml
#!/bin/bash
MCP_VERSION="721"
FORGE_VERSION="latest"
MCP_URL="https://dl.dropbox.com/s/dao8itysfwuhj9q/mcp$MCP_VERSION.zip?dl=1"
FORGE_URL="http://files.minecraftforge.net/minecraftforge-src-$FORGE_VERSION.zip"
mkdir -p forge
cd forge