Skip to content

Instantly share code, notes, and snippets.

@cnlpete
cnlpete / nmeatogpx.sh
Created September 6, 2010 11:06
generate gpx-files from nmea-files
#!/bin/bash
if [ $# -lt 1 ]
then
echo "Nicht genügend Argumente!"
echo "Benutzung: $0 file [file2 [...]]"
exit 1
else
while [ $# -gt 0 ]
@cnlpete
cnlpete / packages.sh
Created September 6, 2010 14:11
simple bash script to create local repo info
#!/bin/sh
FOLDER=/opt/debs
LOGS=$FOLDER/logs
if [ ! -d $FOLDER ]; then
mkdir $FOLDER
if [ ! -d $FOLDER ]; then
sudo mkdir $FOLDER
sudo chown $USER:$USER $FOLDER
@cnlpete
cnlpete / git repo-backup.sh
Created May 16, 2011 15:18
really basic script to backup a ouple of git-repos , for instance to put in cron or rsnapshot or similar
#!/bin/bash
##host
githost="git@mitharas.de"
#----------
# get list of repos using git gl-info from https://cnlpete@github.com/cnlpete/gitolite-tools.git
#install git ls-info
curdir=`pwd`
cd /tmp
#git clone https://cnlpete@github.com/cnlpete/gitolite-tools.git gitolite-tools
@cnlpete
cnlpete / crontab
Created May 27, 2011 12:25
/etc/init.d/minecraft script to handle minecraft auto-start and backups...
5 */6 * * * /etc/init.d/minecraft backup #backup four times a day, meaning every 6 hours
15 */2 * * * /etc/init.d/minecraft map #generate map every two hours
10 1 * * * /etc/init.d/minecraft clean #clean old files daily
@MarkTraceur
MarkTraceur / crontab
Created May 30, 2011 00:00 — forked from cnlpete/crontab
minetest init script
# backup every hour, meaning 00:05, 01:05, 02:05, 03:05, 04:05, ... 23:05
5 * * * * /etc/init.d/minetest backup
# clean old files (once a day, at 01:10
10 1 * * * /etc/init.d/minetest clean
@imathis
imathis / gist_tag.rb
Created June 15, 2011 17:58 — forked from chrisjacob/gist_tag.rb
A Liquid tag for Jekyll sites that allows embedding Gists and showing code for non-JavaScript enabled browsers and readers.
require 'cgi'
require 'digest/md5'
require 'net/https'
require 'uri'
module Jekyll
class GistTag < Liquid::Tag
def initialize(tag_name, text, token)
super
@text = text
@admiral0
admiral0 / naviperl.pl
Created January 18, 2012 22:22
Perl downloader for Nokia N9 firmware.
#!/usr/bin/perl
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Cookies;
use SOAP::Lite;
print "-----------------------------------\n";
print "- Nokia N9 Firmware Downloader -\n";
print "-----------------------------------\n";
print "Downloading product list...\n";
@yeban
yeban / jekyll.tag-cloud.rb
Created April 3, 2012 07:36
Flexible, logarithmic distribution, tag cloud for Jekyll.
# Copyright (C) 2011 Anurag Priyam - MIT License
module Jekyll
# Jekyll plugin to generate tag clouds.
#
# The plugin defines a `tag_cloud` tag that is rendered by Liquid into a tag
# cloud:
#
# <div class='cloud'>
@aperson
aperson / overviewer_filters.py
Created May 9, 2012 11:57
A set of marker filters for the Minecraft Overviewer
def screenshotFilter(poi):
'''This looks for signs that have their first line in the 'Image:<id>' format, where <id> is an
id from an Imgur.com image.'''
if poi['id'] == 'Sign':
if poi['Text1'].startswith('Image:'):
poi['icon'] = "painting_icon.png"
image_html = "<style>.infoWindow img[src='{icon}'] {{display: none}}</style><a href='http://imgur.com/{id}'><img src='http://imgur.com/{id}s.jpg' /></a>".format(icon=poi['icon'], id=poi['Text1'][6:])
return "\n".join([image_html, poi['Text2'], poi['Text3'], poi['Text4']])
def playerFilter(poi):
#include "ProcessInfo.h"
#ifdef _WIN32
#include "psapi.h"
#pragma comment(lib, "psapi.lib")
#include "tlhelp32.h"
#endif
#ifdef linux
#include <sys/sysinfo.h>