Skip to content

Instantly share code, notes, and snippets.

@Niko-sk2x
Niko-sk2x / radiocmd
Last active March 6, 2016 03:39
A simple linux "play and record" online radio command that uses mplayer. You may want to create "radio" (sh) with this: screen -A -m -d -S "radio" "radiocmd" so that it starts that in a screen session. In this example it plays radiozet.
#!/bin/bash
mkdir ~/radio || true
#change to other online radio?
RADIO_NAME=radiozet
NAME=~/radio/$RADIO_NAME-$(date).mp3
LINK_TO_RADIO=http://radiozetmp3-07.eurozet.pl:8400/
mplayer $LINK_TO_RADIO -dumpstream -dumpfile "$NAME" -vc dummy -vo null &
sleep 2
mplayer -vo null "$NAME"
@Niko-sk2x
Niko-sk2x / build.gradle.kts
Created November 20, 2016 14:33
Forge MDK buildscript in kotlin for gradle 3.2 (using forge 1.11-13.19.0.2153)
import net.minecraftforge.gradle.user.patcherUser.forge.ForgeExtension
import net.minecraftforge.gradle.user.patcherUser.forge.ForgePlugin
import org.gradle.api.JavaVersion
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.language.jvm.tasks.ProcessResources
import org.gradle.script.lang.kotlin.*
// Gradle repositories and dependencies
buildscript {
repositories {
/*
* This file is part of Cubic Chunks Mod, licensed under the MIT License (MIT).
*
* Copyright (c) 2015 contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
package cubicchunks.worldgen.gui;
import com.google.common.base.Converter;
import java.util.HashSet;
import java.util.Set;
import java.util.function.DoubleUnaryOperator;
import javax.annotation.ParametersAreNonnullByDefault;
@Niko-sk2x
Niko-sk2x / run-prime.py
Created March 31, 2017 09:31
A way to make running things with nvidia GPU with nouuveau easier on Cinnamon. These files go into /usr/share/nemo/actions/
#!/usr/bin/env python
import errno
import os
import sys
from gi.repository import Gio
os.environ["DRI_PRIME"] = "1"
arg, *rest = sys.argv[1:]
if not os.path.isfile(arg):
@Niko-sk2x
Niko-sk2x / spotify-dl-all.sh
Created May 8, 2017 17:06
spotify-dl download-all-from-file oneliner. Select all in spotify playlist, copypaste into text file, save, and run this.
#!/bin/bash
FILE=list for i in `awk -F / '{ print $5 }' $FILE`; do python2 spotify-dl.py --dl youtube --track $i; done
@Niko-sk2x
Niko-sk2x / D.java
Last active May 9, 2017 19:16
A hacky piece of code to allow effective debug mode without debug mode in Minecraft/Forge, and without the restrictions of hotswapping. And the slowness and bugginess of DCEVM. And I know the naming is nowhere near standard. This is intentional.
package DEBUG;
import static org.apache.commons.io.FileUtils.listFiles;
import static org.lwjgl.input.Keyboard.KEY_D;
import static org.lwjgl.input.Keyboard.KEY_LCONTROL;
import static org.lwjgl.input.Keyboard.KEY_RCONTROL;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
@Niko-sk2x
Niko-sk2x / TickProfiler.java
Created May 12, 2017 17:20
Inproved profiler graph for Minecraft
import net.minecraft.profiler.Profiler;
import net.minecraftforge.fml.relauncher.ReflectionHelper;
import org.apache.commons.lang3.ArrayUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.util.*;
{"waterLevel":-4096,"caves":true,"strongholds":true,"alternateStrongholdsPositions":false,"villages":true,"mineshafts":true,"temples":true,"oceanMonuments":true,"woodlandMansions":true,"ravines":true,"dungeons":true,"dungeonCount":7,"waterLakes":true,"waterLakeRarity":4,"lavaLakes":true,"lavaLakeRarity":8,"aboveSeaLavaLakeRarity":13,"lavaOceans":false,"biome":-1,"biomeSize":4,"riverSize":4,"dirtSpawnSize":33,"dirtSpawnTries":10,"dirtSpawnProbability":0.0625,"dirtSpawnMinHeight":-Infinity,"dirtSpawnMaxHeight":Infinity,"gravelSpawnSize":33,"gravelSpawnTries":8,"gravelSpawnProbability":0.0625,"gravelSpawnMinHeight":-Infinity,"gravelSpawnMaxHeight":Infinity,"graniteSpawnSize":33,"graniteSpawnTries":10,"graniteSpawnProbability":0.2,"graniteSpawnMinHeight":-Infinity,"graniteSpawnMaxHeight":0.25,"dioriteSpawnSize":33,"dioriteSpawnTries":10,"dioriteSpawnProbability":0.2,"dioriteSpawnMinHeight":-Infinity,"dioriteSpawnMaxHeight":0.25,"andesiteSpawnSize":33,"andesiteSpawnTries":10,"andesiteSpawnProbability":0.2,"andesit
{"waterLevel":63,"caves":true,"strongholds":true,"alternateStrongholdsPositions":false,"villages":true,"mineshafts":true,"temples":true,"oceanMonuments":true,"woodlandMansions":true,"ravines":true,"dungeons":true,"dungeonCount":7,"waterLakes":true,"waterLakeRarity":4,"lavaLakes":true,"lavaLakeRarity":8,"aboveSeaLavaLakeRarity":13,"lavaOceans":false,"biome":-1,"biomeSize":4,"riverSize":4,"dirtSpawnSize":33,"dirtSpawnTries":10,"dirtSpawnProbability":0.0625,"dirtSpawnMinHeight":-Infinity,"dirtSpawnMaxHeight":Infinity,"gravelSpawnSize":33,"gravelSpawnTries":8,"gravelSpawnProbability":0.0625,"gravelSpawnMinHeight":-Infinity,"gravelSpawnMaxHeight":Infinity,"graniteSpawnSize":33,"graniteSpawnTries":10,"graniteSpawnProbability":0.2,"graniteSpawnMinHeight":-Infinity,"graniteSpawnMaxHeight":0.25,"dioriteSpawnSize":33,"dioriteSpawnTries":10,"dioriteSpawnProbability":0.2,"dioriteSpawnMinHeight":-Infinity,"dioriteSpawnMaxHeight":0.25,"andesiteSpawnSize":33,"andesiteSpawnTries":10,"andesiteSpawnProbability":0.2,"andesiteSp