Skip to content

Instantly share code, notes, and snippets.

Avatar
🦀

Jonas Friedmann frdmn

🦀
View GitHub Profile
@frdmn
frdmn / icons.c
Created Mar 22, 2013
Custom MiniDLNA Apple icon - read more: http://blog.frd.mn
View icons.c
/* MiniDLNA media server
*
* This file is part of MiniDLNA.
*
* Penguin images are the creation of Larry Ewing (lewing@isc.tamu.edu) using The GIMP.
* NETGEAR images Copyright (c) 2008- NETGEAR, Inc. All Rights Reserved.
*
* MiniDLNA is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
@frdmn
frdmn / clients.c
Created Apr 21, 2013
MiniDLNA update interval patch
View clients.c
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "clients.h"
#include "getifaddr.h"
#include "log.h"
struct client_type_s client_types[] =
{
@frdmn
frdmn / cloudbot
Created Sep 16, 2013
SysVinit start up daemon for CloudBot --- touch /etc/init.d/cloudbot && chmod 700 /etc/init.d/cloudbot && vi /etc/init.d/cloudbot
View cloudbot
#!/bin/sh
### BEGIN INIT INFO
# Provides: cloudbot
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: SysVinit start up daemon for CloudBot
# Description: Start up daemon for CloudBot
@frdmn
frdmn / index.php
Created Nov 13, 2013
Subreddit HTML export/lister
View index.php
<ul>
<?php
# Subreddit HTML export
#
# Log into Reddit and browse to "http://www.reddit.com/reddits.json"
# Save the content with the filename "reddits.json" and place it besides
# this file in the same directory.
$json = file_get_contents("./reddits.json");
$json = json_decode($json, true);
@frdmn
frdmn / mov2gif.md
Last active Dec 28, 2015
Bash function for OS X to convert a .mov file into a .gif but in a reasonable quality.
View mov2gif.md

mov2gif converter

Bash function for OS X to convert a .mov file into a .gif but in a reasonable quality.

Demonstration

.mov example (414 KB)

Click here for a example .mov

@frdmn
frdmn / maven3-brew.sh
Created Nov 20, 2013
Install maven3 on OS X 10.9+ via homebrew formula
View maven3-brew.sh
# In case you run 10.9, there is no maven3 on board by default, and "brew install maven" will fail, so here's a workaround:
brew install https://raw.github.com/Homebrew/homebrew-versions/master/maven30.rb
@frdmn
frdmn / bash_aliases
Last active Mar 8, 2020
Nginx and PHP-FPM configuration + default virtual host
View bash_aliases
alias nginx.start='sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.nginx.plist'
alias nginx.stop='sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.nginx.plist'
alias nginx.restart='nginx.stop && nginx.start'
alias php-fpm.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist"
alias php-fpm.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist"
alias php-fpm.restart='php-fpm.stop && php-fpm.start'
alias mysql.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist"
alias mysql.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist"
alias mysql.restart='mysql.stop && mysql.start'
alias nginx.logs.error='tail -250f /usr/local/etc/nginx/logs/error.log'
@frdmn
frdmn / mininginfo
Last active Jan 1, 2016
Simple bash script to get the latest Informations of your Altcoin Mining workers based on the MPOS API (which is probably used by 95% of the pools out there)
View mininginfo
#!/bin/bash
# MPOS Hostname
config_host="miningpool.org"
# MPOS API token (Login -> Edit Account -> API Key)
config_api="0123456789abcdefghijklmnopqrstuvwxyzaaabacadaeafagahaiajakalaman"
json=$(curl -s "http://${config_host}/index.php?page=api&action=getuserstatus&api_key=${config_api}" | python -m json.tool)
parse_hashrate=$(echo "$json" | python -m json.tool | grep "hashrate" | awk '{ print $2 }' | sed 's/,//g')
@frdmn
frdmn / doge.user.js
Created Dec 24, 2013
DogeCoin beautifier. Many Comic Sans. Much esthetic. Wow. — Moved to userscripts.org/scripts/show/186970
View doge.user.js
// ==UserScript==
// @name DogeCoin beautifier
// @version 0.2
// @author frdmn
// @description Such ComicSans. Wow.
// @match *://*/*
// ==/UserScript==
function addGlobalStyle(css) {
var head, style;
@frdmn
frdmn / osx_free_equivalent.py
Created Dec 27, 2013
Python based `free` equivalent for OS X (Mavericks)
View osx_free_equivalent.py
#!/usr/bin/python
import subprocess
import re
# Get process info
ps = subprocess.Popen(['ps', '-caxm', '-orss,comm'], stdout=subprocess.PIPE).communicate()[0]
vm = subprocess.Popen(['vm_stat'], stdout=subprocess.PIPE).communicate()[0]
# Iterate processes
You can’t perform that action at this time.