Skip to content

Instantly share code, notes, and snippets.

View lkraav's full-sized avatar
🎯
Focusing

Leho Kraav lkraav

🎯
Focusing
View GitHub Profile
@lkraav
lkraav / growlnotify.pl
Created November 16, 2009 15:37 — forked from jashmenn/gist:6206
some modifications to irssi -> growl gateway
# == WHAT
# Simple script for growl notifications in irssi
#
# == WHO
# Nate Murray 2008
# Modif: Leho Kraav 2009
#
# == CONFIG
# /SET growl_on_regex [regex]
# /SET growl_channel_regex [regex]
@lkraav
lkraav / 8kzenrecover.py
Created November 17, 2009 20:57
8kzenrecover.py
#!/usr/bin/python
# Copyright 2007 by Tobia Conforto <tobia.conforto@gmail.com>
#
# This program is free software; you can redistribute it and/or modify it under the terms of the GNU General
# Public License as published by the Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
@lkraav
lkraav / kill-outlook-eml-duplicates.py
Created January 23, 2010 08:20
kill-outlook-eml-duplicates.py
import subprocess
import os
from termcolor import colored
rootdir = 'Documents/thunderbird/tbird2oe/1-LocalFolders/localhost-Inbox-pruned'
md5 = {}
for subdir, dirs, files in os.walk(rootdir):
ii = 0
@lkraav
lkraav / gitweb.conf.pl
Created January 23, 2010 08:21
gitweb.conf
$projectroot = '/path/to/gitosis/repositories';
$gitosis_conf = '/path/to/gitosis/repositories/gitosis-admin.git/gitosis.conf';
$username = $cgi->remote_user;
$export_auth_hook = sub {
my $projectdir = shift;
if($projectdir =~ (/(.*?)\.git/)) {
my $projectname = basename($1);
open FILE, $gitosis_conf or die 'Could not open gitosis config file. Please make sure that $gitosis_conf is set properly';
my $project_match = 0;
my $user_match = 0;
@lkraav
lkraav / ee_sum_as_words.pl
Created December 20, 2010 14:37
this gist implements converting numbers into estonian language text. i'm using it as a replacement for the distribution copy of sql-ledger (currently at 2.6.32) ee locale Num2text, which is broken either in the algorithm or implementation (test: 1078000).
#!/usr/bin/perl
# summad/arvud eesti keeles
# VB original provided by Tarmo Ko~lli [lennuki@hot.ee]
# PHP-sse ymberkirjut Jaanus Kase (terminus@privador.com)
# ausqna ma ei tea mis printsiibil see toimib :)
# aga sellegipoolest vqiks creditsid kuskil kasutades alles j2tta
# Perli versioon Martin Lillepuu <martin@lillepuu.com>
# täisarvu sqnelemine eesti keeles
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
use onlydeps || inherit webapp
DESCRIPTION="SQL based, powerful small business accounting system"
SRC_URI="http://www.sql-ledger.com/source/${P}.tar.gz"
HOMEPAGE="http://www.sql-ledger.com/"
@lkraav
lkraav / grub.cfg
Created April 7, 2011 15:11
Boot Multiple ISO from USB via Grub2 using Linux, using http://www.pendrivelinux.com/boot-multiple-iso-from-usb-via-grub2-using-linux/ as starting point. Idea is that this gist would accumulate known configurations for booting various ISOs with correct pa
# This grub.cfg file was created by Lance http://www.pendrivelinux.com
# Suggested Entries and the suggestor, if available, will also be noted.
# Adding an Unlisted ISO: To try ISO Files that are not yet listed, use
# the existing menuentry examples in /boot/grub/grub.cfg and append any
# options normally found in the distributions syslinux.cfg file on the
# "append" line to the "linux" line of the menu entry.
set timeout=10
set default=0
#!/bin/sh
TMPFILE=`mktemp`
#save the timestamp
touch -r file-name $TMPFILE
> file_name
#restore the timestamp after truncation
touch -r $TMPFILE file-name
rm $TMPFILE
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 7f43cf8..17e2fa1 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -744,13 +742,18 @@ config XO15_EBOOK
config SAMSUNG_LAPTOP
tristate "Samsung Laptop driver"
- depends on RFKILL && BACKLIGHT_CLASS_DEVICE && X86
+ depends on X86
@lkraav
lkraav / samsung-status.sh
Created February 5, 2012 14:14
Hourly reminder on how awesome your Samsung Series 9 is doing
#!/bin/bash
SYSPATH="/sys/devices/platform/samsung"
SUMMARY="Samsung Status"
BODY=()
BODY+=("performance_level: $(cat "$SYSPATH/performance_level")")
BODY+=("backlight: $(cat "/sys/class/backlight/acpi_video0/brightness") / $(cat "/sys/class/backlight/acpi_video0/max_brightness")")
BODY+=("kbd_backlight: $(cat "$SYSPATH/leds/samsung::kbd_backlight/brightness") / $(cat "$SYSPATH/leds/samsung::kbd_backlight/max_brightness")")
BODY+=("$(cat "$SYSPATH/rfkill/rfkill0/name"): $(cat "$SYSPATH/rfkill/rfkill0/state")")
BODY+=("$(cat "$SYSPATH/rfkill/rfkill1/name"): $(cat "$SYSPATH/rfkill/rfkill1/state")")