Skip to content

Instantly share code, notes, and snippets.

View frdmn's full-sized avatar
🦀

Jonas Friedmann frdmn

🦀
View GitHub Profile
@frdmn
frdmn / ssh-hosts.zsh
Created March 29, 2016 10:39
ssh-hosts.zsh plugin
h=()
if [[ -r ~/.ssh/config ]]; then
h=($h ${${${(@M)${(f)"$(cat ~/.ssh/config)"}:#Host *}#Host }:#*[*?]*})
fi
if [[ -r ~/.ssh/known_hosts ]]; then
h=($h ${${${(f)"$(cat ~/.ssh/known_hosts{,2} || true)"}%%\ *}%%,*}) 2>/dev/null
fi
if [[ $#h -gt 0 ]]; then
zstyle ':completion:*:ssh:*' hosts $h
zstyle ':completion:*:slogin:*' hosts $h
@frdmn
frdmn / gogs
Last active March 19, 2016 13:47 — forked from infostreams/gogs
Debian startup (init.d) script for gogs.io
#! /bin/sh
### BEGIN INIT INFO
# Provides: gogs
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Git repository manager Gogs
# Description: Starts and stops the self-hosted git repository manager Gogs
### END INIT INFO
@frdmn
frdmn / doge.user.js
Created December 24, 2013 15:18
DogeCoin beautifier. Many Comic Sans. Much esthetic. Wow. — Moved to userscripts.org/scripts/show/186970
// ==UserScript==
// @name DogeCoin beautifier
// @version 0.2
// @author frdmn
// @description Such ComicSans. Wow.
// @match *://*/*
// ==/UserScript==
function addGlobalStyle(css) {
var head, style;
@frdmn
frdmn / mininginfo
Last active January 1, 2016 04:49
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)
#!/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 / maven3-brew.sh
Created November 20, 2013 11:48
Install maven3 on OS X 10.9+ via homebrew formula
# 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 / messages.yml
Created December 28, 2015 16:08
BanManager spanish translation - messages.yml
# Variables
# [reason] = Motivo del baneo y el silenciamiento.
# [player] = Nombre del jugador.
# [ip] = IP baneada.
# [actor] = Aquél que baneo o silenció a un jugador.
# [expires] = Tiempo de duración de un baneo o silenciamiento.
# NOTA: ban y mute no tienen una traducción y/o al menos no una traducción muy exacta al español. Puede que la traducción en este archivo no sea 100% precisa.
messages:
duplicateIP: '&cAdvertencia: [player] tiene la misma IP que los siguientes jugadores baneados:\n&6[players]'
@frdmn
frdmn / mov2gif.md
Last active December 28, 2015 15:59
Bash function for OS X to convert a .mov file into a .gif but in a reasonable quality.

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 / index.php
Created November 13, 2013 08:02
Subreddit HTML export/lister
<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 / cloudbot
Created September 16, 2013 13:58
SysVinit start up daemon for CloudBot --- touch /etc/init.d/cloudbot && chmod 700 /etc/init.d/cloudbot && vi /etc/init.d/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 / npm
Created December 21, 2015 13:42
vagrant@vagrant-ubuntu-trusty-64:~$ sudo su
root@vagrant-ubuntu-trusty-64:/home/vagrant# apt-get -y update
Ign http://archive.ubuntu.com trusty InRelease
Get:1 http://security.ubuntu.com trusty-security InRelease [64.4 kB]
Get:2 http://archive.ubuntu.com trusty-updates InRelease [64.4 kB]
Get:3 http://security.ubuntu.com trusty-security/main Sources [101 kB]
Get:4 http://archive.ubuntu.com trusty-backports InRelease [64.5 kB]
Hit http://archive.ubuntu.com trusty Release.gpg
Get:5 http://security.ubuntu.com trusty-security/universe Sources [31.9 kB]
Get:6 http://security.ubuntu.com trusty-security/main amd64 Packages [396 kB]