Skip to content

Instantly share code, notes, and snippets.

View iacchus's full-sized avatar

Iacchus Mercurius iacchus

View GitHub Profile
@iacchus
iacchus / cmd.md
Created February 21, 2014 14:01 — forked from KenMacD/cmd.md

Colors in terminal

It's a common confusion about terminal colors... Actually we have this:

  • plain ascii
  • ansi escape codes (16 color codes with bold/italic and background)
  • 256 color palette (216 colors+16gray + ansi) (colors are 24bit)
  • 24bit true color (888 colors (aka 16 milion))

The 256 color palete is configured at start, and it's a 666 cube of colors, each of them defined as a 24bit (888 rgb) color.

@iacchus
iacchus / socket.io-1-0-apache-2.4-nossl.conf
Created December 27, 2014 22:23
Set reverse proxy websockets in Apache 2.4 using socket.io 1.0. Needs mod_rewrite module, this version doesn't uses SSL. As seen here https://serverfault.com/questions/616370/configuring-apache-2-4-mod-proxy-wstunnel-for-socket-io-1-0
<VirtualHost *:80>
ServerName forum.example.com
# ServerAdmin webmaster@localhost
<Proxy *>
Require all granted
</Proxy>
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iacchus
iacchus / sandwich.md
Last active January 5, 2017 04:35
Things that i need to remember when making a sandwich

Sandwich

  • Bread (just in case)
  • Oregano
  • Garlic
  • Tomato
  • Olives
  • Olive oil
  • Chipotle
  • Onion
@iacchus
iacchus / logwatcher.python3
Created January 5, 2017 04:31
Simple log watcher in python3 which sends GET to / to PUSHOVER
#!/usr/bin/env python3
# follow.py
#
# Follow a file like tail -f.
import sys
import time
from iplib import check_ip as CHECKIP

Setting up a Persistent, Unified Chat Proxy & Shell Client

Overview

This guide provides a steps for setting up a unified shell chat proxy & client running in a persistent screen session. The following steps are covered:

  • Server operating system & packages will be updated.
  • Timezone will be updated.
@iacchus
iacchus / gist:9c25a370dd533e523348d1b6fa535697
Created April 3, 2017 03:38
Embed abcjs in vanilla forums pre elements if they are ABC
<script src="https://rawgit.com/paulrosen/abcjs/master/bin/abcjs_plugin_3.1.1-min.js"></script>
<script>
abcjs_plugin_autostart = false;
window.ABCJS.plugin.auto_render = false;
ABCJS.plugin.hide_abc = true;
ABCJS.plugin.render_options = {
scale: 1,
staffwidth:700,
paddingtop: 0,
@iacchus
iacchus / play_notes.py
Created April 20, 2017 12:42 — forked from eliasdorneles/play_notes.py
Playing notes with sox
import subprocess
import time
def wait(seconds):
time.sleep(seconds)
def play_note(note='C', duration=4, delay=0):
# requires sox to be installed