Skip to content

Instantly share code, notes, and snippets.

@unode
unode / shell
Created February 21, 2017 00:24
echo "require("awful.spawn").easy_async("./test.sh", print)" | awesome-client
@unode
unode / nix-tunnel-daemon
Created July 7, 2016 16:29
nix-tunnel-daemon
#!/bin/bash
# Any error is fatal
set -e
# Server running the actual nix-daemon
REMOTE_NIXDAEMON="mega"
# Where to find the socket in the destination server
NIX_DAEMON_SOCKET="/local/nix/var/nix/daemon-socket/socket"
@unode
unode / nix-channel-modified
Created June 17, 2016 13:43
nix-channel-modified - Show last modified date of in-use channels
#!/bin/bash
# nix-channel-modified -- created 2016-06-17, Renato Alves
# Show last modified date of in-use channels
# @Last Change: 2016-06-17.
# @Revision: 0.1
nix-channel --list | cut -d ' ' -f 2 | xargs -I % sh -c 'echo -n % >&2 ; (wget -S -O - %/git-revision 2>&1 >/dev/null | grep Last-Modified | tail -n 1)'
@unode
unode / notify-bar.sh
Last active February 25, 2017 01:05
AwesomeWM reusable notifications - includes text and bar. The latter useful for volume/brightness controls.
#!/usr/bin/env bash
# notify-bar.sh -- created 2015-10-11, Renato Alves
# @Last Change: 2016-04-03.
# @Revision: 0.8
#
# Code released under MIT license transcribed below:
#
# Copyright (c) 2015, Renato Alves
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
@unode
unode / Troubleshooting.md
Created August 30, 2015 19:11
Troubleshooting.md

Troubleshooting

Video

Rotating/flipping webcam data stream (and other issues)

Currently qTox doesn't support adjusting the video stream obtained from webcams. This may change in the future.

In some laptops, the camera has been assembled upside-down. To have the image correctly displayed it is required to flip the stream vertically.

@unode
unode / purge_tool.py
Last active August 29, 2015 14:19
Maintenance script to purge uninstalled tools. To be used with Galaxy (http://usegalaxy.org). Original issue at https://trello.com/c/5RlrHLR6
from __future__ import print_function
import sys
import os.path
import argparse
db_shell_path = __file__
new_path = [ os.path.join( os.path.dirname( db_shell_path ), os.path.pardir, "lib" ) ]
new_path.extend( sys.path[1:] ) # remove scripts/ from the path
sys.path = new_path
@unode
unode / galaxy-base
Last active August 29, 2015 14:14
galaxy init scripts
#!/bin/bash
# Author: Renato Alves, 2013
function usage {
echo "WARNING: $0 should not be used directly"
echo " Create a symlink to $0 with a name in the format 'galaxy-NAME'"
echo " NAME should be 'toolshed' or anything matching [server:NAME] in your config/galaxy.ini"
echo "E.g. galaxy-web0 , galaxy-job0 or galaxy-toolshed"
exit 1
@unode
unode / taskgit
Last active October 17, 2021 19:06
#!/bin/bash
# Copyright 2014-2016 Renato Alves
# distributed under the GPLv3 licence
if [ -z "$TASKDIR" ]; then
#TODO Look for data location in rc:location instead of assuming ~/.taskrc
TASKDIR="$(grep data.location $HOME/.taskrc | cut -d '=' -f 2)"
if [[ "$TASKDIR" == "~/"* ]]; then