This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SUBSYSTEM=="video4linux", KERNEL=="video[0-9]*", ATTRS{product}=="HD Pro Webcam C920", RUN="/usr/bin/v4l2-ctl -d $devnode --set-ctrl=focus_auto=0" RUN+="/usr/bin/v4l2-ctl -d $devnode --set-ctrl=focus_absolute=0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
LATEST_VERSION="$( | |
wget -qO- 'https://kernel.ubuntu.com/~kernel-ppa/mainline/' \ | |
| grep -E 'href="v[0-9.]+/"' \ | |
| cut -d \" -f8 \ | |
| cut -c2- \ | |
| cut -d/ -f1| sort --version-sort \ | |
| tail -n 1 | |
)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PAM | |
type control module-path module-arguments | |
type: management group | |
account | |
non-auth account management | |
auth | |
authenticate | |
group membership |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import evdev | |
import time | |
import logging | |
import os | |
class MouseToKeyboard(object): | |
LOOP_SLEEP = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
event=ibm/hotkey LEN0068:00 00000080 000060c0 | |
action=/etc/acpi/toggle-tablet-mode.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Convert given strig in CamelCase to snake_case. | |
def camel_to_snake_case string | |
string.gsub(/([^A-Z])([A-Z])/, '\1_\2').downcase | |
end | |
# Convert given string in snake_case to CamelCase | |
def snake_to_camel_case string | |
string.split('_').map(&:downcase).map(&:capitalize).join('') | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RetryProxy < BasicObject | |
def initialize target, retries, logger=nil | |
@target = target | |
@retries = retries | |
@logger = logger | |
end | |
BasicObject.instance_methods.each do |basic_object_instance_method| | |
define_method(basic_object_instance_method) do |*args, &block| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'socket' | |
require 'thwait' | |
unless ARGV.size == 2 | |
STDERR.puts "Usage: #{$PROGRAM_NAME} listen_address:listen_port target_address:target_port" | |
exit 1 | |
end | |
listen_address, listen_port = ARGV.shift.split(':') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ensure that all ruby process instances use Simplecov | |
task :simplecov_setup do | |
ENV['RUBYLIB'] = "#{Dir.pwd}:#{ENV['RUBYLIB']}" | |
ENV['RUBYOPT'] = '-r configure_simplecov' | |
sh 'rm -rf coverage/' | |
end | |
# Generate a final report, with all merged results | |
task :simplecov_report do | |
require 'simplecov' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REPO="$HOME/src/dotfiles.git" | |
GITHUB_REPO_URL="git@github.com:fornellas/dotfiles.git" | |
mkdir -p "$REPO" | |
cd "$REPO" | |
git init --bare | |
cd - | |
alias dotfiles='git --git-dir="$REPO" --work-tree="$HOME"' | |
dotfiles remote add origin $GITHUB_REPO_URL | |
dotfiles pull origin |
NewerOlder