Skip to content

Instantly share code, notes, and snippets.

View Derkades's full-sized avatar

Robin Derkades

  • 02:18 (UTC +02:00)
View GitHub Profile
@rlemon
rlemon / gist:1780212
Created February 9, 2012 14:12
PHP get CPU information from /proc/stat
<?php
/* Gets individual core information */
function GetCoreInformation() {
$data = file('/proc/stat');
$cores = array();
foreach( $data as $line ) {
if( preg_match('/^cpu[0-9]/', $line) )
{
$info = explode(' ', $line );
$cores[] = array(
@awidegreen
awidegreen / pulseaudio.service
Last active January 20, 2024 15:10
systemd definition for pulseaudio in system-mode (example for archlinux). The pulseaudio developers explicitly recommend to NOT run pulseaudo system-mode!
# systemd service spec for pulseaudio running in system mode -- not recommended though!
# on arch, put it under /etc/systemd/system/pulseaudio.service
# start with: systemctl start pulseaudio.service
# enable on boot: systemctl enable pulseaudio.service
[Unit]
Description=Pulseaudio sound server
After=avahi-daemon.service network.target
[Service]
ExecStart=/usr/bin/pulseaudio --system --disallow-exit --disallow-module-loading
/*
Example:
new BukkitRunnable()
{
Scroller scroller = new Scroller("&aThis is an &2important &amessage!", 16, 5, '&');
Sign sign = a-sign-from-somewhere;
public void run()
{
@RichardB122
RichardB122 / ExperienceManager.java
Created June 20, 2015 06:28
A simple and easy to use class that can get and set a player's total experience points in Minecraft. This is based off the Bukkit API. The determines this with a mathematical formula based off the player's current level and their progress towards the next one.
/*
AUTHOR: Dev_Richard (https://www.spigotmc.org/members/dev_richard.38792/)
DESC: A simple and easy to use class that can get and set a player's total experience points.
Feel free to use this class in both public and private plugins, however if you release your
plugin please link to this gist publicly so that others can contribute and benefit from it.
*/
import java.math.BigDecimal;
import java.util.List;
@ottonet
ottonet / lychee
Created July 14, 2015 15:55
lychee nginx config
server {
server_name my.lychee.site;
listen 80;
root /var/www/my.lychee.site/htdocs;
access_log /var/www/my.lychee.site/logs/access.log;
error_log /var/www/my.lychee.site/logs/error.log;
index index.php index.html;
@joepie91
joepie91 / vpn.md
Last active June 17, 2024 20:56
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active June 18, 2024 00:01
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
@sbstp
sbstp / minecraftd
Last active April 1, 2020 13:55
Wrapper script for the official minecraft server (or spigot) to shut it down gracefully via SIGTERM. Useful to put behind systemd and friends.
#!/usr/bin/env python3
from signal import signal, SIG_IGN, SIGTERM, SIGINT
import subprocess
import sys
USAGE = '''Usage: minecraftd [server jar path] [java options]*'''
JAVA_BIN = '/usr/bin/java'
JAVA_OPTS = ['-XX:+UseParNewGC', '-XX:+UseConcMarkSweepGC',
'-XX:+AggressiveOpts']
@shnhrrsn
shnhrrsn / plexDatabaseBackupScript.sh
Last active January 5, 2022 13:46 — forked from ssmereka/plexDatabaseBackupScript.sh
Plex Media Server database backup script.
#!/usr/bin/env bash
# Backup a Plex database.
# Author Scott Smereka
# Version 1.0
# Modified by Shaun Harrison
# Version 1.1
# Script Tested on:
@BernCarney
BernCarney / FreeNAS11 Media Stack.md
Last active May 1, 2023 20:31
FreeNAS 11 - Jails setup for Plex, NGINX, PlexPy, Sonarr, Radarr, Jackett, Ombi, and Nzbget

FreeNAS 11 setup for Plex, PlexPy, Sonarr, Radarr, Jackett, NZBGet, Organizr, NGinx, and Ombi

I am currently working on updating this guide after updating my media server. I have added notes on things I no longer use but may update those sections in the future for users who still use them. As of now, I have everything working with the exception of Ombi and the plugins I no longer use.