Skip to content

Instantly share code, notes, and snippets.

View iacchus's full-sized avatar

Iacchus Mercurius iacchus

View GitHub Profile
#!/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
@iacchus
iacchus / cmd.md
Created February 21, 2014 14:01 — forked from KenMacD/cmd.md

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.

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 / 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
#!env ruby
#
# brew install sox
#
def play(note, octave=1)
"play -q -n synth sq #{note}#{octave} remix - fade 0 .6 .1 norm; "
end
song_notes = %w(B A G A B B B A A A G D D B A G A B B B B A A B A G)
@iacchus
iacchus / colors.muttrc
Created September 6, 2019 01:34 — forked from LukeSmithxyz/colors.muttrc
Mutt example colors
# vim: filetype=neomuttrc
# Default index colors:
color index yellow default '.*'
color index_author red default '.*'
color index_number blue default
color index_subject cyan default '.*'
# For new mail:
color index brightyellow black "~N"
color index_author brightred black "~N"
@iacchus
iacchus / sample_ssh_server.py
Created May 21, 2020 04:59 — forked from cschwede/sample_ssh_server.py
Sample paramiko SSH server to receive commands
#!/usr/bin/env python
import logging
import socket
import sys
import threading
import paramiko
logging.basicConfig()
logger = logging.getLogger()
@iacchus
iacchus / delete_git_submodule.md
Created July 24, 2020 12:50 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@iacchus
iacchus / gist:25cf9c61fd70e0153f78303b713f9b1b
Created May 12, 2021 21:05 — forked from hencjo/gist:0710d51c5ba51e0aeb2d905f1e3a38f3
Xorg: Two keyboards with different keyboard layout.
# Use xinput to find your keyboards.
$ xinput
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=11 [slave pointer (2)]
⎜ ↳ TPPS/2 IBM TrackPoint id=12 [slave pointer (2)]
⎜ ↳ Logitech Performance MX id=14 [slave pointer (2)]
⎜ ↳ E-Signal USB Gaming Keyboard id=16 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]