Skip to content

Instantly share code, notes, and snippets.

View alexandregz's full-sized avatar
🎯
Focusing

Alexandre Espinosa Menor alexandregz

🎯
Focusing
View GitHub Profile
@alexandregz
alexandregz / logs.lua
Created October 24, 2013 00:15
Simple lua script to read (easily) logs from Prosody with mod_mam reader module activated. You can clone my repository "prosody-logs", but I don't have idea to update or modify this script. MIT License
--[[
Lua log mod_mam reader (Prosody)
Alexandre Espinosa Menor <aemenor@gmail.com>
To use: lua arg[0] [FILE | LOG_DIR]
Note: LOG_DIR usually is /var/lib/prosody/VIRTUALHOST/archive2
--]]
require 'lfs'
@alexandregz
alexandregz / contestador.sh
Last active December 26, 2015 19:19
Para engadir umha pequena identificaçom no script "contestador.sh" que nos sirve para ter notificaçons na raspberry mediante centerim (http://rsppi.blogspot.com.es/2013/07/uso-de-hangouts-gtalk-para-el-envio-de.html)
#!/bin/bash
#programado por Juanmol para http://rsppi.blogspot.com
# Alexandre Espinosa Menor <aemenor@gmail.com>
# Identificaçom (password de seguridade e control de usuario)
# password por seguridade, por se muda o resource e nom temos acesso á raspberry
# Uso: Enviar password antes do resto
PASSWORD="chave"
PASSWORD_RECIBIDO=$1
@alexandregz
alexandregz / Pesquisar co e-Estraviz
Created November 4, 2013 21:02
Para engadir um serviço a OSX de pesquisa no e-Estraviz, imos a Automator e creamos um novo Serviço, deixando que o serviço reciba a selecçom de texto em qualquer aplicaçom e ejecutando o seguinte código no objecto "Ejecutar AppleScript" (os nomes dos menús dependem da linguagem do teu sistema) Gardamos co nome "Pesquisar co e-Estraviz" e podemo…
on run {input, parameters}
open location "http://estraviz.org/" & input
end run
@alexandregz
alexandregz / initials_from_dictionary.sql
Last active December 29, 2015 04:29
MySQL query to get total from each distinct initial letter from a dictionary database, with special cases like suffix (-grafia, -inho)
-- MySQL query to get total from each distinct initial letter from a dictionary database, with special cases like suffix (-grafia, -inho)
-- Fields: dic_word, DB: nuke_dictionary
--
SELECT
IF(
SUBSTRING( dic_word, 1, 1 ) IN ('&', '-'),
SUBSTRING( dic_word, 2, 1 ),
SUBSTRING( dic_word, 1, 1 )
) AS inicial
@alexandregz
alexandregz / faces2newsgithub.js
Last active August 29, 2015 13:56
put avatars in the news feed page from github
// ==UserScript==
// @name faces2newsgithub.js
// @namespace https://github.com/alexandregz/
// @version 0.1
// @description put avatars in the news feed page from github
// @match https://github.com/
// @copyright 2014+, Alexandre Espinosa Menor
// ==/UserScript==
// ToDo
@alexandregz
alexandregz / mail.scpt
Created February 27, 2014 11:51
returns content (and subject) from mail selected (Mail.App)
tell application "Mail"
set theSelection to selection
set theMessage to item 1 of theSelection
content of theMessage
end tell
#!/bin/bash
# Based on http://jollyjinx.tumblr.com/post/34638496292/fusion-drive-on-older-macs-yes-since-apple-has
# To use this, first create a corestorage drive - see e.g. http://www.cnet.com/how-to/how-to-make-a-custom-corestorage-drive-in-os-x/
# -- it'll look something like this:
#
# diskutil list # and figure out which actual drives you want to join
# diskutil cs create FusionGroup disk0 disk2 # or whichever two drives
# diskutil cs list # and note the Logical Volume Group ID
# diskutil cs createVolume GROUPID jhfs+ Fused 100%
@alexandregz
alexandregz / synologythumbsphoto.sh
Created October 4, 2014 10:03
To create thumbnails directly into Synology NAS (if you want to make thumbs faster). From https://github.com/voz/synothumbs/blob/master/synoThumbs.sh
#!/bin/sh
# Author: phillips321 contact through phillips321.co.uk
# License: CC BY-SA 3.0
# Use:
# Released: www.phillips321.co.uk
version=1.0
# ChangeLog:
# v1.0 - now supports video conversion (mov and avi)
# - for more formats please contact me with requests as i dont have any sample mpg etc
# - ffmpeg output is surpressed (>/dev/null)
@alexandregz
alexandregz / convert.sh
Created October 22, 2014 22:11
convert mkv to mp4 (for example) with handbrakecli
#!/bin/sh
if [ "$#" -ne 1 ]; then
echo "Use: $0 inputfile"
exit
fi
INPUTFILE=$1
OUTPUTFILE=$(echo $INPUTFILE | sed 's/\.[^\.]*$//')".mp4"
@alexandregz
alexandregz / .profile
Last active May 27, 2016 22:32
to add to .profile (ash shell used with Synology NAS)
# place to git, ipkg, another shell commands
PATH=/volume1/@optware/bin:$PATH
export PATH
# more useful prompt shell
#PS1="`hostname`> "
PS1='\u@\h:\w'
case `id -u` in
0) PS1="${PS1}# ";;