Skip to content

Instantly share code, notes, and snippets.

@Nixtren
Nixtren / netpps.sh
Created July 27, 2016 19:47 — forked from joemiller/netpps.sh
shell: quick linux scripts for showing network bandwidth or packets-per-second
#!/bin/bash
if [ -z "$1" ]; then
echo
echo usage: $0 network-interface
echo
echo e.g. $0 eth0
echo
echo shows packets-per-second
@Nixtren
Nixtren / transfer.sh.php
Last active January 2, 2017 17:35
Add transfer.sh alias to .bashrc
<?php
/*
This dirty script adds transfer.sh alias to .bashrc
The string is Base64 encoded because I don't know if the original code would cause any conflict with the PHP variables
You might be wondering why I made this in PHP. Well, it's just because I use PHP on a daily basis. Feel free to port it to Bash or whatever!
Quickly coded by Nixtren, released under public domain because there's nothing special here
Run this with a one-liner:
curl -s https://gist.githubusercontent.com/Nixtren/46191216c8e6349b94b7f776e26b593f/raw | php
@Nixtren
Nixtren / debian_8_caddy.sh
Last active December 10, 2017 21:32
Debian 8 (Jessie) with Caddy & PHP 7.0 from scratch
#!/bin/bash
# This is my personal recipe to put a Caddy webserver running on Debian 8 (Jessie) from scratch.
# This installs some unrelated stuff as well, such as fail2ban, dstat... Feel free to modify it to your needs.
# Run: wget https://gist.githubusercontent.com/Nixtren/ae34d0308355884b9c7431ecab699eb4/raw -O /dev/stdout | bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi

Keybase proof

I hereby claim:

  • I am Nixtren on github.
  • I am nixtren (https://keybase.io/nixtren) on keybase.
  • I have a public key whose fingerprint is 5E12 F902 8C82 7785 0506 C306 06F5 D91B DF0F 427B

To claim this, I am signing this object:

@Nixtren
Nixtren / mta_convert.php
Last active October 12, 2016 14:48
Nixtren MTA to SA-MP Map Converter
<?php
/*
Nixtren MTA to SA-MP Map Converter
Converts objects and remove world objects
Licensed under GPLv3 - https://github.com/Nixtren
GitHub Gist: https://gist.github.com/Nixtren/9793d67b89a7ff47ce74
Live demo: https://nixtren.net/samp/mapconverter/
This script was originally written for private use, so code elegance was not in mind.
@Nixtren
Nixtren / SpooflessDialogs.inc
Last active August 29, 2015 14:28
SpooflessDialogs - SA-MP Dialog Anti-Spoof
// SpooflessDialogs - SA-MP Dialog Anti-Spoof
// Made by Nixtren (https://github.com/Nixtren)
// Licensed under the MIT License
/*
These #include attempts don't work well for whatever reason
#include <YSI\y_hooks>
#if !defined Hook_ReplaceNative
#include <nhooks>
#endif
<?php
// Quickly coded by Nixtren
echo "Welcome to the (unofficial) LowEndSpirit TeamSpeak setup script!\n";
$port_base = exec(<<<HEREDOC
ifconfig | grep venet0:0 -A 1 | grep inet | awk '{print $2}' | sed -e 's/addr://g' | awk -F "[. \t]*" '/^[0-9]+./ {print $4,$5}'
HEREDOC
); // This exec command was taken from the official LES TS bash setup script, credits to Anthony.
$voice_port = "{$port_base}09"; // The voice port the TeamSpeak server will use, following the logic of the original bash script
$filetransfer_port = "{$port_base}10"; // The file transfer port the TeamSpeak server will use, following the logic of the original bash script
$ts3server_startscript = file_get_contents("ts3server_startscript.sh");
@Nixtren
Nixtren / regenerate_ssh_host_keys.sh
Last active August 29, 2015 14:25
SSH Host Keys Regeneration Script
#!/bin/bash
#Quickly coded by Nixtren, licensed under public domain.
echo "Deleting old SSH Host keys..."
rm -f /etc/ssh/ssh_host_*
echo "Generating SSH Host keys..."
ssh-keygen -A
keyFileCount=$(ls -f /etc/ssh/ | grep ssh_host_ | wc -l)
if [ $keyFileCount == 0 ]
then
echo "ERROR: SSH Host keys have not been regenerated."
@Nixtren
Nixtren / main.lua
Last active August 29, 2015 14:23
Cuberite Item Multiplication Bug Fix (Survival Mode) Plugin
-- Coded by Nixtren
-- Released under Public Domain, it's a very simple plugin.
-- More information: https://github.com/cuberite/cuberite/issues/2272 and https://github.com/cuberite/cuberite/issues/1700
PLUGIN = nil
function Initialize(Plugin)
Plugin:SetName("ItemMultiplicationBugFix")
Plugin:SetVersion(4)