Skip to content

Instantly share code, notes, and snippets.

@laurynas
laurynas / schedule_acpi_wakeup.sh
Created May 4, 2011 19:11
Schedule ACPI wakeup script
#!/bin/sh
#
# Schedule ACPI wakeup
#
# Author: Laurynas Butkus (laurynas.butkus at gmail.com)
#
# Some info on ACPI wakeup:
# http://smackerelofopinion.blogspot.com/2009/08/acpi-wake-alarm-bugs.html
#
@laurynas
laurynas / schedule_wakeup_and_halt.sh
Created May 4, 2011 19:38
Execute ACPI wakeup schedule and halt
#!/bin/sh
#
SCHEDULE_CMD="/opt/schedule_acpi_wakeup/schedule_acpi_wakeup.sh"
if [ ! -x $SCHEDULE_CMD ]; then
echo "$SCHEDULE_CMD not found"
exit 1
fi
#!/bin/sh
#
MONIK_LISTENER=YOURID
MONIK_TOKEN=YOURTOKEN
MESSAGE=$@
/opt/monik/monik -c log -l $MONIK_LISTENER -t $MONIK_TOKEN -m "$MESSAGE"
@laurynas
laurynas / result.json
Last active April 1, 2017 21:29
Language detector result
{
"data":{
"detections":[
{
"isReliable":true,
"confidence":39.45,
"language":"es"
},
{
"isReliable":false,
@laurynas
laurynas / blur_detector
Created November 19, 2011 07:29 — forked from pceres/blur_detector
blurry photos detection
#! /bin/bash
#
# Author: Pasquale Ceres ([email protected])
# License: GPL ver. 3
#
# Script originally developed for the
# "San Lorenzo Martire Caposele Church Records Digitalization Project"
#
# http://www.facebook.com/group.php?gid=188973755117&v=photos
@laurynas
laurynas / extract_ip_from_log.sh
Created March 8, 2012 13:48
Extract IPs while tailing log file
tail -f log/development.log | grep "[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}" | awk 'match($0,/([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/){ print substr($0, RSTART, RLENGTH) }'
@laurynas
laurynas / batch_result.json
Created October 16, 2012 12:23
detectlanguage.com batch request result example
{
"data":{
"detections":[
[
{
"language":"es",
"isReliable":false,
"confidence":0.4517133956386293
},
{
@laurynas
laurynas / mddev.conf
Created October 26, 2012 16:03
Mysql on ramdrive
description "MD Development Environment"
author "Laurynas Butkus"
#start on startup
#stop on shutdown
stop on runlevel [016]
pre-start script
stop mysql
mkdir -p /mnt/ramdrive
@laurynas
laurynas / knedliku_teorija.txt
Created June 23, 2014 14:02
Knedlikų teorija
https://web.archive.org/web/20050405113624/http://www.road.lt/keliautojai/am/pasakojimai/30/
Antanas Marcelionis
Vilnius – Valensija autostopu. Antroji dalis
2000 Spalis; Vokietija, Čekija
Juokingą atstumą nuo Prahos iki Vokietijos sienos įveikėme begėdiškai ilgai – užtrukome beveik visą dieną. Dykas buvimas pagimdė mūsų galvose istoriją apie KNIEDLIKUS. Mes maždaug žinojome, kad kniedlikai tai kažkokia nacionalinė čekiška bulka, tačiau nusprendėme, kad vistik tai yra nacionalis augalas. Ir prasidėjo.
KNIEDLIKŲ TEORIJA (galite tikėti, bet geriau ne)
#!/usr/bin/env ruby
# vim: set syntax=ruby
flag = false
files = `git diff --cached --name-only --diff-filter=ACM`.split("\n")
files.each do |file|
results = `git diff --cached #{file} | grep "^\+[^+]" | grep -e "binding.pry" -e "focus: true" -e ":focus => true" -e "console.log" -e "debugger"`.split("\n").map { |r| r.sub(/^\+[\s\t]*/, '') }
if $? == 0