Skip to content

Instantly share code, notes, and snippets.

@Nama
Nama / mnthdd.sh
Last active June 8, 2016 11:40
Easy mount devices encrypted with cryptsetup. I use this code in /etc/profile.d/
#!/bin/bash
mnthdd() {
# The full mount-path is put together bei $MOUNTPATH and $DRIVES
# In this example it would be /media/ + your parameter
MOUNTPATH="/media/"
# /etc/fstab
## hdd1
#/dev/mapper/hdd1 /media/hdd1 ext4 noauto,defaults 0 0
#
@Nama
Nama / kodi_youtube_link.py
Created May 7, 2016 13:34
Send various Youtube-Links to kodi over TCP. No need for the webinterface. TCP needs to be enabled. List and Channel links arent implemented yet.
@Nama
Nama / tg_bot.py
Last active July 8, 2019 13:11
Short script to send messages via Telegram-Bot
#!python
import sys
import requests
from socket import gethostname
from sys import argv
link = 'https://api.telegram.org/bot'
token = 'BotToken'
@Nama
Nama / color_ranks.py
Last active March 20, 2016 21:36
Custom user colors by user mode. Only effects the chat, not the userlist.
import hexchat
__module_name__ = 'color ranks'
__module_author__ = 'Yama'
__module_version__ = '0.1'
__module_description__ = 'Make user colors by rank'
def mod_colors(word, word_eol, userdata):
nickname = hexchat.strip(word[0], len(word[0]), 1)
nickname += '\003'
@Nama
Nama / motd.sh
Last active January 12, 2018 19:15
motd for logins. Just put in /etc/profile.d/
#!/bin/bash
freemem=`cat /proc/meminfo|grep 'MemF'| awk '{print int($2/1024)}'`
totalmem=`cat /proc/meminfo|grep 'MemT'| awk '{print int($2/1024)}'`
usedmem=`echo $totalmem-$freemem | bc`
echo -e "
\033[1;34mHi $USER!\033[0;37m
\033[0;90m+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
\033[0;90m+ \033[1;94mHostname....: \033[36m$(hostname)
\033[0;90m+ \033[1;94mKernel......: \033[36m$(uname -r)
@Nama
Nama / ssh-tunnel_update.sh
Created July 14, 2015 08:11
Use a proxy 5 server to update packages on a Linux machine
#!/bin/bash
REPOFILE="glusterfs-3.7.list"
SSHSERVER="ssh.server"
SSHUSER="username"
# Kopiere das Repo, damit es verwendet werden kann
cp $REPOFILE /etc/apt/sources.list.d/
if [[ $? -eq 0 ]]; then
# SSH-Tunnel über den user "tunnel" zum Login-Server, welcher im Hintergrund bleibt,
@Nama
Nama / lg_color_switcher.lua
Created July 2, 2015 20:15
Small script for Logitech keyboards with different backlight colors. Changes the color of the backlight permanently, smooth! Shouldnt be hard to make it use on keyboards with just two colors.
function OnEvent(event, arg)
if (event == "PROFILE_ACTIVATED") then
color()
end
end
function color()
r1 = 0
g1 = 0
b1 = 0
@Nama
Nama / shorturl.py
Created July 2, 2015 17:58
URL shortener, written in Python with flask
#!/usr/bin/env python
#########################################################################################
# #
'''A.T.S.P. Short-URL Controller''' #
# #
#########################################################################################
import cymysql
from flask import Flask, redirect
app = Flask(__name__)
@Nama
Nama / homecontrol_client.py
Last active August 29, 2015 17:32
Control radio sockets and Senseo coffee machine with NetIO-App and do some other stuff. Github Repo: https://github.com/Nama/HomeControl
#!/usr/bin/python
import os
import sys
import socket
import time
from PIL import Image
from lglcd import LogitechLcd
from threading import Thread
@Nama
Nama / highlight.mrc
Created October 20, 2014 18:39
Incomplete Highlight and Balloon-Notification Script for mIRC
;--------------------------------------------------- - - - -
;| Yama Control Highlight © 14.09.2008
;--------------------------------------------------- - - - -
;| Version: 3.5
;| mIRC: v6.3
;| Script-Planung: Yama
;| Script-Mod: Chialya
;--------------------------------------------------- - - - -
;| Beschreibung: Markiert die Zeile und spielt Ai.mp3 ab,
;| sobald die Nicks gerufen werden.